summaryrefslogtreecommitdiff
path: root/src/libsystemd-network
AgeCommit message (Collapse)Author
2015-02-02test-dhcp-client: add a kludge to make valgrind happyZbigniew Jędrzejewski-Szmek
2015-02-02test-dhcp-client: open a real udp socket for test executionZbigniew Jędrzejewski-Szmek
./test-dhcp-client would attempt to operate fd 0, i.e. stdin. For example, './test-dhcp-client </dev/null' would fail with EPERM because /dev/null cannot be used with epoll. https://bugzilla.redhat.com/show_bug.cgi?id=1076119
2015-01-31test-dhcp-client: remove linebreakZbigniew Jędrzejewski-Szmek
2015-01-28sd-dhcp: chop of trailing dot of DHCP supplied host and domain namsLennart Poettering
2015-01-27sd-icmp6-nd: Add support for fetching the latest expired prefixPatrik Flykt
Keep the expired prefix for the duration of the prefix expiration event and remove it afterwards.
2015-01-27test-icmp6-nd: Add test cases for prefixesPatrik Flykt
Add test cases that feeds an Router Advertisement to the ICMPv6 code and verify that the correct prefix lengths are returned given an IPv6 address. Enhance the prefix verification test by adding a shorter prefix and check that the intended prefix lengths are now updated.
2015-01-27sd-icmp6-nd: Parse ICMPv6 prefix informationPatrik Flykt
Save each new onlink IPv6 prefix and attach an expiry timer to it. If the prefixes overlap, take the shorter prefix and write a debug message about the event. Once the prefix is resent in a Router Advertisement, update the timer. Add a new event for the expiring prefix. Add two helper functions, one for returning a prefix length given a Router Advertisement and the other for generic prefix matching given an IPv6 prefix and address.
2015-01-27test-icmp6-rs: Add trivial test case for an MTU that is not presentPatrik Flykt
2015-01-27sd-icmp6-nd: Add helper function to get the IPv6 link MTUPatrik Flykt
Update MTU according to the latest value received.
2015-01-27sd-icmp6-nd: Add link and prefix structures for ICMPv6Patrik Flykt
Each ICMPv6 structure has an interface index and will therefore be associated with an IPv6 link containing a list of of prefixes.
2015-01-27sd-icmp6-nd: Update Router Advertisement handlingPatrik Flykt
As the IPv6 prefixes are needed, update the ICMPv6 Router Advertisement code to dynamically allocate a suitably sized buffer. Iterate through the ICMPv6 options one by one returning error if the option length is too big to fit the buffer.
2015-01-27sd-dhcp6-lease: Revise address iteration functionsPatrik Flykt
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.
2015-01-23#pragma once here and thereZbigniew Jędrzejewski-Szmek
2015-01-22sd-dhcp-client: use RFC4361-complient ClientID by defaultTom Gundersen
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).
2015-01-22dhcp-identifier: create IAID even if no udev device can be foundTom Gundersen
This is useful for testing.
2015-01-22Assorted format fixesZbigniew Jędrzejewski-Szmek
Types used for pids and uids in various interfaces are unpredictable. Too bad.
2015-01-21network: dhcp - split out dhcp_identifier_set_{iaid,duid_en} from dhcp6-clientTom Gundersen
This will also be used in dhcp4-client.
2015-01-21network: dhcp - split out the duid structure into a new header fileTom Gundersen
We will use the same in both dhcp4 and dhcp6.
2015-01-20sd-dhcp6-client: Remove unnecessary debug printoutPatrik Flykt
2015-01-15LLDP: Support locally assigned port subtypeSusant Sahani
The Zyxel switch sends port subtype as Locally assigned (7). Add LLDP_PORT_SUBTYPE_LOCALLY_ASSIGNED as supported type reported by Mantas Mikulėnas <grawity@gmail.com>
2015-01-13refcnt: refcnt is unsigned, fix comparisonsTom Gundersen
This does not make a difference, but the code was confusing.
2015-01-12network-intenal: user _cleanup_ macro in parse_ifnameTom Gundersen
2015-01-05libsystemd-network: fix typo in lldpTorstein Husebø
2015-01-01network: fix scanf/printf formatZbigniew Jędrzejewski-Szmek
usec_t is defined as 64 bit wide, but long is 32 bit on many archs.
2014-12-31lldp: fix sd_lldp_save()David Herrmann
Fix a bunch of needless memzero() calls, a bunch of use-after-free regarding _cleanup_free_ and drop unused variables. Hint: Do NOT use _cleanup_free_ for temporary strappend() helpers that are freed multiple times. All you safe is the last free() call, which is really not worth the trouble resetting it to NULL all the time.
2014-12-31lldp: fix uninitialized cleanup var #2David Herrmann
Another uninitialized variable marked as _cleanup_. Set it to NULL to avoid accessing uninitialized memory.
2014-12-31lldp: fix uninitialized cleanup varDavid Herrmann
Make sure to set _cleanup_ variables to NULL. Otherwise, we free uninitialized objects.
2014-12-31lldp: fix double freeDavid Herrmann
'k' is marked as _cleanup_free_ so reset it to NULL if we free it explicitly.
2014-12-31network: add malloc-assertion in testDavid Herrmann
Make sure malloc() really returns non-NULL in lldp test.
2014-12-30tree-wide: spelling fixesVeres Lajos
https://github.com/vlajos/misspell_fixer https://github.com/torstehu/systemd/commit/b6fdeb618cf2f3ce1645b3315f15f482710c7ffa Thanks to Torstein Husebo <torstein@huseboe.net>.
2014-12-19sd-lldp: minor header cleanupTom Gundersen
* (potentially) public headers must reside in src/systemd/ (not in src/libsystemd*) * some private (not prefixed with sd_) functions moved from sd-lldp.h to lldp-internal.h * introduce lldp-util.h for the cleanup macro, as these should not be public * rename the cleanup macro, we always name them _cleanup_foo_, never _cleanup_sd_foo_ * mark some function arguments as 'const'
2014-12-19LLDP: Add support for networkctlSusant Sahani
2014-12-19networkd: Introduce Link Layer Discovery Protocol (LLDP)Susant Sahani
This patch introduces LLDP support to networkd. it implements the receiver side of the protocol. The Link Layer Discovery Protocol (LLDP) is an industry-standard, vendor-neutral method to allow networked devices to advertise capabilities, identity, and other information onto a LAN. The Layer 2 protocol, detailed in IEEE 802.1AB-2005.LLDP allows network devices that operate at the lower layers of a protocol stack (such as Layer 2 bridges and switches) to learn some of the capabilities and characteristics of LAN devices available to higher layer protocols.
2014-12-11use correct format typesThomas Hindoe Paaboel Andersen
2014-12-11tree-wide: use our memset() macros instead of memset() itselfLennart Poettering
2014-12-11sd-dhcp-client: log if we fail to set up lease timersTom Gundersen
2014-12-10test-dhcp6-client: Add a simple Information Request test casePatrik Flykt
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.
2014-12-10sd-dhcp6-client: Implement Information Request messagePatrik Flykt
Implement Information Request message according to RFC 3315, section 18.1.5. with the excepion that the first message is not delayed by a random amount. Instead systemd-networkd is supposed to take care of desynchronizing between other clients. Initialize the DHCPv6 client structure in sd_dhcp6_client_start() as this allows toggling between information request and normal DHCPv6 address aquisition modes.
2014-12-10sd-dhcp6-lease: Return only -EINVAL when a NULL lease is suppliedPatrik Flykt
Suppyling a NULL lease is not a condition that needs to be asserted, returning -EINVAL is informative enough to the caller. This simplifies calling code and doesn't falsely indicate that something erroneous was attempted.
2014-12-10sd-dhcp6-client: Make end of successfull option parsing explicitPatrik Flykt
When all DHCPv6 options have been parsed, dhcp6_option_parse() returns -ENOMSG. Explicitely set the return value to indicate success so that later code does not need to take this special value into account.
2014-12-09libsystemd-network: fix writing of routes in dhcp lease fileDan Winship
inet_ntoa() uses a static buffer, so you can't call it twice in the same fprintf() call.
2014-12-05net_setup/networkd: warn if matching is done on possibly unstable ifnameTom Gundersen
2014-12-04udev: net_setup - allow matching on OriginalName=Tom Gundersen
This has been requested repeatedly, so let's give it a go. We explicitly do not allow matching on names that have already been changed (from a previous udev run, or otherwise), and matching on unpredictable names (ethX) is discouraged (but not currently disallowed). We also currently allow: [Match] Name=veth0 [Link] Name=my-name0 SomeOtherSetting=true Which means that the link file will be applied the first time it is invoked, but not on subsequent invocations, which may be surprising.
2014-11-30tests: use assert_se instead of assertRonny Chevalier
Otherwise they can be optimized away with -DNDEBUG
2014-11-28treewide: more log_*_errno + return simplificationsMichal Schmidt
2014-11-28treewide: no need to negate errno for log_*_errno()Michal Schmidt
It corrrectly handles both positive and negative errno values.
2014-11-28treewide: auto-convert the simple cases to log_*_errno()Michal Schmidt
As a followup to 086891e5c1 "log: add an "error" parameter to all low-level logging calls and intrdouce log_error_errno() as log calls that take error numbers", use sed to convert the simple cases to use the new macros: find . -name '*.[ch]' | xargs sed -r -i -e \ 's/log_(debug|info|notice|warning|error|emergency)\("(.*)%s"(.*), strerror\(-([a-zA-Z_]+)\)\);/log_\1_errno(-\4, "\2%m"\3);/' Multi-line log_*() invocations are not covered. And we also should add log_unit_*_errno().
2014-11-27log: rearrange log function namingLennart Poettering
- 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.
2014-11-27log: add an "error" parameter to all low-level logging calls and intrdouce ↵Lennart Poettering
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");
2014-11-20sd-dhcp-lease: fix copy-paste error asserting wrong function argumentThomas Haller