Commit Graph

57 Commits

Author SHA1 Message Date
Yu Watanabe a9d240f4bf network: do not serialize/deserialize routing policy rules
We already handle foreign routing policy rules correctly by the previous
commit. So, the serialization/deserialization of rules are not necessary
anymore.
2020-12-29 16:13:54 +09:00
Florian Westphal 761cf19d7b firewall-util: introduce context structure
for planned nft backend we have three choices:

- open/close a new nfnetlink socket for every operation
- keep a nfnetlink socket open internally
- expose a opaque fw_ctx and stash all internal data here.

Originally I opted for the 2nd option, but during review it was
suggested to avoid static storage duration because of perceived
problems with threaded applications.

This adds fw_ctx and new/free functions, then converts the existing api
and nspawn and networkd to use it.
2020-12-16 00:35:56 +01:00
Yu Watanabe db9ecf0501 license: LGPL-2.1+ -> LGPL-2.1-or-later 2020-11-09 13:23:58 +09:00
Yu Watanabe ad208fac73 network: also manage routes without RTA_OIF attribute 2020-10-07 15:22:10 +02:00
Yu Watanabe 256c75fd1f network: move DUID related functions 2020-10-07 02:50:50 +09:00
Yu Watanabe bfbf150ee6 network: manage address pools by OrderedSet 2020-10-07 02:50:50 +09:00
Yu Watanabe ed76f58521 network: move functions related to address pool 2020-10-07 02:50:50 +09:00
Yu Watanabe e1fc2c4371 network: move manager_rtnl_process_address() 2020-10-07 02:44:43 +09:00
Yu Watanabe 446aaaf35f network: introduce helper function to enumerate information using netlink 2020-10-07 02:39:13 +09:00
Yu Watanabe 8dfed23d92 network: use typesafe macro netlink_add_match() 2020-10-07 02:36:29 +09:00
Yu Watanabe 1797240104 network: old kernel may not support to configure bridge MDB entries on bridge master 2020-09-17 18:15:22 +09:00
Yu Watanabe 1633c45731 network: dhcp6: drop addresses and delegated prefixes on client stop
Previously, we did not drop addresses and delegated prefixes when
DHCP6 client is stopped.

Fixes #15455.
Fixes #13564.
2020-07-29 02:05:05 +09:00
Yu Watanabe c643bda5ec network: read driver name from ethtool
To make Driver= in [Match] section work in containers.

Note that ID_NET_DRIVER= property in udev database is set with the
result of the ethtool. So, this should not change anything for
non-container cases.

Closes #15678.
2020-06-03 18:25:37 +02:00
Susant Sahani 5d3b801764 network: Add support to ignore foreign routes 2020-03-07 01:42:52 +09:00
Susant Sahani c16c780804 network: introduce ip nexthop routing
Used to manipulate entries in the kernel's nexthop tables.
Example:
```
[NextHop]
Id=3
Gateway=192.168.5.1
```
2019-10-14 21:32:48 +09:00
Zbigniew Jędrzejewski-Szmek 5afe558cfd
Merge pull request #12818 from yuwata/network-issue-8726
network: disable kernel creating prefix route when RouteTable= is set
2019-10-03 15:21:35 +02:00
Zbigniew Jędrzejewski-Szmek ab76be5581 networkd: use SIGUSR2 to do a restart
The code supports SIGTERM and SIGINT to termiante the process. It would
be possible to reporpose one of those signals for the restart operation,
but I think it's better to use a completely different signal to avoid
misunderstandings.
2019-10-02 14:01:42 +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 dd9b10c84f network: add fallback logic for old kernels
It seems that old kernels do not support prefix routes with
non-default route tables. This adds a fallback logic when adding route
fails. In that case, prefix route is created by kernel and the default
route table is used.
2019-07-22 11:36:11 +09:00
Yu Watanabe 1576154957 network: implement DBus methods to set DNS related properties 2019-07-17 06:59:12 +09:00
Yu Watanabe 79a59fa51d network: move manager dbus prototypes to networkd-manager-bus.h 2019-07-17 06:59:12 +09:00
Yu Watanabe 04ed994937 network: move DHCP6 related code from networkd-manager.c to networkd-dhcp6.c 2019-06-30 04:46:04 +09:00
Yu Watanabe 3cf7a9807e network: drop unused manager_send_changed() 2019-06-16 23:17:28 +09:00
Yu Watanabe 7f3c07ada6 network: also introduce two new manager states 2019-06-16 23:17:28 +09:00
Yu Watanabe 46606fdda9 network: introduce manager_send_changed_strv() 2019-06-16 09:15:00 +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 a879e1a46e network: monitor link bit rates 2019-06-01 10:24:47 +09:00
Yu Watanabe d03f390ef2 network: drop arpa/inet.h from networkd-manager.h 2019-05-09 02:33:33 +02:00
Yu Watanabe 715d398e61 network: drop list fields in Network object 2019-05-07 16:55:19 +02:00
Yu Watanabe 4b600505dd network: check whether ipv6 is enabled in sysctl
Currently, the value is read only once.

