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. |
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. |
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. |
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. |
e473522841f630bfd25725b06605462e5e30587f |
|
26-Aug-2015 |
Lennart Poettering <lennart@poettering.net> |
dhcp: generic data should be void*, not uint8_t*
If we handly arbitrary data we should use "void*" pointers, not
"uint8_t*", how go intended C to be used. |
89ca10c6a61309d84d54c5dc5a295387ce39e610 |
|
26-Aug-2015 |
Lennart Poettering <lennart@poettering.net> |
network: s/user_data/userdata/
Everywhere else we call the generic user data pointer just "userdata",
rather than "user_data". Let's do this here, too. |
79008bddf679a5e0900369950eb346c9fa687107 |
|
27-Nov-2014 |
Lennart Poettering <lennart@poettering.net> |
log: rearrange log function naming
- Rename log_meta() → log_internal(), to follow naming scheme of most
other log functions that are usually invoked through macros, but never
directly.
- Rename log_info_object() to log_object_info(), simply because the
object should be before any other parameters, to follow OO-style
programming style. |
086891e5c119abb9854237fc32e736fe2d67234c |
|
27-Nov-2014 |
Lennart Poettering <lennart@poettering.net> |
log: add an "error" parameter to all low-level logging calls and intrdouce log_error_errno() as log calls that take error numbers
This change has two benefits:
- The format string %m will now resolve to the specified error (or to
errno if the specified error is 0. This allows getting rid of a ton of
strerror() invocations, a function that is not thread-safe.
- The specified error can be passed to the journal in the ERRNO= field.
Now of course, we just need somebody to convert all cases of this:
log_error("Something happened: %s", strerror(-r));
into thus:
log_error_errno(-r, "Something happened: %m"); |
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. |
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. |
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. |
0bbc2c1f3b8f01eac7826dab1a3e1e073f63da8a |
|
17-Jun-2014 |
Tom Gundersen <teg@jklm.no> |
sd-dhcp: checksum - make endianess-neutral
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>. |
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. |
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. |
aa6fc9b8c823834f262ab5ab2ac094a3775370a9 |
|
08-Apr-2014 |
Tom Gundersen <teg@jklm.no> |
sd-dhcp-client: include client id in debug messages |
d576127429a7be7d8e393d06f1bdd004fa37096c |
|
07-Apr-2014 |
Tom Gundersen <teg@jklm.no> |
libsystemd-network: Speed up checksum computation using 64 bit integers
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. |
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. |
a838c939a3a50b7318efac7b960392ca8d13bb1e |
|
19-Mar-2014 |
Patrik Flykt <patrik.flykt@linux.intel.com> |
libsystemd-network: Export checksum function to test case
Remove identical checksum function implementation from the test
case code. |
63edaa623bee43c934a0c357e8c6498992429391 |
|
11-Mar-2014 |
Tom Gundersen <teg@jklm.no> |
sd-dhcp: generalise ip header generation
This will be needed for sd-dhcp-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. |