summaryrefslogtreecommitdiff
path: root/src/libsystemd-network/dhcp-packet.c
AgeCommit message (Collapse)Author
2016-11-10networkd: support setting dhcp client listen port (#4631)Susant Sahani
Allow setting custom port for the DHCP client to listen on in networkd. [DHCP] ListenPort=6677
2016-02-22tree-wide: make ++/-- usage consistent WRT spacingVito Caputo
Throughout the tree there's spurious use of spaces separating ++ and -- operators from their respective operands. Make ++ and -- operator consistent with the majority of existing uses; discard the spaces.
2016-01-20dhcp: make DHCP_OPTION_* enum publicBeniamino Galvani
libsystemd-network provides the public function sd_dhcp_client_set_request_option() to enable the request of a given DHCP option. However the enum defining such options is defined in the internal header dhcp-protocol.h. Move the enum definition to the public header sd-dhcp-client.h and properly namespace values.
2015-11-16tree-wide: sort includesThomas Hindoe Paaboel Andersen
Sort the includes accoding to the new coding style.
2015-02-23remove unused includesThomas Hindoe Paaboel Andersen
This patch removes includes that are not used. The removals were found with include-what-you-use which checks if any of the symbols from a header is in use.
2014-10-11sd-dhcp-client: support non-Ethernet hardware addressesDan Williams
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.
2014-06-17sd-dhcp: checksum - make endianess-neutralTom Gundersen
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>.
2014-05-21sd-dhcp: option_append - support falling back to 'sname' and 'file'Tom Gundersen
2014-05-20sd-dhcp: refactor dhcp_option_appendTom Gundersen
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.
2014-05-06sd-dhcp: network - set TOS on outgoing packetsTom Gundersen
This should improve performance on busy wireless networks and the like. Inspired by a similar change in dnsmasq.
2014-04-08sd-dhcp-client: include client id in debug messagesTom Gundersen
2014-04-07libsystemd-network: Speed up checksum computation using 64 bit integersTom Gundersen
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.
2014-04-06sd-dhcp-client: eagerly drop too small packetsTom Gundersen
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.
2014-04-06sd-dhcp-client: move magic cookie into DHCPMessage structTom Gundersen
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.
2014-03-30sd-dhcp: avoid checksum calculation if possibleTom Gundersen
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.
2014-03-30sd-dhcp: check for ipv4 packetsTom Gundersen
2014-03-30sd-dhcp: check for udp packetsUmut Tezduyar Lindskog
Do not try to parse ICMP packets [tomegun: slightly tweaked debug message]
2014-03-19libsystemd-network: Export checksum function to test casePatrik Flykt
Remove identical checksum function implementation from the test case code.
2014-03-11sd-dhcp: generalise ip header generationTom Gundersen
This will be needed for sd-dhcp-server.
2014-02-28sd-network: add new libraryTom Gundersen
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.