summaryrefslogtreecommitdiffstats
path: root/src/network
diff options
context:
space:
mode:
authorSusant Sahani <ssahani@gmail.com>2023-08-22 13:46:56 +0200
committerYu Watanabe <watanabe.yu+github@gmail.com>2023-08-23 07:06:14 +0200
commitb26c345279b6232afe6bc5cf9eb9d1b8514ceba0 (patch)
tree376d4f6fde75af3cb6dc08da3d57cd0814113988 /src/network
parentMerge pull request #28764 from yuwata/core-namespace (diff)
downloadsystemd-b26c345279b6232afe6bc5cf9eb9d1b8514ceba0.tar.xz
systemd-b26c345279b6232afe6bc5cf9eb9d1b8514ceba0.zip
network: radv - Allow to send hop limit
Diffstat (limited to 'src/network')
-rw-r--r--src/network/networkd-network-gperf.gperf1
-rw-r--r--src/network/networkd-network.h1
-rw-r--r--src/network/networkd-radv.c4
3 files changed, 6 insertions, 0 deletions
diff --git a/src/network/networkd-network-gperf.gperf b/src/network/networkd-network-gperf.gperf
index a364abf2b4..40e78c91b3 100644
--- a/src/network/networkd-network-gperf.gperf
+++ b/src/network/networkd-network-gperf.gperf
@@ -372,6 +372,7 @@ IPv6SendRA.RetransmitSec, config_parse_router_retransmit,
IPv6SendRA.Managed, config_parse_bool, 0, offsetof(Network, router_managed)
IPv6SendRA.OtherInformation, config_parse_bool, 0, offsetof(Network, router_other_information)
IPv6SendRA.RouterPreference, config_parse_router_preference, 0, 0
+IPv6SendRA.HopLimit, config_parse_uint8, 0, offsetof(Network, router_hop_limit)
IPv6SendRA.EmitDNS, config_parse_bool, 0, offsetof(Network, router_emit_dns)
IPv6SendRA.DNS, config_parse_radv_dns, 0, 0
IPv6SendRA.EmitDomains, config_parse_bool, 0, offsetof(Network, router_emit_domains)
diff --git a/src/network/networkd-network.h b/src/network/networkd-network.h
index 75f1be442a..cb8626f008 100644
--- a/src/network/networkd-network.h
+++ b/src/network/networkd-network.h
@@ -228,6 +228,7 @@ struct Network {
usec_t router_lifetime_usec;
uint8_t router_preference;
usec_t router_retransmit_usec;
+ uint8_t router_hop_limit;
bool router_managed;
bool router_other_information;
bool router_emit_dns;
diff --git a/src/network/networkd-radv.c b/src/network/networkd-radv.c
index e6ef3974f2..1bf6fc99d9 100644
--- a/src/network/networkd-radv.c
+++ b/src/network/networkd-radv.c
@@ -480,6 +480,10 @@ static int radv_configure(Link *link) {
if (r < 0)
return r;
+ r = sd_radv_set_hop_limit(link->radv, link->network->router_hop_limit);
+ if (r < 0)
+ return r;
+
if (link->network->router_lifetime_usec > 0) {
r = sd_radv_set_preference(link->radv, link->network->router_preference);
if (r < 0)