summaryrefslogtreecommitdiff
path: root/src/network/networkd-netdev.c
AgeCommit message (Collapse)Author
2015-07-27networkd: add support for macvtapSusant Sahani
This patch add support for macvtap. see http://virt.kernelnewbies.org/MacVTap
2015-06-29networkd: netdev - avoid hanging transactions in failure casesTom Gundersen
If a link is attempted t obe enslaved by a netdev that has already failed, we must fail immediately and not save the callback for later, as it will then never get triggered.
2015-06-29networkd: fix segfault when cancelling callbacksTom Gundersen
This only happens when something has gone wrong, so is not easy to hit. However, if a bridge (say) is configured on a system without bridge support we will hit this. Fixes issue #299.
2015-06-13sd-netlink: rename from sd-rtnlTom Gundersen
2015-04-29networkd: introduce vti6 tunnelSusant Sahani
This patch add support to create vti6 tunnel test: vt6.network [Match] Name=wlan0 [Network] Tunnel=ip6vti vti6.netdev [NetDev] Name=ip6vti Kind=vti6 [Tunnel] Local=2a00:ffde:4567:edde::4987 Remote=2001:473:fece:cafe::5179 ip link 11: ip6_vti0@NONE: <NOARP> mtu 1500 qdisc noop state DOWN mode DEFAULT group default link/tunnel6 :: brd :: 12: ip6vti@wlan0: <POINTOPOINT,NOARP> mtu 1500 qdisc noop state DOWN mode DEFAULT group default link/tunnel6 2a00:ffde:4567:edde::4987 peer 2001:473:fece:cafe::5179
2015-04-21networkd: improve how networkd logs thingsLennart Poettering
This makes adds a couple of fixes: - Introduces log_netdev_error_errno() and friends, which takes an error number, and matches what log_link_error_errno() and friends do. - Replaces a lof ot strerror() usage with log_netdev_error_errno(), log_link_error_errno() and log_erro_errno() - Uppercases the first character of many log messages, after all this is supposed to be english language - Drops manual negating of error codes before passing them to log functions, the log functions all do that internally anyway. Some other minor fixes. Behaviour should not change really.
2015-04-21networkd: fix confusion between log_netdev_error() but log_warning_netdev()Lennart Poettering
We should always name the object first, the level second, like everywhere else in the sources.
2015-03-04networkd: netdev - inform when we take over an existing netdevTom Gundersen
The crucial point here is that we will not change the settings of a netdev created by someone else we simply use it as is and trust it was set up as intended. This is confusing in the case of the pre-created netdev's (bond0 etc.), the solution should probably be to simply make the kernel stop creating these devices as they are pretty useless.
2015-02-23remove unused includesThomas Hindoe Paaboel Andersen
This patch removes includes that are not used. The removals were found with include-what-you-use which checks if any of the symbols from a header is in use.
2015-01-22networkd: Introduce ip6gre and ip6gretapSusant Sahani
This patch introduces ipv6 gre and gretap. test: ip6gre.netdev: [NetDev] Name=ip6gretap Kind=ip6gretap [Tunnel] Local=2a00:ffde:4567:edde::4987 Remote=2001:473:fece:cafe::5179 ip6gre.network: [Match] Name=eno16777736 [Network] Tunnel=ip6gretap ip link 6: ip6gre@eno16777736: <POINTOPOINT,NOARP> mtu 1448 qdisc noop state DOWN mode DEFAULT group default link/gre6 2a:00:ff:de:45:67:ed:de:00:00:00:00:00:00:49:87 peer 20:01:04:73:fe:ce:ca:fe:00:00:00:00:00:00:51:79
2015-01-22networkd: Introduce IP6 tunnelSusant Sahani
This patch enables networkd to create IP6 tunnels example conf: ipip6.netdev: [NetDev] Name=ipip6-tunnel Kind=ip6tnl [Tunnel] Mode=ip4ipv6 Local=2a00:ffde:4567:edde::4987 Remote=2001:473:fece:cafe::5179 ipip6.network [Match] Name=wlan0 [Network] Tunnel=ipip6-tunnel 23: ipip6-tunnel@wlan0: <POINTOPOINT,NOARP> mtu 1452 qdisc noop state DOWN mode DEFAULT group default link/tunnel6 2a00:ffde:4567:edde::4987 peer 2001:473:fece:cafe::5179
2015-01-22networkd: introduce gretapSusant Sahani
This patch introdeces gretap to networkd
2015-01-19networkd: netdev - add ipvlan supportTom Gundersen
2014-12-11networkd/resolved: correct spacing near eol in code commentsTorstein Husebø
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-12-03networkd: fix typoTorstein Husebø
V2: found another one
2014-11-28treewide: yet more log_*_errno + return simplificationsMichal Schmidt
Using: find . -name '*.[ch]' | while read f; do perl -i.mmm -e \ 'local $/; local $_=<>; s/(if\s*\([^\n]+\))\s*{\n(\s*)(log_[a-z_]*_errno\(\s*([->a-zA-Z_]+)\s*,[^;]+);\s*return\s+\g4;\s+}/\1\n\2return \3;/msg; print;' $f done And a couple of manual whitespace fixups.
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-09-08networkd: netdev - failing to create a netdev is not fatal, just fail that ↵Tom Gundersen
netdev
2014-08-19networkd: netdev - add missing callback when adding stacked devicesTom Gundersen
As the comment says, the passed in callback must always be invoked, or the underlying link will hang. This was missed when reworking the code, so add it back in.
2014-08-12networkd: split out networkd-link.hTom Gundersen
2014-07-21networkd: netdev - split NetDev struct into per-kind structsTom Gundersen
Similarly to how unit types work.
2014-07-18sd-rtnl: make string returned by sd_rtnl_message_read_string() constLennart Poettering
2014-07-16tty-ask-password-agent: modernizationZbigniew Jędrzejewski-Szmek
2014-07-16Be more careful when checking for empty filesZbigniew Jędrzejewski-Szmek
If we want to avoid reading a totally empty file, it seems better to check after we have opened the file, not before.
2014-07-16Let config_parse open file where applicableZbigniew Jędrzejewski-Szmek
Special care is needed so that we get an error message if the file failed to parse, but not when it is missing. To avoid duplicating the same error check in every caller, add an additional 'warn' boolean to tell config_parse whether a message should be issued. This makes things both shorter and more robust wrt. to error reporting.
2014-07-15Constify ConfigTableItem tablesZbigniew Jędrzejewski-Szmek
2014-07-14networkd: netdev - introduce vtable for netdev kindsTom Gundersen
Split each netdev kind into its own .h/.c.
2014-07-14networkd: netdev - rework load_oneTom Gundersen
We now: - parse config - match on environment - verify and complement config - create netdev
2014-07-14networkd: netdev - split out bridge creationTom Gundersen
2014-07-14networkd: netdev - rename 'enslave' to 'join'Tom Gundersen
Enslave only really makes sense when referring to bridges and bonds, so try to be a bit more neutral.
2014-07-07networkd: add support for modeSusant Sahani
This patch adds supports networkd to configure bond mode during creation via persistent conf. Mode can be configured with conf param 'Mode'. A new section Bond is added to the conf to support bond mode. These modes can be configured now. balance-rr active-backup balance-xor broadcast 802.3ad balance-tlb balance-alb Example conf file: test-bond.conf [NetDev] Name=bond1 Kind=bond [Bond] Mode=balance-xor Test case: 1. start networkd service: 12: bond1: <BROADCAST,MULTICAST,MASTER,UP,LOWER_UP> mtu 1500 qdisc noqueue state UNKNOWN mode DEFAULT group default link/ether 22:89:6c:47:23:d2 brd ff:ff:ff:ff:ff:ff 2. find bond mode: cat /proc/net/bonding/bond1 Ethernet Channel Bonding Driver: v3.7.1 (April 27, 2011) Bonding Mode: load balancing (xor) Transmit Hash Policy: layer2 (0) MII Status: up MII Polling Interval (ms): 0 Up Delay (ms): 0 Down Delay (ms): 0 Changes: 1. Added file networkd-bond.c 2. Bond mode enum BondMode 3. conf section [Bond] [tomegun: whitespace]
2014-07-03networkd: tuntap - default to no packet informationTom Gundersen
Susant says: > ip tuntap turns this off by default. Let's follow ip(8) here as that should be the least surprising.
2014-07-03networkd: tuntap - enable PacketInfo by defaultTom Gundersen
2014-07-03networkd: netdev - move tunnel address parsing to networkd-tunnel.cTom Gundersen
2014-07-03networkd: tunnels - make tunnel address parsing genericTom Gundersen
It had a bug in the typing, fix that and also make it save the address family so we can print proper error messages.
2014-07-03networkd: Introduce tun/tap deviceSusant Sahani
This patch introduces TUN/TAP device creation support to networkd. Example conf to create a tap device: file: tap.netdev ------------------ [NetDev] Name=tap-test Kind=tap [Tap] OneQueue=true MultiQueue=true PacketInfo=true User=sus Group=sus ------------------ Test: 1. output of ip link tap-test: tap pi one_queue UNKNOWN_FLAGS:900 user 1000 group 1000 id: uid=1000(sus) gid=10(wheel) groups=10(wheel),1000(sus) context=unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023 Modifications: Added: 1. file networkd-tuntap.c 3. netdev kind NETDEV_KIND_TUN and NETDEV_KIND_TAP 2. Tun and Tap Sections and config params to parse conf and gperf conf parameters [tomegun: tweak the 'kind' checking for received ifindex]
2014-07-03networkd: netdev - drop the link callbacks after calling them onceTom Gundersen
We should never call them again, so make sure they are cleaned up correctly.
2014-07-03networkd: netdev - take ref immediately after calling outTom Gundersen
Keeping the refcounting next to the sd_bus_call_async() makes it easier to check.
2014-07-03networkd: split out vlan and macvlan handlingTom Gundersen
2014-07-01networkd: netdev - add dummy supportTom Gundersen
2014-07-01networkd: netdev - take ref when creating netdevsTom Gundersen
We were doing this correctly for when the callback takes the Link object, but must also do it for the cases it takes the NetDev object.
2014-07-01networkd: tunnel - ensure that enslave callback is always invokedTom Gundersen
The Link statemachine relies on this, as it would otherwise wait forever. Hook up the tunnels in the same way as the other NetDev's.
2014-07-01networkd: netdev add one separate lineSusant Sahani
2014-06-20networkd: veth - fix creation of veth netdevTom Gundersen
Avoid freeing the netdev structure in the cleanup macro.
2014-06-17networkd: veth - fix parsing verificationTom Gundersen