diff --git a/net/icmpv6/Kconfig b/net/icmpv6/Kconfig index 3b90476f33..13a8bbbb15 100644 --- a/net/icmpv6/Kconfig +++ b/net/icmpv6/Kconfig @@ -120,6 +120,14 @@ config NET_ICMPv6_ROUTER if NET_ICMPv6_ROUTER +config NET_ICMPv6_ROUTER_LIFETIME + int "Router Advertisement router lifetime in seconds" + default 1800 + ---help--- + Set the router lifetime for advertising as a default router. + Set to 0 to only advertise autoconfiguration prefix without + advertising as a router. + config NET_ICMPv6_ROUTER_MANUAL bool "Manual router prefix" default n diff --git a/net/icmpv6/icmpv6_radvertise.c b/net/icmpv6/icmpv6_radvertise.c index 5b83530f53..f8926403f2 100644 --- a/net/icmpv6/icmpv6_radvertise.c +++ b/net/icmpv6/icmpv6_radvertise.c @@ -197,7 +197,8 @@ void icmpv6_radvertise(FAR struct net_driver_s *dev) adv->code = 0; /* Message qualifier */ adv->hoplimit = 64; /* Current hop limit */ adv->flags = ICMPv6_RADV_FLAG_M; /* Managed address flag. */ - adv->lifetime = HTONS(1800); /* Router lifetime */ + adv->lifetime = + HTONS(CONFIG_NET_ICMPv6_ROUTER_LIFETIME); /* Router lifetime */ adv->reachable[0] = 0; /* Reachable time */ adv->reachable[1] = 0; adv->retrans[0] = 0; /* Retransmission timer */