summaryrefslogtreecommitdiff
path: root/src
AgeCommit message (Collapse)Author
2016-02-21networkd: add basic LLDP transmission supportLennart Poettering
Let's add some minimalistic LLDP sender support. The idea is that this is either on or off, and all fields determined automatically rather than configured explicitly.
2016-02-21sd-lldp: filter out LLDP messages coming from our own MAC addressLennart Poettering
Let's not get confused should we be connected to some bridge that mirrors back our packets.
2016-02-21import: don't claim we had copied a settings file if we didn'tLennart Poettering
2016-02-21networkd: make a couple of functions staticLennart Poettering
These functions are nowadays used only within networkd-link.c, hence ther's no point in littering our public namespace with them.
2016-02-21networkd: rework when LLDP reception is enabledLennart Poettering
Being on the link-layer LLDP is nothing we should turn on only when there's a link beat. Instead, turn it on, whenever the iface is UP regardless if there's a link beat or not. This closes the race between a link beat being available and us subscribing to LLDP as a result.
2016-02-21networkctl: print a nice warning when networkd isn't runningLennart Poettering
2016-02-21networkctl: if there's no data from networkd about an iface show as "unmanaged"Lennart Poettering
After all, if we know that an interface exists but networkd did not store any info about it, then it's definitely unmanaged by it. (Note that we add this fix-up to networkctl, and not to sd-network, simply because a missing file might also be result of the interface not existing.)
2016-02-21sd-network: use xsprintf() instead of asprintf() where we canLennart Poettering
2016-02-21networkctl: add a couple of (void) castsLennart Poettering
Where we knowingly ignore possible error results, let's cast to void.
2016-02-21networkd: rework how carrier bindings are serializedLennart Poettering
Instead of serializing the interface name, expose the interface index, since that's the only stable identifier.
2016-02-21networkd: turn on LLDP reception by default, in "routers-only" modeLennart Poettering
This way "networkctl status" becomes a bit more useful by default, as router information is just visible, without any further configuration. LLDP reception is fully passive and relatively low simple and low traffic, hence this should be safe to enable by default.
2016-02-21networkctl: extend "networkctl status" per-interface output to include LLDP infoLennart Poettering
This adds a small and useful field to the "systemctl status" output: the router(s) the interface is connected to as reported via LLDP. Example output: ● 2: enp0s25 Link File: /usr/lib/systemd/network/99-default.link Type: ether State: degraded (configured) Path: pci-0000:00:19.0 Driver: e1000e Connected To: GS1900 on port 2 (foobar) i.e. the last line is the relevant one.
2016-02-21networkctl: make use of xsprintf() where we canLennart Poettering
2016-02-21networkctl: simplify networkctlLennart Poettering
Move decode_and_sort_links() into acquire_info_all() which is the only place this is used. The result is then nicely symmetric to acquire_info_strv().
2016-02-21networkctl: rework interface data acquisitionLennart Poettering
Let's always use the same calls to acquire interface data. Specifically port "networkctl status" to use acquire_link_info_strv() and acquire_link_info_all() like the other calls.
2016-02-21networkctl: extend "networkctl list" and "networctl lldp" to optionally take ↵Lennart Poettering
interface names This way, the output may be reduced to only show data about the specified interfaces.
2016-02-21networkctl: add new call that unifies link data acquisition between "status" ↵Lennart Poettering
and "lldp" verbs
2016-02-21networkctl: fix dispatch_verb() tableLennart Poettering
VERB_DEFAULT may only appear once.
2016-02-21networkctl: split out system status stuff into its own functionLennart Poettering
2016-02-21sd-lldp: rework sd-lldp APILennart Poettering
This reworks the sd-lldp substantially, simplifying things on one hand, and extending the logic a bit on the other. Specifically: - Besides the sd_lldp object only one other object is maintained now, sd_lldp_neighbor. It's used both as storage for literal LLDP packets, and for maintainging info about peers in the database. Separation between packet, TLV and chassis data is not maintained anymore. This should be a major simplification. - The sd-lldp API has been extended so that a couple of per-neighbor fields may be queried directly, without iterating through the object. Other fields that may appear multiple times, OTOH have to be iterated through. - The maximum number of entries in the neighbor database is now configurable during runtime. - The generation of callbacks from sd_lldp objects is more restricted: callbacks are only invoked when actual data changed. - The TTL information is now hooked with a timer event, so that removals from the neighbor database due to TTLs now result in a callback event. - Querying LLDP neighbor database will now return a strictly ordered array, to guarantee stability. - A "capabilities" mask may now be configured, that selects what type of LLDP neighbor data is collected. This may be used to restrict collection of LLDP info about routers instead of all neighbors. This is now exposed via networkd's LLDP= setting. - sd-lldp's API to serialize the collected data to text files has been removed. Instead, there's now an API to extract the raw binary data from LLDP neighbor objects, as well as one to convert this raw binary data back to an LLDP neighbor object. networkd will save this raw binary data to /run now, and the client side can simply parse the information. - support for parsing the more exotic TLVs has been removed, since we are not using that. Instead there are now APIs to extract the raw data from TLVs. Given how easy it is to parse the TLVs clients should do so now directly instead of relying on our APIs for that. - A lot of the APIs that parse out LLDP strings have been simplified so that they actually return strings, instead of char arrays with a length. To deal with possibly dangerous characters the strings are escaped if needed. - APIs to extract and format the chassis and port IDs as strings has been added. - lldp.h has been simplified a lot. The enums are anonymous now, since they were never used as enums, but simply as constants. Most definitions we don't actually use ourselves have eben removed.
2016-02-20core: exclude .slice units from "systemctl isolate"Lennart Poettering
Fixes: #1969
2016-02-20networkd: fix logging of error codesLennart Poettering
2016-02-20networkd: enable LLDP only on ethernetLennart Poettering
2016-02-20sd-netlink: fix ifi_iftype typeLennart Poettering
The iftype is an unsigned short, and not just an unsigned.
2016-02-20sd-lldp: fix how we create the LLDP listening socketLennart Poettering
Specifiy the ethernet family, and make sure we se the O_CLOEXEC and O_NONBLOCK bits how we should for all fds.
2016-02-20tree-wide: place #pragma once at the same place everywhereLennart Poettering
Usually, we place the #pragma once before the copyright blurb in header files, but in a few cases we didn't. Move those around, so that we do the same thing everywhere.
2016-02-20sd-lldp: simplify lldp_network_bind_raw_socket() a bitLennart Poettering
Let's constify the filter program, drop a few includes and structure definitions.
2016-02-20sd-lldp: move ETHERTYPE_LLDP to missing.hLennart Poettering
After all, most ETHERTYPE variables are defined in the system headers, hence define these where we defined all other fill-ins for system headers.
2016-02-20test-lldp: fix error checking expressionsLennart Poettering
2016-02-20libsystemd-network: sd-event uses 64bit priorities, expose them in the APIs ↵Lennart Poettering
as such
2016-02-20sd-lldp: drop "port" objectLennart Poettering
Let's just keep the few parts we actually need of it in the main sd_lldp object, so that we can simplify things quite a bit. While we are at it, remove ifname and mac fields which we make no use of whatsoever.
2016-02-20sd-lldp: drop keeping of statisticsLennart Poettering
We don't expose them, and they are only of questionnable use.
2016-02-20libsystemd-network: don't abbreviate "callback" as "cb" needlesslyLennart Poettering
This isn't an excercise in creating APIs that are hard to understand, hence let's call a callback a callback.
2016-02-20sd-lldp: drop state fieldLennart Poettering
There's really no point in maintaining a state, the state machine is trivial, and we actually never look at the state anyway, we just keep updating it.
2016-02-20systemd-resolved: fix typo on log messageSamuel Tardieu
2016-02-19Merge pull request #2666 from keszybz/coverity-fixesZbigniew Jędrzejewski-Szmek
Coverity fixes
2016-02-19udev/path_id: correct segmentation fault due to missing NULL checkHendrik Brueckner
Running "udevadm test-builtin path_id /sys/devices/platform/" results in a segmentation fault. The problem is that udev_device_get_subsystem(dev) might return NULL in a streq() call. Solve this problem by using streq_ptr() instead.
2016-02-19Use (void) to silenc coverity on proc title changesZbigniew Jędrzejewski-Szmek
This is a cosmetic best-effort thing anyway.
2016-02-19resolved: fix NULL dereference in debug stmtZbigniew Jędrzejewski-Szmek
CID #1351544, #1351545.
2016-02-19Merge pull request #2661 from nwmcsween/nwmcsweenDaniel Mack
Include and internal struct member fixes.
2016-02-19Merge pull request #2660 from keszybz/memleaks-and-ubsanDaniel Mack
Memleaks and ubsan
2016-02-19Merge pull request #2662 from keszybz/activate-setenvDaniel Mack
activate: fix -E option parsing
2016-02-19Merge pull request #2648 from keszybz/dnssec-workMartin Pitt
Better support for DANE, shell completion
2016-02-18activate: fix -E option parsingZbigniew Jędrzejewski-Szmek
Fixes #2658.
2016-02-18time-util: rewrite check in a way that does not confuse gccZbigniew Jędrzejewski-Szmek
gcc thinks that multiplier might be unitialized. Split out the inner loop to make the function easier to grok.
2016-02-18test-hashmap: fix undefined behaviour on string constantsZbigniew Jędrzejewski-Szmek
The test was failing at -O2+ with gcc 5.3 and 6.0. "val1" == "val1" and "val1" != "val1" are both valid. http://stackoverflow.com/questions/4843640/why-is-a-a-in-c
2016-02-18journal/catalog: fix memory leaksZbigniew Jędrzejewski-Szmek
Various buffers were lost because finish_item() either consumed the buffer or allocated a new one (if an entry with the same key existed). The caller would simply forget the buffer in either case. Also add a check for the case when a valid identifier is followed by an empty body. We should not allow this. Also be more consistent in error handling and always print an error message.
2016-02-18basic/strbuf: do not call bsearch with a null argumentZbigniew Jędrzejewski-Szmek
Das ist verboten! src/basic/strbuf.c:162:23: runtime error: null pointer passed as argument 2, which is declared to never be null
2016-02-18Don't use internal struct member namesNathan McSween
2016-02-18Remove/add (un)needed includesNathan McSween