Add periodic RA sends

The RFC indeed say that we should send them periodically.  We were
previously only sending them along LCP echo replies, but echo requests
are typically sent only when there is no trafic, which RA need to be
sent even when there is trafic.
This commit is contained in:
Samuel Thibault 2023-12-03 22:32:07 +01:00
parent 3be9b1657a
commit 05772e2295
4 changed files with 16 additions and 5 deletions

2
icmp.c
View file

@ -141,7 +141,7 @@ void send_ipv6_ra(sessionidt s, tunnelidt t, struct in6_addr *ip)
p_nra->nd_ra_cksum = 0; // Checksum
p_nra->nd_ra_curhoplimit = 64; // Hop count
p_nra->nd_ra_flags_reserved = (ND_RA_FLAG_MANAGED|ND_RA_FLAG_OTHER); // Flags
p_nra->nd_ra_router_lifetime = 0xFFFF; // Lifetime
p_nra->nd_ra_router_lifetime = AdvDefaultLifetime; // Lifetime
p_nra->nd_ra_reachable = 0; // Reachable time
p_nra->nd_ra_retransmit = 0; // Retrans timer
// Option PI after RA message (rfc4861)