Commit Graph
374 Commits
Author SHA1 Message Date
Yu Watanabe 39b91d1ae4 network: tuntap: drop unnecessary minus 2021-11-16 16:53:43 +01:00
Yu Watanabe c6df73ca72 ether-addr-util: introduce {hw,ether}_addr_hash_ops_free 2021-11-09 21:39:09 +09:00
Yu Watanabe aa4f765326 conf-parser: rename config_parse_hwaddr() -> config_parse_ether_addr() 2021-11-09 21:39:09 +09:00
Yu Watanabe 227e9ce255 ether-addr-util: replace ether_addr_from_string() with parse_ether_addr() 2021-11-09 21:39:09 +09:00
Yu Watanabe bc945c2b42 network/netdev: sort netdev kinds 2021-11-09 16:00:49 +09:00
Yu Watanabe ad851caebd network/bridge: drop if_bridge.h from bridge.h
To avoid future header conflicts.
2021-11-09 16:00:49 +09:00
Yu Watanabe fddb337cc8 network/netdev: fix typo 2021-11-09 16:00:49 +09:00
Yu Watanabe e331889a5e network: bareudp: use fill_message_create 2021-11-09 16:00:49 +09:00
Yu Watanabe 8e30e5fcd4 network: geneve: use fill_message_create 2021-11-09 16:00:49 +09:00
Yu Watanabe 7f0ed7d1c9 network/netdev: update comment 2021-11-09 16:00:49 +09:00
Yu Watanabe 28a8cc0a44 network/netdev: reduce indentation 2021-11-09 16:00:45 +09:00
Yu Watanabe 60b4af930e network/veth: also set MTU for peer interface
Fixes #21206.
2021-11-02 12:25:15 +09:00
Yu Watanabe 3b6a3bdebf network: use NetworkConfigSource/State to manage addresses and routes
This also fixes #20146.
2021-09-24 21:46:32 +09:00
Yu Watanabe 6771b85d98 network/netdev: append IFLA_INFO_DATA attribute only when it is necessary 2021-08-31 21:12:20 +09:00
Yu Watanabe 56fdc16da8 sd-netlink: drop sd_genl_family_t and introduce GenericNetlinkFamily
Kernel manages each genl family by its name, e.g. "nlctrl" or WG_GENL_NAME,
and its ID (used for nlmsg_type) is determined dynamically when the
corresponding module is loaded.

This commit makes sd-netlink follow the same way; now, sd_genl_family_t
is dropped, and sd_genl_message_new() takes a genl family name. Each
genl family is resolved when it is used first time, and its information
is stored in GenericNetlinkFamily.
2021-08-29 18:10:43 +09:00
Yu Watanabe 7c58ee5f8c Merge pull request #20443 from yuwata/network-conf-parser-cleanups
network: conf parser cleanups
2021-08-17 02:42:27 +09:00
Tom Yan 17a6a4ae2e network: allow users to forbid passthru MACVLAN from putting its link into promiscuous mode
While we haven't implemented a key for users to set MACVLAN/MACVTAP flags,
we can at least allow them to make use of the Promiscuous= key of
the corresponding link to set the nopromisc flag.
2021-08-16 17:26:59 +01:00
Yu Watanabe 634815762d network: rebreak conf parser arguments 2021-08-16 12:54:09 +09:00
Yu Watanabe 2f117922d4 network: recreate stacked netdevs when underlying device is re-added
Closes #20430.
2021-08-12 15:03:47 +09:00
Yu Watanabe b14686ff3a network: adjust log messages, function names, etc. 2021-08-12 14:39:39 +09:00
Yu Watanabe 8f65304c5d network: use netdev_enter_failed() instead of netdev_drop() on error
Preparation for later commits to support reconfiguring netdevs.
2021-08-12 14:23:57 +09:00
Yu Watanabe 798e5dc8ae network: introduce a helper function netdev_is_stacked_and_independent() 2021-08-12 14:10:45 +09:00
Zbigniew Jędrzejewski-Szmek 04499a70fb Drop the text argument from assert_not_reached()
In general we almost never hit those asserts in production code, so users see
them very rarely, if ever. But either way, we just need something that users
can pass to the developers.

We have quite a few of those asserts, and some have fairly nice messages, but
many are like "WTF?" or "???" or "unexpected something". The error that is
printed includes the file location, and function name. In almost all functions
there's at most one assert, so the function name alone is enough to identify
the failure for a developer. So we don't get much extra from the message, and
we might just as well drop them.

Dropping them makes our code a tiny bit smaller, and most importantly, improves
development experience by making it easy to insert such an assert in the code
without thinking how to phrase the argument.
2021-08-03 10:05:10 +02:00
Yu Watanabe 9b682672e4 network: use void* to correctly store SetLinkOperation in Request
Previously, when `link_request_queue()` is called in link_request_set_link(),
`SetLinkOperation` is casted with INT_TO_PTR(), and the value is assigned to
`void *object`. However the value was read directly through the member
`SetLinkOperation set_link_operation` of the union which `object`
beloging to. Thus, read value was always 0 on big-endian systems.

