* Re: [PATCH 3/4] icmp6: Respect lifetime values in a RA
@ 2022-01-03 18:44 Denis Kenzior
0 siblings, 0 replies; 3+ messages in thread
From: Denis Kenzior @ 2022-01-03 18:44 UTC (permalink / raw)
To: ell
[-- Attachment #1: Type: text/plain, Size: 1309 bytes --]
On 1/3/22 08:18, Andrew Zaborowski wrote:
> If the router lifetime is 0 in a RA that router is not supposed to be
> added to the Default Router List in RFC4861:
>
> "A value of zero indicates that the router is not to be used as a
> default router."
>
You may want to put this into the code directly.
> "A router might want to send Router Advertisements without advertising
> itself as a default router. For instance, a router might advertise
> prefixes for stateless address autoconfiguration while not wishing to
> forward packets. Such a router sets the Router Lifetime field in
> outgoing advertisements to zero."
>
But yes, this part makes sense and no objections here.
> Also set the lifetime values on the routes to those received so that the
> user of, say, l_icmp6_client_get_router(), can also determine whether
> there is a default router.
Note that we do not re-upload the routes to the kernel on every RA received.
See the TODO comment in icmp6_client_handle_message(). Once lifetime expires,
the route will be removed -> internet is broke. Please at least sanity test the
changes you're sending out or label them as RFC if you haven't done so.
> ---
> ell/icmp6.c | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
>
Regards,
-Denis
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH 3/4] icmp6: Respect lifetime values in a RA
@ 2022-01-05 14:30 Andrew Zaborowski
0 siblings, 0 replies; 3+ messages in thread
From: Andrew Zaborowski @ 2022-01-05 14:30 UTC (permalink / raw)
To: ell
[-- Attachment #1: Type: text/plain, Size: 1080 bytes --]
On Mon, 3 Jan 2022 at 20:01, Denis Kenzior <denkenz(a)gmail.com> wrote:
> On 1/3/22 08:18, Andrew Zaborowski wrote:
> > "A value of zero indicates that the router is not to be used as a
> > default router."
> >
>
> You may want to put this into the code directly.
Ok, for some reason we don't quote the RFC in this file.
>
> > Also set the lifetime values on the routes to those received so that the
> > user of, say, l_icmp6_client_get_router(), can also determine whether
> > there is a default router.
>
> Note that we do not re-upload the routes to the kernel on every RA received.
> See the TODO comment in icmp6_client_handle_message(). Once lifetime expires,
> the route will be removed -> internet is broke. Please at least sanity test the
> changes you're sending out or label them as RFC if you haven't done so.
Ok, I've dropped the l_icmp6_client_set_rtnl() use locally in IWD so
this wouldn't have shown up even if the router had set a short
lifetime. But I need some way for the user to check if there's a
default gateway.
Best regards
^ permalink raw reply [flat|nested] 3+ messages in thread
* [PATCH 3/4] icmp6: Respect lifetime values in a RA
@ 2022-01-03 14:18 Andrew Zaborowski
0 siblings, 0 replies; 3+ messages in thread
From: Andrew Zaborowski @ 2022-01-03 14:18 UTC (permalink / raw)
To: ell
[-- Attachment #1: Type: text/plain, Size: 1723 bytes --]
If the router lifetime is 0 in a RA that router is not supposed to be
added to the Default Router List in RFC4861:
"A value of zero indicates that the router is not to be used as a
default router."
"A router might want to send Router Advertisements without advertising
itself as a default router. For instance, a router might advertise
prefixes for stateless address autoconfiguration while not wishing to
forward packets. Such a router sets the Router Lifetime field in
outgoing advertisements to zero."
Also set the lifetime values on the routes to those received so that the
user of, say, l_icmp6_client_get_router(), can also determine whether
there is a default router.
---
ell/icmp6.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/ell/icmp6.c b/ell/icmp6.c
index 42fe67d..93c1701 100644
--- a/ell/icmp6.c
+++ b/ell/icmp6.c
@@ -299,9 +299,10 @@ static void icmp6_client_setup_routes(struct l_icmp6_client *client)
l_rtnl_route_set_protocol(rt, RTPROT_RA);
l_rtnl_route_set_mtu(rt, ra->mtu);
l_rtnl_route_set_priority(rt, client->route_priority);
+ l_rtnl_route_set_lifetime(rt, ra->lifetime);
l_queue_push_tail(client->routes, rt);
- if (client->rtnl)
+ if (client->rtnl && ra->lifetime)
l_rtnl_route_add(client->rtnl, client->ifindex, rt,
NULL, NULL, NULL);
@@ -322,6 +323,7 @@ static void icmp6_client_setup_routes(struct l_icmp6_client *client)
l_rtnl_route_set_protocol(rt, RTPROT_RA);
l_rtnl_route_set_mtu(rt, ra->mtu);
l_rtnl_route_set_priority(rt, client->route_priority);
+ l_rtnl_route_set_lifetime(rt, info->valid_lifetime);
l_queue_push_tail(client->routes, rt);
if (client->rtnl)
--
2.32.0
^ permalink raw reply related [flat|nested] 3+ messages in thread
end of thread, other threads:[~2022-01-05 14:30 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-01-03 18:44 [PATCH 3/4] icmp6: Respect lifetime values in a RA Denis Kenzior
-- strict thread matches above, loose matches on Subject: below --
2022-01-05 14:30 Andrew Zaborowski
2022-01-03 14:18 Andrew Zaborowski
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.