1d1a3e0afb85478cda43670b8ed92a6db6c83f3e |
|
02-Feb-2016 |
Beniamino Galvani <bgalvani@redhat.com> |
dhcp: delay restarts after NAKs
The server might answer to a DHCPREQUEST with a NAK and currently the
client restarts the configuration process immediately. It was
observed that this can easily generate loops in which the network is
flooded with DISCOVER,OFFER,REQUEST,NAK sequences.
RFC 2131 only states that "if the client receives a DHCPNAK message,
the client restarts the configuration process" without further
details.
Add a delay with exponential backoff between retries after NAKs to
limit the number of requests and cap the delay to 30 minutes. |
22805d9207d5242681e5667ee304572e4abf9b94 |
|
20-Jan-2016 |
Beniamino Galvani <bgalvani@redhat.com> |
dhcp: make DHCP_OPTION_* enum public
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. |
3cd03457bd3546a9d54a17bc00dae2058b43081b |
|
02-Dec-2015 |
Lennart Poettering <lennart@poettering.net> |
util-lib: update dns_name_to_wire_format() to optionally generate DNSSEC canonical names
We'll need this later when putting together RR serializations to
checksum. |
4afd3348c7506dd1d36305b7bcb9feb8952b9d6b |
|
27-Nov-2015 |
Lennart Poettering <lennart@poettering.net> |
tree-wide: expose "p"-suffix unref calls in public APIs to make gcc cleanup easy
GLIB has recently started to officially support the gcc cleanup
attribute in its public API, hence let's do the same for our APIs.
With this patch we'll define an xyz_unrefp() call for each public
xyz_unref() call, to make it easy to use inside a
__attribute__((cleanup())) expression. Then, all code is ported over to
make use of this.
The new calls are also documented in the man pages, with examples how to
use them (well, I only added docs where the _unref() call itself already
had docs, and the examples, only cover sd_bus_unrefp() and
sd_event_unrefp()).
This also renames sd_lldp_free() to sd_lldp_unref(), since that's how we
tend to call our destructors these days.
Note that this defines no public macro that wraps gcc's attribute and
makes it easier to use. While I think it's our duty in the library to
make our stuff easy to use, I figure it's not our duty to make gcc's own
features easy to use on its own. Most likely, client code which wants to
make use of this should define its own:
#define _cleanup_(function) __attribute__((cleanup(function)))
Or similar, to make the gcc feature easier to use.
Making this logic public has the benefit that we can remove three header
files whose only purpose was to define these functions internally.
See #2008. |
dc477e7385e8ab29efb8fadb72ec994077a105c6 |
|
25-Nov-2015 |
Lennart Poettering <lennart@poettering.net> |
dns-domain: simplify dns_name_is_root() and dns_name_is_single_label()
Let's change the return value to bool. If we encounter an error while
parsing, return "false" instead of the actual parsing error, after all
the specified hostname does not qualify for what the function is
supposed to test.
Dealing with the additional error codes was always cumbersome, and
easily misused, like for example in the DHCP code.
Let's also rename the functions from dns_name_root() to
dns_name_is_root(), to indicate that this function checks something and
returns a bool. Similar for dns_name_is_signal_label(). |
f693e9b38f13575b988335e3324a50dcc8772d48 |
|
25-Nov-2015 |
Tom Gundersen <teg@jklm.no> |
sd-dhcp: parse error message in DECLINE or NAK
If a client sends a DECLINE or a server sends a NAK, they can include
a string with a message to explain the error. Parse this and print it
at debug level. |
0d43d2fcb7ac5264c739dc2f67f93ed0985a418a |
|
25-Nov-2015 |
Tom Gundersen <teg@jklm.no> |
libsystemd-network: clean up recv functions |
23873e25aac70e1bddd2f701855cf94925111448 |
|
17-Nov-2015 |
Beniamino Galvani <bgalvani@redhat.com> |
libsystemd-network: add support for "Client FQDN" DHCP option
This adds support for the Client Fully Qualified Domain Name (FQDN)
option [RFC 4702] to libsystemd-network. The option can be used to
exchange information about a DHCPv4 client's fully qualified domain
name and about responsibility for updating the DNS RR related to the
client's address assignment.
Other popular DHCP clients (dhclient, dhcpcd) support this option and
it would be useful to have it in networkd too. |
a8eaaee72a2f06e0fb64fb71de3b71ecba31dafb |
|
06-Nov-2015 |
Jan Engelhardt <jengelh@inai.de> |
doc: correct orthography, word forms and missing/extraneous words |
b5efdb8af40ea759a1ea584c1bc44ecc81dd00ce |
|
27-Oct-2015 |
Lennart Poettering <lennart@poettering.net> |
util-lib: split out allocation calls into alloc-util.[ch] |
07630cea1f3a845c09309f197ac7c4f11edd3b62 |
|
24-Oct-2015 |
Lennart Poettering <lennart@poettering.net> |
util-lib: split our string related calls from util.[ch] into its own file string-util.[ch]
There are more than enough calls doing string manipulations to deserve
its own files, hence do something about it.
This patch also sorts the #include blocks of all files that needed to be
updated, according to the sorting suggestions from CODING_STYLE. Since
pretty much every file needs our string manipulation functions this
effectively means that most files have sorted #include blocks now.
Also touches a few unrelated include files. |
ed19c567e5fcdcec1a2b6dbac63787e001ad5d55 |
|
11-Oct-2015 |
Tom Gundersen <teg@jklm.no> |
libsystemd-network: limit accuracy of timestamps in logging
We don't care about timestamps down to the last usec, round to the closest sec
as that will be plenty for debugging purposes. |
0374814250e0ccc4699214422999cb5b35a1afae |
|
22-Sep-2015 |
David Herrmann <dh.herrmann@gmail.com> |
sd-dhcp: fix namespacing
Prefix all constants with SD_DHCP_CLIENT_* to avoid namespacing
conflicts. |
fbcd420aa407dc3c16efd9fb32cbae6d04d4f65d |
|
27-Aug-2015 |
Lennart Poettering <lennart@poettering.net> |
dhcp: don't underflow in lease time calculations
Don't underflow when calculating lease time. |
4b7b5abb785c03cb880e3a8a7a724d7de6e9cf3b |
|
27-Aug-2015 |
Lennart Poettering <lennart@poettering.net> |
dhcp: NTP servers should be requested by networkd but not implicitly by sd-dhcp
The library so far always requested the NTP servers. This might be
unnecessary in some uses, hence let's move the request into networkd
instead. |
0339cd7707ac40c29d51ee6933d06bc87ed140a4 |
|
27-Aug-2015 |
Lennart Poettering <lennart@poettering.net> |
dhcp: clean up dhcp4 lease object
a) drop handling of obsolete or unused DHCP options time_offset,
mtu_aging_timeout, policy filter, mdr, ttl, ip forwarding settings.
Should this become useful one day we can readd support for this.
b) For subnet mask and broadcast it is not always clear whether 0 or
255.255.255.255 might be valid, hence maintain a boolean indicating
validity next to it.
c) serialize/deserialize broadcast address, lifetime, T1 and T2 together
with the rest of the fields in dhcp_lease_save() and
dhcp_lease_load().
d) consistently return ENODATA from getter functions for data that is
missing in the lease.
e) add missing getter calls for broadcast, lifetime, T1, T2.
f) when decoding DHCP options, generate debug messages on parse
failures, but try to proceed if possible.
g) Similar, when deserializing a lease in dhcp_lease_load(), make sure
we deal nicely with unparsable fields, to provide upgrade compat.
h) fix some memory allocations |
3733eec3e292e4ddb4cba5eb8d3bd8cbee7102d8 |
|
26-Aug-2015 |
Lennart Poettering <lennart@poettering.net> |
dhcp: stop using refcnt.h
No need to invole atomic ops in single-threaded APIs, let's simplify
this. |
e6b18ffaea7d557eec3028a37c043da67a78550c |
|
26-Aug-2015 |
David Herrmann <dh.herrmann@gmail.com> |
sd-dhcp: don't randomly ref objects
In our API design, getter-functions don't ref objects. Calls like
foo_get_bar() will not ref 'bar'. We never do that and there is no real
reason to do it in single threaded APIs. If you need a ref-count, you
better take it yourself *BEFORE* doing anything else on the parent object
(as this might invalidate your pointer).
Right now, sd_dhcp?_get_lease() refs the lease it returns. A lot of
code-paths in systemd do not expect this and thus leak the lease
reference. Fix this by changing the API to not ref returned objects. |
144c348883a71ecc580ecf11967ceb9f304bd9da |
|
17-Jun-2015 |
Thomas Hindoe Paaboel Andersen <phomes@gmail.com> |
sd-dhcp-client: readd deleted error check
Seems to have been removed by mistake in:
9021bb9f935c93b516b10c88db2a212a9e3a8140 |
2a1288ff89322a2f49c79f6d1832c8164c14a05c |
|
10-Jun-2015 |
Lennart Poettering <lennart@poettering.net> |
util: introduce CMSG_FOREACH() macro and make use of it everywhere
It's only marginally shorter then the usual for() loop, but certainly
more readable. |
dd168445f851adc196125b98d59961b2085ff763 |
|
12-Apr-2015 |
Lennart Poettering <lennart@poettering.net> |
dhcp: yes, infiniband has the larger MAC address length, but let the compuler figure that out... |
3df3e884ae1237ef0d4d23b0e80f4ffda95ac135 |
|
11-Apr-2015 |
Ronny Chevalier <chevalier.ronny@gmail.com> |
shared: add random-util.[ch] |
3dc055541c570e93c817e42f451f7d3519629cbc |
|
10-Apr-2015 |
Lennart Poettering <lennart@poettering.net> |
Revert "sd-dhcp-client: fix strict aliasing issue"
This reverts commit 6ec8e7c763b7dfa82e25e31f6938122748d1608f.
This doesn't fix any issues, just makes the code harder to read. |
6ec8e7c763b7dfa82e25e31f6938122748d1608f |
|
14-Mar-2015 |
Shawn Landden <shawn@churchofgit.com> |
sd-dhcp-client: fix strict aliasing issue |
2eec67acbb00593e414549a7e5b35eb7dd776b1b |
|
23-Feb-2015 |
Thomas Hindoe Paaboel Andersen <phomes@gmail.com> |
remove unused includes
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. |
a38d99451f2bf8026ec51aee91662292e823c6a8 |
|
12-Feb-2015 |
Lennart Poettering <lennart@poettering.net> |
Revert "tree-wide: Always use recvmsg with MSG_CMSG_CLOEXEC"
This reverts commit d6d810fbf8071f8510450dbacd1d083f37603656.
It's apparently not OK to pass MSG_CMSG_CLOEXEC to recvmsg() of raw
sockets. |
d6d810fbf8071f8510450dbacd1d083f37603656 |
|
10-Feb-2015 |
Cristian RodrÃguez <crrodriguez@opensuse.org> |
tree-wide: Always use recvmsg with MSG_CMSG_CLOEXEC |
5bac5235934fabe5a3e6a9d47f4812f81034c427 |
|
22-Jan-2015 |
Tom Gundersen <teg@jklm.no> |
sd-dhcp-client: use RFC4361-complient ClientID by default
In addition to the benefits listed in the RFC, this allows DHCP to work also in
case several interfaces share the same MAC address on the same link (IPVLAN).
Note that this will make the ClientID (so probably the assigned IP address)
change on upgrades. If it is desired to avoid that we would have to remember and
write back the ID (which the library supports, but networkd currently does not). |
1fa2f38f0f011010bf57522b42fcc168856a7003 |
|
22-Jan-2015 |
Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> |
Assorted format fixes
Types used for pids and uids in various interfaces are unpredictable.
Too bad. |
f0c4b1c3fd827b429ba36aa45fd39e0a023cbf2c |
|
13-Jan-2015 |
Tom Gundersen <teg@jklm.no> |
refcnt: refcnt is unsigned, fix comparisons
This does not make a difference, but the code was confusing. |
f131770b1465fbf423881f16ba85523a05f846fe |
|
31-Dec-2014 |
Veres Lajos <vlajos@gmail.com> |
tree-wide: spelling fixes
https://github.com/vlajos/misspell_fixer
https://github.com/torstehu/systemd/commit/b6fdeb618cf2f3ce1645b3315f15f482710c7ffa
Thanks to Torstein Husebo <torstein@huseboe.net>. |
0411760af1ecd0bf4af07bb5775d32deda633600 |
|
11-Dec-2014 |
Tom Gundersen <teg@jklm.no> |
sd-dhcp-client: log if we fail to set up lease timers |
e37f74a6d5cc3c0a3d214c3a7f5de234b0696b4c |
|
19-Nov-2014 |
Dan Williams <dcbw@redhat.com> |
sd-dhcp-lease: load/save client ID
The lease is usually tied to the client ID, so users of the
lease may want to know what client ID it was acquired with. |
ba6c0fd6303c63576983c7be892d80d954c1e4c5 |
|
19-Nov-2014 |
Dan Williams <dcbw@redhat.com> |
sd-dhcp-client: allow getting/setting the client ID
The client identifier can be in many different formats, not just
the one that systemd creates from the Ethernet MAC address. Non-
ethernet interfaces may have different client IDs formats. Users
may also have custom client IDs that the wish to use to preserve
lease options delivered by servers configured with the existing
client ID. |
d8d74ef06fa0ccf39084a6177e70e4c2297cca57 |
|
18-Nov-2014 |
Dan Williams <dcbw@redhat.com> |
sd-dhcp-client: fix REBOOT state handling
client->secs wasn't getting set in the REBOOT state, causing
an assertion. REBOOT should work the same way as INIT, per
RFC 2131:
secs 2 Filled in by client, seconds elapsed since client
began address acquisition or renewal process.
REBOOT is necessary because some DHCP servers (eg on
home routers) do not hand back the same IP address unless the
'ciaddr' field is filled with that address, which DISCOVER
cannot do per the RFCs. This leads to multiple leases
on machine reboot or DHCP client restart. |
356779df90a2ecab5da2cb310ad0f8ebc9ca9f46 |
|
04-Nov-2014 |
Lennart Poettering <lennart@poettering.net> |
sd-event: rename sd_event_source_set_name() to sd_event_source_get_name()
To mirror the recent name change of the concept for sd_bus objects,
follow the same logic for sd_event_source objects, too. |
affaa94fc38a980a70534f70f6a6c58a4129b062 |
|
31-Oct-2014 |
Dan Williams <dcbw@redhat.com> |
sd-dhcp-client: clean up raw socket sd_event_source when creating new UDP socket
The raw socket sd_event_source used for DHCP server solicitations
was simply dropped on the floor when creating the new UDP socket
after a lease has been acquired. Clean it up properly so we're
not still listening and responding to events on it. |
76253e73f9c9c24fec755e485516f3b55d0707b4 |
|
11-Oct-2014 |
Dan Williams <dcbw@redhat.com> |
sd-dhcp-client: support non-Ethernet hardware addresses
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. |
6ff8806e1d20a4d3cbc4b360326ea3786768f0ca |
|
29-Aug-2014 |
Ruben Kerkhof <ruben@rubenkerkhof.com> |
Fix a few typos in log messages |
9021bb9f935c93b516b10c88db2a212a9e3a8140 |
|
28-Aug-2014 |
Tom Gundersen <teg@jklm.no> |
sd-event: name event sources used in libraries
This should help in debugging failing event sources. |
db73295accbec0c6513817f0a64a92018592bb26 |
|
15-Aug-2014 |
Lennart Poettering <lennart@poettering.net> |
util: never use ether_ntoa(), since it formats with %x, not %02x, which makes ethernet addresses look funny |
324f818781a250b60f2fcfa74ff1c9101d2d1315 |
|
01-Aug-2014 |
Tom Gundersen <teg@jklm.no> |
sd-dhcp-client: allow the max dhcp message size to be set to the MTU of the link |
615c1467c81411bf1d19fd7092e8995b5ebadc13 |
|
28-Jul-2014 |
Tom Gundersen <teg@jklm.no> |
sd-dhcp-client: add support for FORCERENEW
This partially implements RFC3203. Note that we are not fully compliant as we do not
support authentication. |
0af03ba57f43b973463e15949c2830cbd228f19d |
|
28-Jul-2014 |
Tom Gundersen <teg@jklm.no> |
sd-dhcp-client: listen on UDP socket as soon as a lease is acquired
This is necessary in order to listen for FORCERENEW events. |
2d2349cc3ed43153344807892332c9fa626c8d8a |
|
28-Jul-2014 |
Tom Gundersen <teg@jklm.no> |
sd-dhcp-client: drop event DHCP_EVENT_NO_LEASE
Keep this internal to the client and simply restart it when NAK is receieved, as
per the RFC. |
9fbc25232c123aac886b5327418b7254a48ea3dc |
|
28-Jul-2014 |
Tom Gundersen <teg@jklm.no> |
sd-dhcp-client: only verify UDP messages
RAW messages are verified by the BPF in the kernel. |
fa94c34b083b5b4019975624453e53d0cbad2a5d |
|
24-Jul-2014 |
Tom Gundersen <teg@jklm.no> |
libsystemd-network: use CLOCK_BOOTTIME instead of CLOCK_MONOTONIC where possible
The timeouts in the networking library (DHCP lease timeouts and similar) should not be affected
by suspend. In the cases where CLOCK_BOOTTIME is not implemented, it is still safe to fallback to
CLOCK_MONOTONIC, as the consumers of the library (i.e., networkd) _should_ renew the leases when
coming out of suspend. |
f5de5b00204f041aaec828d336c8afd9e860a5c3 |
|
15-Jul-2014 |
Tom Gundersen <teg@jklm.no> |
sd-dhcp-client: make request broadcasts opt-in
It appears there is no good way to decide whether or not broadcasts should be enabled,
there is hardware that must have broadcast, and there are networks that only allow
unicast. So we give up and make this configurable.
By default, unicast is used, but if the kernel were to inform us abotu certain
interfaces requiring broadcast, we could change this to opt-in by default in
those cases. |
edb85f0d8d0a84f27308a3728f3fde3c52b9dce2 |
|
14-Jul-2014 |
Susant Sahani <susant@redhat.com> |
networkd: dhcp add vendor class indentifier option 60
Vendor Class Identifier be used by DHCP clients to identify
their vendor type and configuration. When using this option,
vendors can define their own specific identifier values, such
as to convey a particular hardware or operating system
configuration or other identifying information.
Vendor-specified DHCP options—features that let administrators assign
separate options to clients with similar configuration requirements.
For example, if DHCP-aware clients for example we want to separate
different gateway and option for different set of people
(dev/test/hr/finance) in a org or devices for example web/database
servers or let's say in a embedded device etc and require a different
default gateway or DNS server than the rest of clients. |
58587a7a0c3bf5595190486781d3bbc00654c6ef |
|
07-Jul-2014 |
Michal Sekletar <msekleta@redhat.com> |
dhcp-network: add check for DHCP.chaddr
Check that received DHCP packets actually include our MAC address in
chaddr field. BPF interpreter has 32 bit wide registers but MAC address
is 48 bits long so we have to do check in two steps. |
4cc7a82c9490a3c5ae03b1d6d168ce40ba499e23 |
|
01-Jul-2014 |
Eugene Yakubovich <eugene.yakubovich@coreos.com> |
networkd: send hostname to dhcp server
Send hostname (option 12) in DISCOVER and REQUEST messages so the
DHCP server could use it to register with dynamic DNS and such.
To opt-out of this behaviour set SendHostname to false in [DHCP]
section of .network file
[tomegun: rebased, made sure a failing set_hostname is a noop and moved
config from DHCPv4 to DHCP] |
fb41e6d7c68c83558f8482f7fc72794a67b0638f |
|
29-Jun-2014 |
Tom Gundersen <teg@jklm.no> |
sd-dhcp-client: don't fail hard if UDP socket can not be bound
Even if we cannot renew the lease at T1, we will likely succeed at T2, so warn and ignore the failure.
This could happen if for whatever reason the received address is not yet configured, or it has
been lost. |
68ceb9df6a39a7f86ffc3cf8266ca677a5d5271b |
|
29-Jun-2014 |
Patrik Flykt <Patrik.Flykt@linux.intel.com> |
sd-dhcp-client/networkd: set lifetimes for IPv4 addresses
Note that /proc/sys/net/ipv4/ip_dynaddr needs to be non-zero.
[tomegun: hook up DHCP renew events to increase the lifetime when necessary] |
574cc928887851269c5919123dbdf8e1b2713b23 |
|
24-Jun-2014 |
Tom Gundersen <teg@jklm.no> |
sd-dhcp-client: return NULL from _unref() like the other sd-* libraries
Let's keep this behavior consistent across our libraries.
In order to keep the refcounting working, a DONT_DESTROY macro similar
to the one in sd-bus was introduced. |
f7926298e934c91dc2d152f4223cafbd202c907c |
|
18-Jun-2014 |
Thomas Hindoe Paaboel Andersen <phomes@gmail.com> |
sd-dhcp-client: check return from dhcp_option_append |
8186d9dda0d3f8a853afe6fdbd605f42151fe165 |
|
13-Jun-2014 |
Andreas Henriksson <andreas@fatal.se> |
sd-dhcp-client: fix invalid free() in client_send_request()
static int client_send_request(...) in
./src/libsystemd-network/sd-dhcp-client.c tries to initialize
"request" by calling client_message_init(...), which has atleast
5 error cases where it can return without that happening.
This leads to the function finishing without "request" being initialized. |
63a070415db09f5b5bcc5c487bfc85dabe443dde |
|
03-Jun-2014 |
Camilo Aguilar <camilo.aguilar@gmail.com> |
sd-dhcp-client: allways request broadcast
On systems which cannot receive unicast packets until its IP stack has been configured
we need to request broadcast packets. We are currently not able to reliably detect when
this is necessary, so set it unconditionally for now.
This is set on all packets, but the DHCP server will only broadcast the packets that are
necessary, and unicast the rest.
For more information please refer to this thread in CoreOS: https://github.com/coreos/bugs/issues/12
[tomegun: rephrased commit message] |
590b6b9188e75ba46c42995984a1c2fa06adb6d6 |
|
25-May-2014 |
Cristian RodrÃguez <crrodriguez@opensuse.org> |
Use %m instead of strerror(errno) where appropiate |
424a87321427d255ac287f08a649e7808ae1641c |
|
21-May-2014 |
Tom Gundersen <teg@jklm.no> |
sd-dhcp-client: factor out dhcp packet allocation |
23289745d737a57ecc040e18abadebaaf69dc8d1 |
|
21-May-2014 |
Tom Gundersen <teg@jklm.no> |
sd-dhcp: rely on FIONREAD working
This fallback will anyway never get tested, so rip it out. |
04b28be1a306fd2ba454d3ee333d63df71aa3873 |
|
21-May-2014 |
Tom Gundersen <teg@jklm.no> |
sd-dhcp: option_append - support falling back to 'sname' and 'file' |
20b958bf157dfb2f521b191ef7158035bcaa3003 |
|
20-May-2014 |
Tom Gundersen <teg@jklm.no> |
sd-dhcp: refactor dhcp_option_append
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. |
699370c98d37e4b373795f62cba9ff7bade5f2a1 |
|
09-May-2014 |
Tom Gundersen <teg@jklm.no> |
sd-dhcp-client: improve logging when stopping client
'Requested by user' was confusing, just drop it. |
22fc2420b2a7220addcee33c2fa17ada44d87f9c |
|
06-May-2014 |
Tom Gundersen <teg@jklm.no> |
sd-dhcp-client: use asynchronous_close()
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. |
085cabf266bfbbc5ebdada9179a8ebe404e540a8 |
|
06-May-2014 |
Tom Gundersen <teg@jklm.no> |
dhcp-network: don't pass ifindex to bind_udp_socket
UDP sockets can anyway not be bound to specific netdev's. The packages would have to be filtered
when received instead. |
ccfdc9a11256dc9b88860583924b5e57a9bb4ed1 |
|
27-Apr-2014 |
Umut Tezduyar Lindskog <umut.tezduyar@axis.com> |
sd-dhcp-client: log positive error number
Log error no for such client_stop(client, DHCP_EVENT_STOP) |
d9bf4f8c6c47b8620ffa1a056208eb15118b78d5 |
|
27-Apr-2014 |
Umut Tezduyar Lindskog <umut.tezduyar@axis.com> |
libnetworkd: add link local tests
- 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.] |
6317519517210f703e20dc846b31d018845244cd |
|
20-Apr-2014 |
Tom Gundersen <teg@jklm.no> |
sd-dhcp-client: log ifindex and mac address when starting |
6e00a80641aaba814204c65365c2fd5a90768394 |
|
12-Apr-2014 |
Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> |
test-dhcp-client: unref lease objects to make valgrind happy
Also unref client objects in test code, and initalize logging,
to DEBUG by default. |
730b3062088792ea0ad06655046d548be01a6d79 |
|
12-Apr-2014 |
Tom Gundersen <teg@jklm.no> |
sd-dhcp-client: drop logging about T1/T2
These are redundant now that the REQUEST messages contain the same information. |
998d8047029fb922ec42e55c9ed0c8926d1d9223 |
|
12-Apr-2014 |
Tom Gundersen <teg@jklm.no> |
sd-dhcp-client: improve logging
Specify what kind of REQUEST we send, and distinguish between REBOOT and START.
Also log stop reasons as strings rather than numbers. |
7739a40b45fcc00874f8760be3d26534ed76cd45 |
|
12-Apr-2014 |
Tom Gundersen <teg@jklm.no> |
sd-dhcp-client: use client_initialiez and client_restart for REBOOT |
50d6810ea8117bbfcf7007ae779d1a98a7300b5f |
|
11-Apr-2014 |
Tom Gundersen <teg@jklm.no> |
sd-dhcp-client: document message creation a bit more
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. |
8a9e761600d0d44bcc2e665e4fe1fda30e3e4749 |
|
11-Apr-2014 |
Tom Gundersen <teg@jklm.no> |
sd-dhcp-client: assert that we can only create DISCOVER or REQUEST messages |
eb105b96d58a3ebfeedb76a5d421b13748e0395c |
|
11-Apr-2014 |
Tom Gundersen <teg@jklm.no> |
sd-dhcp-client: rebind raw socket when resetting transaction id
As we are now filtering the raw socket based on the transaction id, we must
reset the BPF when we reset the transaction id. |
781ca7a13feb01739a9aa8b629ff1ff7c51e74aa |
|
11-Apr-2014 |
Patrik Flykt <patrik.flykt@linux.intel.com> |
sd-dhcp-client: Add an explicit stop state for the DHCP client
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. |
e5b04c8de83aa17e324bae95f18a822931fb8078 |
|
11-Apr-2014 |
Patrik Flykt <patrik.flykt@linux.intel.com> |
sd-dhcp-client: Add reference counting for DHCP
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. |
48a4612e6b67ae81b93ee8e8a4b3f8efa5324270 |
|
11-Apr-2014 |
Tom Gundersen <teg@jklm.no> |
sd-dhcp-client: recevie_message - verify cmsg_len before reading |
7429b07f822348dc5a87208ce107f5f6bf02656d |
|
06-Apr-2014 |
Tom Gundersen <teg@jklm.no> |
sd-dhcp-client: improve BPF
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. |
0c79c68d93d721d37ba088fb50dbf07bb0d447e5 |
|
06-Apr-2014 |
Tom Gundersen <teg@jklm.no> |
sd-dhcp-client: eagerly drop too small packets
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. |
3b7ca119fdc501e21f017695dc9b6f82fdbd1d93 |
|
06-Apr-2014 |
Tom Gundersen <teg@jklm.no> |
sd-dhcp-client: move magic cookie into DHCPMessage struct
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. |
9f2a50a3005a771a3b6cea2136b6a6c7e5686a0e |
|
27-Mar-2014 |
Thomas Hindoe Paaboel Andersen <phomes@gmail.com> |
silence warnings |
6a0f1f6d5af7c7300d3db7a0ba2b068f8abd222b |
|
24-Mar-2014 |
Lennart Poettering <lennart@poettering.net> |
sd-event: rework API to support CLOCK_REALTIME_ALARM and CLOCK_BOOTTIME_ALARM, too |
4644fee04fb515787bcfbba53b3cabe58c81d317 |
|
21-Mar-2014 |
Tom Gundersen <teg@jklm.no> |
sd-dhcp-client/sd-ipv4ll: allow mac address to be updated at any time
If necessary, restart the clients to deal with a changing mac address
at runtime. This will solve the problem of starting clients on bridges
before they have received their final MAC address. |
9e64dd72765ddc2583554ebed24eb2c824564838 |
|
21-Mar-2014 |
Tom Gundersen <teg@jklm.no> |
sd-dhcp-client: add fallback subnet masks
The DHCP RFC does not require the DHCP server to send a subnet mask, so if it
is missing, let's try to use the default subnet masks based on address class.
In case the class the address belongs to does not have a default subnet mask,
we fail as before.
Also improve logging when handling invalid dhcp messages, and simply ignore them
rather than stop the whole dhcp client. |
022446adf99b84c59a88c2e614033ccde13c395c |
|
21-Mar-2014 |
Tom Gundersen <teg@jklm.no> |
sd-dhcp-client: make timeout handling a bit more robust
Accept any lease lifetime greater than one second. Server should not
hand out extremely short leases, but let's not be the ones to fail.
Do not fail when arming a timer in the past, but also only arm one such
timer.
Avoid rounding errors when computing the default timeouts, this may be
an issue if we are handed a very short lease.
Also, don't pass 'time_now' around, as that can be found in the event
object when needed. |
58ec2d3e6e7d2274f5bb5cb64b936f1dbac45168 |
|
20-Mar-2014 |
Tom Gundersen <teg@jklm.no> |
sd-dhcp-client: do not reset 'secs' when entering INIT-REBOOT
Also keep start_time in sync, but that shouldn't matter. |
6236f49b230568ba3163df71fd7d386d354091de |
|
20-Mar-2014 |
Tom Gundersen <teg@jklm.no> |
sd-dhcp-client: don't pass around 'secs'
The value is stored in the client object, so get it there when needed. |
9d7bf1d58c2ce7f383f256a5beb1f5fc4ee843f5 |
|
20-Mar-2014 |
Patrik Flykt <patrik.flykt@linux.intel.com> |
libsystemd-network: Don't unnecessarily send too long packets
Since the length used by options is known, send packets with no
extra padding. |
715c6a9acd6ce4cce4fdfe8a62a32dc8f552e1d7 |
|
20-Mar-2014 |
Patrik Flykt <patrik.flykt@linux.intel.com> |
libsystemd-network: Prepend hardware type byte to client identifier
Even though client identifiers SHOULD be treated as opaque objects by
DHCP servers, follow the recommendation of a hardware type field with
value 0x01 (ethernet) followed by the hardware address as described in
RFC 2132. |
7bf2f4397255bc8f6cf20a0f2adab4c984ea7d14 |
|
19-Mar-2014 |
Tom Gundersen <teg@jklm.no> |
sd-dhcp-client: accept infinite lease lifetime
Otherwise we would fail with -EINVAL. Thanks to Brandon Philips
<brandon.philips@coreos.com>, for reporting the bug. |
8b1243f72ed321bd11f0939405b6d0963ce5eea5 |
|
19-Mar-2014 |
Patrik Flykt <patrik.flykt@linux.intel.com> |
libsystemd-network: Add Init-Reboot support
Init-Reboot is tried if a client IP address has been given when
the DHCP client is started. In Init-Reboot, start by sending a
broadcast DHCP Request including the supplied client IP address
but without the server identifier. After sending the request,
enter Reboot state.
If a DHCP Ack is received, proceed to Bound state as usual. If a
DHCP Nak is received or the first timeout triggers, start the
address acquisition over from DHCP Init state.
See RFC 2131, sections 4.3.2, 4.4, 4.4.1 and 4.4.2 for details. |
0f941add365638ad487ba94017cc2cf1f8d45195 |
|
19-Mar-2014 |
Patrik Flykt <patrik.flykt@linux.intel.com> |
libsystemd-network: Restart DHCP acquisition if the lease expires
This causes the DHCP client struct initialization and DHCP client
starting to be factored out into functions of their own. |
03e334a1c7dc8c20c38902aa039440763acc9b17 |
|
18-Mar-2014 |
Lennart Poettering <lennart@poettering.net> |
util: replace close_nointr_nofail() by a more useful safe_close()
safe_close() automatically becomes a NOP when a negative fd is passed,
and returns -1 unconditionally. This makes it easy to write lines like
this:
fd = safe_close(fd);
Which will close an fd if it is open, and reset the fd variable
correctly.
By making use of this new scheme we can drop a > 200 lines of code that
was required to test for non-negative fds or to reset the closed fd
variable afterwards. |
d23c45bfccb3ed6e2628e6d12b4ea12b8c920ab9 |
|
18-Mar-2014 |
Tom Gundersen <teg@jklm.no> |
sd-dhcp-client: make sure timers fire immediately
The default slack caused there to be a delay before timers fired. Solve it
by setting timers that should trigger immediately to trigger far in the past.
This brings down the ideal-case dhcp lease acquisition time from about 500ms to
about 50ms (over a veth pair, so no network latency involved).
All the rest of the time (except for ~0.5ms) is spent in the bind() call in,
dhcp_network_bind_raw_socket(). I don't know if there is anything to be done
about that though... |
93570bd7ed31aad336c1a0a88ba08159c9c8e4cc |
|
11-Mar-2014 |
Tom Gundersen <teg@jklm.no> |
sd-dhcp-client: use close_nointr_nofail()
We are already assuming the close() will not fail, so make it explicit. |
63edaa623bee43c934a0c357e8c6498992429391 |
|
11-Mar-2014 |
Tom Gundersen <teg@jklm.no> |
sd-dhcp: generalise ip header generation
This will be needed for sd-dhcp-server. |
02ec5cd78a148c2c05c0d6e5016ae04570a9ef97 |
|
05-Mar-2014 |
Tom Gundersen <teg@jklm.no> |
sd-dhcp-client: log the MAC address we are using |
8e34a618e2a67e22250247956697fe27c14c83c8 |
|
03-Mar-2014 |
Tom Gundersen <teg@jklm.no> |
sd-dhcp-lease: add sd_dhcp_lease_get_next_server() |
fe8db0c5ee3365a2fc80ee7ebffa238f9a0a2ae2 |
|
28-Feb-2014 |
Tom Gundersen <teg@jklm.no> |
sd-network: add new library
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. |