diff options
author | hrs <hrs@FreeBSD.org> | 2011-06-08 16:03:29 +0000 |
---|---|---|
committer | hrs <hrs@FreeBSD.org> | 2011-06-08 16:03:29 +0000 |
commit | 1eefc7ab06b30aec595b347e288fa4afd1535a39 (patch) | |
tree | d51f3ada57d0885094e28644af3dc20fefe35f40 /usr.sbin/rtsold/rtsold.h | |
parent | 724e938247a1f61f3cd1e8db0e998c3ad7490198 (diff) | |
download | FreeBSD-src-1eefc7ab06b30aec595b347e288fa4afd1535a39.zip FreeBSD-src-1eefc7ab06b30aec595b347e288fa4afd1535a39.tar.gz |
- Accumulate RA options instead of replacing old ones when a new RA arrived.
RFC 4861 6.3.4 clearly defines handling multiple RAs in this way.
- RDNSS/DNSSL options from multiple RAs on a single link will be
gathered and sent to resolvconf(8).
- Call "resolvconf -d" only after at least one RDNSS or DNSSL option is
received and then all of them are expired.
- The rtsold.dump output now supports displaying a list of the RA options.
- Use more human-readable expression for logging values of struct timeval.
Discussed with: ume
Diffstat (limited to 'usr.sbin/rtsold/rtsold.h')
-rw-r--r-- | usr.sbin/rtsold/rtsold.h | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/usr.sbin/rtsold/rtsold.h b/usr.sbin/rtsold/rtsold.h index 1c395d0..0aa9b4f 100644 --- a/usr.sbin/rtsold/rtsold.h +++ b/usr.sbin/rtsold/rtsold.h @@ -46,6 +46,16 @@ struct ra_opt { void *rao_msg; }; +TAILQ_HEAD(rainfo_head, ra_opt); + +struct rainfo { + TAILQ_ENTRY(rainfo) rai_next; + + struct ifinfo *rai_ifinfo; + struct sockaddr_in6 rai_saddr; + TAILQ_HEAD(, ra_opt) rai_ra_opt; +}; + struct ifinfo { TAILQ_ENTRY(ifinfo) ifi_next; /* pointer to the next interface */ @@ -64,13 +74,16 @@ struct ifinfo { struct timeval timer; struct timeval expire; int errors; /* # of errors we've got - detect wedge */ +#define IFI_DNSOPT_STATE_NOINFO 0 +#define IFI_DNSOPT_STATE_RECEIVED 1 + int ifi_rdnss; /* RDNSS option state */ + int ifi_dnssl; /* DNSSL option state */ int racnt; /* total # of valid RAs it have got */ + TAILQ_HEAD(, rainfo) ifi_rainfo; size_t rs_datalen; u_char *rs_data; - - TAILQ_HEAD(, ra_opt) ifi_ra_opt; }; /* per interface status */ @@ -118,6 +131,7 @@ extern const char *resolvconf_script; extern int ifconfig(char *); extern void iflist_init(void); struct ifinfo *find_ifinfo(int); +struct rainfo *find_rainfo(struct ifinfo *, struct sockaddr_in6 *); void rtsol_timer_update(struct ifinfo *); extern void warnmsg(int, const char *, const char *, ...) __attribute__((__format__(__printf__, 3, 4))); @@ -145,6 +159,7 @@ extern void defrouter_probe(struct ifinfo *); /* dump.c */ extern void rtsold_dump_file(const char *); +extern const char *sec2str(const struct timeval *); /* rtsock.c */ extern int rtsock_open(void); |