| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
| |
No functional change, just refactoring.
|
|
|
|
| |
No functional change, just refactoring.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
On my system, networkd would report that interface ve-rawhide is "Failed"
without anything in the logs:
systemd-networkd[651095]: ve-rawhide: Trying to reconfigure the interface.
systemd-networkd[651095]: ve-rawhide: Gained IPv6LL
systemd-networkd[651095]: ve-rawhide: Link DOWN
systemd-networkd[651095]: ve-rawhide: Lost carrier
systemd-networkd[651095]: ve-rawhide: Configuring with /usr/lib/systemd/network/80-container-ve.network.
systemd-networkd[651095]: ve-rawhide: Link UP
systemd-networkd[651095]: ve-rawhide: Gained carrier
systemd-networkd[651095]: ve-rawhide: Failed
At debug level:
systemd-networkd[799993]: dhcp-server-lease/ve-rawhide:1:1: Missing object field 'Address'.
$ jq </var/lib/systemd/network/dhcp-server-lease/ve-rawhide
{
"BootID": "5d86b34b98894322bfd4ae8443ce59b3",
"Leases": [
{
"ClientId": [ ... ],
"Address": [ 192, 168, 120, 179 ],
"Hostname": "rawhide",
"ExpirationUSec": 966046821158,
"ExpirationRealtimeUSec": 1711203197266940
}
]
}
I'm not sure why "Address" is missing, but anyway, in this case, we should ignore the
lease file rather than refusing to configure the interface. Also, warn at the point
where we know what the filename is.
|
|
|
|
| |
Requested at https://github.com/systemd/systemd/pull/31772#issuecomment-2000053357.
|
|
|
|
|
|
|
|
|
|
|
|
| |
If the DHCP server on an interface is configured with its server
address is null, then let's reuse the previous server address if
possible.
Otherwise, if networkd is restarted or the host is rebooted, then
possibly new subnet is picked, and clients that already have addresses
in the previous subnet cannot access the server.
Prompted by https://github.com/systemd/systemd/pull/30021#discussion_r1518478633.
|
| |
|
|
|
|
|
|
| |
This also drop the support of /run/systemd/netif/persistent-storage-ready,
as the file is anyway removed when networkd is stopped.
Let's use $SYSTEMD_NETWORK_PERSISTENT_STORAGE_READY=1 instead on testing.
|
|
|
|
|
|
|
| |
directory fd
Currently, though, no valid directory fd is passed to the function call.
Preparation for later commits.
|
|
|
|
|
|
|
| |
Otherwise, even if the persistent storage is not ready, the DHCP server
may be started e.g. by unplugging and plugging cable.
Follow-up for 5582b36c384fc522c23ef1ac032001882d033aff.
|
|
|
|
|
|
|
|
|
|
|
|
| |
Then, we can read the lease file on restart, and the DHCP server will be
able to manage previously assigned addresses.
To save leases in the state directory /var/lib/systemd/network/, this
adds systemd-networkd-dhcp-server.service, and by default
systemd-networkd does not start the DHCP server without the heler
service started.
Closes #29991.
|
|
|
|
|
| |
Then, Address object can live if it is detached from the owner (Link or
Network object).
|
| |
|
| |
|
| |
|
|
|
|
| |
Co-authored-by: Yu Watanabe <watanabe.yu+github@gmail.com>
|
| |
|
|\
| |
| |
| |
| | |
yuwata/network-dhcp-server-allow-null-server-address
network/dhcp-server: allow null server address
|
| |
| |
| |
| |
| |
| |
| | |
And refuse a link-local address.
With the previous commit, now ServerAddress= can take a null address,
but the config parser refused that. Let's allow that now.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Previously, we periodically search suitable address for DHCP server,
1. when .network file is loaded,
2. when checking if we can configure sd_dhcp_server object,
3. when configuring sd_dhcp_server.
Especially, the step 2 may be triggered several times.
This makes, when .network file is loaded, find a corresponding Address
object, add a new Address object if not found, then save the found or
added Address object. So, it is not necessary to find address again on
configuring sd_dhcp_server object.
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
We need to find a suitable static address for the DHCP server.
So, all static addresses must be verified before network_adjust_dhcp_server()
is called. For safety, let's call it from network_drop_invalid_addresses().
No functional change, just refactoring and preparation for later
commits.
|
|/ |
|
|
|
|
| |
It will be called later in link_request_address().
|
|
|
|
|
| |
Otherwise, we get redefinition errors if <net/if.h> is included later
on by another header.
|
|
|
|
|
|
| |
With the previous change, now Address objects under requesting are not
owned by Link object, hence we need to also search corresponding Address
object in the request queue.
|
|
|
|
|
|
|
|
|
| |
link_request_address()
Follow-up for 9684a8ded083dd427f843b0c40aa0292e6c7ae06.
Now, the input Address object is always copied, hence it is not
necessary to free it in link_request_address().
|
| |
|
| |
|
|
|
|
|
|
|
| |
configuring DHCP client or friends
Otherwise, DHCP client or friends may started before link-layer properties,
e.g. MAC address, being configured or the link being activated.
|
|
|
|
| |
This also avoids multiple evaluations in STRV_FOREACH_BACKWARDS()
|
|\
| |
| | |
network: re-design request queue
|
| |
| |
| |
| |
| |
| |
| |
| | |
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.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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.
|
|/
|
|
|
|
|
| |
And make the settings configures DHCP option 66 and 67.
Follow-ups for #22615.
Fixes #22661.
|
| |
|
|
|
|
| |
No functional change. Preparation for later commits.
|
|
|
|
| |
Closes #4403.
|
|
|
|
|
|
|
|
|
|
|
| |
Previously, the broadcast address was set to a Address object in
address_section_verify() (or address_acquire()). But, for wireguard
interfaces, we do not use the broadcast address. The .network file may
be assigned to multiple interfaces, hence, we cannot determine if we
should set the broadcast address in address_section_verify().
This makes the broadcast address set in link_request_address().
Then, we set the broadcast address only when we need it.
|
|
|
|
| |
specified servers
|
|\
| |
| | |
network: dhcp-server: allow to specify server address for DNS= or friends
|
| |
| |
| |
| | |
Closes #15026.
|
| | |
|
| |
| |
| |
| | |
Follow-up for 59aa622013277cfe6349d0789a7a00ad2b884902.
|
|/
|
|
| |
address
|
| |
|
|
|
|
| |
Closes #21202.
|
|
|
|
| |
This also fixes #20146.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
| |
This also renames link_get() -> link_get_by_index().
|
|
|
|
|
|
|
|
| |
the flags are updating
E.g. nexthop requires IFF_UP flag, but the currently stored flag may be
outdated if we called link_down(). This makes such requests pending if
at least one of the flags are updating.
|