summaryrefslogtreecommitdiff
path: root/src/network/netdev
Commit message (Collapse)AuthorAgeFilesLines
...
* network: unify config_parse_wireguard_public_key() and ↵Yu Watanabe2020-09-103-40/+12
| | | | config_parse_wireguard_preshared_key()
* network: don't fail on various config parse errorsLennart Poettering2020-09-092-8/+14
| | | | | We typically don't fail on config parse errors (to maximize compat), let's not do this in these cases either.
* tree-wide: prefer AF_xyz over PF_xyzLennart Poettering2020-09-091-1/+1
| | | | | | This really doesn't matter given that AF_xyz and PF_xyz are equivalent in all ways, but we almost always use AF_xyz, hence stick to it universally and convert the remaining PF_ to AF_
* tree-wide: define iterator inside of the macroZbigniew Jędrzejewski-Szmek2020-09-085-20/+12
|
* tree-wide: use READ_FULL_FILE_CONNECT_SOCKET at various placesLennart Poettering2020-07-212-2/+8
| | | | | | | | | | | Let's use the new flag wherever we read key material/passphrases/hashes off disk, so that people can plug in their own IPC service as backend if they like, easily. (My main goal was actually to support this for crypttab key files — i.e. that you can specify AF_UNIX sockets as third column in crypttab — but that's harder to implement, since the keys are read via libcryptsetup's API, not ours.)
* fileio: add explicit flag for generating world executable warning when ↵Lennart Poettering2020-07-212-2/+2
| | | | reading file
* network: downgrade log level in conf parsersYu Watanabe2020-07-1710-99/+104
|
* network: drop doubled white spaceYu Watanabe2020-07-152-2/+2
|
* network: add support for MACVLAN source modeAlvin Šipraga2020-07-083-0/+44
| | | | | | | | | | | | | | | | | | | | | | | Add support for creating a MACVLAN interface in "source" mode by specifying Mode=source in the [MACVLAN] section of a .netdev file. A list of allowed MAC addresses for the corresponding MACVLAN can also be specified with the SourceMACAddress= option of the [MACVLAN] section. An example .netdev file: [NetDev] Name=macvlan0 Kind=macvlan MACAddress=02:DE:AD:BE:EF:00 [MACVLAN] Mode=source SourceMACAddress=02:AB:AB:AB:AB:01 02:CD:CD:CD:CD:01 SourceMACAddress=02:EF:EF:EF:EF:01 The same keys can also be specified in [MACVTAP] for MACVTAP kinds of interfaces, with the same semantics.
* networkd: use capitalized "IP" and "TOS" in messagesZbigniew Jędrzejewski-Szmek2020-07-071-5/+5
|
* network: fix typo in commentYu Watanabe2020-06-251-1/+1
|
* netdev/wireguard: do not invalidate peer on invalid syntaxZbigniew Jędrzejewski-Szmek2020-06-221-16/+9
| | | | | | | We would say "ignoring", but invalidate the peer anyway. Let's only do that if we modified the peer irreperably. Also add comments explaining allocation handling.
* tree-wide: use set_ensure_put()Zbigniew Jędrzejewski-Szmek2020-06-221-14/+3
| | | | | | | | | Patch contains a coccinelle script, but it only works in some cases. Many parts were converted by hand. Note: I did not fix errors in return value handing. This will be done separate to keep the patch comprehensible. No functional change is intended in this patch.
* conf-parser: return mtime in config_parse() and friendsLennart Poettering2020-06-021-8/+13
| | | | | | | | | | | | | This is a follow-up for 9f83091e3cceb646a66fa9df89de6d9a77c21d86. Instead of reading the mtime off the configuration files after reading, let's do so before reading, but with the fd we read the data from. This is not only cleaner (as it allows us to save one stat()), but also has the benefit that we'll detect changes that happen while we read the files. This also reworks unit file drop-ins to use the common code for determining drop-in mtime, instead of reading system clock for that.
* network: also read mtime of drop-in configsYu Watanabe2020-06-011-2/+2
| | | | Fixes #15521.
* network: fix double free in macsec_receive_channel_free()Yu Watanabe2020-06-011-1/+1
| | | | | Fixes #15941. Fixes https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=22547
* network: wireguard: set ListenPort= when no peers are configuredYu Watanabe2020-06-011-1/+4
| | | | Closes #15786.
* network: L2TP fix crashSusant Sahani2020-05-301-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ``` =220358== Invalid read of size 8 ==220358== at 0x452F05: l2tp_session_free (l2tp-tunnel.c:46) ==220358== by 0x456926: l2tp_tunnel_done (l2tp-tunnel.c:725) ==220358== by 0x43CF4D: netdev_free (netdev.c:205) ==220358== by 0x43D045: netdev_unref (netdev.c:210) ==220358== by 0x4198B7: manager_free (networkd-manager.c:1877) ==220358== by 0x40D0B3: manager_freep (networkd-manager.h:105) ==220358== by 0x40DE1C: run (networkd.c:21) ==220358== by 0x40DE75: main (networkd.c:130) ==220358== Address 0x5c035d0 is 0 bytes inside a block of size 40 free'd ==220358== at 0x483A9F5: free (vg_replace_malloc.c:538) ==220358== by 0x452F87: l2tp_session_free (l2tp-tunnel.c:57) ==220358== by 0x456857: netdev_l2tp_tunnel_verify (l2tp-tunnel.c:710) ==220358== by 0x440947: netdev_load_one (netdev.c:738) ==220358== by 0x441222: netdev_load (netdev.c:851) ==220358== by 0x419C50: manager_load_config (networkd-manager.c:1934) ==220358== by 0x40D7BE: run (networkd.c:87) ==220358== by 0x40DE75: main (networkd.c:130) ==220358== Block was alloc'd at ==220358== at 0x4839809: malloc (vg_replace_malloc.c:307) ==220358== by 0x452A76: malloc_multiply (alloc-util.h:96) ==220358== by 0x4531E6: l2tp_session_new_static (l2tp-tunnel.c:82) ==220358== by 0x455C01: config_parse_l2tp_session_id (l2tp-tunnel.c:535) ==220358== by 0x48E6D72: next_assignment (conf-parser.c:133) ==220358== by 0x48E77A3: parse_line (conf-parser.c:271) ==220358== by 0x48E7E4F: config_parse (conf-parser.c:396) ==220358== by 0x48E80E5: config_parse_many_files (conf-parser.c:453) ==220358== by 0x48E8490: config_parse_many (conf-parser.c:512) ==220358== by 0x44089C: netdev_load_one (netdev.c:729) ==220358== by 0x441222: netdev_load (netdev.c:851) ==220358== by 0x419C50: manager_load_config (networkd-manager.c:1934) ```
* network: clean up doubled white spaceYu Watanabe2020-05-291-1/+1
|
* Merge pull request #15166 from ssahani/networkctl-ipvlanLennart Poettering2020-05-192-38/+3
|\ | | | | networkctl: Add support to display ipvlan
| * network: Introduce ipvlan utilSusant Sahani2020-05-172-38/+3
| | | | | | | | Move ipvlan common to shared
* | network: Introduce bond utilSusant Sahani2020-05-172-171/+5
|/
* condition: add ConditionEnvironment=Lennart Poettering2020-05-151-1/+2
| | | | | | | Prompted by the discussions in #15180. This is a bit more complex than I hoped, since for PID 1 we need to pass in the synethetic environment block in we generate on demand.
* network: allow setting VLAN protocol on bridgesRubens Figueiredo2020-05-143-0/+9
| | | | Signed-off-by: Rubens Figueiredo <rubens.figueiredo@bisdn.de>
* network: Introduce macvlan utilSusant Sahani2020-05-142-21/+2
|
* tree-wide: Initialize _cleanup_ variables if neededBenjamin Robin2020-05-131-1/+1
|
* network: use "FooOverUDP" as one wordZbigniew Jędrzejewski-Szmek2020-04-161-2/+2
| | | | | The whole thing is one name, and I think it's confusing to break it up into separate words.
* network: fix static assertion on IPPROTO_MAX rangeZbigniew Jędrzejewski-Szmek2020-04-161-6/+16
| | | | | | | | | | | | | | | Builds with recent glibc would fail with: ../src/network/netdev/fou-tunnel.c: In function ‘config_parse_ip_protocol’: ../src/basic/macro.h:380:9: error: static assertion failed: "IPPROTO_MAX-1 <= UINT8_MAX" 380 | static_assert(expr, #expr) | ^~~~~~~~~~~~~ ../src/network/netdev/fou-tunnel.c:161:9: note: in expansion of macro ‘assert_cc’ 161 | assert_cc(IPPROTO_MAX-1 <= UINT8_MAX); | ^~~~~~~~~ This is because f9ac84f92f151e07586c55e14ed628d493a5929d (present in glibc-2.31.9000-9.fc33.x86_64) added IPPROTO_MPTCP=262, following v5.5-rc5-1002-gfaf391c382 in the kernel.
* network: VXLan - Add support for remote addressSusant Sahani2020-04-111-0/+12
|
* network: VXLan - fix adding Group addressSusant Sahani2020-04-101-4/+4
|
* network: move NETWORK_DIRS to path-lookup.hZbigniew Jędrzejewski-Szmek2020-03-271-0/+1
| | | | In preparation for future changes...
* network: fix implicit type conversion warning by GCC-10Yu Watanabe2020-01-291-2/+2
| | | | Fixes part of #14691.
* network: append INTERFACE= attributes for logs corresponds to a netifYu Watanabe2020-01-073-8/+9
|
* Merge pull request #14208 from poettering/json-homed-prepareYu Watanabe2019-12-172-2/+2
|\ | | | | json bits from homed PR
| * fileio: add 'dir_fd' parameter to read_full_file_full()Lennart Poettering2019-12-022-2/+2
| | | | | | | | Let's introduce an "at" version of read_full_file().
* | network: introduce ifb (Intermediate Functional Block)Susant Sahani2019-12-074-0/+28
| | | | | | | | | | | | | | | | | | | | | | | | Intermediate Functional Block The Intermediate Functional Block (ifb) pseudo network interface acts as a QoS concentrator for multiple different sources of traffic. Packets from or to other interfaces have to be redirected to it using the mirred action in order to be handled, regularly routed traffic will be dropped. This way, a single stack of qdiscs, classes and filters can be shared between multiple interfaces. Here's a simple example to feed incoming traffic from multiple interfaces through a Stochastic Fairness Queue (sfq): (1) # modprobe ifb (2) # ip link set ifb0 up (3) # tc qdisc add dev ifb0 root sfq
* | network: warn about unknown sections when parsing .netdev filesZbigniew Jędrzejewski-Szmek2019-11-2523-35/+64
|/ | | | | | Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1774242. Now we'll emit the warning about unknown section [Netdev], making the issue much easier to diagnose.
* tree-wide: drop missing.hYu Watanabe2019-10-319-9/+1
|
* network: cleanup header inclusionYu Watanabe2019-10-3040-98/+76
|
* network: also reload .netdev filesYu Watanabe2019-10-242-6/+8
|
* Set key (IFLA_GRE_IKEY,IFLA_GRE_OKEY) on ip6gre interfaces.18482019-10-201-0/+36
|
* network: do not abort execution when a config file cannot be loadedYu Watanabe2019-09-111-1/+1
| | | | Closes #13516.
* network: also check the permission of key fileYu Watanabe2019-09-112-0/+4
|
* network: slightly update log messageYu Watanabe2019-07-261-2/+2
|
* network: rename IGMPVersion= -> MulticastIGMPVersion=Yu Watanabe2019-07-261-1/+1
|
* networkd: bridge add support to set IGMP versionSusant Sahani2019-07-253-0/+53
|
* tree-wide: drop duplicated blank linesYu Watanabe2019-07-151-1/+0
| | | | | | | ``` $ for i in */*.[ch] */*/*.[ch]; do sed -e '/^$/ {N; s/\n$//g}' -i $i; done $ git checkout HEAD -- basic/linux shared/linux ```
* tree-wide: some more [static] related fixesLennart Poettering2019-07-121-0/+2
| | | | | | | | | | | let's add [static] where it was missing so far Drop [static] on parameters that can be NULL. Add an assert() around parameters that have [static] and can't be NULL hence. Add some "const" where it was forgotten.
* network: ip6tnl and vti6 does not support the case both Local= and Remote= ↵Yu Watanabe2019-07-111-20/+12
| | | | | | | | are any This partially revert feb0c8b86f05330c8c7581463b8adf35ea68e5a9. This also drop assertions about Tunnel.family.
* network: add AssignToLoopback= setting to [Tunnel] sectionYu Watanabe2019-07-113-10/+12
| | | | | networkd does not manage loopback interface lo. So, previously, we have no way to assign tunnel devices to lo.