Age | Commit message (Collapse) | Author |
|
|
|
This fallback will anyway never get tested, so rip it out.
|
|
|
|
for END
|
|
|
|
Use helper functions, and add some more sanity checking/asserts.
|
|
Similar to the previous patch, exchange a length and a pointer with only one offset variable.
Also fix the type of the options to be uint8_t[], rather than uint8_t*.
|
|
Store a pointer to the options in the DHCPMessage struct, and pass
this together with an offset around, rather than a uint8_t**.
This avoids us having to (re)compute the pointer; and changes
dhcp_option_append from adjusting both the pointer to the next
option and the remaining size of the options, to just adjusting
the current offset.
This makes the code a bit simpler to follow IMHO, but there should
be no functional change.
|
|
|
|
|
|
Also, keep the kmod_new internal to networkd-manager.c
|
|
This patch enables basic ipip tunnel support.
It works with kernel module ipip
example conf:
file: ipip.netdev
[NetDev]
Name=ipip-tun
Kind=ipip
MTUBytes=1480
[Tunnel]
Local=192.168.223.238
Remote=192.169.224.239
TTL=64
file: ipip.network
[Match]
Name=em1
[Network]
Tunnel=ipip-tun
[tomegun:
- drop unused variable
- take ref when enslaving]
|
|
'Requested by user' was confusing, just drop it.
|
|
Also add a call to check if a link is loopback, as this should commonly be ignored.
|
|
close() is a blocking call, which may slow things down measurably when running many dhcp
clients in the same single-threaded main loop. Let's just use the asynchronous version
instead to avoid the problem.
|
|
Also some general cleanups
|
|
This should improve performance on busy wireless networks and the
like. Inspired by a similar change in dnsmasq.
|
|
UDP sockets can anyway not be bound to specific netdev's. The packages would have to be filtered
when received instead.
|
|
|
|
|
|
Also use inet_ntoa rather than inet_ntop.
|
|
|
|
Export the NTP servers so timesyncd can use them.
|
|
Log error no for such client_stop(client, DHCP_EVENT_STOP)
|
|
- Also only allow positive ifindex on both dhcp and ipv4ll
[tomegun: the kernel always sets a positive ifindex, but some APIs accept
ifindex=0 with various meanings, so we should protect against
accidentally passing ifindex=0 along.]
|
|
To make sure we don't delay boot on systems where (some) network links are managed by someone else
we don't block if something else has successfully brought up a link.
We will still block until all links we are aware of that are managed by networkd have been
configured, but if no such links exist, and someone else have configured a link sufficiently
that it has a carrier, it may be that the link is ready so we should no longer block.
Note that in all likelyhood the link is not ready (no addresses/routes configured),
so whatever network managment daemon configured it should provide a similar wait-online
service to block network-online.target until it is ready.
The aim is to block as long as we know networking is not fully configured, but no longer. This
will allow systemd-networkd-wait-online.service to be enabled on any system, even if we don't
know whether networkd is the main/only network manager.
Even in the case networking is fully configured by networkd, the default behavior may not be
sufficient: if two links need to be configured, but the first is fully configured before the
second one appears we will assume the network is up. To work around that, we allow specifying
specific devices to wait for before considering the network up.
This unit is enabled by default, just like systemd-networkd, but will only be pulled in if
anyone pulls in network-online.target.
|
|
|
|
This essentially swaps the roles of rtnl and udev in networkd. After this
change libudev is only used for waiting for udev to initialize devices and
to get udev-specific information needed for some [Match] attributes.
This in particular simplifies the code in containers where udev is not really
useful, but also simplifies things and reduces round-trips in the non-container
case.
|
|
Also unref client objects in test code, and initalize logging,
to DEBUG by default.
|
|
These are redundant now that the REQUEST messages contain the same information.
|
|
Specify what kind of REQUEST we send, and distinguish between REBOOT and START.
Also log stop reasons as strings rather than numbers.
|
|
|
|
Also reshuffle some code to make the correspondence with the RFC a bit more
obvious.
Small functional change: fail if we try to send a message from the wrong state.
|
|
|
|
As we are now filtering the raw socket based on the transaction id, we must
reset the BPF when we reset the transaction id.
|
|
Add an explicit stop state for IPv4LL so that the user can stop the
IPv4LL client from the callback. When returning from the callback,
check also the stop state in order to halt any further protocol
processing.
|
|
Similar to DHCP, the IPv4LL library user can decide to free the LL
client any time the callback is called. Guard against freeing the
LL client in the callback by introducing proper reference counting.
Also update code using the IPv4LL library to properly handle a
returned NULL from the notify and stop functions if the IPv4LL
client was freed.
|
|
Add an explicit stop state for the DHCP client so that the library
user can issue a stop at any time the callback has been called.
When returning from the callback, check also the stop state and
stop any further DHCP processing.
|
|
The DHCP library user can decide to free the DHCP client any time
the callback is called. After the callback has been called, other
computations may still be needed - the best example being a full
restart of the DHCP procedure in case of lease expiry.
Fix this by introducing proper reference counting. Properly handle
a returned NULL from the notify and stop functions if the DHCP
client was freed.
|
|
|
|
This test should have been updated when changing the magic cookie handling around.
Reported by Ken MacLeod.
|
|
|
|
|
|
Improve the checksum computation by using 64 bit integers instead of the 16 bit
integers in the existing implementation. This change speeds up the computation
with approximately 78% both on 64 bit and 32 bit systems.
Please see RFC 1071 for details.
|
|
This should significantly reduce spurious wakeups.
|
|
Umut said: 'I have noticed a bug that we are sending PROBE/ANNOUNCE messages on
00:00:00:00:00:00 address where it should be broadcast.'
|
|
Try a bit harder to make the kernel drop packets not for us. This should reduce
the number of wakeups from n^2 to n in the number of dhcp clients, which admittedly
only makes a differenc in very extreme cases.
|
|
If they are too small to fit the IP+UDP+DHCP headers they can be of no use, so
don't waste resources parsing them. This is at the cost of losing some verbosity
in the logging.
|
|
Also move the checking of it to the main message handler, rather than the
options parser.
Fix a bug, so we now drop the packet if any of the magic bytes don't match.
Before we used to only drop the packet if they were all wrong.
|
|
Currently when both ipv4ll and dhcp are enabled, ipv4ll
address (if one has been claimed) is removed when dhcp
address is aquired. This is not the best thing to do
since there might be clients unaware of the removal
trying to communicate.
This patch provides a smooth transition between ipv4ll
and dhcp. If ipv4ll address was claimed [1] before dhcp,
address is marked as deprecated. Deprecated address is still
a valid address and packets can be received on it but address
cannot be selected as a source address. If dhcp lease cannot
be extended, then ipv4ll address is marked as valid again.
[1] If there is no collision, claiming IPv4LL takes between 4 to
7 seconds.
|