Fixes configuring link issue on s390x systems.
2021-06-15 20:58:20 +02:00
Yu Watanabe 1187fc3375 network: use link_request_to_set_master() or friends 2021-06-08 06:39:48 +09:00
Yu Watanabe 112a0972a2 network: introduce link_request_to_activate()
The request will be processed after all setlink requests are processed.
The function will be used in later commits.
2021-06-08 06:39:48 +09:00
Yu Watanabe 71a754f70f network: introduce link_request_to_create_stacked_netdev()
This will be used in later commits.
2021-06-08 06:33:27 +09:00
Jörg DeckertandJörg Deckert dd568427fb networkd: correct batman-adv setting name (GatewayBandwidth) (#19539)
Co-authored-by: Jörg Deckert <jdeckert@unitas-network.de>
2021-05-08 14:39:32 +02:00
Uwe Kleine-König cbcdcaaa0e Add support for conditions on the machines firmware
This allows to limit units to machines that run on a certain firmware
type. For device tree defined machines checking against the machine's
compatible is also possible.
2021-04-28 10:55:55 +02:00
Yu Watanabe 74bd6ad016 network: update log message
In some optimization level with gcc, including netdev->ifname in log
message causes error.
2021-04-16 19:48:54 +09:00
Yu Watanabe 6064344894 network: make log_netdev_xxx_errno() refuse zero errno 2021-04-16 09:17:28 +09:00
Luca Boccassi c2b2df604b tree-wide: avoid uninitialized warning on _cleanup_ variables
With some versions of the compiler, the _cleanup_ attr makes it think
the variable might be freed/closed when uninitialized, even though it
cannot happen. The added cost is small enough to be worth the benefit,
and optimized builds will help reduce it even further.
2021-04-14 12:25:06 +01:00
hide 6b1ed5e7e6 network: fix ipv6 tunnel encapsulation limit (#19087)
The encapsulation limit of IPv6 tunnel can not be set to 4, which is the default value of the encapsulation limit.
2021-03-24 01:05:25 +09:00
Frantisek Sumsal 57ac6959f5 tree-wide: coccinelle fixes
Another batch of fixes (mostly) generated by Coccinelle.
2021-03-18 11:59:31 +01:00
Yu Watanabe 4e54a17dbb network: use null_or_empty_path()
This also drops unnecessary fseek().
2021-03-05 08:09:05 +09:00
Annika Wickert c0267a592a network: Implement B.A.T.M.A.N. Advanced interface type 2021-02-25 01:57:29 +09:00
Zbigniew Jędrzejewski-Szmek 8b8024f1c2 shared/conf-parser: allow more than one location of the main config file
No functional change as long as only one path is passed.
2021-02-21 12:22:13 +01:00
Yu Watanabe 94876904bb tree-wide: use in_addr_is_set() or friends 2021-02-18 03:48:07 +09:00
Zbigniew Jędrzejewski-Szmek 75db809ae5 tree-wide: return NULL from freeing functions
I started working on this because I wanted to change how
DEFINE_TRIVIAL_CLEANUP_FUNC is defined. Even independently of that change, it's
nice to make make things more consistent and predictable.
2021-02-16 17:15:10 +01:00
Yu Watanabe b98680b2b8 tree-wide: use error codes in xxx_from_string() 2021-02-12 01:17:13 +09:00
Zbigniew Jędrzejewski-Szmek 2d93c20e5f tree-wide: use -EINVAL for enum invalid values
As suggested in https://github.com/systemd/systemd/pull/11484#issuecomment-775288617.

This does not touch anything exposed in src/systemd. Changing the defines there
would be a compatibility break.

Note that tests are broken after this commit. They will be fixed in the next one.
2021-02-10 14:46:59 +01:00
Zbigniew Jędrzejewski-Szmek 9ee03516df tree-wide: add spdx header on all scripts and helpers
Even though many of those scripts are very simple, it is easier to include
the header than to try to say whether each of those files is trivial enough
not to require one.
2021-01-28 09:55:35 +01:00
Yu Watanabe 7b5ed18779 Merge pull request #18294 from ssahani/net-2
tree wide use ensure_put
2021-01-19 16:46:41 +09:00
Susant Sahani 9d6bb21f37 network: macsec - use ordered_hashmap_ensure_put 2021-01-18 20:16:50 +01:00
Susant Sahani d1ce835989 network: bond - use ordered_set_ensure_put 2021-01-18 13:00:35 +01:00
Susant Sahani ebffea2a25 network: Use ordered_hashmap_ensure_put (#18233) 2021-01-17 20:07:02 +09:00
Yu Watanabe f9ead1a2f4 Merge pull request #18230 from ssahani/macvlan-bcqueuelen
network: macvlan - add support to configure rx queue for broadcast / multicast
2021-01-17 20:05:22 +09:00
Susant Sahani dca0a4e131 network: macvlan - add support to configure rx queue for broadcast/multicast 2021-01-17 08:39:28 +01:00
Yu Watanabe 16ed53658a Merge pull request #18243 from ssahani/ensure-put-use
tree-wide: introduce hashmap_ensure_put() and use it
2021-01-17 15:39:41 +09:00
Susant Sahani f4c6fcd766 network: macsec - tighten variable scope used in loop 2021-01-15 20:30:04 +01:00