Age | Commit message (Collapse) | Author |
|
Like Infiniband. See RFC 4390 section 2.1 for details on DHCP
and Infiniband; chaddr is zeroed, hlen is set to 0, and htype
is set to ARPHRD_INFINIBAND because IB hardware addresses
are 20 bytes in length.
|
|
For efficiency, we group bytes together before adding them up. This
is guaranteed to always work (regardless of the byte order) as long
as the i-th byte in each group lign up with the i-th byte in each
other group.
On big-endian machines this broke when handling the trailing few bytes
which did not make up a full group of 4 bytes. This patch fixes the
problem by explicitly creating a 4 byte zero-padded group out of the
trailing bytes.
Reported and tested by Thomas Ritter <th.ritter@gmx.at>.
|
|
|
|
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.
|
|
This should improve performance on busy wireless networks and the
like. Inspired by a similar change in dnsmasq.
|
|
|
|
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.
|
|
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.
|
|
When receiving lots of packets that are not meant for us, we waste a relatively large amount
of cpu time computing their checksums before discarding them. Move the checksum calculation last
so we never compute it for packets which would otherwise be discarded.
|
|
|
|
Do not try to parse ICMP packets
[tomegun: slightly tweaked debug message]
|
|
Remove identical checksum function implementation from the test
case code.
|
|
This will be needed for sd-dhcp-server.
|
|
This is similar to sd-login, but exposes the state of networkd rather than logind.
Include it in libsystemd-dhcp and rename it to libsystemd-network.
|