summaryrefslogtreecommitdiff
path: root/src/network/networkd-manager.c
Commit message (Collapse)AuthorAgeFilesLines
* network: also reload .netdev filesYu Watanabe2019-10-241-1/+1
|
* network: add Reload() dbus methodYu Watanabe2019-10-241-1/+1
|
* network: introduce ip nexthop routingSusant Sahani2019-10-141-0/+162
| | | | | | | | | | Used to manipulate entries in the kernel's nexthop tables. Example: ``` [NextHop] Id=3 Gateway=192.168.5.1 ```
* networkd: use SIGUSR2 to do a restartZbigniew Jędrzejewski-Szmek2019-10-021-2/+28
| | | | | | | The code supports SIGTERM and SIGINT to termiante the process. It would be possible to reporpose one of those signals for the restart operation, but I think it's better to use a completely different signal to avoid misunderstandings.
* network: DHCP server Add support to transmit SIP serverSusant Sahani2019-09-201-7/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 1. DHCP server trasmit 2. Client parses and saves in leases Implements http://www.rfc-editor.org/rfc/rfc3361.txt ``` Frame 134: 348 bytes on wire (2784 bits), 348 bytes captured (2784 bits) on interface 0 Ethernet II, Src: 42:65:85:d6:4e:32 (42:65:85:d6:4e:32), Dst: 1e:04:f8:b8:2f:d4 (1e:04:f8:b8:2f:d4) Internet Protocol Version 4, Src: 192.168.5.1, Dst: 192.168.5.11 User Datagram Protocol, Src Port: 67, Dst Port: 68 Dynamic Host Configuration Protocol (ACK) Message type: Boot Reply (2) Hardware type: Ethernet (0x01) Hardware address length: 6 Hops: 0 Transaction ID: 0x7cc87cb4 Seconds elapsed: 0 Bootp flags: 0x0000 (Unicast) Client IP address: 0.0.0.0 Your (client) IP address: 192.168.5.11 Next server IP address: 0.0.0.0 Relay agent IP address: 0.0.0.0 Client MAC address: 1e:04:f8:b8:2f:d4 (1e:04:f8:b8:2f:d4) Client hardware address padding: 00000000000000000000 Server host name not given Boot file name not given Magic cookie: DHCP Option: (53) DHCP Message Type (ACK) Length: 1 DHCP: ACK (5) Option: (51) IP Address Lease Time Length: 4 IP Address Lease Time: (3600s) 1 hour Option: (1) Subnet Mask (255.255.255.0) Length: 4 Subnet Mask: 255.255.255.0 Option: (3) Router Length: 4 Router: 192.168.5.1 Option: (6) Domain Name Server Length: 4 Domain Name Server: 192.168.5.1 Option: (42) Network Time Protocol Servers Length: 4 Network Time Protocol Server: 192.168.1.1 Option: (120) SIP Servers <=====here Length: 9 SIP Server Encoding: IPv4 Address (1) SIP Server Address: 192.168.1.1 SIP Server Address: 192.168.5.2 Option: (101) TCode Length: 13 TZ TCode: Europe/Berlin Option: (54) DHCP Server Identifier (192.168.5.1) Length: 4 DHCP Server Identifier: 192.168.5.1 Option: (255) End Option End: 255 ``` ``` cat /run/systemd/netif/state  ✔  ⚡  3148  16:40:51 OPER_STATE=routable CARRIER_STATE=carrier ADDRESS_STATE=routable DNS=192.168.94.2 192.168.5.1 NTP=192.168.5.1 SIP=192.168.1.1 192.168.5.2 ``` aa
* network: also take Route::initcwnd and ::initrwnd into hash funcYu Watanabe2019-09-171-0/+25
| | | | Fixes #13506.
* network: make route_get() or friends take Route objectYu Watanabe2019-09-171-42/+43
|
* network: add more debug messagesYu Watanabe2019-09-151-0/+10
|
* Merge pull request #13302 from yuwata/network-set-put-fixesLennart Poettering2019-08-141-0/+2
|\ | | | | network: fixes related to set_put()
| * network: add missing link_ref()Yu Watanabe2019-08-111-0/+2
| |
* | networkd: Keep track of static neighborsWilliam A. Kennington III2019-08-121-0/+221
|/ | | | | We need to keep track of the static neighbors that are configured on the interface so that we can delete stale entries that were removed.
* networkd: Routes should take the gateway into accountWilliam A. Kennington III2019-08-071-2/+2
| | | | | | | | | | | | | | Otherwise, changing the default gateway doesn't purge old gateway routes left on the system during daemon restart. This also fixes removing other foreign gateway routes that don't match the expected configuration. Tested: Changed gateway addresses prior to the patch and they lingered on the system during each reconfiguration. Applied this patch and reconfigured gateways and other routes multiple times and it removed the foreign routes that had gateways that didn't match. Signed-off-by: William A. Kennington III <william@wkennington.com>
* network: fix use after free()Yu Watanabe2019-07-171-1/+1
| | | | The hashmap will be accessed by client_stop().
* network: implement DBus methods to set DNS related propertiesYu Watanabe2019-07-171-3/+4
|
* network: move manager dbus prototypes to networkd-manager-bus.hYu Watanabe2019-07-171-0/+1
|
* network: also show route protocol in debugging logsYu Watanabe2019-07-121-2/+4
|
* network: show route scope, table, and type in debugging logsYu Watanabe2019-07-121-2/+6
|
* network: update log messageYu Watanabe2019-07-121-9/+9
| | | | | Follow-up for 7f474ed78df138677557fb43701efeb6e2588c6f and 44e891bbf6908e494856fcf3011e88a70a12e087.
* network: move prototypes related to network Network bus objects to ↵Yu Watanabe2019-06-301-0/+1
| | | | networkd-network-bus.h
* network: move DHCP6 related code from networkd-manager.c to networkd-dhcp6.cYu Watanabe2019-06-301-121/+1
|
* network: move conf parsers and function prototypesYu Watanabe2019-06-301-0/+1
|
* network: further log message updateYu Watanabe2019-06-261-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-121-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.