summaryrefslogtreecommitdiffstats
path: root/src/network/networkd-manager.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
* network: move prototypes related to network Network bus objects to ↵Yu Watanabe2019-06-291-0/+1
| | | | networkd-network-bus.h
* network: move DHCP6 related code from networkd-manager.c to networkd-dhcp6.cYu Watanabe2019-06-291-121/+1
|
* network: move conf parsers and function prototypesYu Watanabe2019-06-291-0/+1
|
* network: further log message updateYu Watanabe2019-06-251-49/+49
| | | | Follow-up for 44e891bbf6908e494856fcf3011e88a70a12e087.
* networkd: rework warning and debug messages about address addition and removalZbigniew Jędrzejewski-Szmek2019-06-241-34/+34
| | | | | | | | | | | | | | Those messages were quite confusing. In particular "adding address" suggests that we are assiging a new address to an interface, but in fact we're just reacting to a notification about an addition. So let's call that "remembering" and "forgetting". It's not fully gramatically correct, but I think it's much clearer than "adding"/"removing" in this context. And "received address without address" is too cryptic, let's say "address message" to distinguish the message from its content. Also, make failure to format address non-fatal, and print more details in various places.
* Merge pull request #12762 from ↵Lennart Poettering2019-06-201-4/+43
|\ | | | | | | | | yuwata/network-introduce-carrier-and-network-state-12752 network: introduce carrier and address state to fix network_is_online()
| * sd-network: introduce functions for new link and manager statesYu Watanabe2019-06-161-2/+11
| |
| * network: also introduce two new manager statesYu Watanabe2019-06-161-2/+31
| |
| * network: split out DBus related prototypes to networkd-link-bus.hYu Watanabe2019-06-161-0/+1
| |
* | network: add missing entries in routing_policy_rule_{hash,compare}_func()Yu Watanabe2019-06-191-26/+54
|/ | | | | This also makes routing_policy_rule_get() or friends take a RoutingPolicyRule object as an input.
* network: read link specific sysctl valueYu Watanabe2019-06-151-17/+0
| | | | | This introduce link_sysctl_ipv6_enabled() and replaces manager_sysctl_ipv6_enabled() with it.
* network: add KeepConfiguration=dhcp-on-stopYu Watanabe2019-06-061-1/+1
| | | | | The option prevents to drop lease address on stop. By setting this, we can safely restart networkd.
* network: monitor link bit ratesYu Watanabe2019-06-011-1/+12
|
* network: use in6_addr_hash_opsYu Watanabe2019-05-181-13/+1
|
* network: include glibc headers before including kernel headersYu Watanabe2019-05-091-1/+2
|
* network: replace inet_ntop() with in_addr_to_string()Yu Watanabe2019-05-091-14/+11
|
* network: use IN_ADDR_NULL and ETHER_ADDR_NULLYu Watanabe2019-05-071-3/+3
| | | | | The change in manager_rtnl_process_address() may not be necessary, but for safety, let's initialize the value.
* network: fix use-after-freeYu Watanabe2019-05-071-13/+29
| | | | | | | The function sd_radv_add_prefix() in dhcp6_pd_prefix_assign() may return -EEXIST, and in that case the sd_radv_prefix object allocated in dhcp6_pd_prefix_assign() will be freed when the function returns. Hence, the key value in Manager::dhcp6_prefixes hashmap is lost.
* network: drop list fields in Network objectYu Watanabe2019-05-071-3/+1
|
* networkd: manager do not unef netlink and gennetlink earlySusant Sahani2019-05-071-8/+5
| | | | | | | | | | | | | | Because of this the fd is getting closed and we getting errors like ``` ^Ceno1: Could not send rtnetlink message: Bad file descriptor enp7s0f0: Could not send rtnetlink message: Bad file descriptor enp7s0f0: Cannot delete unreachable route for DHCPv6 delegated subnet 2a0a:...:fc::/62: Bad file descriptor Assertion '*_head == _item' failed at ../systemd/src/network/networkd-route.c:126, function route_free(). Aborting. Aborted ``` Closes one of https://github.com/systemd/systemd/issues/12452
* network: introduce reference counter for Network objectYu Watanabe2019-05-071-1/+1
|
* networkd: stop clients when networkd shuts down (#12463)Susant Sahani2019-05-061-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We not stopping the clients when networkd stops. They should shut down cleanly and then we need to clean the DS. One of requirements to implement https://github.com/systemd/systemd/issues/10820. ``` ^CBus bus-api-network: changing state RUNNING → CLOSED DHCP SERVER: UNREF DHCP SERVER: STOPPED DHCP CLIENT (0x60943df0): STOPPED veth-test: DHCP lease lost veth-test: Removing address 192.168.5.31 NDISC: Stopping IPv6 Router Solicitation client DHCP CLIENT (0x0): FREE ==24308== ==24308== HEAP SUMMARY: ==24308== in use at exit: 8,192 bytes in 2 blocks ==24308== total heap usage: 4,230 allocs, 4,228 frees, 1,209,732 bytes allocated ==24308== ==24308== LEAK SUMMARY: ==24308== definitely lost: 0 bytes in 0 blocks ==24308== indirectly lost: 0 bytes in 0 blocks ==24308== possibly lost: 0 bytes in 0 blocks ==24308== still reachable: 8,192 bytes in 2 blocks ==24308== suppressed: 0 bytes in 0 blocks ==24308== Rerun with --leak-check=full to see details of leaked memory ==24308== ==24308== For lists of detected and suppressed errors, rerun with: -s ==24308== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0) ==24308== could not unlink /tmp/vgdb-pipe-from-vgdb-to-24308-by-sus-on-Zeus ==24308== could not unlink /tmp/vgdb-pipe-to-vgdb-from-24308-by-sus-on-Zeus ==24308== could not unlink /tmp/vgdb-pipe-shared-mem-vgdb-24308-by-sus-on-Zeus ```
* network: fix ref/unref logic for Link objectYu Watanabe2019-04-251-4/+3
| | | | | | | | | - bridge or bonding master takes a reference of slave links. - drop link from bridge or bonding master's slave list when slave link is removed. - change type of Link::slaves to Set*, Fixes #12315.
* Make fopen_temporary and fopen_temporary_label unlockedZbigniew Jędrzejewski-Szmek2019-04-121-2/+0
| | | | | | | | This is partially a refactoring, but also makes many more places use unlocked operations implicitly, i.e. all users of fopen_temporary(). AFAICT, the uses are always for short-lived files which are not shared externally, and are just used within the same context. Locking is not necessary.
* headers: remove unneeded includes from util.hZbigniew Jędrzejewski-Szmek2019-03-271-0/+1
| | | | | This means we need to include many more headers in various files that simply included util.h before, but it seems cleaner to do it this way.
* network: use device_get_action()Yu Watanabe2019-03-111-6/+8
|
* network: do not configure interfaces under renamingYu Watanabe2019-03-051-1/+12
|
* network: generate addresses from pool with larger prefixlenYu Watanabe2019-03-011-2/+2
|
* network: use fd00::/8 for ipv6 address poolYu Watanabe2019-03-011-1/+1
| | | | fc00::/8 may be used in the future. See rfc4193.
* network: fix invalid memory accessYu Watanabe2019-02-251-3/+3
| | | | This fixes a bug introduced by 959f65d32ec15cf84afe3efff1a18b0987b56c60.
* Merge pull request #11776 from keszybz/networkd-ordered-setsLennart Poettering2019-02-211-22/+6
|\ | | | | Store domains lists in OrderedSets in networkd
| * networkd: use OrderedSets instead of strvs to store lists of domainsZbigniew Jędrzejewski-Szmek2019-02-211-2/+2
| | | | | | | | | | | | | | | | | | | | | | We were already using OrderedSets in the manager object, but strvs in the configuration parsing code. Using sets gives us better scaling when many domains are used. In oss-fuzz #13059 the attached reproducer takes approximately 30.5 s to be parsed. Converting to sets makes this go down to 10s. This is not _vastly_ faster, but using sets seems like a nicer approach anyway. In particular, we avoid the quadratic de-unification operation after each addition.
| * basic/ordered-set: export networkd function to print string setsZbigniew Jędrzejewski-Szmek2019-02-211-20/+4
| | | | | | | | Tests are added.
* | network: check whether ipv6 is enabled in sysctlYu Watanabe2019-02-211-0/+18
|/ | | | | | Currently, the value is read only once. Fixes #11711.
* Merge pull request #10408 from keszybz/analyze-cat-presetsLennart Poettering2019-02-181-11/+3
|\ | | | | systemd-analyze cat-presets
| * udev,network: use standard paths for .network and .link filesZbigniew Jędrzejewski-Szmek2019-02-181-11/+3
| | | | | | | | | | | | This centralizes the configuration to one header file. /usr/local/lib is now included in the search list, and documentation is updated accordingly.
* | dhcp: move filtering of bogus DNS/NTP addresses out of DHCP clientThomas Haller2019-02-181-4/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | The DHCP client should not pre-filter addresses beyond what RFC requires. If a client's user (like networkd) wishes to skip/filter certain addresses, it's their responsibility. The point of this is that the DHCP library does not hide/abstract information that might be relevant for certain users. For example, NetworkManager exposes DHCP options in its API. When doing that, the options should be close to the actual lease. This is related to commit d9ec2e632df4905201facf76d6a205edc952116a (dhcp4: filter bogus DNS/NTP server addresses silently).
* | network: add more debugging logs when adding, removing, updateing and ↵Yu Watanabe2019-02-151-0/+22
|/ | | | configuring route
* tree-wide: make sure to flush/close all bus connections when our daemons exitLennart Poettering2019-01-171-1/+1
| | | | | | | Let's make sure everything is written out ebfore we exit, so that no messages keep our bus connections referenced. Fixes: #11462
* Merge pull request #10920 from yuwata/hashmap-destructorLennart Poettering2018-12-031-11/+4
|\ | | | | hashmap: make hashmap_free() call destructors of key or value
| * tree-wide: make hash_ops typesafeYu Watanabe2018-12-021-11/+4
| |
* | Merge pull request #10976 from yuwata/typesafe-netlink-callLennart Poettering2018-12-031-4/+2
|\ \ | | | | | | netlink: introduce typesafe netlink functions
| * | network: use typesafe netlink_call_async() macro where applicableYu Watanabe2018-12-021-4/+2
| |/
* / util-lib: split out all temporary file related calls into tmpfiles-util.cLennart Poettering2018-12-021-0/+1
|/ | | | | | | | This splits out a bunch of functions from fileio.c that have to do with temporary files. Simply to make the header files a bit shorter, and to group things more nicely. No code changes, just some rearranging of source files.
* networkd: add support to configure ip rule port range and protocol.Susant Sahani2018-11-281-3/+22
| | | | | | | | | Please see: iprule: support for ip_proto, sport and dport match options https://git.kernel.org/pub/scm/network/iproute2/iproute2.git/commit/?id=f686f764682745daf6a93b0a6330ba42a961f858 Closes 10622
* network: use hashmap_steal_first() rather than hashmap_first()+hashmap_remove()Yu Watanabe2018-11-121-6/+2
|
* network: allocate hashmap objects when they are requiredYu Watanabe2018-11-121-35/+28
|
* network: do not assign unused valueYu Watanabe2018-11-121-5/+2
|
* sd-device: drop priority and description from ↵Yu Watanabe2018-11-101-2/+2
| | | | | | | sd_device_monitor_attach_event() and sd_device_monitor_start() Now we have sd_device_monitor_get_event_soruce(). So, it is not necessary to include these parameters in the functions for sd_device_monitor.
* Merge pull request #10633 from yuwata/sd-resolve-destroyLennart Poettering2018-11-061-10/+6
|\ | | | | Another solution to fix wireguard issues