summaryrefslogtreecommitdiff
path: root/src/libsystemd-network
Commit message (Collapse)AuthorAge
* Assorted format fixesZbigniew Jędrzejewski-Szmek2015-01-22
| | | | | Types used for pids and uids in various interfaces are unpredictable. Too bad.
* network: dhcp - split out dhcp_identifier_set_{iaid,duid_en} from dhcp6-clientTom Gundersen2015-01-21
| | | | This will also be used in dhcp4-client.
* network: dhcp - split out the duid structure into a new header fileTom Gundersen2015-01-21
| | | | We will use the same in both dhcp4 and dhcp6.
* sd-dhcp6-client: Remove unnecessary debug printoutPatrik Flykt2015-01-20
|
* LLDP: Support locally assigned port subtypeSusant Sahani2015-01-15
| | | | | | | 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>
* refcnt: refcnt is unsigned, fix comparisonsTom Gundersen2015-01-13
| | | | This does not make a difference, but the code was confusing.
* network-intenal: user _cleanup_ macro in parse_ifnameTom Gundersen2015-01-12
|
* libsystemd-network: fix typo in lldpTorstein Husebø2015-01-05
|
* network: fix scanf/printf formatZbigniew Jędrzejewski-Szmek2015-01-01
| | | | usec_t is defined as 64 bit wide, but long is 32 bit on many archs.
* lldp: fix sd_lldp_save()David Herrmann2014-12-31
| | | | | | | | | 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.
* lldp: fix uninitialized cleanup var #2David Herrmann2014-12-31
| | | | | Another uninitialized variable marked as _cleanup_. Set it to NULL to avoid accessing uninitialized memory.
* lldp: fix uninitialized cleanup varDavid Herrmann2014-12-31
| | | | | Make sure to set _cleanup_ variables to NULL. Otherwise, we free uninitialized objects.
* lldp: fix double freeDavid Herrmann2014-12-31
| | | | | 'k' is marked as _cleanup_free_ so reset it to NULL if we free it explicitly.
* network: add malloc-assertion in testDavid Herrmann2014-12-31
| | | | Make sure malloc() really returns non-NULL in lldp test.
* tree-wide: spelling fixesVeres Lajos2014-12-30
| | | | | | | https://github.com/vlajos/misspell_fixer https://github.com/torstehu/systemd/commit/b6fdeb618cf2f3ce1645b3315f15f482710c7ffa Thanks to Torstein Husebo <torstein@huseboe.net>.
* sd-lldp: minor header cleanupTom Gundersen2014-12-19
| | | | | | | | | | | * (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'
* LLDP: Add support for networkctlSusant Sahani2014-12-19
|
* networkd: Introduce Link Layer Discovery Protocol (LLDP)Susant Sahani2014-12-19
| | | | | | | | | | | | | | 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.
* use correct format typesThomas Hindoe Paaboel Andersen2014-12-11
|
* tree-wide: use our memset() macros instead of memset() itselfLennart Poettering2014-12-11
|
* sd-dhcp-client: log if we fail to set up lease timersTom Gundersen2014-12-11
|
* test-dhcp6-client: Add a simple Information Request test casePatrik Flykt2014-12-10
| | | | | | | 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.
* sd-dhcp6-client: Implement Information Request messagePatrik Flykt2014-12-10
| | | | | | | | | | | 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.
* sd-dhcp6-lease: Return only -EINVAL when a NULL lease is suppliedPatrik Flykt2014-12-10
| | | | | | | 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.
* sd-dhcp6-client: Make end of successfull option parsing explicitPatrik Flykt2014-12-10
| | | | | | 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.
* libsystemd-network: fix writing of routes in dhcp lease fileDan Winship2014-12-09
| | | | | inet_ntoa() uses a static buffer, so you can't call it twice in the same fprintf() call.
* net_setup/networkd: warn if matching is done on possibly unstable ifnameTom Gundersen2014-12-05
|
* udev: net_setup - allow matching on OriginalName=Tom Gundersen2014-12-04
| | | | | | | | | | | | | | | | | | 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.
* tests: use assert_se instead of assertRonny Chevalier2014-11-30
| | | | Otherwise they can be optimized away with -DNDEBUG
* treewide: more log_*_errno + return simplificationsMichal Schmidt2014-11-28
|
* treewide: no need to negate errno for log_*_errno()Michal Schmidt2014-11-28
| | | | It corrrectly handles both positive and negative errno values.
* treewide: auto-convert the simple cases to log_*_errno()Michal Schmidt2014-11-28
| | | | | | | | | | | | | 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().
* log: rearrange log function namingLennart Poettering2014-11-27
| | | | | | | | | | - 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.
* log: add an "error" parameter to all low-level logging calls and intrdouce ↵Lennart Poettering2014-11-27
| | | | | | | | | | | | | | | | | | | | 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");
* sd-dhcp-lease: fix copy-paste error asserting wrong function argumentThomas Haller2014-11-20
|
* sd-dhcp-lease: load/save client IDDan Williams2014-11-19
| | | | | The lease is usually tied to the client ID, so users of the lease may want to know what client ID it was acquired with.
* sd-dhcp-client: allow getting/setting the client IDDan Williams2014-11-19
| | | | | | | | | The client identifier can be in many different formats, not just the one that systemd creates from the Ethernet MAC address. Non- ethernet interfaces may have different client IDs formats. Users may also have custom client IDs that the wish to use to preserve lease options delivered by servers configured with the existing client ID.
* sd-dhcp-lease: expose load/save functionsTom Gundersen2014-11-18
| | | | Based on patch by Dan Williams.
* sd-dhcp-client: fix REBOOT state handlingDan Williams2014-11-18
| | | | | | | | | | | | | | | client->secs wasn't getting set in the REBOOT state, causing an assertion. REBOOT should work the same way as INIT, per RFC 2131: secs 2 Filled in by client, seconds elapsed since client began address acquisition or renewal process. REBOOT is necessary because some DHCP servers (eg on home routers) do not hand back the same IP address unless the 'ciaddr' field is filled with that address, which DISCOVER cannot do per the RFCs. This leads to multiple leases on machine reboot or DHCP client restart.
* shared: rename condition-util.[ch] to condition.[ch]Lennart Poettering2014-11-06
| | | | | Now that we only have one file with condition implementations around, we can drop the -util suffix and simplify things a bit.
* core: get rid of condition.c and move the remaining call into util.cLennart Poettering2014-11-06
| | | | | | | That way only one file with condition code remaining, in src/shared/, rather than src/core/. Next step: dropping the "-util" suffix from condition-util.[ch].
* condition: internalize condition test functionsLennart Poettering2014-11-06
| | | | | Also, implement the negation check inside of condition_test() instead of individually in each test function.
* sd-pppoe: spellingTom Gundersen2014-11-05
| | | | Thanks to Daniele Medri
* libsystemd-network: don't use unaligned helpers in _packed_ structsTom Gundersen2014-11-05
| | | | The compiler will do this for us.
* sd-pppoe: whitespaceTom Gundersen2014-11-05
|
* sd-event: rename sd_event_source_set_name() to sd_event_source_get_name()Lennart Poettering2014-11-04
| | | | | To mirror the recent name change of the concept for sd_bus objects, follow the same logic for sd_event_source objects, too.
* sd-pppoe: include ppp_defs.hLukas Nykryn2014-11-03
| | | | | | On older kernels before this patch: https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=e8b671460410c8fd996c8a1c228b718c547cc236 ppp-ioctl.h did not pull in ppp_defs.h which results in build errors
* sd-pppoe: fix some leaksTom Gundersen2014-11-01
|
* libsystemd-networkd: introduce sd-pppoe libraryTom Gundersen2014-11-01
| | | | | | | | | | | | | | | | | | | | This library negotiates a PPPoE channel. It handles the discovery stage and leaves the session stage to the kernel. A further PPP library is needed to actually set up a PPP unit (negotatie LCP, IPCP and do authentication), so in isolation this is not yet very useful. The test program has two modes: # ./test-pppoe will create a veth tunnel in a new network namespace, start pppoe-server on one end and this client library on the other. The pppd server will time out as no LCP is performed, and the client will then shut down gracefully. # ./test-pppoe eth0 will run the client on eth0 (or any other netdev), and requires a PPPoE server to be reachable on the local link.
* sd-dhcp6-client: fix off-by-two error in DUID lengthDan Williams2014-11-01
| | | | | The duid data passed by the caller does not include the DUID type, but sd_dhcp6_client_set_duid() was treating it like it did.