Commit graph

722 commits

Author SHA1 Message Date
Susant Sahani 482efedc08 network: Do not disable IPv6 by writing to sysctl
Only enable is and do not disable IPv6
2019-08-22 13:21:57 +02:00
Yu Watanabe 2d79289525 network: rename AddressFamilyBoolean -> AddressFamily
We usually do not call an extended boolean as XxxBoolean.
2019-08-16 22:02:17 +09:00
Lennart Poettering 24f36fb180
Merge pull request #13302 from yuwata/network-set-put-fixes
network: fixes related to set_put()
2019-08-14 16:18:06 +02:00
William A. Kennington III d1bdafd214 networkd: Keep track of static neighbors
We need to keep track of the static neighbors that are configured on the
interface so that we can delete stale entries that were removed.
2019-08-12 20:28:19 +09:00
Yu Watanabe 3dc2e7af5f network: add missing link_ref() 2019-08-11 09:11:25 +09:00
Yu Watanabe 75a302b561 network: fix potential memleaks related to set_put() 2019-08-11 08:57:01 +09:00
William A. Kennington III 0b1cd3e25a networkd: Routes should take the gateway into account
Otherwise, changing the default gateway doesn't purge old gateway routes
left on the system during daemon restart. This also fixes removing other
foreign gateway routes that don't match the expected configuration.

Tested:
    Changed gateway addresses prior to the patch and they lingered on
    the system during each reconfiguration. Applied this patch and
    reconfigured gateways and other routes multiple times and it removed
    the foreign routes that had gateways that didn't match.

Signed-off-by: William A. Kennington III <william@wkennington.com>
2019-08-07 20:32:36 +09:00
Yu Watanabe 500b96eb34 network: drop redundant Link::kind check
All CAN devices' iftype are ARPHRD_CAN. So, checking Link::kind is
redundant.

Follow-up for c6ac3729c9.
2019-07-25 16:47:16 +09:00
Yu Watanabe c6ac3729c9 network: support slcan
The device driver does not have IFLA_INFO_KIND attribute. So, we need to
check iftype.

Closes #13150.
2019-07-24 23:13:22 +09:00
Yu Watanabe 8f815e8b03 tree-wide: drop netinet/ether.h from socket-util.h and sd-netlink.h 2019-07-24 18:23:08 +09:00
Yu Watanabe bd7d6cec33 network: do not touch kernel-created multicast route
Fixes #6088.
2019-07-23 22:08:49 +09:00
Yu Watanabe d4c52ee5b5 network: store routes provided by DHCPv4 in Set
This re-writes d03073ddcd.
2019-07-19 01:44:44 +09:00
Yu Watanabe 8107f4731e network: drop fallback mechanism to assign DHCPv6 addresses with IFA_F_NOPREFIXROUTE
The flag IFA_F_NOPREFIXROUTE was introduced in kernel-3.14. But even if
the kernel does not support the flag, it should be just ignored. So, it
is not necessary to do the fallback logic. Moreover, the current logic
is not a fallback mechanism but just retrying. So, it should not work.
Let's drop that.
2019-07-17 23:13:40 +09:00
Yu Watanabe 1576154957 network: implement DBus methods to set DNS related properties 2019-07-17 06:59:12 +09:00
Yu Watanabe 4e2ef9d9d1 network: do not configure routes when dropping addresses
Follow-up for 4ff296b024.
2019-07-17 00:51:46 +09:00
Yu Watanabe 4ff296b024 network: make link enter failed state when a configuration fails
Some path of configuring address, route or etc., go to failed state, but
some do not. E.g., failure in address configuration which is provided by
DHCPv4 goes to failed state, but static address does not.

This is just for consistency. This should not change anything if
everything is fine.

This also voidify manager_rtnl_process_address().
2019-07-15 21:52:06 +09:00
Yu Watanabe a0cd6da5bb network: honor IPv6AcceptRA.UseDomains= setting 2019-07-14 22:08:29 +09:00
Yu Watanabe b425c3ae02 network: do not change to configuring state needlessly
When DHCP or any other dynamic addresses are changed, then
link_request_set_routes() is invoked, and even if no static routes
are configured, the operational state is needlessly changed to
configuring state.
This makes the state is changed only when static routes are configured.
2019-07-14 07:37:12 +02:00
Lennart Poettering 7e82b4059b
Merge pull request #13006 from yuwata/network-split-dhcp-12917
networkd: DHCPv6 - separate DHCPv6 options from DHCPv4 options
2019-07-11 10:28:03 +02:00
Lennart Poettering a082157282
Merge pull request #13005 from keszybz/fix-gcc-warning
Fix two gcc warnings
2019-07-10 16:20:31 +02:00
1848 b7700511ef Fixed condition checked twice 2019-07-10 23:02:24 +09:00
1848 98d20a17a9 Added support for xfrm interfaces 2019-07-10 23:02:19 +09:00
Zbigniew Jędrzejewski-Szmek 573e9a3310 networkd: silence bogus gcc warning about %s
Fixes #12931.

In file included from ../src/basic/macro.h:558,
                 from ../src/basic/alloc-util.h:9,
                 from ../src/network/networkd-link.c:7:
