b26fa1a2fbcfee7d03b0c8fd15ec3aa64ae70b9f |
|
10-Feb-2016 |
Daniel Mack <daniel@zonque.org> |
tree-wide: remove Emacs lines from all files
This should be handled fine now by .dir-locals.el, so need to carry that
stuff in every file. |
2c1ab8ca9b5dec48c66eb25dd8af71731e70e517 |
|
20-Jan-2016 |
Beniamino Galvani <bgalvani@redhat.com> |
dhcp: make DHCP6_OPTION_* enum public
libsystemd-network provides the public function
sd_dhcp6_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 dhcp6-protocol.h. Move the enum definition to the
public header sd-dhcp6-client.h and properly namespace values. |
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. |
c601ebf79f0c54be14d3c16f0f484c0335cdeec4 |
|
17-Nov-2015 |
Tom Gundersen <teg@jklm.no> |
sd-dhcp6-client: bind to link-local address
This ensures that several DHCPv6 clients can run on separate interfaces
simultaneously. |
3ffd4af22052963e7a29431721ee204e634bea75 |
|
25-Oct-2015 |
Lennart Poettering <lennart@poettering.net> |
util-lib: split out fd-related operations into fd-util.[ch]
There are more than enough to deserve their own .c file, hence move them
over. |
04c0136989b7eb896bfb0fb176e11233d69e1453 |
|
24-Oct-2015 |
Lennart Poettering <lennart@poettering.net> |
sd-*.h: clean up exported (or to-be-exported) header files
Exported header files should not include internal headers. Fix that.
Exported header files should not use the bool type. So far we opted to
stick to C89 for exported headers, and hence use "int" for bools in
them. Continue to do so.
Exported header files should have #include lines for everything they use
including inttypes.h and sys/types.h, so that they may be included in
any order.
Exported header files should have C++ guards, hence add them.
Exported header files should not use gcc extensions like #pragma once,
get rid of it. |
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. |
44598572da523f66872f593be7139b9a0f97deee |
|
23-Sep-2015 |
Patrik Flykt <patrik.flykt@linux.intel.com> |
test-dhcp6-client: Update test case due to changed semantics
Update the test case to stop the ongoing Information Request exchange
before unsetting its state. To keep the test case callback verification
simpler, temporarily unset the callback function before stopping. |
10c9ce615d98e125bc520efa94aebaef250a4061 |
|
22-Sep-2015 |
David Herrmann <dh.herrmann@gmail.com> |
sd-dhcp6: fix namespacing
Prefix all exported constants with SD_DHCP6_CLIENT_* to avoid any
namespacing conflicts. |
75f86906c52735c98dc0aa7e24b773edb42ee814 |
|
07-Sep-2015 |
Lennart Poettering <lennart@poettering.net> |
basic: rework virtualization detection API
Introduce a proper enum, and don't pass around string ids anymore. This
simplifies things quite a bit, and makes virtualization detection more
similar to architecture detection. |
52efd56a6369e19c2400a42981a197cd2eef924a |
|
27-Aug-2015 |
Lennart Poettering <lennart@poettering.net> |
tree-wide: we place the opening bracket on the same line as the function name
Let's do this everywhere the same way. |
bc152ff879a79412e358daaaa3677a0fc226bcb0 |
|
21-Aug-2015 |
Patrik Flykt <patrik.flykt@linux.intel.com> |
test-dhcp6-client: Add tests for DNS and NTP options
Test option setting and getting in test_advertise_option(). Verify
that the information provided in DHCPv6 Reply messages is also
available in the Information and Solicit callbacks. |
41e4615d4f4f5c61afa84ba857f23c0ac496687b |
|
21-Aug-2015 |
Patrik Flykt <patrik.flykt@linux.intel.com> |
sd-dhcp6: Support deprecated SNTP Configuration Option
Although the SNTP option specified in RFC 4075 has been deprecated, some
servers are still sending NTP information with this option. Use the SNTP
information provided only if the NTP option is not present.
Update the test case as SNTP information is also requested. |
70c79983e1abae17c46969b024d0b9e6a3b83d00 |
|
14-Apr-2015 |
Thomas Hindoe Paaboel Andersen <phomes@gmail.com> |
test-dhcp6-client: don't unref the event twice |
e7504d95479455be5cef120fc8e0a48fd74ad5ca |
|
27-Jan-2015 |
Patrik Flykt <patrik.flykt@linux.intel.com> |
sd-dhcp6-lease: Revise address iteration functions
Revise the address iteration functions so that one helper function
resets the iterator to the start of the address list while the
second one fetches addresses one by one.
The test case is also updated. |
c4e8ceddccfbb14e475e74eb5c57ba32c3c6cf86 |
|
10-Dec-2014 |
Patrik Flykt <patrik.flykt@linux.intel.com> |
test-dhcp6-client: Add a simple Information Request test case
Start the DHCPv6 test case by sending an Information Request, verifying
the reply and continuing at once with the normal address acquisition
procedure. Reuse the DHCPv6 Solicit Reply so that the client code is
verified to ignore any erroneously added IPv6 address information. |
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. |
d63be95a306bf1e262c7e1c7ad4b2c12b49d371e |
|
09-Sep-2014 |
Patrik Flykt <patrik.flykt@linux.intel.com> |
test-dhcp6-client: Add checks for Elapsed Time option
Verify that the Elapsed Time option is present. |
44481a8b537839cd9ffead4d261491641f5b5260 |
|
31-Aug-2014 |
Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> |
sd-dhcp6-client: properly calculate buffer size when parsing options
Also make pointer calculations more explicit so they are
easier to understand. |
d182960ae974a0074010a058d0d909846a2f3f79 |
|
31-Aug-2014 |
Patrik Flykt <patrik.flykt@linux.intel.com> |
test-dhcp6-client: Fix option length
The whole DHCPv6 test message length was incorrectly used as the length
of DHCPv6 options causing the following bad memory access:
$ build/test-dhcp6-client
Assertion 'interface_index >= -1' failed at ../src/libsystemd-network/sd-dhcp6-client.c:129, function sd_dhcp6_client_set_index(). Ignoring.
=================================================================
==29135==ERROR: AddressSanitizer: global-buffer-overflow on address 0x7fe204aa9148 at pc 0x7fe204a5958f bp 0x7fff3e47d470 sp 0x7fff3e47d460
READ of size 1 at 0x7fe204aa9148 thread T0
#0 0x7fe204a5958e in option_parse_hdr ../src/libsystemd-network/dhcp6-option.c:145
#1 0x7fe204a59884 in dhcp6_option_parse ../src/libsystemd-network/dhcp6-option.c:165
#2 0x7fe204a4eb9c in test_advertise_option ../src/libsystemd-network/test-dhcp6-client.c:227
#3 0x7fe204a51c58 in main ../src/libsystemd-network/test-dhcp6-client.c:584
#4 0x7fe2031590df in __libc_start_main (/lib64/libc.so.6+0x200df)
#5 0x7fe204a4cc5b (/home/test/systemd/build/test-dhcp6-client+0x25c5b)
0x7fe204aa9148 is located 2 bytes to the right of global variable 'msg_advertise' from '../src/libsystemd-network/test-dhcp6-client.c' (0x7fe204aa9080) of size 198
0x7fe204aa9148 is located 56 bytes to the left of global variable 'msg_reply' from '../src/libsystemd-network/test-dhcp6-client.c' (0x7fe204aa9180) of size 173
SUMMARY: AddressSanitizer: global-buffer-overflow ../src/libsystemd-network/dhcp6-option.c:145 option_parse_hdr |
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. |
da6fe470e17fa02f3adedc779585caf8669252bd |
|
26-Jun-2014 |
Patrik Flykt <patrik.flykt@linux.intel.com> |
sd-dhcp6-client: Add Option Request Option support
Provide a function to request more options from the DHCPv6 server.
Provide a sensible default set at startup and add test basic test
cases for the intended usage.
Define DNS and NTP related option codes and add comments for the
unassigned codes. |
947527f8326d3591f252c48fee5426a563f03544 |
|
19-Jun-2014 |
Patrik Flykt <patrik.flykt@linux.intel.com> |
sd-dhcp6-client: Add reply sending for test
Enhance the test case by generating a Reply. With a properly formed
Reply the callback function will be called and the additional
earlier event loop exit can now be removed. |
5e256ea7d3d556b3a1fb5c1faa94ec6a8833e53e |
|
19-Jun-2014 |
Patrik Flykt <patrik.flykt@linux.intel.com> |
sd-dhcp6-client: Add Advertise sending for test case
Enhance the test case by replying with an Advertise message to the
client. Copy the transaction id, IAID and DUID from the Solicit
message. Verify the Request message created by the DHCPv6 client
implementation and move the main loop exit to the end of the Request
message verification. |
859cca44f834ab1cc3e41fa6b94744f1856ab027 |
|
19-Jun-2014 |
Patrik Flykt <patrik.flykt@linux.intel.com> |
sd-dhcp6-client: Add test case for Advertise message parsing
Add a basic test case excersising once more option parsing function
in addition to lease handling. Check that the address iteration
functions return the correct IPv6 address and lifetimes and that
only one address is returned. Also verify that the server ID and
preference values are read correctly. |
2ea8857effb833615b16d10fc7a19a7104c19e13 |
|
19-Jun-2014 |
Patrik Flykt <patrik.flykt@linux.intel.com> |
sd-dhcp6-client: Add DHCPv6 Solicit test case
Verify the Solicit message created by the DHCPv6 client code.
Provide local variants for detect_vm(), detect_container() and
detect_virtualization() defined in virt.h. This makes the DHCPv6
library believe it is run in a container and does not try to request
interface information from udev for the non-existing interface index
used by the test case code. |
f12ed3bf0b315fc88d5fbdf5bdca14b218c86e0c |
|
19-Jun-2014 |
Patrik Flykt <patrik.flykt@linux.intel.com> |
sd-dhcp6-client: Add basic DHCPv6 option handling
Add option appending and parsing. DHCPv6 options are not aligned, thus
the option handling code must be able to handle options starting at
any byte boundary.
Add a test case for the basic option handling. |
813e3a6ffcd094696001716480bbd68008cc54c8 |
|
19-Jun-2014 |
Patrik Flykt <patrik.flykt@linux.intel.com> |
sd-dhcp6-client: Add basic DHCPv6 test cases
Add test cases for basic DHCPv6 client handling, e.g. setting
interface index, mac address and attaching event loop. |