Fixes #11711.
2019-02-21 10:55:13 +09: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 d2ebf9527e network: replace udev_monitor by sd_device_monitor 2018-10-17 03:31:20 +09:00
Yu Watanabe fdb20b7c59 network: make manager_dhcp6_prefix_remove() static 2018-10-10 14:43:05 +09:00
Zbigniew Jędrzejewski-Szmek c07fe6d0df Merge pull request #9406 from yuwata/rfe-9228
Trivial conflict solved in merge and include net/if_arp.h added.
2018-08-23 11:11:13 +02:00
Yu Watanabe 51517f9e09 network: replace udev_device by sd_device 2018-08-23 04:57:39 +09:00
Yu Watanabe 27dfc98275 network: request product UUID when DUIDType=uuid but DUIDRawData= is not set
Closes #9228.
2018-08-08 10:15:00 +09:00
Yu Watanabe f24648a66c network: move and rename link_duid() 2018-08-08 10:15:00 +09:00
Yu Watanabe 3534a04300 network: move sd_event initialization to manager_new() 2018-07-18 12:37:50 +09:00
Yu Watanabe cad4359568 network: drop unused slots 2018-07-17 12:40:04 +02:00
Yu Watanabe afb76fdbff tree-wide: drop double newline 2018-06-29 11:02:17 +09: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
Lennart Poettering 818bf54632 tree-wide: drop 'This file is part of systemd' blurb
This part of the copyright blurb stems from the GPL use recommendations:

https://www.gnu.org/licenses/gpl-howto.en.html

The concept appears to originate in times where version control was per
file, instead of per tree, and was a way to glue the files together.
Ultimately, we nowadays don't live in that world anymore, and this
information is entirely useless anyway, as people are very welcome to
copy these files into any projects they like, and they shouldn't have to
change bits that are part of our copyright header for that.

hence, let's just get rid of this old cruft, and shorten our codebase a
bit.
2018-06-14 10:20:20 +02:00
Lennart Poettering 8e766630f0 tree-wide: drop redundant _cleanup_ macros (#8810)
This drops a good number of type-specific _cleanup_ macros, and patches
all users to just use the generic ones.

In most recent code we abstained from defining type-specific macros, and
this basically removes all those added already, with the exception of
the really low-level ones.

Having explicit macros for this is not too useful, as the expression
without the extra macro is generally just 2ch wider. We should generally
emphesize generic code, unless there are really good reasons for
specific code, hence let's follow this in this case too.

Note that _cleanup_free_ and similar really low-level, libc'ish, Linux
API'ish macros continue to be defined, only the really high-level OO
ones are dropped. From now on this should really be the rule: for really
low-level stuff, such as memory allocation, fd handling and so one, go
ahead and define explicit per-type macros, but for high-level, specific
program code, just use the generic _cleanup_() macro directly, in order
to keep things simple and as readable as possible for the uninitiated.

Note that before this patch some of the APIs (notable libudev ones) were
already used with the high-level macros at some places and with the
generic _cleanup_ macro at others. With this patch we hence unify on the
latter.
2018-04-25 12:31:45 +02:00
Yu Watanabe 79a4beb39f network,resolve: remove unused variables (#8738)
Follow-up for d7afd945b5.
2018-04-17 12:40:45 +02:00
Zbigniew Jędrzejewski-Szmek 11a1589223 tree-wide: drop license boilerplate
Files which are installed as-is (any .service and other unit files, .conf
files, .policy files, etc), are left as is. My assumption is that SPDX
identifiers are not yet that well known, so it's better to retain the
extended header to avoid any doubt.

I also kept any copyright lines. We can probably remove them, but it'd nice to
obtain explicit acks from all involved authors before doing that.
2018-04-06 18:58:55 +02:00
Lennart Poettering 38edb7674b
Merge pull request #7582 from pfl/dhcp6_prefix_delegation
DHCPv6 prefix delegation
2018-01-15 12:02:37 +01:00
Zbigniew Jędrzejewski-Szmek 2269954112 Merge pull request #7191 from Mic92/systemd
The change in netdev.c done in the merge is necessary to avoid crashing in
cleanup. This is a follow-up for f3c33b234d.
2018-01-09 14:35:54 +01:00
Jörg Thalheim 05d0c2e3cf sd-netlink: add generic netlink support
This also adds the ability to incorporate arrays into netlink messages
and to determine when a netlink message is too big, used by some generic
netlink protocols.
2018-01-09 14:00:49 +01:00
Lennart Poettering d7afd945b5 networkd,resolved: make use of watch_bind feature to connect to the bus
The changes both networkd and resolved to make use of the watch_bind
feature of sd-bus to connect to the system bus. This way, both daemons
can be started during early boot, and automatically and instantly
connect to the system bus as it becomes available.

This replaces prior code that used a time-based retry logic to connect
to the bus.
2018-01-05 13:58:32 +01:00