../src/network/networkd-link.c: In function ‘link_sysctl_ipv6_enabled’:
../src/basic/log.h:107:9: error: ‘%s’ directive argument is null [-Werror=format-overflow=]
  107 |         log_internal_realm(LOG_REALM_PLUS_LEVEL(LOG_REALM, (level)), __VA_ARGS__)
      |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../src/shared/log-link.h:21:25: note: in expansion of macro ‘log_internal’
   21 |                         log_internal(level, error, _FILE_, __LINE__, __func__, ##__VA_ARGS__); \
      |                         ^~~~~~~~~~~~
../src/shared/log-link.h:33:50: note: in expansion of macro ‘log_link_full’
   33 | #define log_link_warning_errno(link, error, ...) log_link_full(link, LOG_WARNING, error, ##__VA_ARGS__)
      |                                                  ^~~~~~~~~~~~~
../src/network/networkd-link.c:83:24: note: in expansion of macro ‘log_link_warning_errno’
   83 |                 return log_link_warning_errno(link, r,
      |                        ^~~~~~~~~~~~~~~~~~~~~~
../src/network/networkd-link.c:84:77: note: format string is defined here
   84 |                                               "Failed to read net.ipv6.conf.%s.disable_ipv6 sysctl property: %m",
      |                                                                             ^~
cc1: some warnings being treated as errors
2019-07-10 10:32:39 +02:00
Susant Sahani caa8ca4286 networkd: DHCPv6 - separate DHCPv6 options from DHCPv4 options
Closes https://github.com/systemd/systemd/issues/12917
2019-07-10 16:59:29 +09:00
Yu Watanabe 593aee8f3c network: read sysctl value only once (#12990)
Follow-up for bafa964144.

When the value is changed, networkd needs to be restarted.
2019-07-09 09:56:50 +02:00
Yu Watanabe 8fcf1d6180 network: move DHCP server related functions to networkd-dhcp-server.c 2019-06-30 04:46:27 +09:00
Yu Watanabe ca5ad760a5 network: move conf parsers and function prototypes 2019-06-30 04:45:56 +09:00
Lennart Poettering 762267cdc1
Merge pull request #12762 from yuwata/network-introduce-carrier-and-network-state-12752
network: introduce carrier and address state to fix network_is_online()
2019-06-20 13:36:30 +02:00
Yu Watanabe b80a511b1b network: add missing entries in routing_policy_rule_{hash,compare}_func()
This also makes routing_policy_rule_get() or friends take
a RoutingPolicyRule object as an input.
2019-06-19 21:10:07 +09:00
Yu Watanabe ff14e2ebcb network: do not configure routing policy rule if it is already configured 2019-06-18 13:10:23 +09:00
Yu Watanabe ac999bf07d sd-network: introduce functions for new link and manager states 2019-06-16 23:17:28 +09:00
Yu Watanabe 35c5a9cae4 network: expose carrier and address states over dbus
Previously, when a bridge or bonding interface is in degraded-carrier
state, then we cannot judge the interface has addresses or not.
By using the new states, dbus clients can distinguish such situation.
2019-06-16 23:17:28 +09:00
Yu Watanabe 1678fbb3c5 network: split operational states into carrier and address states
This should not change any behavior. The new states will be exposed by
later commits.
2019-06-16 23:17:23 +09:00
Yu Watanabe 6a1af3d4ca network: split out DBus related prototypes to networkd-link-bus.h 2019-06-16 09:13:12 +09:00
Yu Watanabe bafa964144 network: read link specific sysctl value
This introduce link_sysctl_ipv6_enabled() and replaces
manager_sysctl_ipv6_enabled() with it.
2019-06-15 14:56:42 +02:00
Yu Watanabe 463797c104 network: skip to check dynamic addresses when ConfigureWithoutCarrier=yes
Otherwise, the interface cannot be in "configured" state, as ipv6 link local
addressing is enabled by default. Note that even if ConfigureWithoutCarrier=
is set, all dynamic configurations are checked when the interface has
carrier.
2019-06-14 05:25:35 +09:00
Yu Watanabe 7ef7e5509b network: ignore requested ipv6 routing policy rule when ipv6 is disabled by sysctl 2019-06-12 11:03:37 +09:00
Yu Watanabe c442331750 network: ignore requested ipv6 route when ipv6 is disabled by sysctl 2019-06-12 11:03:08 +09:00
Yu Watanabe 54a1a535bd network: ignore requested ipv6 addresses when ipv6 is disabled by sysctl 2019-06-12 11:02:33 +09:00
Yu Watanabe d03073ddcd network: assign new DHCP address before removing old lease address
Closes #12676.
2019-06-07 16:22:00 +09:00
Zbigniew Jędrzejewski-Szmek 2db18cdd46
Merge pull request #12738 from yuwata/network-routing-policy-cleanup
network: several cleanups for routing policy rule
2019-06-06 18:53:20 +02:00
Yu Watanabe db51778f85 network: make KeepConfiguration=static drop DHCP addresses and routes
Also, KeepConfiguration=dhcp drops static foreign addresses and routes.
2019-06-06 22:50:29 +09:00
Yu Watanabe 95355a281c network: add KeepConfiguration=dhcp-on-stop
The option prevents to drop lease address on stop.
By setting this, we can safely restart networkd.
2019-06-06 22:50:29 +09:00
Susant Sahani 7da377ef16 networkd: add support to keep configuration 2019-06-06 22:50:29 +09:00
Yu Watanabe 9f08a578a8 network: remove unused argument in routing_policy_rule_configure() 2019-06-04 16:23:18 +09:00
Zbigniew Jędrzejewski-Szmek c2babfc2f5 networkd: rewrite condition to make it easier to understand 2019-05-30 15:31:44 +02:00
Yu Watanabe d61e4c5b6e network: add nlmon support
nlmon is a Netlink monitor device.
2019-05-28 22:47:15 +09:00
Yu Watanabe cab042b843 network: make VXCAN devices go through LINK_STATE_CONFIGURING 2019-05-24 10:55:33 +09:00
Yu Watanabe 910feb787f network: unify link_ipv4ll_enabled() and link_ipv4ll_fallback_enabled() 2019-05-22 17:59:39 +09:00
Yu Watanabe a0ae96149a network: drop unused variable 2019-05-22 17:59:39 +09:00