summaryrefslogtreecommitdiff
path: root/src/libsystemd-dhcp/sd-dhcp-client.c
AgeCommit message (Collapse)Author
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.
2014-02-24sd-dhcp-client: respect TP_STATUS_CSUMNOTREADYTom Gundersen
If an UDP packet has not passed through a hardware device, its checksum may not have been computed. This is exposed through the TP_STATUS_CSUMNOTREADY sockopt. When using raw sockets, skip checksum validation when TP_STATUS_CSUMNOTREADY is set. This is necessary for dhcp to work directly over a veth tunnel, e.g. as done in systemd-nspawn.
2014-02-23sd-dhcp-client: fix max size of REQUEST messageTom Gundersen
2014-02-23sd-dhcp: message_init - only set secs in the clientTom Gundersen
2014-02-23sd-dhcp: use FIONREAD to get correct size of incoming DHCP packetTom Gundersen
This avoids the problem of broken DHCP servers sending us too big packets that don't fit in our buffer.
2014-02-23sd-dhcp: equally verify udp and raw dhcp messagesTom Gundersen
Also be more explicit about why packages are ignored.
2014-02-23sd-dhcp: be more detailed about invalid headersTom Gundersen
This may be a common problem, so let's make it simpler to debug, at least for now.
2014-02-22sd-dhcp: add very basic debug loggingTom Gundersen
2014-02-20sd-dhcp-client: prevent timer related memory leaksUmut Tezduyar Lindskog
2014-02-20api: in constructor function calls, always put the returned object pointer ↵Lennart Poettering
first (or second) Previously the returned object of constructor functions where sometimes returned as last, sometimes as first and sometimes as second parameter. Let's clean this up a bit. Here are the new rules: 1. The object the new object is derived from is put first, if there is any 2. The object we are creating will be returned in the next arguments 3. This is followed by any additional arguments Rationale: For functions that operate on an object we always put that object first. Constructors should probably not be too different in this regard. Also, if the additional parameters might want to use varargs which suggests to put them last. Note that this new scheme only applies to constructor functions, not to all other functions. We do give a lot of freedom for those. Note that this commit only changes the order of the new functions we added, for old ones we accept the wrong order and leave it like that.
2014-02-19sd-dhcp-client: fix mixup between raw and udp socketsTom Gundersen
2014-02-16sd-dhcp: silently ignore malformed packetsTom Gundersen
This fixes a regression introduced in e5002702.
2014-02-15sd-dhcp: network - don't hardcode portsTom Gundersen
We want to reuse these functions for the server library too.
2014-02-15sd-dhcp: minimum options size is part of the protocolTom Gundersen
2014-02-15sd-dhcp-client: explicitly handle raw and udp messagesTom Gundersen
Split the recevie_message callback into _raw and _udp parts and a generic DHCPMessage handler. Also always verify the xid/MAC, rather than only for udp messages.
2014-02-12sd-dhcp: make sure client->secs > 0Tom Gundersen
Some DHCP servers will not work correctly if secs == 0, so round up to at least 1.
2014-02-11sd-dhcp: split out packet handling from clientTom Gundersen
2014-02-07sd-dhcp-client: split sd_dhcp_lease from sd_dhcp_clientTom Gundersen
This allows us users of the library to keep copies of old leases. This is used by networkd to know what addresses to drop (if any) when the lease expires. In the future this may be used by DNAv4 and sd-dhcp-server.
2014-01-31libsystemd-dhcp: Update secs field only when sending DiscoverPatrik Flykt
Compute the 'secs' field as seconds since start of lease acquisition procedure. Start off with a value of zero and increase it only for each resent DHCP discover message. See the discussion before and after http://www.ietf.org/mail-archive/web/dhcwg/current/msg05836.html and Section 3.1 of RFC 2131.
2014-01-31libsystemd-dhcp: Fix stopping of DHCP clientPatrik Flykt
Go back to Init state independent of the current state the client is in.
2014-01-31libsystemd-dhcp: Compute UDP checksum only if setPatrik Flykt
A checksum field with value zero means no UDP checksum has been computed for the packet.
2014-01-31libsystemd-dhcp: Rename function to be clearer that options are parsedPatrik Flykt
2014-01-31libsystemd-dhcp: DNS name option must be a multiple of 4 bytesPatrik Flykt
2014-01-30sd-dhcp-client/net-util: make netmask_to_prefixlen genericTom Gundersen
This was originally included in the dhcp-client at my request, but it is not really dhcp-specific and useful outside of it, so let's pull it out.
2014-01-21libsystemd-dhcp: revert merge into libsystemdTom Gundersen
Unlike the other merged libs, the rest of libsystemd will never depend on sd-dhcp-client, so there is no reason not to keep it separate.