summaryrefslogtreecommitdiff
path: root/src/network
AgeCommit message (Collapse)Author
2015-10-25util-lib: split out fd-related operations into fd-util.[ch]Lennart Poettering
There are more than enough to deserve their own .c file, hence move them over.
2015-10-24sd-*.h: clean up exported (or to-be-exported) header filesLennart Poettering
Exported header files should not include internal headers. Fix that. Exported header files should not use the bool type. So far we opted to stick to C89 for exported headers, and hence use "int" for bools in them. Continue to do so. Exported header files should have #include lines for everything they use including inttypes.h and sys/types.h, so that they may be included in any order. Exported header files should have C++ guards, hence add them. Exported header files should not use gcc extensions like #pragma once, get rid of it.
2015-10-24util-lib: split our string related calls from util.[ch] into its own file ↵Lennart Poettering
string-util.[ch] There are more than enough calls doing string manipulations to deserve its own files, hence do something about it. This patch also sorts the #include blocks of all files that needed to be updated, according to the sorting suggestions from CODING_STYLE. Since pretty much every file needs our string manipulation functions this effectively means that most files have sorted #include blocks now. Also touches a few unrelated include files.
2015-10-22sd-ndisc: don't inform the caller of expired prefixesTom Gundersen
The caller should push any lifetime information into the kernel and let the kernel handle prefix expiration.
2015-10-22networkd: dhcp6 - do not handle prefix expirationTom Gundersen
This ressurects 47d45d3cde45d6545367570264e4e3636bc9e345. We now always use /128 prefixes, so there is no need for the DHCPv6 code to know about prefixes expiring.
2015-10-22networkd: dhcp6 - DHCPv6 addresses should always be /128Tom Gundersen
The routing information should be configured separately by ND, there is no need to indicate the prefix again in the DHCPv6 addresses. See discussion and related links at issue #1520.
2015-10-22networkd: ndisc - split out from dhcp6 codeTom Gundersen
2015-10-22networkd: ndisc - make logging messages uniformTom Gundersen
Refer to Router Discovery rather than ICMPv6.
2015-10-22networkd: rename icmp6 to ndiscTom Gundersen
2015-10-22sd-ndisc: rename API from sd-icmp6-ndTom Gundersen
2015-10-22sd-icmp6-nd: rename files to sd-ndiscTom Gundersen
The actual code rename will follow. The reason for the change of name is to make it simpler and more uniform with how we name other libraries (we don't include the underlying protocol). The new name also matches the naming in the kernel (which is particularly relevent here as we expect to let the kernel do some parts of the protocol and we do others).
2015-10-22networkd-manager: fix swapped argumentsreverendhomer
fixes Coverity #1328493
2015-10-21networkd: manager/link - only serialize once per event-loop iterationTom Gundersen
Every time the state is written out we may trigger third-party apps, so let's be a bit more careful about writing this out unnecessarily.
2015-10-21networkd: link - serialize addressesTom Gundersen
2015-10-21networkd: route - add hash_opsTom Gundersen
2015-10-21networkd: route - simplify route_new()Tom Gundersen
2015-10-21networkd: address - distinguish between addresses added by us and by othersTom Gundersen
We only keep the addresses that we added ourselves in link->addresses, and introduce a new set link->addresses_foreign to keep addresses of unknown origin. Only functional change is that "foreign" addresses no longer prevent a link from entering "configured" state.
2015-10-21networkd: address - rework firewall rules lifetimeTom Gundersen
Establish the firewall rule before creating the address, and do not create the address if the firewall rule could not be created. Also, only drop the firewall rule once the address has been removed from the kernel.
2015-10-21networkd: address - merge _change() into _configure()Tom Gundersen
These functions are almost entirely the same, so avoid duplication.
2015-10-21networkd: address - factor out address_update()Tom Gundersen
Call back into link_check_ready() whenever an address state change may have made a link ready.
2015-10-21networkd: link - only consider configured when all addresses are readyTom Gundersen
We were considering a link configured whilst its IPv6 addresses were still tentative. Fixes issue #650.
2015-10-16networkd: add support for configure IPv6 DADSusant Sahani
Configures Ipv6 Duplicate Address Detection. 10
2015-10-14Merge pull request #1530 from teg/network-fixes-2Lennart Poettering
networkd/libsystemd-network: collection of trivial patches v2
2015-10-12man: describe IPv6AcceptRouterAdvertisements= betterZbigniew Jędrzejewski-Szmek
With the previous description it wasn't clear that the kernel default is being described. Add link to kernel docs.
2015-10-11networkd: address - introduce address_is_ready()Tom Gundersen
Checks that a given address is not tentative nor deprecated.
2015-10-11networkd: make address_{establish,release}() staticTom Gundersen
No need to expose these functions, but rather call them from address_{add,drop}.
2015-10-11networkd: manager - avoid unnecessary memory allocationTom Gundersen
Don't allocate Address objects only to free them again when processing rtnl events.
2015-10-11networkd: address - store active addresses in a Set rather than a ListTom Gundersen
We need to be able to look these things up quickly as we will be updating them continuously and there can in principle be many of them.
2015-10-11networkd: address - process in manager.c rather than link.cTom Gundersen
2015-10-11networkd: link - refactor (un)refTom Gundersen
2015-10-11networkd: link - fix error handling in link_add()Tom Gundersen
2015-10-11networkd: link/network - correctly align log messagesTom Gundersen
2015-10-11networkd: address - add hash helpers for Address objectsTom Gundersen
Add compare_func and hash_func for the Address object. The notion of address equality is the same as in the kernel, and hashing preserves preserves equality. Two addresses are considered equal if: - they have the same address family, and - they are neither IPv4 nor IPv6 addresses, or - the local addresses are identical, and - they are IPv6 addresses, or - they have the same prefixlength, and - their peer prefixes are identical This fixes a bug in the old equality check, which got the local address and the peer prefix mixed up.
2015-10-11networkd: manager - free bus after own objectsTom Gundersen
Freeing links/addresses may trigger sending signals over the bus, so let's make sure the bus stays around until our own objects have been freed.
2015-10-11networkd: route/address - simplify and unify creatorsTom Gundersen
Rename new_dynamic() to simply _new() and reuse that from new_static().
2015-10-08networkd-link: remove unused variable assignment in link_save()reverendhomer
fixes Coverity #1317207
2015-10-05Merge pull request #1459 from ssahani/bridge1Tom Gundersen
networkd: add bridge properties
2015-10-05Merge pull request #1372 from jemk/prefsrcTom Gundersen
networkd: add support to configure preferred source of static routes
2015-10-05networkd: add bridge propertiesSusant Sahani
ForwardDelaySec: forward delay HelloTimeSec: hello time MaxAgeSec: maximum message age for more information see http://www.tldp.org/HOWTO/BRIDGE-STP-HOWTO/set-up-the-bridge.html In kernel br_dev_newlink: does not have the this functionality to set while creation. br_changelink: after creation we can change the parameters. we need to first create then set it the parameters. Introduce new callback post_create .This should set the properties after the creation.
2015-09-30tree-wide: remove a number of invocations of strerror() and replace by %mLennart Poettering
Let's clean up our tree a bit, and reduce invocations of the thread-unsafe strerror() by replacing it with printf()'s %m specifier.
2015-09-30tree-wide: clean up log_syntax() usageLennart Poettering
- Rely everywhere that we use abs() on the error code passed in anyway, thus don't need to explicitly negate what we pass in - Never attach synthetic error number information to log messages. Only log about errors we *receive* with the error number we got there, don't log any synthetic error, that don#t even propagate, but just eat up. - Be more careful with attaching exactly the error we get, instead of errno or unrelated errors randomly. - Fix one occasion where the error number and line number got swapped. - Make sure we never tape over OOM issues, or inability to resolve specifiers
2015-09-29util: introduce common version() implementation and use it everywhereLennart Poettering
This also allows us to drop build.h from a ton of files, hence do so. Since we touched the #includes of those files, let's order them properly according to CODING_STYLE.
2015-09-24networkd: Be opportunistic when declaring link configuredPatrik Flykt
The DHCP variable in the [Network] section of the network configuration file moves the link to the configured state according to the following: DHCP=yes Link is configured when either DHCPv4 or DHCPv6 succeed DHCP=ipv4 Link is configured only when DHCPv4 succeeds DHCP=ipv6 Link is configured only when DHCPv6 succeeds DHCP=no Neither DHCPv4 or DHCPv6 is attempted Reported by Martin Pitt. Fixes https://github.com/systemd/systemd/issues/1368
2015-09-24networkd: add support to configure preferred source of static routesJens Kuske
2015-09-24Merge pull request #1356 from pfl/dhcp6_suspendTom Gundersen
DHCPv6 suspend fixes
2015-09-23networkd: Wait for DHCPv6 before announcing link configuredPatrik Flykt
Wait until DHCPv6 has acquired an address before announcing the link to be configured. Log the DHCPv6 lease lost event.
2015-09-23sd-dhcp6-client: Properly handle DHCPv6 client restart after resumePatrik Flykt
Whenever a Router Advertisement is received, dhcp6_configure() will be called. A Router Advertisment can also instruct DHCPv6 to start acquiring IPv6 addresses in manged mode, if it previously was handling only other information. As an Router Advertisment is also received after the DHCPv6 client has resumed from a suspend, fix the function not to assume DHCPv6 is currently running, but instead try to restart it. Handle sd_dhcp6_start() returning -EALREADY indicating that the DHCPv6 client was already running. Collect all client unrefs in one place to unclutter the error handling. Fixes https://github.com/systemd/systemd/issues/963
2015-09-23Set accept_ra to "2" if enabled in configGeorg Müller
This causes the kernel to accept router advertisments even if ip forwarding is enabled for this interface. This fixes #1340.
2015-09-22Merge pull request #1335 from poettering/some-fixesDaniel Mack
A variety of mostly unrelated fixes
2015-09-22cgtop: underline table headerLennart Poettering
Let's underline the header line of the table shown by cgtop, how it is customary for tables. In order to do this, let's introduce new ANSI underline macros, and clean up the existing ones as side effect.