diff options
author | Michal 'vorner' Vaner <michal.vaner@nic.cz> | 2017-08-11 12:25:36 +0200 |
---|---|---|
committer | Ondrej Zajicek (work) <santiago@crfreenet.org> | 2017-08-30 16:34:15 +0200 |
commit | e2d2b3ef21f082a034e79d0880d4b36428029a59 (patch) | |
tree | dae12f76ed7901e68be0dd24f44402fadeec9986 /proto/radv/radv.h | |
parent | 3ac5d1ce4c10719dd48555521a50d4a9c5eadd15 (diff) |
RAdv: Buffer prefixes awhile after they disappear
Keep a cache of all the relevant prefixes we send out. When a prefix
appears, insert it into the cache. If it dies, keep it there for a
while, marked as dead.
Send out the dead prefixes with zero lifetime.
Diffstat (limited to 'proto/radv/radv.h')
-rw-r--r-- | proto/radv/radv.h | 23 |
1 files changed, 22 insertions, 1 deletions
diff --git a/proto/radv/radv.h b/proto/radv/radv.h index 559a3f3f..54d7c6f0 100644 --- a/proto/radv/radv.h +++ b/proto/radv/radv.h @@ -121,6 +121,23 @@ struct radv_proto u8 active; /* Whether radv is active w.r.t. triggers */ }; +struct radv_prefix /* One prefix we advertise */ +{ + node n; + ip_addr prefix; + u8 len; + /* Is the prefix alive? If not, we advertise it with 0 lifetime, so clients + * stop using it. */ + u8 alive; + u8 mark; /* A temporary mark for processing */ + /* The (absolute) time when we drop this prefix from advertising. It is valid + * only if !alive. */ + bird_clock_t expires; + /* The config tied to this prefix. Always valid (we place a dummy config here + * when !alive). */ + struct radv_prefix_config *config; +}; + struct radv_iface { node n; @@ -128,6 +145,9 @@ struct radv_iface struct radv_iface_config *cf; /* Related config, must be updated in reconfigure */ struct iface *iface; struct ifa *addr; /* Link-local address of iface */ + struct pool *pool; /* A pool for interface-specific things */ + list prefixes; /* The prefixes we advertise */ + bird_clock_t prefix_expires; /* When the soonest prefix expires (0 = none dead) */ timer *timer; struct object_lock *lock; @@ -135,12 +155,13 @@ struct radv_iface bird_clock_t last; /* Time of last sending of RA */ u16 plen; /* Length of prepared RA in tbuf, or 0 if not valid */ - byte initial; /* List of active ifaces */ + byte initial; /* How many RAs are still to be sent as initial */ }; #define RA_EV_INIT 1 /* Switch to initial mode */ #define RA_EV_CHANGE 2 /* Change of options or prefixes */ #define RA_EV_RS 3 /* Received RS */ +#define RA_EV_GC 4 /* Internal garbage collection of prefixes */ /* Default Router Preferences (RFC 4191) */ #define RA_PREF_LOW 0x18 |