summaryrefslogtreecommitdiff
path: root/src/libsystemd-network
Commit message (Collapse)AuthorAgeFilesLines
* journal,network,timesync: fix segfault on 32bit timeval/timespec systemsYu Watanabe2021-09-161-1/+2
| | | | Fixes #20741.
* network: print Ethernet Link-Layer DHCP client ID with leading 0'sAlvin Šipraga2021-09-011-1/+1
| | | | | | | | | | | | This is a small cosmetic change. Before: Offered DHCP leases: 192.168.0.183 (to 0:9:a7:36:bc:89) After: Offered DHCP leases: 192.168.0.183 (to 00:09:a7:36:bc:89)
* socket-util: introduce CMSG_SPACE_TIMEVAL/TIMESPEC macro to support ↵Yu Watanabe2021-08-301-1/+1
| | | | | | additional 64bit timeval or timespec Fixes #20482 and #20564.
* icmp6: drop unnecessary assertionYu Watanabe2021-08-201-1/+0
| | | | Follow-up for 3691bcf3c5eebdcca5b4f1c51c745441c57a6cd1.
* sd-dhcp-server: support static lease outside of address poolYu Watanabe2021-08-113-85/+78
| | | | Closes #20341.
* sd-dhcp-server: fix possible double-free or use-after-freeYu Watanabe2021-08-111-1/+1
|
* sd-dhcp-server: use hashmap_ensure_put()Yu Watanabe2021-08-113-12/+12
|
* sd-dhcp6-client: use SYNTHETIC_ERRNO()Yu Watanabe2021-08-101-50/+29
|
* sd-dhcp6-client: cirtainly adjust T1 and T2Yu Watanabe2021-08-101-9/+8
| | | | | | This fixes a bug introduced by 99f1d3fc5043b33dea5faa88f7015a487965333f. Note that in the information requesting mode, the lease has neither addresses nor PD prefixes.
* sd-dhcp6-client: fix copy-and-paste mistakeYu Watanabe2021-08-101-1/+1
| | | | Fix bug introduced by b47fb949b338a8e77be789542fffb8c86da79284.
* sd-dhcp6-client: do not ignore errors in client_receive_advertise()Yu Watanabe2021-08-051-6/+11
| | | | This also adds several debug log messages.
* Drop the text argument from assert_not_reached()Zbigniew Jędrzejewski-Szmek2021-08-037-20/+12
| | | | | | | | | | | | | | | | | In general we almost never hit those asserts in production code, so users see them very rarely, if ever. But either way, we just need something that users can pass to the developers. We have quite a few of those asserts, and some have fairly nice messages, but many are like "WTF?" or "???" or "unexpected something". The error that is printed includes the file location, and function name. In almost all functions there's at most one assert, so the function name alone is enough to identify the failure for a developer. So we don't get much extra from the message, and we might just as well drop them. Dropping them makes our code a tiny bit smaller, and most importantly, improves development experience by making it easy to insert such an assert in the code without thinking how to phrase the argument.
* Merge pull request #20109 from keszybz/timestamp-macrosYu Watanabe2021-07-146-47/+18
|\ | | | | Add macros that define scratch buffer internally for timestamp/timespan formatting
| * tree-wide: add FORMAT_TIMESPAN()Zbigniew Jędrzejewski-Szmek2021-07-096-45/+17
| |
| * tree-wide: use FORMAT_TIMESTAMP()Zbigniew Jędrzejewski-Szmek2021-07-091-2/+1
| |
* | tree-wide: coccinelle fixesFrantisek Sumsal2021-07-091-1/+1
|/ | | | Yet another batch of Coccinelle fixes.
* sd-ipv4ll: introduce sd_ipv4ll_set_check_mac_callback()Yu Watanabe2021-07-011-2/+30
|
* sd-ipv4ll: allow to set MAC address without stopping sd-ipv4ll engineYu Watanabe2021-07-011-1/+1
|
* sd-ipv4acd: update condition of address conflictYu Watanabe2021-07-011-16/+48
| | | | | | | | See RFC 5227 section 2.1.1. This introduces a callback which intend to a library user, e.g. networkd, checks whether the sender hardware address is a MAC address of the host's intrerface or not.
* sd-ipv4acd: allow to change requesting address without restarting sd-ipv4acdYu Watanabe2021-07-011-1/+22
|
* sd-ipv4acd: set defend window in timeout event and state is ↵Yu Watanabe2021-07-011-8/+7
| | | | IPV4ACD_STATE_STARTED
* sd-ipv4acd: allow to change MAC address without restarting sd-ipv4acdYu Watanabe2021-07-011-1/+13
| | | | This also makes sd_ipv4acd_set_mac() refuses null MAC address.
* arp-util: split out logic of setting BPF code into a functionYu Watanabe2021-07-013-4/+21
|
* arp-util: use struct in_addrYu Watanabe2021-07-014-20/+23
|
* arp-util: make arp_send_{probe,announcement}() inlineYu Watanabe2021-07-013-40/+30
|
* arp-util: shorten code a bitYu Watanabe2021-07-011-5/+2
|
* arp-util: check ifindex and mac addressYu Watanabe2021-07-011-0/+3
|
* arp-util: check sent message sizeYu Watanabe2021-07-011-3/+5
|
* arp-util: align elementsYu Watanabe2021-07-011-18/+22
|
* sd-ipv4acd: include announced address in log messageYu Watanabe2021-07-011-4/+6
|
* sd-ipv4acd: use struct in_addr instead of be32_tYu Watanabe2021-07-011-20/+13
|
* sd-dhcp-client: tentatively ignore FORCERENEW commandYu Watanabe2021-06-241-0/+8
| | | | | | | | | | This makes DHCP client ignore FORCERENEW requests, as unauthenticated FORCERENEW requests causes a security issue (TALOS-2020-1142, CVE-2020-13529). Let's re-enable this after RFC3118 (Authentication for DHCP Messages) and/or RFC6704 (Forcerenew Nonce Authentication) are implemented. Fixes #16774.
* sd-dhcp-client: logs when dhcp client unexpectedly gains a new leaseYu Watanabe2021-06-241-11/+12
| | | | Previously, such situation is handled silently.
* sd-dhcp-client: shorten code a bitYu Watanabe2021-06-241-9/+4
|
* sd-dhcp-client: check error earlier and reduce indentationYu Watanabe2021-06-241-64/+64
|
* sd-dhcp: refuse to set iaid if we cannot find the interfaceYu Watanabe2021-06-121-18/+21
|
* dhcp: do not use ifindex when generating iaid in testsYu Watanabe2021-06-129-20/+48
|
* sd-dhcp: do not use detect_container() to guess udev is running or notYu Watanabe2021-06-121-2/+3
|
* tree-wide: use sd_device_new_from_ifindex/ifname()Yu Watanabe2021-06-121-4/+2
|
* sd-dhcp-server: make sd_dhcp_server_start() no-op if it is already runningYu Watanabe2021-06-082-1/+5
|
* sd-dhcp-server: support static address to DHCPv4 offerborna-blazevic2021-05-272-53/+183
|
* alloc-util: simplify GREEDY_REALLOC() logic by relying on malloc_usable_size()Lennart Poettering2021-05-1910-43/+26
| | | | | | | | | | | | | | | | | | | | | | | | We recently started making more use of malloc_usable_size() and rely on it (see the string_erase() story). Given that we don't really support sytems where malloc_usable_size() cannot be trusted beyond statistics anyway, let's go fully in and rework GREEDY_REALLOC() on top of it: instead of passing around and maintaining the currenly allocated size everywhere, let's just derive it automatically from malloc_usable_size(). I am mostly after this for the simplicity this brings. It also brings minor efficiency improvements I guess, but things become so much nicer to look at if we can avoid these allocation size variables everywhere. Note that the malloc_usable_size() man page says relying on it wasn't "good programming practice", but I think it does this for reasons that don't apply here: the greedy realloc logic specifically doesn't rely on the returned extra size, beyond the fact that it is equal or larger than what was requested. (This commit was supposed to be a quick patch btw, but apparently we use the greedy realloc stuff quite a bit across the codebase, so this ends up touching *a*lot* of code.)
* netlink,network: drop "const" from opaque object parameters in ↵Lennart Poettering2021-05-123-32/+32
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | supposed-to-be-public APIs This drops the "const" specifier from the opaque object parameters to various functions in our API. This effectively reverts #19292 and more. Why drop this? Our public APIs should not leak too much information about how stuff is implemented internally. In our public APIs we shouldn't give too many guarantees we don#t want to necessarily keep. Specifically: in many cases it makes sense that getters actually generate/parse/allocate data on the fly, storing/caching the result internally, to speed things up, do things lazily or to track memory allocations so that they can be freed later. Doing this means we need to change the objects, even though the getters are semantically a read operation. We want to retain the freedom that we can change things around internally. By exposing the objects as "const" we remove a good chunk of that, for little gain. See sd_bus_creds_get_description() for a real example of a getter that implicitly caches and thus modifies the relevant object. This removes the "const" decorators from sd-dhcp and sd-netlink, two APIs that we intend to make public eventually even though they still are not, leaving us the chance to still fix this before it becomes set in stone.
* tree-wide: fix typoYu Watanabe2021-05-091-1/+1
|
* rfc3046 implementationYegor Alexeyev2021-05-085-25/+218
|
* relay role implementationYegor Alexeyev2021-04-202-21/+90
|
* Merge pull request #19317 from ↵Luca Boccassi2021-04-158-92/+76
|\ | | | | | | | | keszybz/check-return-values-from-log_errno-functions Check return values from log_errno functions
| * libsystemd-network: check that errno==0 is not passed to log functionsZbigniew Jędrzejewski-Szmek2021-04-148-16/+40
| |
| * libsystemd-network: use macro for definitions of log_{lldp,dhcp,…}_errnoZbigniew Jędrzejewski-Szmek2021-04-148-84/+44
| | | | | | | | No functional change.
| * Check that errno passed log_{interface,link}_*_errno() is non-zeroZbigniew Jędrzejewski-Szmek2021-04-148-8/+8
| |