1
0
mirror of https://github.com/systemd/systemd.git synced 2024-12-22 17:35:35 +03:00

network: radv - Allow to send hop limit

This commit is contained in:
Susant Sahani 2023-08-22 17:16:56 +05:30 committed by Yu Watanabe
parent 244f518f1d
commit b26c345279
4 changed files with 14 additions and 0 deletions

View 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

View 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)

View 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;

View 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)