diff options
author | Jun-ichiro itojun Hagino <itojun@cvs.openbsd.org> | 2000-01-05 01:54:51 +0000 |
---|---|---|
committer | Jun-ichiro itojun Hagino <itojun@cvs.openbsd.org> | 2000-01-05 01:54:51 +0000 |
commit | d32ab4f9ef9ff71bfad38f9aad0fa6b42400e96b (patch) | |
tree | 1759b1dd11affcfa1498bf0c142922bdde4bae5a /usr.sbin/rtsold/rtsol.c | |
parent | 94a111eedec4fd64f875c29bb5d623c000bbc8c1 (diff) |
avoid use of kvm (sync with latest kame)
Diffstat (limited to 'usr.sbin/rtsold/rtsol.c')
-rw-r--r-- | usr.sbin/rtsold/rtsol.c | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/usr.sbin/rtsold/rtsol.c b/usr.sbin/rtsold/rtsol.c index 024bbb83364..4fa33aef77d 100644 --- a/usr.sbin/rtsold/rtsol.c +++ b/usr.sbin/rtsold/rtsol.c @@ -1,4 +1,4 @@ -/* $OpenBSD: rtsol.c,v 1.2 1999/12/09 15:10:49 itojun Exp $ */ +/* $OpenBSD: rtsol.c,v 1.3 2000/01/05 01:54:50 itojun Exp $ */ /* * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project. @@ -93,21 +93,39 @@ sockopen() /* specify to tell receiving interface */ on = 1; +#ifdef IPV6_RECVPKTINFO + if (setsockopt(rssock, IPPROTO_IPV6, IPV6_RECVPKTINFO, &on, + sizeof(on)) < 0) { + warnmsg(LOG_ERR, __FUNCTION__, "IPV6_RECVPKTINFO: %s", + strerror(errno)); + exit(1); + } +#else /* old adv. API */ if (setsockopt(rssock, IPPROTO_IPV6, IPV6_PKTINFO, &on, sizeof(on)) < 0) { warnmsg(LOG_ERR, __FUNCTION__, "IPV6_PKTINFO: %s", strerror(errno)); exit(1); } +#endif on = 1; /* specify to tell value of hoplimit field of received IP6 hdr */ +#ifdef IPV6_RECVHOPLIMIT + if (setsockopt(rssock, IPPROTO_IPV6, IPV6_RECVHOPLIMIT, &on, + sizeof(on)) < 0) { + warnmsg(LOG_ERR, __FUNCTION__, "IPV6_RECVHOPLIMIT: %s", + strerror(errno)); + exit(1); + } +#else /* old adv. API */ if (setsockopt(rssock, IPPROTO_IPV6, IPV6_HOPLIMIT, &on, sizeof(on)) < 0) { warnmsg(LOG_ERR, __FUNCTION__, "IPV6_HOPLIMIT: %s", strerror(errno)); exit(1); } +#endif /* specfiy to accept only router advertisements on the socket */ ICMP6_FILTER_SETBLOCKALL(&filt); |