summaryrefslogtreecommitdiff
path: root/src/network
AgeCommit message (Collapse)Author
2016-06-06lldp: add proper ref counting to sd_lldp object and a separate call for ↵Lennart Poettering
setting the ifindex Let's make sd-lldp a bit more like sd-ndisc ant the other APIs, and add proper ref counting and a separate call for setting the ifindex. This also adds a new lldp_reset() call we can use at various places to close all fds. This is also similar to how sd-ndisc already does it.
2016-06-06networkd: remove unused variable (#3447)Tobias Jungel
this patch solves the following waring: ../src/network/networkd-ndisc.c:197:13: warning: unused variable ‘r’ [-Wunused-variable] int r; fixes acac5b2f
2016-06-04networkd-link: fix handler typo for route_remove() (#3433)tomty89
Obviously we've been using the wrong handler here. Fixes #3352.
2016-06-03networkd: constify more thingsLennart Poettering
2016-06-03networkd: also enforce limit on total number of address/routesLennart Poettering
This covers the address/routers acquire dynamically.
2016-06-03networkd: drop weird "const" usage in function parametersLennart Poettering
We generally only use "const" to constify the destination of pointers, but not the pointers themselves, as they are copied anyway during C function invocation. Hence, drop this usage of "const".
2016-06-03networkd: enforce a limit on the number of statically assigned ↵Lennart Poettering
addresses/routes/fdb entries We should put a limit on everything, hence also on these resources.
2016-06-02networkd-ndisc: do not start DHCPv6 when after NDISC timeoutTom Yan
For it's silly and unnecessary. Although it was apparently mandated by RFC 2462 in [5.5.2. Absence of Router Advertisements], that has been changed in the same section of RFC 4862, which obsoleted the former RFC.
2016-06-01networkd-dhcp6: generalize DHCPv6 client (re)startingTom Yan
dhcp6_request_address() was merely a function to switch the DHCPv6 client from "stateless" mode to "stateful" mode. It was also a one-way switch. Also, to (re)start the client, we would need to repeat separate function calls. In this patch, dhcp6_request_address() is made a general starter/manager of the DHCPv6 client. It now takes an extra parameter so we will be specifying which mode the DHCPv6 client should be started in. Also it will keep track of the current mode and compare with the newly requested mode, and only restart the client in case there is a difference between them. This also makes sure that the DHCPv6 client will be (re)started accordingly as per the Router Advertisement flags.
2016-05-30networkd: bridge add support to configure VLAN filtering (#3344)Tobias Jungel
This patch implements support for IFLA_BR_VLAN_FILTERING configuration.
2016-05-29Merge pull request #3378 from keszybz/unit-write-drop-in-newline-removalLennart Poettering
Remove newlines from drop in format strings + some formatting fixes
2016-05-28Merge pull request #3326 from tomty89/update-2Zbigniew Jędrzejewski-Szmek
networkd: IPv6 fixes
2016-05-28Typo fix: s/advertisment/advertisement/Zbigniew Jędrzejewski-Szmek
2016-05-28networkd: disable IPv6 for bridge slaveTom Yan
If an interface is managed as a bridge slave, we don't want any IP configuration for it. Therefore, disable IPv6 in such case.
2016-05-28networkd: unset master if not enslaved with networkdTom Yan
When we manage an interface with networkd but not as a slave (i.e. no `Bridge=` or `Bond=` set in its .network), we do not want it to remain slaved.
2016-05-26ipv4ll: change "seed" parameter to be uint64_tLennart Poettering
Let's make clear this always has the same size, since otherwise it's not useful for reproducible runs, which this is really about however.
2016-05-26sd-network: rename "index" field of the various clients to "ifindex"Lennart Poettering
A field "index" is not particularly precise and also might conflict with libc's index() function definition. Also, pretty much everywhere else we call this concept "ifindex", including in networkd, the primary user of these libraries. Hence, let's fix this up and call this "ifindex" everywhere here too.
2016-05-25networkd: Disable IPv6 when DHCPv6 is only enabledTom Yan
DHCPv6 requires an IPv6 link-local address to work. The client will not be started (even when enabled explicitly with `DHCP=`) if none is configured (either by autoconfiguration or manually). Therefore, disable IPv6 in such case.
2016-05-25networkd: set IFLA_INET6_ADDR_GEN_MODE as per stable_secretTom Yan
Although networkd has option (LinkLocalAddressing=) to toggle IPv6LL autoconfiguration, when it is enabled, the address is autoconfigured by the kernel, but not networkd. Therefore, we do not statically set IFLA_INET6_ADDR_GEN_MODE to IN6_ADDR_GEN_MODE_EUI64, but dynamically depending on whether stable_secret is set, just as what the kernel does by default. Note that this does NOT affect the global addresses configured by networkd.
2016-05-21networkd-ndisc: do not return value from void functionsystemd/v230Zbigniew Jędrzejewski-Szmek
Fixup for #3304. Only warn, and not return, because that's what sd_dhcp6_client_start() does right below the call to sd_dhcp6_client_set_local_address().
2016-05-20Merge pull request #3304 from tomty89/masterTom Gundersen
[networkd] ndisc DHCPv6 triggering fixes
2016-05-20Merge pull request #3276 from ssahani/issue-3264Tom Gundersen
networkd: Drop IPv6LL address when link is down.
2016-05-20Merge pull request #3235 from dkg/hwaddr-cleanupTom Gundersen
minor improvements for dealing with MAC Addresses
2016-05-20[networkd-dhcp6] do not call sd_dhcp6_client_start() from ↵tomty89
dhcp6_request_address() Starting the DHCP client doesn't seem like dhcp6_request_address()'s responsibility anyway. Whenever it's called, sd_dhcp6_client_start() is unconditionally called outside of it as well. See ndisc_router_handler() and ndisc_handler() in networkd-ndisc.c.
2016-05-20[networkd-ndisc] set IPv6LL address in DHCP clienttomty89
Fix issue #3256 and probably #1982. Referenced link_acquire_ipv6_conf() in networkd-link.c.
2016-05-18networkd: Drop IPv6LL address when link is downSusant Sahani
Now we are not dropping the IPv6LL address when link is down. So next time when link is up and before kernel acquired this address we are using the old address. When the link is down kernel tells us that this address is no longer valid . Let's remove this address and again when kernel tells us that the address is added let's use it. fixes #3264
2016-05-17networkd: do not update state or IPv6LL address if link is failed or lingeringSusant Sahani
This is partial fix for #2228 and #2977, #3204. bridge-test: netdev ready docker0: Gained IPv6LL wlan0: Gained IPv6LL eth0: Gained IPv6LL Enumeration completed bridge-test: netdev exists, using existing without changing its parameters vboxnet0: IPv6 enabled for interface: Success lo: Configured docker0: Could not drop address: No such process vboxnet0: Gained carrier wlan0: Could not drop address: No such process eth0: Could not drop address: No such process eth0: Could not drop address: No such process eth0: Could not drop address: No such process vboxnet0: Gained IPv6LL vboxnet0: Could not set NDisc route or address: Invalid argument vboxnet0: Failed [New Thread 0x7ffff6505700 (LWP 1111)] [Thread 0x7ffff6505700 (LWP 1111) exited] Assertion 'link->state == LINK_STATE_SETTING_ROUTES' failed at src/network/networkd-link.c:672, function link_enter_configured(). Aborting. Program received signal SIGABRT, Aborted. 0x00007ffff6dc6a98 in raise () from /lib64/libc.so.6 Missing separate debuginfos, use: dnf debuginfo-install iptables-1.4.21-15.fc23.x86_64 libattr-2.4.47-14.fc23.x86_64 libidn-1.32-1.fc23.x86_64 pcre-8.38-7.fc23.x86_64 Debugging (gdb) bt "link->state == LINK_STATE_SETTING_ROUTES", file=0x5555556a34c8 "src/network/networkd-link.c", line=672, func=0x5555556a56d0 <__PRETTY_FUNCTION__.14850> "link_enter_configured") at src/basic/log.c:788 src/network/networkd-link.c:672 src/network/networkd-link.c:720 flags=0 '\000', scope=0 '\000', cinfo=0x7fffffffe020) at src/network/networkd-address.c:344 (rtnl=0x5555556eded0, message=0x55555570ff20, userdata=0x5555556ec590) at src/network/networkd-manager.c:604 m=0x55555570ff20) at src/libsystemd/sd-netlink/sd-netlink.c:365 at src/libsystemd/sd-netlink/sd-netlink.c:395 ret=0x0) at src/libsystemd/sd-netlink/sd-netlink.c:429 revents=1, userdata=0x5555556eded0) at src/libsystemd/sd-netlink/sd-netlink.c:723 src/libsystemd/sd-event/sd-event.c:2268 src/libsystemd/sd-event/sd-event.c:2629 timeout=18446744073709551615) at src/libsystemd/sd-event/sd-event.c:2688 bus=0x5555556eeba0, name=0x55555568a2f5 "org.freedesktop.network1", timeout=30000000, check_idle=0x55555556adb6 <manager_check_idle>, userdata=0x5555556ec590) at src/shared/bus-util.c:134 src/network/networkd-manager.c:1130 src/network/networkd.c:127 (gdb) f 3 src/network/networkd-link.c:672 672 assert(link->state == LINK_STATE_SETTING_ROUTES); (gdb) p link->state $1 = LINK_STATE_FAILED We should not be in this state . even if vboxnet0 failed we went into this state. vboxnet0: Could not set NDisc route or address: Invalid argument vboxnet0: Failed
2016-05-17networkd: add route expiration handler (#3242)Susant Sahani
Fix for #3232.
2016-05-17networkd: Add EmitRouter= option for DHCP Server (#3251)Clemens Gruber
Add an option to disable appending DHCP option 3 (Router) to the DHCP OFFER and ACK packets. This commit adds the boolean option EmitRouter= for the [DHCPServer] section in .network files. Rationale: On embedded devices, it is very useful to have a DHCP server running on an USB OTG ethernet gadget interface to avoid manual setup on the client PCs, but it should only serve IP addresses, no route(r)s. Otherwise, Windows clients experience network connectivity issues, due to them using the address set in DHCP option 3 as default gateway. Signed-off-by: Clemens Gruber <clemens.gruber@pqgruber.com>
2016-05-17network: test MAC address parsingDaniel Kahn Gillmor
networkd currently silently accepts some strings as MAC addresses that it probably shouldn't (like "ab:cd:ef:12:34:56:78" and "ab:cd:ef:12:3 4:56"). Add tests to MAC address parsing to ensure that we only accept valid MAC addresses, and that we accept the three most common forms of MAC address (colon-delimited hex, IEEE, and Cisco) Several of these tests currently fail, but another commit in this series will resolve them.
2016-05-17Merge pull request #3258 from keszybz/small-networkd-cleanupLennart Poettering
Small networkd cleanup
2016-05-15tree-wide: drop spurious "&"s when passing functions aroundZbigniew Jędrzejewski-Szmek
Also adjust indentation in various places.
2016-05-15networkd: do not generate a mac address for vlan interfaces (#3221)Susant Sahani
While creating a VLAN the mac address should be copied from the parent interface, so that the VLANs inherit the MAC address of the physical interface. Before: ``` 3: wlp3s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000 link/ether 00:26:c6:85:a3:c2 brd ff:ff:ff:ff:ff:ff ... 6: vlan1@wlp3s0: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN group default qlen 1000 link/ether 22:07:73:9d:43:59 brd ff:ff:ff:ff:ff:ff 7: vlan2@wlp3s0: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN group default qlen 1000 link/ether 46:30:76:33:35:d4 brd ff:ff:ff:ff:ff:ff ``` After: ``` 3: wlp3s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000 link/ether 00:26:c6:85:a3:c2 brd ff:ff:ff:ff:ff:ff ... 11: vlan1@wlp3s0: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN group default qlen 1000 link/ether 00:26:c6:85:a3:c2 brd ff:ff:ff:ff:ff:ff 12: vlan2@wlp3s0: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN group default qlen 1000 link/ether 00:26:c6:85:a3:c2 brd ff:ff:ff:ff:ff:ff ``` v2 of #1573, with fixed commit message.
2016-05-15networkd: bridge add support to configure multicast snooping (#3223)Susant Sahani
This patch implements support for the IFLA_BR_MCAST_SNOOPING attribute it can change the multicast snooping value. IGMP snooping monitors the Internet Group Management Protocol (IGMP) traffic between hosts and multicast routers.
2016-05-14networkd: fix copy-pasto in error messageZbigniew Jędrzejewski-Szmek
2016-05-14networkd: drop route_dropZbigniew Jędrzejewski-Szmek
It is just an alias for route_free which requires that route is not null, but it was only used in one place where it was checked that route is not null anyway. Let's just call route_free instead.
2016-05-10Merge pull request #3220 from keszybz/install-fixesLennart Poettering
Fix "preset-all" with dangling symlinks and install-section hint emitted too eagerly
2016-05-09tree-wide: rename draw_special_char to special_glyphZbigniew Jędrzejewski-Szmek
That function doesn't draw anything on it's own, just returns a string, which sometimes is more than one character. Also remove "DRAW_" prefix from character names, TREE_* and ARROW and BLACK_CIRCLE are unambigous on their own, don't draw anything, and are always used as an argument to special_glyph(). Rename "DASH" to "MDASH", as there's more than one type of dash.
2016-05-09networkd: reworkd LLDP emission to allow control of propagation levelLennart Poettering
This allows selecting the propagation level of emitted LLDP packets (specifically: the destination MAC address of the packets). This is useful because it allows generating LLDP packets that optionally cross certain types of bridges. See 802.11ab-2009, Table 7-1 for details.
2016-05-09tree-wide: port more code to use ifname_valid()Lennart Poettering
2016-05-06networkd: move the IAID configuration option into the [DHCP] sectionLennart Poettering
It's only relevant to DHCP, and it should be where the DUID is configured too.
2016-05-06Merge pull request #3201 from ssahani/net-wordLennart Poettering
networkd lib: cleanup FOREACH_WORD
2016-05-06networkd: route fix commentSusant Sahani
2016-05-05test-networkd-conf: fix memleakThomas Hindoe Paaboel Andersen
2016-05-05networkd: fix memleak in config_parse_duid_rawdataThomas Hindoe Paaboel Andersen
2016-05-05Trivial network cleanup (#3196)Thomas H. P. Andersen
* gitignore: typo fix for test-networkd-conf * networkd: fix double include
2016-05-04Merge pull request #3156 from keszybz/duid-settingsLennart Poettering
Rework DUID setting
2016-05-03networkd: Add support to configure IPv6 preferred lifetime (#3102)Susant Sahani
Closes #2166. We only allow 0, infinity and forever. infinity and forever is same.
2016-05-03networkd: add support to set route tableSusant Sahani
networkd: add support to set route table 1. add support to configure the table id. if id is less than 256 we can fit this in the header of route as netlink property is a char. But in kernel this proepty is a unsigned 32. Hence if greater that 256 add this as RTA_TABLE attribute. 2. we are not setting the address family now. Now set this property.
2016-05-03network: get rid of DUID_TYPE_RAWZbigniew Jędrzejewski-Szmek
It wasn't used for anything after the recent changes.