Module Name: src Committed By: christos Date: Sat Oct 19 15:50:26 UTC 2013
Modified Files: src/sbin/ifconfig: af_inet6.c tunnel.c src/sbin/route: route.c Log Message: use symbolic flags To generate a diff of this commit: cvs rdiff -u -r1.28 -r1.29 src/sbin/ifconfig/af_inet6.c cvs rdiff -u -r1.18 -r1.19 src/sbin/ifconfig/tunnel.c cvs rdiff -u -r1.142 -r1.143 src/sbin/route/route.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/sbin/ifconfig/af_inet6.c diff -u src/sbin/ifconfig/af_inet6.c:1.28 src/sbin/ifconfig/af_inet6.c:1.29 --- src/sbin/ifconfig/af_inet6.c:1.28 Fri Oct 18 20:35:30 2013 +++ src/sbin/ifconfig/af_inet6.c Sat Oct 19 11:50:26 2013 @@ -1,4 +1,4 @@ -/* $NetBSD: af_inet6.c,v 1.28 2013/10/19 00:35:30 christos Exp $ */ +/* $NetBSD: af_inet6.c,v 1.29 2013/10/19 15:50:26 christos Exp $ */ /* * Copyright (c) 1983, 1993 @@ -31,7 +31,7 @@ #include <sys/cdefs.h> #ifndef lint -__RCSID("$NetBSD: af_inet6.c,v 1.28 2013/10/19 00:35:30 christos Exp $"); +__RCSID("$NetBSD: af_inet6.c,v 1.29 2013/10/19 15:50:26 christos Exp $"); #endif /* not lint */ #include <sys/param.h> @@ -278,7 +278,7 @@ in6_alias(const char *ifname, prop_dicti sin6 = &creq->ifr_addr; - inet6_getscopeid(sin6, 1); + inet6_getscopeid(sin6, INET6_IS_ADDR_LINKLOCAL); scopeid = sin6->sin6_scope_id; if (getnameinfo((const struct sockaddr *)sin6, sin6->sin6_len, hbuf, sizeof(hbuf), NULL, 0, niflag)) @@ -298,7 +298,7 @@ in6_alias(const char *ifname, prop_dicti ifr6.ifr_addr.sin6_len = sizeof(struct sockaddr_in6); } sin6 = &ifr6.ifr_addr; - inet6_getscopeid(sin6, 1); + inet6_getscopeid(sin6, INET6_IS_ADDR_LINKLOCAL); hbuf[0] = '\0'; if (getnameinfo((struct sockaddr *)sin6, sin6->sin6_len, hbuf, sizeof(hbuf), NULL, 0, niflag)) @@ -406,8 +406,8 @@ in6_pre_aifaddr(prop_dictionary_t env, c setia6vltime_impl(env, ifra); setia6pltime_impl(env, ifra); setia6flags_impl(env, ifra); - inet6_putscopeid(&ifra->ifra_addr, 1); - inet6_putscopeid(&ifra->ifra_dstaddr, 1); + inet6_putscopeid(&ifra->ifra_addr, INET6_IS_ADDR_LINKLOCAL); + inet6_putscopeid(&ifra->ifra_dstaddr, INET6_IS_ADDR_LINKLOCAL); return 0; } Index: src/sbin/ifconfig/tunnel.c diff -u src/sbin/ifconfig/tunnel.c:1.18 src/sbin/ifconfig/tunnel.c:1.19 --- src/sbin/ifconfig/tunnel.c:1.18 Fri Oct 18 20:35:30 2013 +++ src/sbin/ifconfig/tunnel.c Sat Oct 19 11:50:26 2013 @@ -1,4 +1,4 @@ -/* $NetBSD: tunnel.c,v 1.18 2013/10/19 00:35:30 christos Exp $ */ +/* $NetBSD: tunnel.c,v 1.19 2013/10/19 15:50:26 christos Exp $ */ /* * Copyright (c) 1983, 1993 @@ -31,7 +31,7 @@ #include <sys/cdefs.h> #ifndef lint -__RCSID("$NetBSD: tunnel.c,v 1.18 2013/10/19 00:35:30 christos Exp $"); +__RCSID("$NetBSD: tunnel.c,v 1.19 2013/10/19 15:50:26 christos Exp $"); #endif /* not lint */ #include <sys/param.h> @@ -125,8 +125,8 @@ settunnel(prop_dictionary_t env, prop_di IN6_IS_ADDR_MULTICAST(&s6->sin6_addr)) errx(EXIT_FAILURE, "tunnel src/dst is multicast"); /* embed scopeid */ - inet6_putscopeid(s6, 1); - inet6_getscopeid(d, 1); + inet6_putscopeid(s6, INET6_IS_ADDR_LINKLOCAL); + inet6_getscopeid(d, INET6_IS_ADDR_LINKLOCAL); } #endif /* INET6 */ @@ -162,7 +162,8 @@ tunnel_status(prop_dictionary_t env, pro afp = lookup_af_bynum(req.addr.ss_family); #ifdef INET6 if (req.addr.ss_family == AF_INET6) - inet6_getscopeid((struct sockaddr_in6 *)&req.addr, 1); + inet6_getscopeid((struct sockaddr_in6 *)&req.addr, + INET6_IS_ADDR_LINKLOCAL); #endif /* INET6 */ getnameinfo((struct sockaddr *)&req.addr, req.addr.ss_len, psrcaddr, sizeof(psrcaddr), &srcserv[1], sizeof(srcserv) - 1, @@ -170,7 +171,8 @@ tunnel_status(prop_dictionary_t env, pro #ifdef INET6 if (req.dstaddr.ss_family == AF_INET6) - inet6_getscopeid((struct sockaddr_in6 *)&req.dstaddr, 1); + inet6_getscopeid((struct sockaddr_in6 *)&req.dstaddr, + INET6_IS_ADDR_LINKLOCAL); #endif getnameinfo((struct sockaddr *)&req.dstaddr, req.dstaddr.ss_len, pdstaddr, sizeof(pdstaddr), &dstserv[1], sizeof(dstserv) - 1, Index: src/sbin/route/route.c diff -u src/sbin/route/route.c:1.142 src/sbin/route/route.c:1.143 --- src/sbin/route/route.c:1.142 Fri Oct 18 20:39:39 2013 +++ src/sbin/route/route.c Sat Oct 19 11:50:26 2013 @@ -1,4 +1,4 @@ -/* $NetBSD: route.c,v 1.142 2013/10/19 00:39:39 christos Exp $ */ +/* $NetBSD: route.c,v 1.143 2013/10/19 15:50:26 christos Exp $ */ /* * Copyright (c) 1983, 1989, 1991, 1993 @@ -39,7 +39,7 @@ __COPYRIGHT("@(#) Copyright (c) 1983, 19 #if 0 static char sccsid[] = "@(#)route.c 8.6 (Berkeley) 4/28/95"; #else -__RCSID("$NetBSD: route.c,v 1.142 2013/10/19 00:39:39 christos Exp $"); +__RCSID("$NetBSD: route.c,v 1.143 2013/10/19 15:50:26 christos Exp $"); #endif #endif /* not lint */ @@ -538,7 +538,8 @@ routename(const struct sockaddr *sa, str memcpy(&sin6, sa, sa->sa_len); sin6.sin6_len = sizeof(struct sockaddr_in6); sin6.sin6_family = AF_INET6; - inet6_getscopeid(&sin6, 3); + inet6_getscopeid(&sin6, INET6_IS_ADDR_LINKLOCAL| + INET6_IS_ADDR_MC_LINKLOCAL); nml = netmask_length(nm, AF_INET6); if (IN6_IS_ADDR_UNSPECIFIED(&sin6.sin6_addr)) { if (nml == 0) @@ -695,7 +696,8 @@ netname(const struct sockaddr *sa, struc memcpy(&sin6, sa, sa->sa_len); sin6.sin6_len = sizeof(struct sockaddr_in6); sin6.sin6_family = AF_INET6; - inet6_putscopeid(&sin6, 3); + inet6_putscopeid(&sin6, INET6_IS_ADDR_LINKLOCAL| + INET6_IS_ADDR_MC_LINKLOCAL); nml = netmask_length(nm, AF_INET6); if (IN6_IS_ADDR_UNSPECIFIED(&sin6.sin6_addr)) { if (nml == 0) @@ -1235,7 +1237,8 @@ getaddr(int which, const char *s, struct } memcpy(&su->sin6, res->ai_addr, sizeof(su->sin6)); freeaddrinfo(res); - inet6_getscopeid(&su->sin6, 3); + inet6_getscopeid(&su->sin6, INET6_IS_ADDR_LINKLOCAL| + INET6_IS_ADDR_MC_LINKLOCAL); if (hints.ai_flags == AI_NUMERICHOST) { if (slash) return prefixlen(slash + 1, soup);