summaryrefslogtreecommitdiff
path: root/src/network/networkd-link.c
AgeCommit message (Collapse)Author
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
2014-08-12networkd: link - split out dhcp4 handlingTom Gundersen
2014-08-12networkd: link - fix IN_SET usageTom Gundersen
2014-08-12networkd: link - split out ipv4ll handlingTom Gundersen
2014-08-12networkd: link - make check for whether addresses/routes are being ↵Tom Gundersen
configured implicit
2014-08-12networkd: split out networkd-link.hTom Gundersen
2014-08-12networkd: update manager_save() to use fflush_and_check() to simplify things ↵Lennart Poettering
a bit
2014-08-12networkd: fix buildLennart Poettering
2014-08-11networkd: monopolize in_addr utility functions in shared/in-addr-util.hLennart Poettering
Primarily, this means we get rid of net_parse_inaddr(), and replace it everywhere with in_addr_from_string() and in_addr_from_string_auto(). These functions do not clobber the callers arguments on failure, which is more close to our usual coding style.
2014-08-04sd-dhcp-server: always send out ROUTER and SUBNET_MASKTom Gundersen
For now we simply take these values from the server's address.
2014-08-04networkd: add and expose per-link LLMNR config optionTom Gundersen
2014-08-01networkd: track the MTU of each linkTom Gundersen
And inform the DHCPv4 clients about it.
2014-08-01Revert "networkd: don't assume udev_device_new_from_device_id sets errno"Tom Gundersen
libudev now does set errno correctly, so we can indeed rely on this. This reverts commit 2b49732c3d511007ae2c413997e56c40f678d79a.
2014-07-30networkd: don't assume udev_device_new_from_device_id sets errnoTom Gundersen
This reverts 6f4d55a8ae04e344a41fc2adef12ad99c2bb2927, as we cannot rely on errno here. Reported by David Herrmann.
2014-07-30networkd: improve error message when udev device can not be foundTom Gundersen
Reported by Raimonds Cicans <ray@apollo.lv>
2014-07-30networkd: ipv4ll - configure link-local address independently of DHCPv4Tom Gundersen
This changes the behavior when both DHCPv4 and IPv4LL are enabled. Before, we would disable IPv4LL when we got a DHCPv4 lease and enable it if the lease was lost. Now we just always set up both, if both are enabled, but the DHCPv4 addresses and routes will always take precedence due to their metric and scope.
2014-07-30resolved: when answer A or AAAA questions, order responses by whether ↵Lennart Poettering
addresses are link-local or not
2014-07-29networkd: fix reporting errors from hostnamedMichael Marineau
The return value may be -EINVAL or a positive errno from the dbus message. Check both ranges, otherwise most errors are silently ignored.
2014-07-28networkd: unify handling of stacked netdevsTom Gundersen
2014-07-28networkd: store ifindex as intTom Gundersen
2014-07-28sd-dhcp-client: drop event DHCP_EVENT_NO_LEASETom Gundersen
Keep this internal to the client and simply restart it when NAK is receieved, as per the RFC.
2014-07-25networkd: ipv4ll - drop unnecessary get_address()Tom Gundersen
2014-07-23networkd: merge DNS and NTP entries when exportingTom Gundersen
In the state files, do not distinguish where the various entries came from (static or DHCP), but include them all in the same list.
2014-07-23networkd: set route protocolDan Williams
All routes added by networkd are currently set RTPROT_BOOT, which according to the kernel means "Route installed during boot" (rtnetlink.h). But this is not always the case as networkd changes routing after boot too. Since the kernel gives more detailed protocols, use them. With this patch, user-configured static routes now use RTPROT_STATIC (which they are) and DHCP routes use RTPROT_DHCP. There is no define for IPv4LL yet, so those are installed as RTPROT_STATIC (though perhaps RTPROT_RA is better?). [tomegun: fixup src/network/networkd-link.c:972:33: error: too few arguments to function 'route_new_dynamic']
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-17sd-network: fixup apiTom Gundersen
Do not expose link_is_loopback, people should just get this from rtnl directly. Do not expose NTP servers as IP addresses, these must be strings. Expose ifindex as int, not unsigned. This is what the kernel (mostly) and glibc uses.
2014-07-17sd-network: remove redundant array size parameter from functions that return ↵Lennart Poettering
arrays As long as the number of array entries is relatively small it's nicer to simply return the number of entries directly, instead of using a size_t* return parameter for it.
2014-07-15sd-dhcp-client: make request broadcasts opt-inTom Gundersen
It appears there is no good way to decide whether or not broadcasts should be enabled, there is hardware that must have broadcast, and there are networks that only allow unicast. So we give up and make this configurable. By default, unicast is used, but if the kernel were to inform us abotu certain interfaces requiring broadcast, we could change this to opt-in by default in those cases.
2014-07-14networkd: link - fix memory leakTom Gundersen
Make link_initialized() idempotent to avoid taking refs on several udev_device objects.
2014-07-14networkd: netdev - introduce vtable for netdev kindsTom Gundersen
Split each netdev kind into its own .h/.c.
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-14networkd: dhcp add vendor class indentifier option 60Susant Sahani
Vendor Class Identifier be used by DHCP clients to identify their vendor type and configuration. When using this option, vendors can define their own specific identifier values, such as to convey a particular hardware or operating system configuration or other identifying information. Vendor-specified DHCP options—features that let administrators assign separate options to clients with similar configuration requirements. For example, if DHCP-aware clients for example we want to separate different gateway and option for different set of people (dev/test/hr/finance) in a org or devices for example web/database servers or let's say in a embedded device etc and require a different default gateway or DNS server than the rest of clients.
2014-07-14networkd: return 1 from successful event handlersTom Gundersen
2014-07-10networkd: always prefer dhcp routes over ipv4ll routesLennart Poettering
2014-07-03networkd: properly track addresses when first addedTom Gundersen
When doing a NEWADDR, the reply we get back is the NEWADDR itself, rather than just an empty ack (unlike how NEWLINK works). For this reason, the process that did the NEWADDR does not get the broadcast message. We were only listening for broadcast messages, and hence not tracking the addresses we added ourselves. This went unnoticed as the kernel will usually send NEWADDR messages from time to time anyway, so things would mostly work, but in the worst case we would not notice that a routable address was available and consider ourselves offline.
2014-07-03networkd: link - improve link tracking loggingTom Gundersen
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-02util: generalize is_localhost() and use it everywhere where applicableLennart Poettering
2014-07-01networkd: send hostname to dhcp serverEugene Yakubovich
Send hostname (option 12) in DISCOVER and REQUEST messages so the DHCP server could use it to register with dynamic DNS and such. To opt-out of this behaviour set SendHostname to false in [DHCP] section of .network file [tomegun: rebased, made sure a failing set_hostname is a noop and moved config from DHCPv4 to DHCP]
2014-07-01networkd: link - don't fail if master netdev already existsTom Gundersen
This allows restarts to work gracefully.
2014-07-01networkd: link - ignore missing MAC addressTom Gundersen
Currently DHCP/IPv4LL only works on ethernet devices, but no reason not to otherwise manage them.
2014-07-01networkd: link - drop assert from _free()Tom Gundersen
_free() should always succeed, even if object is not fully allocated.
2014-07-01networkd: link - improve refcountingTom Gundersen
We failed to take a ref when waiting for udev synchronization. Fix that and also make unreffing in callbacks simpler throughout by using _cleanup_ macros. Fixes <https://bugs.freedesktop.org/show_bug.cgi?id=80556>.
2014-06-30networkd: dhcp - use same metric for all DHCP-related routesTom Gundersen
2014-06-29networkd: dhcp - update the lifetime of an existing addressTom Gundersen
The logic otherwise is that we leave anything preconfigured alone, but in the case of DHCP we actually need to update it whenever the lease is renewed.
2014-06-29networkd: improve DHCP error loggingTom Gundersen
2014-06-29networkd: set static addresses immediatelyTom Gundersen
Don't wait for IPv4LL nor DHCP to finish before setting statically configured addresses.
2014-06-29Add support for DHCP static route optionsEugene Yakubovich
This adds support for DHCP options 33 and 121: Static Route and Classless Static Route. To enable this feature, set UseRoutes=true in .network file. Returned routes are added to the routing table.