summaryrefslogtreecommitdiff
path: root/src/network/networkd-netdev.c
Commit message (Collapse)AuthorAge
...
* Revert "networkd: netdev - set predictable mac address when creating netdev"Tom Gundersen2014-04-21
| | | | | | | | | | | | | | This reverts commit cdc85c875b842b9309f72caefc51c262f521cf92. There appears to be a kernel bug that (among other things) cause bridges not to get a bridge id set when supplying IFLA_ADDRESS when creating the netdev. Simply revert the whole thing until we sort this out in the kernel. See: http://www.spinics.net/lists/netdev/msg279807.html Reported-by: C. R. Oldham <cr@saltstack.com>
* network: implement masking of .link, .network and .netdev filesTom Gundersen2014-04-19
|
* networkd: netdev - give up early when setting already set ifindexTom Gundersen2014-04-19
| | | | | We may receive RTM_NEWLINK messages with missing LINKINFO after the initial NEWLINK message, don't bother verifying these, just drop out early after checking that the ifindex is not in conflict.
* networkd: netdev - verify name of newlink messagesTom Gundersen2014-04-19
|
* networkd: netdev - set predictable mac address when creating netdevTom Gundersen2014-04-19
|
* networkd: tie links to rtnl rather than udevTom Gundersen2014-04-19
| | | | | | | | | | This essentially swaps the roles of rtnl and udev in networkd. After this change libudev is only used for waiting for udev to initialize devices and to get udev-specific information needed for some [Match] attributes. This in particular simplifies the code in containers where udev is not really useful, but also simplifies things and reduces round-trips in the non-container case.
* Fix a few return codes in error pathsZbigniew Jędrzejewski-Szmek2014-04-05
|
* networkd: netdev - improve logging when setting ifindexTom Gundersen2014-03-28
|
* sd-rtnl: rework rtnl type systemTom Gundersen2014-03-28
| | | | | | | | | | | | Use a static table with all the typing information, rather than repeated switch statements. This should make it a lot simpler to add new types. We need to keep all the type info to be able to create containers without exposing their implementation details to the users of the library. As a freebee we verify the types of appended/read attributes. The API is extended to nicely deal with unions of container types.
* networkd: fix a couple of memory leaksLennart Poettering2014-03-24
|
* networkd: netdev - fix error handling in set_ifindex()Tom Gundersen2014-03-24
| | | | | | | Firstly, remove stray assert(). Also be a bit stricter when verifying the received info. If we get an applicable newlink message that we can't make sense of, we will now enter NETDEV_FAILED, as we cannot reasonably continue without knowing the ifindex of our device.
* networkd: netdev - verify that newlink messages has the expected kindTom Gundersen2014-03-24
| | | | | We match 'newlink' messages with expected netdev's based on their names. Now also make sure that the receieved link has the expected kind.
* libsystemd-network: move network-utils from src/sharedTom Gundersen2014-03-21
| | | | | | This does not belong in shared as it is mostly a detail of our networking subsystem. Moreover, now we can use libudev here, which will simplify things.
* networkd: netdev - support joining already existing netdevsTom Gundersen2014-03-15
|
* Make tables for DEFINE_STRING_TABLE_LOOKUP consistentDaniel Mack2014-03-07
| | | | | | | | Bring some arrays that are used for DEFINE_STRING_TABLE_LOOKUP() in the same order than the enums they reference. Also, pass the corresponding _MAX value to the array initalizer where appropriate.
* networkd: add basic support for MACVLANsTom Gundersen2014-02-25
|
* net-util: match on the driver as exposed by ethtool if DRIVER not setTom Gundersen2014-02-21
| | | | Also fix a copy-paste error that broke matching on interface name.
* .network/.netdev/.link: allow to match on architectureTom Gundersen2014-02-21
|
* networkd: netdev - allow filtering on kernel cmdline, host and virtTom Gundersen2014-02-20
|
* api: in constructor function calls, always put the returned object pointer ↵Lennart Poettering2014-02-20
| | | | | | | | | | | | | | | | | | | | | | | | | | | first (or second) Previously the returned object of constructor functions where sometimes returned as last, sometimes as first and sometimes as second parameter. Let's clean this up a bit. Here are the new rules: 1. The object the new object is derived from is put first, if there is any 2. The object we are creating will be returned in the next arguments 3. This is followed by any additional arguments Rationale: For functions that operate on an object we always put that object first. Constructors should probably not be too different in this regard. Also, if the additional parameters might want to use varargs which suggests to put them last. Note that this new scheme only applies to constructor functions, not to all other functions. We do give a lot of freedom for those. Note that this commit only changes the order of the new functions we added, for old ones we accept the wrong order and leave it like that.
* sd-rtnl-message: store reference to the bus in the messageTom Gundersen2014-02-18
| | | | This mimics the sd-bus api, as we may need it in the future.
* sd-rtnl: message_open_container - don't take a 'size' argumentTom Gundersen2014-02-15
| | | | We can always know the size based on the type, so let's do this inside the library.
* rtnl: support adding VETH_INFO_PEER containers into rtnl messagesLennart Poettering2014-02-13
|
* rtnl: rename constructors from the form sd_rtnl_xxx_yyy_new() to ↵Lennart Poettering2014-02-13
| | | | | | | | sd_rtnl_xxx_new_yyy() So far we followed the rule to always indicate the "flavour" of constructors after the "_new_" or "_open_" in the function name, so let's keep things in sync here for rtnl and do the same.
* rtnl: drop "sd_" prefix from cleanup macrosLennart Poettering2014-02-13
| | | | | | | | | The "sd_" prefix is supposed to be used on exported symbols only, and not in the middle of names. Let's drop it from the cleanup macros hence, to make things simpler. The bus cleanup macros don't carry the "sd_" either, so this brings the APIs a bit nearer.
* networkd: VLAN - allow multiple vlans to be created on a linkTom Gundersen2014-02-10
| | | | | | | | Also limit the range of vlan ids. Other implementations and documentation use the ranges {0,1}-{4094,4095}, but we use the one accepted by the kernel: 0-4094. Reported-by: Oleksii Shevchuk <alxchk@gmail.com>
* networkd: netdev - rename Netdev to NetDevTom Gundersen2014-02-07
| | | | Both in the configuration file format and everywhere else in the code.
* networkd: remove unused variableTom Gundersen2014-02-01
|
* networkd: don't check for ifindex in answer to RTM_NEWLINKTom Gundersen2014-01-31
| | | | | | The kernel will not be changed to support this, so drop the code. Listening for all RTM_NEWLINK messages and filtering on name is reliable, so it is not a problem.
* networkd: netdev - reduce chance of race when receiving netdev's ifindexTom Gundersen2014-01-30
| | | | | | | | | | | | | When creating a new link, the kernel will not inform us about the new ifindex in its ack. We have to listen for newly created devices and deduce the new ifindex by matching on the ifname. We used to do this by waiting for a new device from libudev, but that is asking for trouble, as udev will happily rename the device before handing it to us. Listen on rtnl instead, the chance of the name being changed before reaching us is much smaller (if not nil). Kernel patch in the works to make this unneccessary.
* networkd: add basic VLAN supportTom Gundersen2014-01-25
|
* networkd: add basic bonding supportTom Gundersen2014-01-22
Refactor bridging support to be generic netdev support and extend it to cover bonding as well.