Age | Commit message (Collapse) | Author |
|
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.
|
|
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.
|
|
|
|
|
|
This avoids the problem of broken DHCP servers sending us too big packets that don't fit in our buffer.
|
|
Also be more explicit about why packages are ignored.
|
|
This may be a common problem, so let's make it simpler to debug,
at least for now.
|
|
|
|
|
|
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.
|
|
|
|
This fixes a regression introduced in e5002702.
|
|
We want to reuse these functions for the server library too.
|
|
|
|
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.
|
|
Some DHCP servers will not work correctly if secs == 0, so round up
to at least 1.
|
|
|
|
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.
|
|
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.
|
|
Go back to Init state independent of the current state the client
is in.
|
|
A checksum field with value zero means no UDP checksum has been
computed for the packet.
|
|
|
|
|
|
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.
|
|
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.
|