summaryrefslogtreecommitdiff
path: root/src/libsystemd-network
AgeCommit message (Collapse)Author
2015-02-12Add missing includes in header filesThomas Hindoe Paaboel Andersen
This fixes various issues found by globally reordering the include sections of all .c files.
2015-02-12Revert "tree-wide: Always use recvmsg with MSG_CMSG_CLOEXEC"Lennart Poettering
This reverts commit d6d810fbf8071f8510450dbacd1d083f37603656. It's apparently not OK to pass MSG_CMSG_CLOEXEC to recvmsg() of raw sockets.
2015-02-11network-internal: fix inverted matchingTom Gundersen
This fixes the test-suite again.
2015-02-10net: support globbing and disjunction in Match logicTom Gundersen
Match{Name,OrginalName,Type,Driver,Path} can now take a space-separated glob of matches.
2015-02-10tree-wide: Always use recvmsg with MSG_CMSG_CLOEXECCristian Rodríguez
2015-02-10test-lldp: fix minor OOMLennart Poettering
2015-02-10test-lldp: initialize structs when we define themLennart Poettering
2015-02-10test-lldp: use strndup() where possibleLennart Poettering
2015-02-10libsystemd-network: Avoid potential NULL dereference in test-lldpPhilippe De Swert
As a malloc0 could fail, doing a strncpy without checking could cause issues. Adding an assert should be good enough and in line with other similar routines in the code. Found with Coverity Fixes: CID#1261402
2015-02-09treewide: correct typos and use consistent "MAC" spellingTorstein Husebø
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.