Yu Watanabe
2075e596cf
network: convert router lifetime from usec_t to uint16_t
2020-11-10 00:04:52 +09:00
Yu Watanabe
db9ecf0501
license: LGPL-2.1+ -> LGPL-2.1-or-later
2020-11-09 13:23:58 +09:00
Timo Rothenpieler
b8162cd200
network: store full hardware address in Link struct
...
This passes the legacy ethernet address to functions in a lot of places,
which all will need migrated to handle arbitrary size hardware addresses
eventually.
2020-10-28 14:44:43 +01:00
Yu Watanabe
9c914c0401
Merge pull request #17357 from yuwata/network-dhcp6-pd-announce-17353
...
network: add an option to control announcement of delegated prefix
2020-10-23 12:57:58 +09:00
Yu Watanabe
27ff0490e6
network: rename IPv6PrefixDelegation= to IPv6SendRA=
2020-10-19 14:55:18 +09:00
Yu Watanabe
e502f94dcf
network: introduce DHCPv6PrefixDelegation= setting
...
Then, the link can configure prefix delegated by DHCPv6 without emitting
RA.
2020-10-19 10:09:38 +09:00
Yu Watanabe
8a08bbfc98
network: drop static prefixes and static route prefixes earlier if IPv6PrefixDelegation=no or dhcpv6
2020-10-19 10:09:38 +09:00
Yu Watanabe
69e0f833a3
network: introduce network_adjust_radv()
2020-10-19 10:09:38 +09:00
Yu Watanabe
a3c1a94947
network: clear DNS and domains for RA when an empty string is assigned
2020-10-19 10:09:38 +09:00
Yu Watanabe
5e2767720a
network: use string_hash_ops_free for search domains
2020-10-19 10:09:38 +09:00
Yu Watanabe
a391901eb2
network: drop unnecessary conditions
...
sd_ipv4acd_stop() and sd_ipv4ll_stop() are idempotent.
2020-10-15 07:40:13 +09:00
Yu Watanabe
13ffa39f8e
network: rename network_verify_xxx() -> network_drop_invalid_xxx()
...
As 'verify' implies a boolean result.
2020-10-07 03:22:03 +09:00
Yu Watanabe
4cf8500067
network: use sd_event stored in Manager
2020-10-07 02:50:51 +09:00
Yu Watanabe
be9363ccab
network: introduce radv_update_mac()
2020-10-07 02:50:51 +09:00
Yu Watanabe
086b8853d1
network: move link_radv_enabled()
2020-10-07 02:50:50 +09:00
Yu Watanabe
be023c670b
network: make network_get_ipv6_dns() always set return value on success
2020-10-07 02:44:42 +09:00
Yu Watanabe
a8d4a21091
network: fix indentation
2020-10-07 02:44:42 +09:00
Yu Watanabe
b5ce40472c
network: cleanup networkd-radv.h
2020-10-07 02:44:42 +09:00
Yu Watanabe
1a7deb2fcf
network: introduce network_verify_prefix() and network_verify_route_prefix()
2020-10-07 02:44:42 +09:00
Yu Watanabe
ecb0e85ea9
network: drop redundant list of prefixes and route prefixes
2020-10-07 02:44:42 +09:00
Yu Watanabe
064dfb05f0
network: make prefix_free() and route_prefix_free() return NULL
2020-10-07 02:44:42 +09:00
Yu Watanabe
85b6a8110d
network: do not add prefix to RA if radv is not configured
...
Fixes #17017 .
2020-09-11 19:28:46 +02:00
Yu Watanabe
99e015e28c
network: rename settings about DHCPv6 Prefix Delegation
...
Closes #16602 .
2020-07-29 05:50:08 +09:00
Yu Watanabe
61c0ef4ff3
network: make RADVPrefixDelegation enum bitfield
...
This should not change any behavior.
2020-07-29 05:09:42 +09:00
Yu Watanabe
1633c45731
network: dhcp6: drop addresses and delegated prefixes on client stop
...
Previously, we did not drop addresses and delegated prefixes when
DHCP6 client is stopped.
Fixes #15455 .
Fixes #13564 .
2020-07-29 02:05:05 +09:00
Yu Watanabe
e77bd3fdff
network: support port number and SNI in [Network] DNS=
2020-07-21 04:08:22 +09:00
Yu Watanabe
c97785168b
network: radv: clean up conf parsers
2020-07-17 01:16:38 +09:00
Yu Watanabe
d96edb2c6e
network: downgrade log level in conf parsers
2020-07-17 00:40:09 +09:00
Yu Watanabe
1d596fdec2
network: do not restart radv engine when adding prefix
...
Replaces d469cea3bd
.
2020-07-07 11:20:35 +09:00
Andreas Rammhold
02e9e34bd9
networkd: Add support for setting a preferred subnet id for IPv6 PD leases
...
This allows users to configure a subnet id that should be used instead
of automatically (sequentially) assigned subnets. The previous attempt
had the downside that the subnet id would not be the same between
networkd restarts. In some setups it is desirable to have predictable
subnet ids across restarts of services and systems.
The code for the assignment had to be broken up into two pieces. One of
them is the old (sequential) assignment of prefixes and the other is the
new assignment based on configured subnet ids. The new assignment code
has to be executed first and has to be taken into account when (later
on) allocating the "old" subnets from the same pool.
Instead of having one iteration through the links we are now trying to
allocate a prefix for every link on every delegated prefix, unless they
received an assignment in a previous iteration.
2020-05-26 12:41:22 +02:00
Susant Sahani
bd6379ec57
network: introduce IPv6 prefix assign
...
Expose a boolean flag to automatically add an address from the delegated prefix to the interface
2020-03-01 00:49:19 +09:00
Yu Watanabe
fd3ef936ed
network,radv: make DNS= in [IPv6PrefixDelegation] section take special value 'linklocal'
...
Closes #13639 .
2020-02-04 13:56:30 +09:00
Yu Watanabe
95081e08d7
network: split struct Prefix into Prefix and RoutePrefix
2019-11-05 22:31:20 +09:00
Yu Watanabe
471e126b25
network: fix memleak in route_prefix_free()
2019-11-05 10:48:15 +09:00
Yu Watanabe
095b3a7d90
network: fix typo
2019-11-05 10:43:43 +09:00
Yu Watanabe
e7825b2359
network: fix invalid cleanup function
2019-11-05 10:39:15 +09:00
Susant Sahani
203d4df573
network: Add support to advertie ipv6 route
...
Implements https://tools.ietf.org/html/rfc4191
cat veth99.network
```
[Match]
Name=veth99
[Network]
DHCP=no
IPv6PrefixDelegation=yes
Address=2001:db8:0:1::1/64
[IPv6Prefix]
Prefix=2001:db8:0:1::4/64
[IPv6RoutePrefix]
Route=2001:db0:fff::/48
```
Wireshark
```
Frame 481: 142 bytes on wire (1136 bits), 142 bytes captured (1136 bits) on interface 0
Ethernet II, Src: 1e:04:f8:b8:2f:d4 (1e:04:f8:b8:2f:d4), Dst: IPv6mcast_01 (33:33:00:00:00:01)
Internet Protocol Version 6, Src: fe80::1c04:f8ff:feb8:2fd4, Dst: ff02::1
Internet Control Message Protocol v6
Type: Router Advertisement (134)
Code: 0
Checksum: 0xec77 [correct]
[Checksum Status: Good]
Cur hop limit: 0
Flags: 0x00, Prf (Default Router Preference): Medium
Router lifetime (s): 0
Reachable time (ms): 0
Retrans timer (ms): 0
ICMPv6 Option (Source link-layer address : 1e:04:f8:b8:2f:d4)
Type: Source link-layer address (1)
Length: 1 (8 bytes)
Link-layer address: 1e:04:f8:b8:2f:d4 (1e:04:f8:b8:2f:d4)
ICMPv6 Option (MTU : 1500)
Type: MTU (5)
Length: 1 (8 bytes)
Reserved
MTU: 1500
ICMPv6 Option (Prefix information : 2001:db8:0:1::4/64)
Type: Prefix information (3)
Length: 4 (32 bytes)
Prefix Length: 64
Flag: 0xc0, On-link flag(L), Autonomous address-configuration flag(A)
Valid Lifetime: 2592000
Preferred Lifetime: 604800
Reserved
Prefix: 2001:db8:0:1::4
ICMPv6 Option (Route Information : Medium 2001:db0:fff::/48)
Type: Route Information (24)
Length: 3 (24 bytes)
Prefix Length: 48
Flag: 0x00, Route Preference: Medium
...0 0... = Route Preference: Medium (0)
000. .000 = Reserved: 0
Route Lifetime: 604800
Prefix: 2001:db0:fff::
```
2019-09-17 12:09:59 +02:00
Yu Watanabe
ca5ad760a5
network: move conf parsers and function prototypes
2019-06-30 04:45:56 +09:00
Frantisek Sumsal
4e361acc06
tree-wide: replace explicit NULL checks with their shorter variants
...
Done by coccinelle/equals-null.cocci
2019-04-28 14:28:49 +02:00
Yu Watanabe
fcbf4cb727
network: drop sections contain invalid settings in network_verify()
...
If e.g., an [Address] section has an invalid setting, then
previously assigned settings in the section is freed, and
only later settings are stored. That may cause partially broken
section stored in Network object.
This makes if an invalid setting is found, then set 'invalid' flag
instead of freeing it. And invalid sections are dropped later by
network_verify().
2019-03-13 11:59:18 +09:00
Yu Watanabe
9560e5b323
network: make all xxx_new_static() static
...
These functions are called from only config parsers, and the parsers are
in the same files. So, let's make them static.
2019-03-13 11:59:18 +09:00
Zbigniew Jędrzejewski-Szmek
5e2a51d588
networkd: use OrderedSets instead of strvs to store lists of domains
...
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.
2019-02-21 12:04:27 +01:00
Lennart Poettering
59ea6e57a5
networkd: refuse IPv6 RADV prefixes that lack Prefix= setting
...
Fixes : #9589
2018-11-30 22:19:28 +01:00
Yu Watanabe
3e5700428e
network: allocate hashmap objects when they are required
2018-11-12 16:32:11 +09:00
Yu Watanabe
0f7f27694e
network: fixes related to NetworkConfigSection
...
- Do not allocate NetworkConfigSection when filename == NULL
- set .network element before calling hashmap_put()
- Always free NetworkConfigSection in each object.
2018-11-12 16:32:11 +09:00
Yu Watanabe
ecee0abe77
network: fix memleak in static prefix
...
The fix by 744faf5e4e
is not perfect,
as the section leaks if `hashmap_put()` in `prefix_new_static()` fails.
2018-11-04 00:31:46 +09:00
Yu Watanabe
6b1dec6696
network: introduce radv_prefix_delegation_{from,to}_string()
2018-11-04 00:31:46 +09:00
Yu Watanabe
744faf5e4e
network: fix memleak in static prefix
...
Fixes #10608 .
2018-11-01 21:46:38 +09:00
Yu Watanabe
51517f9e09
network: replace udev_device by sd_device
2018-08-23 04:57:39 +09:00
Lennart Poettering
810adae9e9
tree-wide: use proper unicode © instead of (C) where we can
...
Let's use a proper unicode copyright symbol where we can, it's prettier.
This important patch is very important.
2018-06-14 10:20:20 +02:00