summaryrefslogtreecommitdiff
path: root/sbin
diff options
context:
space:
mode:
authorJun-ichiro itojun Hagino <itojun@cvs.openbsd.org>2001-03-01 08:34:38 +0000
committerJun-ichiro itojun Hagino <itojun@cvs.openbsd.org>2001-03-01 08:34:38 +0000
commit12ca5d25eb55ba1e1070228b55554de4dfdc9676 (patch)
treed86ba50d0e7761cc0a7ade6f5398a51e256b6b8f /sbin
parent047e1e0c38ef8a21ec6e346db695fadcaebd2560 (diff)
on "giftunnel" configuration, use specified address family
Diffstat (limited to 'sbin')
-rw-r--r--sbin/ifconfig/ifconfig.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/sbin/ifconfig/ifconfig.c b/sbin/ifconfig/ifconfig.c
index 6d101e415ea..873870bb8be 100644
--- a/sbin/ifconfig/ifconfig.c
+++ b/sbin/ifconfig/ifconfig.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ifconfig.c,v 1.45 2001/02/20 13:50:53 itojun Exp $ */
+/* $OpenBSD: ifconfig.c,v 1.46 2001/03/01 08:34:37 itojun Exp $ */
/* $NetBSD: ifconfig.c,v 1.40 1997/10/01 02:19:43 enami Exp $ */
/*
@@ -81,7 +81,7 @@ static char copyright[] =
#if 0
static char sccsid[] = "@(#)ifconfig.c 8.2 (Berkeley) 2/16/94";
#else
-static char rcsid[] = "$OpenBSD: ifconfig.c,v 1.45 2001/02/20 13:50:53 itojun Exp $";
+static char rcsid[] = "$OpenBSD: ifconfig.c,v 1.46 2001/03/01 08:34:37 itojun Exp $";
#endif
#endif /* not lint */
@@ -767,12 +767,13 @@ gifsettunnel(src, dst)
memset(&hints, 0, sizeof(hints));
hints.ai_family = afp->af_af;
+ hints.ai_socktype = SOCK_DGRAM; /*dummy*/
- if ((ecode = getaddrinfo(src, NULL, NULL, &srcres)) != 0)
+ if ((ecode = getaddrinfo(src, NULL, &hints, &srcres)) != 0)
errx(1, "error in parsing address string: %s",
gai_strerror(ecode));
- if ((ecode = getaddrinfo(dst, NULL, NULL, &dstres)) != 0)
+ if ((ecode = getaddrinfo(dst, NULL, &hints, &dstres)) != 0)
errx(1, "error in parsing address string: %s",
gai_strerror(ecode));
@@ -2003,7 +2004,7 @@ in6_getaddr(s, which)
if (IN6_IS_ADDR_LINKLOCAL(&sin6->sin6_addr) &&
*(u_int16_t *)&sin6->sin6_addr.s6_addr[2] == 0 &&
sin6->sin6_scope_id) {
- *(u_int16_t *)&sin6->sin6_addr.s6_addr[2] =
+ *(u_int16_t *)&sin6->sin6_addr.s6_addr[2] =
htons(sin6->sin6_scope_id & 0xffff);
sin6->sin6_scope_id = 0;
}