Susant Sahani
007cac09a2
network: route - add support to configure tcp advmss
2021-01-08 14:06:13 +00:00
Yu Watanabe
4055ec9323
network: merge manager_drop_routes() and manager_drop_foreign_routes()
2020-12-14 23:26:49 +09:00
Yu Watanabe
167a5561cd
network: introduce log_route_debug()
2020-12-14 23:26:45 +09:00
Yu Watanabe
ad6df71759
network: use netlink_message_read_in_addr_union() where applicable
2020-12-14 23:25:09 +09:00
Yu Watanabe
bd4733da64
network: do not configure static configs more than once simultaneously
2020-12-11 14:39:46 +09:00
Yu Watanabe
b2219cc4b6
network: drop assertions to check link state in netlink callback handlers
...
As, the link may be dropped while configuring addresses or routes.
Fixes #17920 .
2020-12-11 13:47:24 +09:00
Yu Watanabe
575f14eef0
network: make IPv6 routes with reject type managed by Manager
2020-12-04 11:23:23 +09:00
Yu Watanabe
6c252588df
network: introduce route_type_is_reject() helper
2020-12-04 11:23:23 +09:00
Yu Watanabe
dca63b5b46
Merge pull request #17474 from yuwata/network-drop-link-deserialization-logic
...
network: drop link deserialization logic
2020-11-27 09:08:01 +09:00
Yu Watanabe
db9ecf0501
license: LGPL-2.1+ -> LGPL-2.1-or-later
2020-11-09 13:23:58 +09:00
Yu Watanabe
6fdcef2174
network: do not serialize/deserialize routes
...
The same as the previous commit. These are not used.
2020-10-28 18:16:01 +09:00
Yu Watanabe
778c879533
network: use sysctl_read_ip_property() where applicable
2020-10-28 15:44:10 +09:00
Yu Watanabe
1132a714ec
network: drop routes managed by Manager when link is removed
...
Also, foreign routes managed by Manager are dropped in
link_drop_foreign_routes().
2020-10-23 23:07:12 +09:00
Yu Watanabe
5f4d7aa458
network: specify route type in route_remove()
...
This factors out the common netlink message handling in route_remote()
and route_configure() to route_set_netlink_message().
2020-10-23 23:07:12 +09:00
Yu Watanabe
bac319a795
network: link may be NULL
2020-10-23 23:07:12 +09:00
Yu Watanabe
0c54bfd698
network: call netlink in the last of route_configure()
...
Otherwise, assertion will be hit when route_add() fails.
2020-10-20 15:44:24 +09:00
Yu Watanabe
40075951dc
network: also compare and hash weight of the gateway
2020-10-20 15:32:55 +09:00
Yu Watanabe
cc17f75f66
network: copy multipath route element earlier
...
`route_get()` compares input with existing routes, however previously,
the input may did not have information about gateway. So, the
comparison result might be incorrect, and the foregoing set_put() might
return -EEXIST.
2020-10-20 15:32:55 +09:00
Yu Watanabe
8c212f76c2
network: make route_configure() return 0 on success
...
Previously, route_configure() always returns 1 on success, and never
returns 0. It is not necessary to return positive value.
2020-10-20 14:20:22 +09:00
Yu Watanabe
956dbf361b
network: warn if dynamic gateway is specified but corresponding protocol is disabled
2020-10-15 07:07:46 +09:00
Yu Watanabe
c27abcf4fb
network: when Gateway=_dhcp4, set several properties based on lease if they are not explicitly specified
...
Before this commit, event when Gateway=_dhcp4 or _ra is set, the
route was configured with 'protocol static', and other properties
specified by RouteTable=, RouteMTU=, or etc, were ignored.
This commit makes set the route protocol based on the protocol the
gateway address is obtained, and apply other settings if it is not
explicitly specified in the [Route] section.
2020-10-15 07:06:23 +09:00
Yu Watanabe
c3d679c43f
network: when Gateway=_dhcp, assume gateway family based on other settings
2020-10-15 07:05:58 +09:00
Yu Watanabe
b8caa4ef34
network: rename Gateway=_dhcp6 -> Gateway=_ipv6ra
2020-10-15 07:04:02 +09:00
Yu Watanabe
1a3a6309a7
network: rename gateway_from_dhcp -> gateway_from_dhcp_or_ra
...
As for IPv6 case gateway is given by RA.
2020-10-15 06:58:53 +09:00
Zbigniew Jędrzejewski-Szmek
081b300976
networkd: add assert to appease coverity
...
The code was OK, but not obviously so. Let's add an assert to help a
human or nonhuman reader figure it out.
Coverity CID#1433224.
2020-10-09 08:14:54 +02:00
Yu Watanabe
d442bb3728
network: make Gateway= in [Route] section accept an empty string
2020-10-08 02:51:23 +09:00
Yu Watanabe
d306d1d0ca
network: introduce Gateway=_dhcp4 and _dhcp6, and deprecate "_dhcp"
...
Fixes #17249 .
2020-10-08 02:51:23 +09:00
Yu Watanabe
f9bb333832
network: manage multipath routes separately
2020-10-08 02:51:23 +09:00
Yu Watanabe
d6ad41e27d
network: free Route object when route_remove() fails
...
When route_remove() succeeds, the Route object will be freed later by
manager_rtnl_process_route().
2020-10-08 02:51:23 +09:00
Yu Watanabe
423c249c2e
network: constify arguments
2020-10-08 02:51:23 +09:00
Yu Watanabe
6dd5398137
network: support IPv4 route with IPv6 gateway
2020-10-08 00:06:19 +09:00
Yu Watanabe
ad208fac73
network: also manage routes without RTA_OIF attribute
2020-10-07 15:22:10 +02:00
Yu Watanabe
fd7701bf31
network: ignore Scope= for IPv6 routes as it will not be used
2020-10-07 15:22:10 +02:00
Yu Watanabe
8973df5c42
network: set default priority for IPv6 routes
...
See inet6_rtm_newroute() in kernel's net/ipv6/route.c.
2020-10-07 15:22:09 +02: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
ac49887e8c
network: move link_get_xxx_route_table()
2020-10-07 02:50:50 +09:00
Yu Watanabe
9cd9fc8f44
network: drop list of static addresses
...
[Address] sections are managed by both LIST and Hashmap. Let's drop the
list and manage them by OrderedHashmap.
2020-10-07 02:50:50 +09:00
Yu Watanabe
e2263711ba
network: cleanup networkd-route.h
2020-10-07 02:44:43 +09:00
Yu Watanabe
2a54a0446b
network: drop list of static routes
...
[Route] sections are managed by both LIST and Hashmap. Let's drop the
list.
2020-10-07 02:44:43 +09:00
Yu Watanabe
74154c2e28
network: make several functions static
2020-10-07 02:44:43 +09:00
Yu Watanabe
d9940a3f8a
network: introduce network_verify_routes()
2020-10-07 02:44:42 +09:00
Yu Watanabe
565194127a
network: introduce link_serialize_routes()
2020-10-07 02:44:42 +09:00
Yu Watanabe
731ff05b32
network: introduce link_deserialize_routes()
2020-10-07 02:44:42 +09:00
Yu Watanabe
62f0ea5fae
network: introduce link_drop_routes()
2020-10-07 02:44:42 +09:00
Yu Watanabe
779804dd60
network: introduce link_drop_foreign_routes()
2020-10-07 02:44:42 +09:00
Yu Watanabe
169948e9d2
network: make route_free() return NULL
2020-10-07 02:44:42 +09:00
Yu Watanabe
4468f01b67
network: move manager_rtnl_process_route()
2020-10-07 02:44:42 +09:00
Yu Watanabe
141318f777
network: move link_request_set_routes()
2020-10-07 02:44:42 +09:00
Yu Watanabe
fef160b5ab
network: limit InitialCongestionWindow= and InitialAdvertisedReceiveWindow= value
...
Strivtly speaking, this breaks backward compatibility. But setting
too large value into them, then their networking easily breaks.
Note that typically 100 for them is event too large. So, ommiting the
values equal or higher than 1024, and dropping support of k, M, and G
suffixes is OK for normal appropriate use cases.
See discussion in #16643 .
2020-09-29 13:55:17 +09:00
Zbigniew Jędrzejewski-Szmek
90e74a66e6
tree-wide: define iterator inside of the macro
2020-09-08 12:14:05 +02:00