| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
| |
Fixes bugs caused by 7f9915f0de67f3a10a4b22810d119da65af8c84a.
Fixes #24268.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
When a PF port becomes down (this can happens e.g. the PF port is joining
a bond interface), some drivers make its VF ports also become down, and
may cause failures in configuring VF ports.
Similary, when a VF port become down, some drivers make its PF port and
other VF ports down.
Let's configure SR-IOV ports (both PF and VFs) after all link-layer
settings of all ports being applied.
Fixes #23315.
|
| |
|
|
|
|
|
|
|
|
|
| |
This fixes the following error:
---
systemd-networkd[465]: wlan0: Could not bring up interface: Operation not possible due to RF-kill
---
Fixes #23649.
|
|
|
|
|
|
|
|
| |
Previously, if activation failed, link did not enter the failed state,
but still Link.activated flag not set. Hence, nothing processed even if
the interface is manually brought up later.
Partially fixes #23649.
|
|
|
|
|
|
|
|
| |
This makes Request object takes hash, compare, free, and process functions.
With this change, the logic in networkd-queue.c can be mostly
independent of the type of the request or the object (e.g. Address) assigned
to the request, and it becomes simpler.
|
|
|
|
|
| |
These two enum indicate how we process the request. Hence, it is not
necessary to introduce two separated indicators.
|
|
|
|
|
|
| |
The condition should be satisfied only when users request to reconfigure
the link, and in that case, all request will be cancelled. Hence, it is
not necessary to process the request.
|
|
|
|
| |
As returning negative errno makes the link will enter the failed state.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
In most netlink handlers, we do the following,
1. decrease the message counter,
2. check the link state,
3. error handling,
4. update link state via e.g. link_check_ready().
The first two steps are mostly common, hence let's extract it.
Moreover, this is not only extracting the common logic, but provide a
strong advantage; `request_call_netlink_async()` assigns the relevant
Request object to the userdata of the netlink slot, and the request object
has full information about the message we sent. Hence, in the future,
netlink handler can print more detailed error message. E.g. when
an address is failed to configure, then currently we only show an
address is failed to configure, but with this commit, potentially we can
show which address is failed explicitly.
This does not change such error handling yet. But let's do that later.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
corresponding object
This also renames e.g. request_process_address() -> address_process_request().
Also, this drops type checks such as `assert(req->type == REQUEST_TYPE_ADDRESS)`,
as in the later commits, the function of processing request, e.g.
`address_process_request()`, will be assigned to the Request object when
it is created. And the request type will be used to distinguish and to
avoid deduplicating requests which do not have any assigned objects,
like REQUEST_TYPE_DHCP4_CLIENT. Hence, the type checks in process functions
are mostly not necessary and redundant.
This is mostly cleanups and preparation for later commits, and should
not change any behavior.
|
|
|
|
|
|
| |
This should not change any behavior.
Just a preparation for a later commit which introduces
request_call_netlink_async().
|
|
|
|
|
|
|
| |
This also renames netlink message `req` -> `m` for preparation of later
commits.
Follow-ups for #22014.
|
|
|
|
|
| |
And rename it to link_down_now() to emphasize it does not use request
queue.
|
|\
| |
| | |
network: use sysctl to set IPv6LL address generation mode when the interface is already up
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Try to ensure kernel IPv6 link local address generation occurs by
setting the per-if addr_gen_mode sysctl when the link is already up,
instead of the netlink interface (IFLA_INET6_ADDR_GEN_MODE).
The netlink setting is sufficient in cases where the interface is not
yet up when networkd configures an interface - bringing the interface
up will trigger in-kernel address generation.
If the interface is already up, yet the interface has no IPv6LL assigned
setting IFLA_INET6_ADDR_GEN_MODE has no effect.
Writing the addr_gen_mode sysctl is a best effort attempt at triggering
address generation regardless of interface state because it also works
in cases where the interface is already up.
Fixes #22424.
|
| |
| |
| |
| | |
already set
|
| |
| |
| |
| | |
generation mode
|
|/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Add the "Isolated" parameter in the *.network file, e.g.,
[Bridge]
Isolated=true|false
When the Isolated parameter is true, traffic coming out of this port
will only be forward to other ports whose Isolated parameter is false.
When Isolated is not specified, the port uses the kernel default
setting (false).
The "Isolated" parameter was introduced in Linux 4.19.
See man bridge(8) for more details.
But even though the kernel and bridge/iproute2 recognize the "Isolated"
parameter, systemd-networkd did not have a way to set it.
|
| |
|
| |
|
|
|
|
|
| |
The remaining message is changed, because the user would most likely not
understand that "append VLANs" is just talking about the netlink message.
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
This is for the DSA subsystem, which have several stacked interfaces
on the master interface. To bring up a stacked interface, it is necessary
that the master is already up. See
https://github.com/systemd/systemd/issues/7478#issuecomment-348508263.
Note this is not necessary for newer kernels which includes
https://github.com/torvalds/linux/commit/9d5ef190e5615a7b63af89f88c4106a5bc127974.
Fixes #7478.
|
| |
|
| |
|
|
|
|
| |
As the master interface may inherit the slave MAC address.
|
|
|
|
|
|
|
| |
People often assigns the MAC address of the enslaved interface to e.g.
bridge interface. So, the local assignment bit should not be adjusted.
Fixes #21649.
|
|
|
|
| |
MTU is updated when IB mode is changed.
|
| |
|
|
|
|
| |
Addresses https://github.com/systemd/systemd/pull/21517#discussion_r757096584.
|
|
|
|
|
|
|
| |
INFINIBAND_ALEN
Also, the multicast and local bits in the specified MAC address for
ethernet are adjusted.
|
|
|
|
|
|
| |
Both linux kernel kernel and iproute2 uses int32 type for a link group
attribute and -1 has a special meaning, so setting it to 4294967295
would make it -1 in the linux kernel (and ip link cmd).
|
|
|
|
| |
To avoid future header conflicts.
|
|
|
|
| |
This also fixes #20146.
|
|
|
|
| |
Closes #20624.
|
| |
|
|
|
|
|
|
| |
Fix a bug introduced by 7558f9e717381eef0ddc8ddfb5a754ea4b0f3e6c.
Fixes #20428.
|
|
|
|
| |
Fixes #20241.
|
|
|
|
|
|
|
| |
For some setups, kernel refuses to set bridge configs with -EOPNOTSUPP.
See kernel's rtnl_bridge_setlink() in net/core/rtnetlink.c.
Fixes #20373.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
|\
| |
| | |
network: add missing increment of Link::set_flags_messages
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
link_up_or_down() will decrement the counter when the subsequent
RTM_GETLINK netlink method is finished. So, we need to increment
the counter here.
Fixes the issue mentioned at
https://github.com/systemd/systemd/issues/19832#issuecomment-860255692.
|
| |
| |
| |
| |
| |
| |
| |
| | |
Most real network devices refuse to set MAC address when its operstate
is not down. So, setting MAC address once failed, then let's bring down
the interface and retry to set.
Closes #6696.
|
|/
|
|
|
| |
Also, skip to set MAC address when the current address equals to the
requrested one.
|
|
|
|
|
|
|
| |
As for the other ones in src/network/, if they are removed, gcc warns when they
are removed.
Should fix Coverity CID#1457466.
|