summaryrefslogtreecommitdiff
path: root/src/network/networkd-link.c
AgeCommit message (Collapse)Author
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.
2014-06-29networkd: merge DHCPv4 and DHCPv6 configTom Gundersen
If there are v4 or v6 specific options we can keep those in separate sections, but for the common options, we will use only one. Moreovere only use DHCP=[yes/both|no/none|v4|v6] to enable or disable the clients.
2014-06-29sd-dhcp-client/networkd: set lifetimes for IPv4 addressesPatrik Flykt
Note that /proc/sys/net/ipv4/ip_dynaddr needs to be non-zero. [tomegun: hook up DHCP renew events to increase the lifetime when necessary]
2014-06-29networkd/sd-dhcp-server: only start dhcp server when necessaryTom Gundersen
2014-06-26networkd: Properly stop router solicitation and DHCPv6 clientPatrik Flykt
When a link fails or looses carrier, always stop ongoing router solicitation and any DHCPv6 client that may be running.
2014-06-20networkd: link - fix memleak of icmp6 structTom Gundersen
2014-06-19networkd: fix refcounting with UseMTU=yesSteven Noonan
The link was unintentionally being unreferenced instead of referenced for the MTU setup.
2014-06-19networkd: Add initial DHCPv6 supportPatrik Flykt
Enable DHCPv6 support by creating a DHCPv6 boolean in the Network section. Add necessary DHCPv6 structures and initial function calls.
2014-06-18networkd: configure dhcp server range only after successfully setting an IP ↵Lennart Poettering
address on the interface This way we can make use of the addresses of the IP pool.
2014-06-18networkd: add address pool supportLennart Poettering
When an address is configured to be all zeroes, networkd will now automatically find a locally unused network of the right size from a list of pre-configured pools. Currently those pools are 10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16 and fc00::/7, i.e. the network ranges for private networks. They are compiled in, but should be configurable eventually. This allows applying the same configuration to a large number of interfaces with each time a different IP range block, and management of these IP ranges is fully automatic. When allocating an address range from the pool it is made sure the range is not used otherwise.
2014-06-17networkd: link - fix carrier check on new linkTom Gundersen
We were comparing against our own internal enum rather than the kernel exposed one. Found by Thomas Ritter.
2014-06-16networkd: introduce vxlanSusant Sahani
This patch enables netwokd to create vxlan Changes: Added: 1. File networkd networkd-vxlan.c 2. to netdev bool learning struct in_addr group uint64_t vxlanid; 3. VXLAN subsection and config parameters
2014-06-14networkd: link - flush all pending NEWLINK events before trying to matchTom Gundersen
We could still have an old interface name and/or mac address when libudev tells us that the device is initialized, as the up-to-date info could still be on its way from the kernel.
2014-06-14networkd: add assertTom Gundersen
It should not be possible to have a DHCP lease on a link without also having an associated network. Add assert() to avoid compiler warnings. Reported by Thomas H. P. Andersen
2014-06-13networkd: link - check returned value from set_lease_poolThomas Hindoe Paaboel Andersen
2014-06-13networkd: link - left-align debug messagesTom Gundersen
Still add some whitespace betwen ifname and the message to get the messages aligned (as I find it easier to spot specific messages this way).
2014-06-13networkd: add dhcp server supportTom Gundersen
When enabled in [Network] it will set up a dhcp server on the interface, listening on one of its statically configured IPv4 addresses and with a fixed size pool of leases determined from it. Example: [Match] Name=ve-arch-tree [Network] Address=192.168.12.5/24 DHCPServer=yes [Route] Gateway=192.168.12.5 Destination=192.168.12.0/24 In this case we will configure ve-arch-tree with the address 192.168.12.5 and hand out addresses in the range 192.168.12.6 - 192.168.12.38. In the future, we should (as suggested by Lennart) introduce a syntax to pick the server address automatically.
2014-06-04networkd: link - intialize mac addressTom Gundersen
Otherwise .netwrok matching on MAC address will not work. Based on patch by Dave Reisner, and bug originally reported by Max Pray.
2014-06-03networkd: split runtime config dir from state dirTom Gundersen
Configuration will be in root:root /run/systemd/network and state will be in systemd-network:systemd-network /run/systemd/netif This matches what we do for logind's seat/session state.
2014-05-21networkd: link - serialize link when addresses changeTom Gundersen
Thanks to Kay for tracking this down.
2014-05-19networkd/sd-network: extend operational statesTom Gundersen
Expose states 'degraded' or 'routable' if a link has a site/link-local or a routable address, respectively.
2014-05-19networkd/sd-network: expose statically configured NTP serversTom Gundersen
2014-05-19networkd: fixup static DNS serializationTom Gundersen
2014-05-19resolved: add daemon to manage resolv.confTom Gundersen
Also remove the equivalent functionality from networkd.
2014-05-19networkd: link - serialize DNS informationTom Gundersen
2014-05-17networkd: log - only log about udev initalization on debug levelTom Gundersen
2014-05-17networkd: keep list of active addressesTom Gundersen