summaryrefslogtreecommitdiff
path: root/src/network/networkd-link.c
AgeCommit message (Collapse)Author
2015-02-05networkd: exit on idleTom Gundersen
We will be woken up on rtnl or dbus activity, so let's just quit if some time has passed and that is the only thing that can happen. Note that we will always stay around if we expect network activity (e.g. DHCP is enabled), as we are not restarted on that.
2015-02-05networkd: don't unlink state files on exitTom Gundersen
Only unlink state files on DELLINK. This allows sd-network to be used even when networkd is not running.
2015-02-05networkd: add basic dbus APITom Gundersen
Only the very basics, more to come. For now: $ busctl tree org.freedesktop.network1 └─/org/freedesktop/network1 └─/org/freedesktop/network1/link ├─/org/freedesktop/network1/link/1 ├─/org/freedesktop/network1/link/2 ├─/org/freedesktop/network1/link/3 ├─/org/freedesktop/network1/link/4 ├─/org/freedesktop/network1/link/5 ├─/org/freedesktop/network1/link/6 ├─/org/freedesktop/network1/link/7 ├─/org/freedesktop/network1/link/8 └─/org/freedesktop/network1/link/9 $ busctl introspect org.freedesktop.network1 /org/freedesktop/network1 NAME TYPE SIGNATURE RESULT/VALUE FLAGS org.freedesktop.network1.Manager interface - - - .OperationalState property s "carrier" emits-change $ busctl introspect org.freedesktop.network1 /org/freedesktop/network1/link/1 NAME TYPE SIGNATURE RESULT/VALUE FLAGS org.freedesktop.network1.Link interface - - - .AdministrativeState property s "unmanaged" emits-change .OperationalState property s "carrier" emits-change
2015-02-05networkd: don't warn about missing links unnecessarilyTom Gundersen
If we get a NEWLINK + NEWADDR between enumerating the links and enumerating the addresses, we would get a warning that the link corresponding to the address does not exist. This is a false warning as both the NEWLINK and NEWADDR would be processed after enumerating completed, so drop it.
2015-02-03networkd: handle suspend eventsTom Gundersen
2015-02-03util: rework strappenda(), and rename it strjoina()Lennart Poettering
After all it is now much more like strjoin() than strappend(). At the same time, add support for NULL sentinels, even if they are normally not necessary.
2015-01-31networkd: dhcp-server - start as soon as addresses have been setTom Gundersen
We would otherwise wait for the interface to be completely configured, which could take considerable time with IPv4LL. As a result nspawn was very slow at obtaining IP addresses.
2015-01-21networkd: plug lldp leakTom Gundersen
2015-01-13networkd: propagate IPFoward= per-interface setting also to ↵Lennart Poettering
/proc/sys/net/ipv4/ip_forward We need to turn on /proc/sys/net/ipv4/ip_forward before the per-interface forwarding setting is useful, hence let's propagate the per-interface setting once to the system-wide setting. Due to the unclear ownership rules of that flag, and the fact that turning it on also has effects on other sysctl flags we try to minimize changes to the flag, and only turn it on once. There's no logic to turning it off again, but this should be fairly unproblematic as the per-interface setting defaults to off anyway.
2015-01-13networkd: make IP forwarding for IPv4 and IPv6 individually configurableLennart Poettering
2015-01-13networkd: introduce an AddressFamilyBoolean enum typeLennart Poettering
This introduces am AddressFamilyBoolean type that works more or less like a booleaan, but can optionally turn on/off things for ipv4 and ipv6 independently. THis also ports the DHCP field over to it.
2015-01-13networkd: add minimal IP forwarding and masquerading support to .network filesLennart Poettering
This adds two new settings to networkd's .network files: IPForwarding=yes and IPMasquerade=yes. The former controls the "forwarding" sysctl setting of the interface, thus controlling whether IP forwarding shall be enabled on the specific interface. The latter controls whether a firewall rule shall be installed that exposes traffic coming from the interface as coming from the local host to all other interfaces. This also enables both options by default for container network interfaces, thus making "systemd-nspawn --network-veth" have network connectivity out of the box.
2014-12-19networkd: link - plug leakTom Gundersen
2014-12-19LLDP: Add support for networkctlSusant Sahani
2014-12-19networkd: integrate LLDPSusant Sahani
This patch integrates LLDP with networkd. Example conf: file : lldp.network [Match] Name=em1 [Network] LLDP=yes
2014-12-18networkd: add FDB supportAlin Rauta
2014-12-10networkd-dhcp6: Move ICMPv6 and DHCPv6 configuration to new filePatrik Flykt
Handle all aspects of ICMPv6 and DHCPv6 in a file of its own as is done with DHCPv4 and IPv4LL.
2014-12-09networkd: remove unused variableThomas Hindoe Paaboel Andersen
It is no longer used after 45af44d47da6933b260c734ad9ff721f63f80a4d
2014-12-08networkd: manager - enumerate addresses globally, rather than per-linkTom Gundersen
The kernel always returns all addresses, rather than only for the given link, so let's only enumerate once.
2014-12-08networkd: link - typoTom Gundersen
2014-12-05networkd: add basic [Link] settings to .network filesTom Gundersen
This allows the default link settings (set in .link files) to be overridden per Network. Only MTU and MACAddress is supported for now.
2014-12-04networkd: fix compileTom Gundersen
Rebase failure on my side.
2014-12-04networkd: Add bridge port path costSusant Sahani
This patch add support to specify path cost of the bridge port to be configured via conf file. Exampe: conf file: br.netdev [NetDev] Name=br-test Kind=bridge file: br.network [Match] Name=em1 [Network] Bridge=br-test [BridgePort] Cost=332 bridge link 2: em1 state UP : <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 master br-test state disabled priority 32 cost 332
2014-11-28networkd: update logging macros for parameter order, and errno, to match ↵Lennart Poettering
rest of the code
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-18sd-dhcp-lease: expose load/save functionsTom Gundersen
Based on patch by Dan Williams.
2014-10-27networkd: don't stop the dhcp server when link goes downTom Gundersen
2014-10-11sd-dhcp-client: support non-Ethernet hardware addressesDan Williams
Like Infiniband. See RFC 4390 section 2.1 for details on DHCP and Infiniband; chaddr is zeroed, hlen is set to 0, and htype is set to ARPHRD_INFINIBAND because IB hardware addresses are 20 bytes in length.
2014-09-29Do not format USEC_INFINITY as NULLZbigniew Jędrzejewski-Szmek
systemctl would print 'CPUQuotaPerSecUSec=(null)' for no limit. This does not look right. Since USEC_INFINITY is one of the valid values, format_timespan() could return NULL, and we should wrap every use of it in strna() or similar. But most callers didn't do that, and it seems more robust to return a string ("infinity") that makes sense most of the time, even if in some places the result will not be grammatically correct.
2014-09-16sd-bus: sd_bus_message_get_errno should only return positive errnoThomas Hindoe Paaboel Andersen
sd_bus_message_get_errno can currently return either a number of different poitive errno values (from bus-error-mapping), or a negative EINVAL if passed null as parameter. The check for null parameter was introduced in 40ca29a1370379d43e44c0ed425eecc7218dcbca at the same as the function was renamed from bus_message_to_errno and made public API. Before becoming public the function used to return only negative values. It is weird to have a function return both positive and negative errno and it generally looks like a mistake. The function is guarded by the --enable-kdbus flags so I wonder if we still have time to fix it up? It does not have any documentation yet. However, except for a few details it is just a convenient way to call sd_bus_error_get_errno which is documented to return only positive errno. This patch makes it return only positive errno and fixes up the two calls to the function that tried to cope with both positive and negative values.
2014-09-15hashmap: introduce hash_ops to make struct Hashmap smallerMichal Schmidt
It is redundant to store 'hash' and 'compare' function pointers in struct Hashmap separately. The functions always comprise a pair. Store a single pointer to struct hash_ops instead. systemd keeps hundreds of hashmaps, so this saves a little bit of memory.
2014-09-08sd-network: add _get_network_file apiTom Gundersen
2014-09-04networkd: link - allow loopback links to be manage, but ignore DHCP/IPv4LLTom Gundersen
2014-09-04networkd: link - clarify log message when receiving address for unknown linkTom Gundersen
2014-09-04networkd: link - do not manage loopback linksTom Gundersen
Fixes https://bugs.freedesktop.org/show_bug.cgi?id=83134.
2014-09-04networkd: link - save link flags when the link is addedTom Gundersen
Don't wait for the link to be fully synchronised.
2014-09-04networkd: move carrier gained/lost handling from link_update_flags() to ↵Tom Gundersen
link_update() This allows us also to simplify link_has_carrier() a bit.
2014-08-19networkd: don't consider deprecated or tentative addresses when determining ↵Tom Gundersen
operstate https://bugs.freedesktop.org/show_bug.cgi?id=81287
2014-08-19networkd: link - don't enforce ENSLAVING stateTom Gundersen
We are only guaranteed to stay in ENSLAVING state whilst enslaving by bridges/bonds, not when adding stacked devices (as then the underlying device can be IFF_UP'ed and configured in parallel), so drop these asserts.
2014-08-18networkd: fix how we generate lists in link_save()Lennart Poettering
https://bugs.freedesktop.org/show_bug.cgi?id=82721
2014-08-15networkd: always write out locally configured settings first, dhcp-acquired ↵Lennart Poettering
ones later This is primarily important for the domains list, as we really should prefer the locally configured domain over the dhcp supplied ones when we use it as a search list.
2014-08-15sd-network: add support for wildcard domainsTom Gundersen
2014-08-15networkd: add support for Domains= to .network filesTom Gundersen
This allows the search/routing domanis to be specified per link/network and be passed on to resolved.
2014-08-15networkd: rename UseDomainName to UseDomainsTom Gundersen
This option will also apply to the search domains, so make it plural.
2014-08-14sd-network: add sd_network_linkg_get_domains()Tom Gundersen
For now this only exposes the domain name (DHCP Option 15), and not the search string (DHCP Option 119), which will be implemented in a follow-up patch.
2014-08-14networkd: link - don't enter LINK_CONFIGURED more than onceTom Gundersen
2014-08-14networkd: link - print address lifetime for tracked addressesTom Gundersen
This should help in debugging issues with DHCP lease renewal.
2014-08-13sd-network: rename operstates 'down' -> 'off' and 'up' -> 'no-carrier'Tom Gundersen
Suggested by Lennart and Kay.
2014-08-13sd-network: rename state INITALIZING to PENDING and expose as any other stateTom Gundersen
This is the state when we are waiting for udev to initialize the device, and waiting for libudev and rtnl to be in sync. In the future we probably will also be waiting for nl80211. At this point we do not yet have enough information to know whether or not networkd should be handling the device.
2014-08-12sd-network: split the operstate 'unknown' into 'down' and 'up'Tom Gundersen