]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
network: radv - Allow to send hop limit
authorSusant Sahani <ssahani@gmail.com>
Tue, 22 Aug 2023 11:46:56 +0000 (17:16 +0530)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Wed, 23 Aug 2023 05:06:14 +0000 (14:06 +0900)
man/systemd.network.xml
src/network/networkd-network-gperf.gperf
src/network/networkd-network.h
src/network/networkd-radv.c

index fcf37a19b82bd45e6fed5ba8ab74895cda1743a5..93830b5935b1f323b6a2fbf1458ef7486cdf3608 100644 (file)
@@ -3098,6 +3098,14 @@ Token=prefixstable:2002:da8:1::</programlisting></para>
         for details. Defaults to <literal>medium</literal>.</para></listitem>
       </varlistentry>
 
+      <varlistentry>
+        <term><varname>HopLimit=</varname></term>
+        <listitem>
+          <para>Configures hop limit. Takes an integer in the range 0…255. See also
+          <varname>IPv6HopLimit=</varname>.</para>
+        </listitem>
+      </varlistentry>
+
       <varlistentry>
         <term><varname>UplinkInterface=</varname></term>
         <listitem><para>Specifies the name or the index of the uplink interface, or one of the special
index a364abf2b4765bd9dd6757ce87105539478c0b85..40e78c91b3046fe0b05ab5fbf32bc8162c478903 100644 (file)
@@ -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)
index 75f1be442aa0a511d2cbb474d1167685c3baca83..cb8626f008e687601200fb4ed450ae4bfb359f60 100644 (file)
@@ -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;
index e6ef3974f288837993cd8722bd88541880d1f13a..1bf6fc99d97dd537ceeeacdc823d908507d06699 100644 (file)
@@ -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)