Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/usr.sbin/route6d set IPV6_V6ONLY to 1.
details: https://anonhg.NetBSD.org/src/rev/2f840ffa7018
branches: trunk
changeset: 536938:2f840ffa7018
user: itojun <itojun%NetBSD.org@localhost>
date: Tue Sep 24 13:48:14 2002 +0000
description:
set IPV6_V6ONLY to 1.
diffstat:
usr.sbin/route6d/route6d.c | 13 +++++++++----
1 files changed, 9 insertions(+), 4 deletions(-)
diffs (48 lines):
diff -r e285c6a556f4 -r 2f840ffa7018 usr.sbin/route6d/route6d.c
--- a/usr.sbin/route6d/route6d.c Tue Sep 24 13:31:33 2002 +0000
+++ b/usr.sbin/route6d/route6d.c Tue Sep 24 13:48:14 2002 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: route6d.c,v 1.41 2002/09/23 12:48:08 mycroft Exp $ */
+/* $NetBSD: route6d.c,v 1.42 2002/09/24 13:48:14 itojun Exp $ */
/* $KAME: route6d.c,v 1.88 2002/08/21 16:24:25 itojun Exp $ */
/*
@@ -32,7 +32,7 @@
#include <sys/cdefs.h>
#ifndef lint
-__RCSID("$NetBSD: route6d.c,v 1.41 2002/09/23 12:48:08 mycroft Exp $");
+__RCSID("$NetBSD: route6d.c,v 1.42 2002/09/24 13:48:14 itojun Exp $");
#endif
#include <stdio.h>
@@ -561,7 +561,8 @@
void
init(void)
{
- int i, int0, int255, error;
+ int i, error;
+ const int int0 = 0, int1 = 1, int255 = 255;
struct addrinfo hints, *res;
char port[10];
@@ -585,7 +586,6 @@
/*NOTREACHED*/
}
- int0 = 0; int255 = 255;
ripsock = socket(res->ai_family, res->ai_socktype, res->ai_protocol);
if (ripsock < 0) {
fatal("rip socket");
@@ -595,6 +595,11 @@
fatal("rip bind");
/*NOTREACHED*/
}
+ if (setsockopt(ripsock, IPPROTO_IPV6, IPV6_V6ONLY,
+ &int1, sizeof(int1)) < 0) {
+ fatal("rip IPV6_V6ONLY");
+ /*NOTREACHED*/
+ }
if (setsockopt(ripsock, IPPROTO_IPV6, IPV6_MULTICAST_HOPS,
&int255, sizeof(int255)) < 0) {
fatal("rip IPV6_MULTICAST_HOPS");
Home |
Main Index |
Thread Index |
Old Index