Yu Watanabe
cd43199671
Merge pull request #12520 from ssahani/geneve
...
networkd: Geneve add DF feature and allow TTL to bechosen by kernel
2019-05-10 19:47:19 +02:00
Susant Sahani
328184d1fc
networkd: Geneve Allow TTL to be zero.
...
Also verify VNI is set
2019-05-10 22:45:26 +09:00
Susant Sahani
aac350192b
networkd: Geneve add support configure IP don't fragment
2019-05-10 22:45:26 +09:00
Yu Watanabe
5af7bc6f4c
Merge pull request #12480 from ssahani/proxy-arp
...
network: bridge add support to configure proxy ARP/WIFI
2019-05-10 15:30:41 +02:00
Susant Sahani
1189c00a3c
networkd: VXLAN add support to configure IP Don't fragment.
...
Allow users to set the IPv4 DF bit in outgoing packets, or to inherit its
value from the IPv4 inner header. If the encapsulated protocol is IPv6 and
DF is configured to be inherited, always set it.
2019-05-09 06:40:33 +02:00
Susant Sahani
1c8b0eccc7
networkd: Assign VXLAN destination port to when GPE is set
...
When VXLAN destination port is unset and GPE is set
then assign 4790 to destination port. Kernel does the same as
well as iproute.
IANA VXLAN-GPE port is 4790
2019-05-09 06:40:33 +02:00
Yu Watanabe
9aa5d8ba84
network: include glibc headers before including kernel headers
2019-05-09 03:21:31 +02:00
Susant Sahani
8c32c5884d
networkd: VXLAN use correct type for VNI
2019-05-08 06:52:54 +05:30
Susant Sahani
4cc0fd7531
networkd: VXLAN add support to configure Generic Protocol Extension
...
See https://tools.ietf.org/html/draft-ietf-nvo3-vxlan-gpe-07
2019-05-08 06:52:42 +05:30
Susant Sahani
76fbd4d73d
networkd: VXLan TTL must be <= 255
...
Ignore when TTL > 255
2019-05-07 20:34:45 +02:00
Susant Sahani
83cb24ac20
networkd: VXLan Make group and remote variable separate
...
VXLAN Document Group=
2019-05-07 20:34:27 +02:00
Susant Sahani
6f213e4a34
networkd: VXLAN rename Id to VNI
...
It makes more sense to call VXLAN ID as
1. the VXLAN Network Identifier (VNI) (or VXLAN Segment ID)
2. test-network: rename VXLAN Id to VNI
3. fuzzer: Add VXLAN VNI directive to fuzzer
2019-05-07 20:52:11 +05:30
Yu Watanabe
1c30b174ed
network: rename WireGuard.FwMark -> FirewallMark
...
For the consistency with FirewallMark= in [RoutingPolicyRule] section.
2019-05-04 17:20:23 +02:00
Ben Boeckel
5238e95759
codespell: fix spelling errors
2019-04-29 16:47:18 +02:00
Yu Watanabe
a62b7bb79e
network: fix ListenPort= in [WireGuard] section
...
This fixes a bug introduced by f1368a333e
.
Fixes #12377 .
2019-04-25 02:43:03 +02:00
Lennart Poettering
929b02b5b8
Merge pull request #12301 from keszybz/silence-alignment-warning
...
Silence alignment warning
2019-04-15 11:21:15 +02:00
Zbigniew Jędrzejewski-Szmek
e61614099f
network: avoid warning about unaligned pointers
...
With gcc-9.0.1-0.10.fc30.x86_64:
../src/network/netdev/macsec.c: In function ‘config_parse_macsec_port’:
../src/network/netdev/macsec.c:584:24: warning: taking address of packed member of ‘struct <anonymous>’ may result in an unaligned pointer value [-Waddress-of-packed-member]
584 | dest = &c->sci.port;
| ^~~~~~~~~~~~
../src/network/netdev/macsec.c:592:24: warning: taking address of packed member of ‘struct <anonymous>’ may result in an unaligned pointer value [-Waddress-of-packed-member]
592 | dest = &b->sci.port;
| ^~~~~~~~~~~~
(The alignment was probably OK, but it's nicer to avoid the warning anyway.)
2019-04-13 11:55:04 +02:00
Yu Watanabe
3e8afae5b5
network: re-indent conf parser and wrap long lines in bond.c
2019-04-13 17:52:00 +09:00
Yu Watanabe
674c96fc44
network: use OrderedSet for bond ARP ip targets
2019-04-13 17:52:00 +09:00
Yu Watanabe
1e2a490e91
network: drop allocation for Bond::ad_actor_system
2019-04-13 17:51:59 +09:00
Yu Watanabe
f200093337
network: drop bond_mode_to_kernel() and bond_xmit_hash_policy_to_kernel()
2019-04-13 17:51:59 +09:00
Yu Watanabe
e57319dd54
network: re-indent gperf files
2019-04-12 10:12:42 +09:00
Yu Watanabe
70c5754761
network: warn when private key is stored in world readable files
2019-04-12 10:12:42 +09:00
Yu Watanabe
b0e13c3122
network: add MACsecTransmitAssociation.UseForEncoding= setting
2019-04-12 10:12:42 +09:00
Yu Watanabe
a7b9c52f1f
network: add MACsec*Association.Activate= setting
2019-04-12 10:12:42 +09:00
Yu Watanabe
eb4705fb36
network: add MACsec*Association.KeyFile= setting
2019-04-12 10:12:42 +09:00
Yu Watanabe
e482018672
network: explicitly clear security key for macsec
2019-04-12 10:12:42 +09:00
Yu Watanabe
e0fde24c97
network: support multiple security associations for macsec channels
2019-04-12 10:12:42 +09:00
Susant Sahani
81962db798
network: Introduce MACsec
...
Media Access Control Security (MACsec) is an 802.1AE IEEE
industry-standard security technology that provides secure
communication for all traffic on Ethernet links.
MACsec provides point-to-point security on Ethernet links between
directly connected nodes and is capable of identifying and preventing
most security threats, including denial of service, intrusion,
man-in-the-middle, masquerading, passive wiretapping, and playback attacks.
Closes #5754
2019-04-12 10:12:41 +09:00
Yu Watanabe
01234e1fe7
tree-wide: drop several missing_*.h and import relevant headers from kernel-5.0
2019-04-11 19:00:37 +02:00
Yu Watanabe
86a3d44de5
network: fix use-of-uninitialized-value or null dereference
...
This fixes a bug introduced by 6ef5c881dd
.
Fixes oss-fuzz#14157 and oss-fuzz#14158.
2019-04-10 18:18:11 +09:00
Yu Watanabe
2b942a926c
network: make wireguard_decode_key_and_warn() take uint8_t buf[static WG_KEY_LEN]
2019-04-09 15:50:23 +09:00
Yu Watanabe
26f86d500e
network: warn when wireguard keys are stored in world readable files
2019-04-09 15:50:22 +09:00
Yu Watanabe
a3945c6361
network: add WireGuardPeer.PresharedKeyFile= setting
2019-04-09 15:50:22 +09:00
Yu Watanabe
6ef5c881dd
network: clear wireguard keys on failure or on exit
2019-04-09 15:50:22 +09:00
Yu Watanabe
cb31e7c861
network: make reading PrivateKeyFile= failure always fatal
...
This also refactor wireguard_read_key_file().
2019-04-09 15:50:22 +09:00
Yu Watanabe
03fec54396
network: re-indent conf parsers in wireguard.c
2019-04-08 00:52:34 +09:00
Yu Watanabe
7df5c6ba90
network: make FooOverUDP.Protocol= support name of ipproto
2019-04-02 03:29:41 +09:00
Yu Watanabe
881c74bd64
network: use asynchronous call for creating FOU tunnels
...
Otherwise, multiple FOU tunnels cannot be created correctly.
2019-04-02 03:08:49 +09:00
Yu Watanabe
3abf950fdb
network: do not ignore FooOverUDP.Encapsulation= setting
...
Previously the setting is ignored and always FOU_ENCAP_GUE is sent.
2019-04-02 03:07:42 +09:00
Yu Watanabe
a27a0ad641
network: merge ipip_init() and sit_init()
2019-04-02 03:07:08 +09:00
Yu Watanabe
4799d932b5
network: add FooOverUDP support for SIT and GRE tunnels
2019-04-02 03:07:08 +09:00
Yu Watanabe
c6e77d7b22
network: add '=' to config key names in log
...
Also, long lines are wrapped.
2019-04-01 10:30:31 +09:00
Yu Watanabe
b519908cac
network: do not abort execution when NetDev.Name= conflicts
...
This also changes that .netdev files are loaded in ascending order.
Otherwise, when NetDev.ifname= setting conflicts with other .netdev file,
then .netdev file with large prefix number wins.
2019-04-01 10:30:31 +09:00
Yu Watanabe
a8b9a65c50
network: make GRE and GRETAP support Key=, InputKey=, OutputKey=, and SerializeTunneledPackets=
...
This also merge netdev_gre_fill_message_create() and netdev_erspan_fill_message_create().
2019-03-30 21:16:03 +09:00
Yu Watanabe
9282f75bf4
network: make erspan netdev can be specified in Network.Tunnel=
2019-03-30 03:52:25 +09:00
Yu Watanabe
1a9bc3d8f6
network: do not continue when appending data to netlink message fails
2019-03-30 03:52:21 +09:00
Jörg Thalheim
7232c1f9da
wireguard: fix exponential backoff when resolving hosts
...
It should stop at 25s, not start.
Fixes #12134
2019-03-28 20:00:19 +01:00
Zbigniew Jędrzejewski-Szmek
10c353e1c5
Remove variable only used for an assert
...
When compiled with -DNDEBUG, we get warnings about set-but-unused variables.
In general, it's not something we care about, but since removing those
variables arguably makes the code nicer, let's just to it in this case.
2019-03-28 09:03:06 +01:00
Lennart Poettering
b82f71c7ff
tree-wide: constify a few static string tables
2019-03-25 14:04:34 +01:00
Yu Watanabe
1beabe08d6
network,udev: explicitly declare 'conditions' is a list
2019-03-24 00:35:39 +09:00
Evgeny Vereshchagin
53294d9496
network: add missing nulstr terminator
...
https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=13821
2019-03-22 13:25:42 +01:00
Yu Watanabe
3f4c9bc04c
Merge pull request #12066 from yuwata/fix-network-tunnel-12041
...
network: fix netdev_tunnel_verify()
2019-03-22 05:57:38 +09:00
Yu Watanabe
bb9683e096
network: fix netdev_tunnel_verify()
...
Fixes #12041 .
2019-03-22 01:47:38 +09:00
Yu Watanabe
c4f58deab5
network,udev: split static condition tests from net_match_config()
2019-03-21 23:37:39 +09:00
Yu Watanabe
50969cff60
network: clear previous assignment
...
Prompted by oss-fuzz#13719.
2019-03-16 00:12:25 +09:00
Yu Watanabe
5f07d640ca
network: clear previous assignment
...
Fixes oss-fuzz#13719.
2019-03-15 23:44:51 +09:00
Yu Watanabe
3a27af62b5
network: wait for L2TP tunnel to be created before creating sessions
...
And if failed to create L2TP tunnel, then do not try to create sessions.
2019-03-14 10:57:41 +09:00
Yu Watanabe
d053d08a37
network: automatically pick an address on link when L2TP.Local= is not specified
...
This makes L2TP.Local= support an empty string, 'auto', 'static', and
'dynamic'. When one of the values are specified, a local address is
automatically picked from the local interface of the tunnel.
2019-03-14 10:57:41 +09:00
Susant Sahani
3a56e697c8
networkd: Introduce l2tp tunnel
...
This works allows networkd to configure l2tp tunnel.
See http://man7.org/linux/man-pages/man8/ip-l2tp.8.html
2019-03-14 10:57:41 +09:00
Yu Watanabe
7033af49df
network: introduce new netdev create type NETDEV_CREATE_AFTER_CONFIGURED
...
It will be used to support L2TP tunnel in later commits.
2019-03-14 10:57:41 +09:00
Yu Watanabe
859e9c0487
network: introduce netdev_get_create_type() helper function
2019-03-14 10:57:41 +09:00
Lennart Poettering
0a9707187b
util: split out memcmp()/memset() related calls into memory-util.[ch]
...
Just some source rearranging.
2019-03-13 12:16:43 +01:00
Yu Watanabe
76df77794a
wireguard: add PrivateKeyFile= option
...
Closes #11878 .
2019-03-13 12:02:03 +09:00
Yu Watanabe
9cc9021aed
wireguard: check whether PrivateKey= and PublicKey= are set
2019-03-13 11:59:18 +09:00
Yu Watanabe
fedcb4c3eb
wireguard: drop unused arguments and rename parse_wireguard_key()
2019-03-13 11:59:18 +09:00
Yu Watanabe
583eb170f0
wireguard: do not log wireguard key
...
It may be PrivateKey=.
2019-03-13 11:59:18 +09:00
Yu Watanabe
85c987a82d
wireguard: reuse sd_event_source object
2019-03-13 11:59:18 +09:00
Yu Watanabe
f1368a333e
wireguard: use NetworkConfigSection to manage [WireGuardPeer] sections
...
This also contains huge refactoring of wireguard support.
2019-03-13 11:59:18 +09:00
Yu Watanabe
cebe12571d
network: make resolving NetDev names delayed and moved to network_verify()
...
And before resolving NetDev names, check conditions in .network,
and if they do not match the system environment, drop the network
unit earlier.
Fixes #4211 .
2019-02-26 10:06:23 +09:00
Yu Watanabe
a6779fecd9
network: add debug log when conditions do not match system environment
2019-02-26 09:58:33 +09:00
Lennart Poettering
bde06abd4f
Merge pull request #10408 from keszybz/analyze-cat-presets
...
systemd-analyze cat-presets
2019-02-18 16:02:45 +01:00
Zbigniew Jędrzejewski-Szmek
dc0d407851
udev,network: use standard paths for .network and .link files
...
This centralizes the configuration to one header file.
/usr/local/lib is now included in the search list, and documentation is
updated accordingly.
2019-02-18 10:29:33 +01:00
Yu Watanabe
4f4daf418f
udev,network: drop unused parent_driver argument from net_match_config()
...
The argument has never been used.
2019-02-17 00:47:49 +09:00
Yu Watanabe
4624289279
network/tunnel: fix log message
2019-02-11 01:29:56 +09:00
Yu Watanabe
b7c2bb4c9e
network: refuse AF_UNSPEC for Tunnel devices
2019-02-11 01:29:56 +09:00
Yu Watanabe
9e64c1f8b5
network: unify netdev_{ipip,sit}_fill_message_create()
2019-02-11 01:29:56 +09:00
Yu Watanabe
3affe303d3
network: unify netdev_vti{,6}_fill_message_create()
2019-02-11 01:29:56 +09:00
Yu Watanabe
10490d9025
network/geneve: fix log message
2019-02-11 01:29:49 +09:00
Yu Watanabe
434094864c
network: use netlink_message_append_{in_addr,sockaddr}_union()
2019-02-11 01:28:09 +09:00
Yu Watanabe
bd930cbdeb
network: shorten code by using SYNTHETIC_ERRNO()
2019-02-11 01:28:09 +09:00
Yu Watanabe
3f7cc0809d
network: coding style fixes
2019-02-11 01:28:09 +09:00
Yu Watanabe
d40b01e44b
network: in_addr_is_null() may return negative errno
...
So, do not silently cast the returned value to boolean.
Exception is the case that family is trivially AF_INET or AF_INET6.
2019-02-11 01:28:09 +09:00
Lennart Poettering
9066811e5a
Merge pull request #11580 from yuwata/fix-11579
...
network/wireguard: fix sending wireguard peers
2019-01-28 16:57:08 +01:00
Yu Watanabe
624a47694c
network/wireguard: use sd_netlink_message_append_sockaddr_in{,6}()
2019-01-28 12:27:37 +01:00
Yu Watanabe
2301c54fa9
network/wireguard: fixes sending wireguard peer settings
...
This fixes a bug introduced by e1f717d4a0
.
Fixes #11579 .
2019-01-28 10:09:57 +01:00
Lennart Poettering
6e9417f5b4
tree-wide: use newa() instead of alloca() wherever we can
...
Typesafety is nice. And this way we can take benefit of the new size
assert() the previous commit added.
2019-01-26 16:17:04 +01:00
Yu Watanabe
15cdaeee2e
network: fix an error log
2019-01-24 14:33:58 +09:00
Zbigniew Jędrzejewski-Szmek
29a93cb19d
Merge pull request #11418 from yuwata/fix-11404
...
network: fix infinite loop in setting up wireguard
2019-01-15 21:04:32 +01:00
Yu Watanabe
9e2bbf9915
network: make Link and NetDev always have the valid poiter to Manager
...
c4397d94c3
introduces
link_detach_from_manager() and netdev_detach_from_manager(), and they
set Link::manager or NetDev::manager NULL.
But, at the time e.g. link is removed, hence link_drop() is called,
there may be still some asynchronous netlink call is waiting, and
their callbacks hit assertion.
This make {link,netdev}_detach_from_manager() just drop all references
from manager, but keep the pointer to manager.
Fixes #11411 .
2019-01-15 14:48:53 +01:00
Yu Watanabe
e1f717d4a0
network: wireguard: rename and split set_wireguard_interface()
...
This does not change the behavior except for fixing the issue #11404 .
Fixes #11404 .
2019-01-14 10:08:40 +09:00
Lennart Poettering
500c65ad69
Merge pull request #11167 from yuwata/sd-resolve-typesafe
...
sd-resolve: introduce typesafe macros
2018-12-17 19:22:07 +01:00
Yu Watanabe
1061dab129
netdev: use typesafe resolve_getaddrinfo() in wireguard.c
2018-12-17 10:02:36 +09:00
Yu Watanabe
a4c9ae400f
netdev: sort headers
2018-12-17 10:02:36 +09:00
Susant Sahani
6d4efac2d9
networkd: Bond - AllSlavesActive fix parser
...
Bond.AllSlavesActive use parser type bool
2018-12-15 18:17:02 +05:30
Susant Sahani
fde60a424e
netdev bond: add support to configure tlb_dynamic_lb
...
Closes https://github.com/systemd/systemd/issues/11135
Add test for bond : tlb_dynamic_lb
2018-12-15 18:15:16 +05:30
Yu Watanabe
e93672eeac
tree-wide: drop missing.h from headers and use relevant missing_*.h
2018-12-06 13:31:16 +01:00
Yu Watanabe
253de60634
Merge pull request #11021 from ssahani/isatap
...
networkd: Add support to configure ISATAP tunnel
2018-12-05 23:13:17 +01:00
Lennart Poettering
a20f73221a
Merge pull request #10976 from yuwata/typesafe-netlink-call
...
netlink: introduce typesafe netlink functions
2018-12-03 17:55:00 +01:00
Yu Watanabe
9714c020fc
missing: split network related entries
...
Also adds comments which kernel version added the entries.
Closes #10553 .
2018-12-03 10:31:05 +01:00
Susant Sahani
918049ad53
networkd: Add support to configure ISATAP tunnel
...
Let's just reuse the code of sit tunnel to create a ISATAP tunnel.
Matter of turning a flag
Please see https://elixir.bootlin.com/linux/v4.19.6/source/net/ipv6/sit.c#L208
2018-12-03 09:15:24 +05:30
Susant Sahani
7b3b982217
vxlan: minor coding style fixes.
2018-12-03 02:05:12 +09:00
Yu Watanabe
302a796f5a
network: use typesafe netlink_call_async() macro where applicable
2018-12-02 06:29:32 +01:00
Susant Sahani
173a6e29be
networkd: vxlan make use of parse_ip_port_range
...
Use parse_ip_port_range
2018-11-29 14:04:26 +01:00
Susant Sahani
2266864b04
networkd: Add support for ERSPAN tunnel
...
Please see: https://patchwork.ozlabs.org/patch/800327/
```
[NetDev]
Name=erspan-test
Kind=erspan
[Tunnel]
Independent=true
ERSPANIndex=123
Local = 172.16.1.200
Remote = 172.16.1.100
Key=101
SerializeTunneledPackets=true
```
2018-11-27 11:04:42 +09:00
Yu Watanabe
6ce611e57c
network: also load foo.netdev.d/*.conf
...
Fixes #9940 .
2018-11-26 14:28:44 +09:00
Yu Watanabe
538f15cf06
tree-wide: use CONFIG_PARSER_PROTOTYPE() macro
2018-11-12 16:45:04 +09:00
Yu Watanabe
c6dbb5c43f
network: use hashmap_clear_with_destructor() at one more place
2018-11-12 16:32:11 +09:00
Yu Watanabe
3e5700428e
network: allocate hashmap objects when they are required
2018-11-12 16:32:11 +09:00
Yu Watanabe
17f9c355d5
network: use structured initializers
2018-11-12 16:32:10 +09:00
Yu Watanabe
bf877a54c7
Merge pull request #10669 from danderson/networkd-6rd
...
networkd: add 6rd support for sit netdevs
2018-11-12 15:55:03 +09:00
Yu Watanabe
30dce346d8
network: add missing verification for ip6gretap and sit
...
Fixes oss-fuzz#11324.
2018-11-10 15:53:18 +09:00
David Anderson
d067cab35c
networkd: support 6rd tunnel netdev setup.
2018-11-09 17:56:33 -08:00
Yu Watanabe
1909e9f11d
network: drop unused members in Wireguard object
2018-11-07 18:14:11 +09:00
Yu Watanabe
62facba19a
network: ignore multiple assignment of netdev kind
...
Fixes oss-fuzz#11279 and oss-fuzz#11280.
2018-11-07 17:23:50 +09:00
Evgeny Vereshchagin
e27aac11f2
networkd: make netdev_load_one "public" and add a fuzzer for it
2018-11-06 19:01:32 +01:00
Lennart Poettering
b992109b3e
Merge pull request #10633 from yuwata/sd-resolve-destroy
...
Another solution to fix wireguard issues
2018-11-06 19:30:59 +03:00
Tobias Jungel
db688b7e55
networkd: cleanup for #10542
...
fixes: 53b1f7d
2018-11-06 16:42:12 +03:00
Yu Watanabe
a7cc45caad
network: sort headers in wireguard.h
2018-11-05 13:19:02 +09:00
Yu Watanabe
fc72155321
network: use structured initializers in wireguard.c
2018-11-05 13:19:02 +09:00
Yu Watanabe
c195364da5
network: fix crash in wireguard_done()
...
Fixes another issue in #10629 .
2018-11-05 13:19:02 +09:00
Yu Watanabe
56ba90c2df
network: use destroy callback to unref netdev attached to event source
2018-11-05 13:19:02 +09:00
Yu Watanabe
8173d1d0ec
network: use destroy callback to clear resolved wireguard endpoints
2018-11-05 13:19:02 +09:00
Yu Watanabe
c4397d94c3
network: link_drop() and netdev_drop() remove reference from manager
2018-11-05 13:19:02 +09:00
Yu Watanabe
2e5da68b7d
network: add missing .sections element for vcan and vrf
...
Fixes #10629 .
2018-11-04 00:31:46 +09:00
Yu Watanabe
6f1a96ded4
netdev: also support GENEVE.UDP6ZeroChecksum{Tx,Rx}=
...
After 53c06862c1
, we prefer Checksum
instead of CheckSum. Let's do so for GENEVE netdev.
2018-11-04 00:31:46 +09:00
Yu Watanabe
1176b054e1
network: shorten code a bit
2018-11-04 00:31:06 +09:00
Tobias Jungel
99f68ef02d
networkd: add missing bonding options ( #10542 )
...
Add support for bonding options system prio, port key and actor system mac.
These options exist in the linux kernel since 4.2
(torvalds/linux@171a42c38c )
Details:
https://www.kernel.org/doc/Documentation/networking/bonding.txt
2018-11-02 10:31:20 +09:00
Yu Watanabe
80df8f2518
missing: support old linux/fou.h
...
linux/fou.h was introduced in 3.18.
FOU_ATTR_REMCSUM_NOPARTIAL was added in 4.0.
FOU_CMD_GET was added in 4.1.
Follow-up for 53cb501a13
.
Fixes #10474 .
2018-10-21 22:34:28 +09:00
Yu Watanabe
14cb109d45
tree-wide: replace 'unsigned int' with 'unsigned'
2018-10-19 22:19:12 +02:00
Yu Watanabe
8190a388a6
sd-netlink: make sd_netlink_slot take its description
2018-10-16 18:42:23 +09:00
Yu Watanabe
ee38400bba
sd-netlink: introduce sd_netlink_slot
2018-10-15 18:10:04 +09:00
Jason A. Donenfeld
7d0b26a027
networkd: fix attribute length for wireguard ( #10380 )
...
This is actually a u16, not a u32, so the kernel complains:
kernel: netlink: 'systemd-network': attribute type 5 has an invalid length
This is due to:
if (nla_attr_len[pt->type] && attrlen != nla_attr_len[pt->type]) {
pr_warn_ratelimited("netlink: '%s': attribute type %d has an invalid length.\n",
current->comm, type);
}
Presumably this has been working fine in functionality on little-endian
systems, but nobody bothered to try on big-endian systems.
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2018-10-13 17:28:49 +09:00
Yu Watanabe
09dd32eea7
network: make netdev_enslave() static
2018-10-10 14:43:05 +09:00
Yu Watanabe
1046bf9b1a
network: add destroy callbacks for asynchronous netlink calls
2018-10-10 14:43:05 +09:00
Yu Watanabe
545bab1f0a
sd-netlink: add destroy_callback argument to sd_netlink_call_async()
2018-10-10 14:43:05 +09:00
Yu Watanabe
7dd05e9472
network: drop an unused variable
...
Follow-up for 53cb501a13
.
2018-09-03 14:08:30 +02:00
Yu Watanabe
8301aa0bf1
tree-wide: use DEFINE_TRIVIAL_REF_UNREF_FUNC() macro or friends where applicable
2018-08-27 14:01:46 +09:00
Yu Watanabe
cf4b2f9906
tree-wide: use unsigned for refcount
2018-08-27 13:48:04 +09:00
Zbigniew Jędrzejewski-Szmek
e3bb989b6f
network: adjust some error messages
...
The option is now called simply "Encapsulation=".
Also, "ignoring" is rather misleading, because we use to to mean that some line
is being ignored. Here the whole tunnel is dropped.
2018-08-23 11:43:28 +02:00
Susant Sahani
53cb501a13
networkd and sd-netlink: add support for Generic netlink And FooOverUDP to IPIP tunnel
...
This work add support to generic netlink to sd-netlink.
See https://lwn.net/Articles/208755/
networkd: add support FooOverUDP support to IPIP tunnel netdev
https://lwn.net/Articles/614348/
Example conf:
/lib/systemd/network/1-fou-tunnel.netdev
```
[NetDev]
Name=fou-tun
Kind=fou
[FooOverUDP]
Port=5555
Protocol=4
```
/lib/systemd/network/ipip-tunnel.netdev
```
[NetDev]
Name=ipip-tun
Kind=ipip
[Tunnel]
Independent=true
Local=10.65.208.212
Remote=10.65.208.211
FooOverUDP=true
FOUDestinationPort=5555
```
$ ip -d link show ipip-tun
```
5: ipip-tun@NONE: <POINTOPOINT,NOARP> mtu 1472 qdisc noop state DOWN mode DEFAULT group default qlen 1000
link/ipip 10.65.208.212 peer 10.65.208.211 promiscuity 0
ipip remote 10.65.208.211 local 10.65.208.212 ttl inherit pmtudisc encap fou encap-sport auto encap-dport 5555 noencap-csum noencap-csum6 noencap-remcsum numtxqueues 1 numrxqueues 1 gso_max_size 65536 gso_max_segs 65535
```
2018-08-23 11:30:37 +02:00
Yu Watanabe
51517f9e09
network: replace udev_device by sd_device
2018-08-23 04:57:39 +09:00
Lennart Poettering
fafff8f1ff
user-util: rework get_user_creds()
...
Let's fold get_user_creds_clean() into get_user_creds(), and introduce a
flags argument for it to select "clean" behaviour. This flags parameter
also learns to other new flags:
- USER_CREDS_SYNTHESIZE_FALLBACK: in this mode the user records for
root/nobody are only synthesized as fallback. Normally, the synthesized
records take precedence over what is in the user database. With this
flag set this is reversed, and the user database takes precedence, and
the synthesized records are only used if they are missing there. This
flag should be set in cases where doing NSS is deemed safe, and where
there's interest in knowing the correct shell, for example if the
admin changed root's shell to zsh or suchlike.
- USER_CREDS_ALLOW_MISSING: if set, and a UID/GID is specified by
numeric value, and there's no user/group record for it accept it
anyway. This allows us to fix #9767
This then also ports all users to set the most appropriate flags.
Fixes : #9767
[zj: remove one isempty() call]
2018-08-20 15:58:21 +02:00
Lennart Poettering
163a035aa6
networkd: add O_CLOEXEC where it's missing
2018-08-20 15:58:11 +02:00
Zbigniew Jędrzejewski-Szmek
b215c2e7e2
Drop some more copyright headers
...
Acks in https://github.com/systemd/systemd/issues/9320 .
2018-07-24 11:16:01 +02:00
Yu Watanabe
afb76fdbff
tree-wide: drop double newline
2018-06-29 11:02:17 +09:00
Yu Watanabe
ad16158c10
netdev: do not assign unused values
2018-06-26 14:26:19 +09:00
Zbigniew Jędrzejewski-Szmek
25612ecba4
tree-wide: drop copyright lines for more authors
...
Acks in https://github.com/systemd/systemd/issues/9320 .
2018-06-22 16:39:45 +02:00
Zbigniew Jędrzejewski-Szmek
d9b02e1697
tree-wide: drop copyright headers from frequent contributors
...
Fixes #9320 .
for p in Shapovalov Chevalier Rozhkov Sievers Mack Herrmann Schmidt Rudenberg Sahani Landden Andersen Watanabe; do
git grep -e 'Copyright.*'$p -l|xargs perl -i -0pe 's|/([*][*])?[*]\s+([*#]\s+)?Copyright[^\n]*'$p'[^\n]*\s*[*]([*][*])?/\n*|\n|gms; s|\s+([*#]\s+)?Copyright[^\n]*'$p'[^\n]*\n*|\n|gms'
done
2018-06-20 11:58:53 +02:00
Lennart Poettering
96b2fb93c5
tree-wide: beautify remaining copyright statements
...
Let's unify an beautify our remaining copyright statements, with a
unicode ©. This means our copyright statements are now always formatted
the same way. Yay.
2018-06-14 10:20:21 +02:00