diff options
author | SUZUKI Shinsuke <suz@FreeBSD.org> | 2005-10-19 15:05:42 +0000 |
---|---|---|
committer | SUZUKI Shinsuke <suz@FreeBSD.org> | 2005-10-19 15:05:42 +0000 |
commit | b9204379a14bc57fac7a6d174af5b26d07b99c62 (patch) | |
tree | 3dc9168e29ff177252961d6c77b2be13d7b389e2 /usr.sbin/rtadvd | |
parent | 273ae68f43b0167479f0e8c7a18ceb3dd2339ebd (diff) | |
download | src-b9204379a14bc57fac7a6d174af5b26d07b99c62.tar.gz src-b9204379a14bc57fac7a6d174af5b26d07b99c62.zip |
added an ioctl option in kernel so that ndp/rtadvd can change some NDP-related kernel variables based on their configurations (RFC2461 p.43 6.2.1 mandates this for IPv6 routers)
Obtained from: KAME
Reviewd by: ume, gnn
MFC after: 2 weeks
Notes
Notes:
svn path=/head/; revision=151468
Diffstat (limited to 'usr.sbin/rtadvd')
-rw-r--r-- | usr.sbin/rtadvd/config.c | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/usr.sbin/rtadvd/config.c b/usr.sbin/rtadvd/config.c index 09e4eac659b5..e9e3b97246c9 100644 --- a/usr.sbin/rtadvd/config.c +++ b/usr.sbin/rtadvd/config.c @@ -46,6 +46,7 @@ #include <netinet/ip6.h> #include <netinet6/ip6_var.h> #include <netinet/icmp6.h> +#include <netinet6/nd6.h> #include <arpa/inet.h> @@ -407,6 +408,35 @@ getconfig(intface) exit(1); } +#ifdef SIOCSIFINFO_IN6 + { + struct in6_ndireq ndi; + int s; + + if ((s = socket(AF_INET6, SOCK_DGRAM, 0)) < 0) { + syslog(LOG_ERR, "<%s> socket: %s", __func__, + strerror(errno)); + exit(1); + } + memset(&ndi, 0, sizeof(ndi)); + strncpy(ndi.ifname, intface, IFNAMSIZ); + if (ioctl(s, SIOCGIFINFO_IN6, (caddr_t)&ndi) < 0) { + syslog(LOG_INFO, "<%s> ioctl:SIOCGIFINFO_IN6 at %s: %s", + __func__, intface, strerror(errno)); + } + + /* reflect the RA info to the host variables in kernel */ + ndi.ndi.chlim = tmp->hoplimit; + ndi.ndi.retrans = tmp->retranstimer; + ndi.ndi.basereachable = tmp->reachabletime; + if (ioctl(s, SIOCSIFINFO_IN6, (caddr_t)&ndi) < 0) { + syslog(LOG_INFO, "<%s> ioctl:SIOCSIFINFO_IN6 at %s: %s", + __func__, intface, strerror(errno)); + } + close(s); + } +#endif + /* route information */ #ifdef ROUTEINFO tmp->routes = 0; |