diff options
author | Jun-ichiro itojun Hagino <itojun@cvs.openbsd.org> | 2002-06-08 00:06:59 +0000 |
---|---|---|
committer | Jun-ichiro itojun Hagino <itojun@cvs.openbsd.org> | 2002-06-08 00:06:59 +0000 |
commit | b35ff1ae08a7fe569897241947182407873a92e8 (patch) | |
tree | f01f04bee59b051fdc760bd8cdf826f90a471984 /sys/netinet6/in6.c | |
parent | 698e8b0820f983e14323608284b9bec2f5dd339e (diff) |
in6_len2mask is a duplicate of in6_prefixlen2mask. unify. sync w/kame
Diffstat (limited to 'sys/netinet6/in6.c')
-rw-r--r-- | sys/netinet6/in6.c | 22 |
1 files changed, 4 insertions, 18 deletions
diff --git a/sys/netinet6/in6.c b/sys/netinet6/in6.c index 5e1110c107d..d2bfe420ee7 100644 --- a/sys/netinet6/in6.c +++ b/sys/netinet6/in6.c @@ -1,4 +1,4 @@ -/* $OpenBSD: in6.c,v 1.40 2002/06/08 00:00:59 itojun Exp $ */ +/* $OpenBSD: in6.c,v 1.41 2002/06/08 00:06:58 itojun Exp $ */ /* $KAME: in6.c,v 1.198 2001/07/18 09:12:38 itojun Exp $ */ /* @@ -280,20 +280,6 @@ in6_mask2len(mask) return x * 8 + y; } -void -in6_len2mask(mask, len) - struct in6_addr *mask; - int len; -{ - int i; - - bzero(mask, sizeof(*mask)); - for (i = 0; i < len / 8; i++) - mask->s6_addr8[i] = 0xff; - if (len % 8) - mask->s6_addr8[i] = (0xff00 >> (len % 8)) & 0xff; -} - #define ifa2ia6(ifa) ((struct in6_ifaddr *)(ifa)) #define ia62ifa(ia6) (&((ia6)->ia_ifa)) @@ -928,7 +914,7 @@ in6_lifaddr_ioctl(so, cmd, data, ifp, p) ifra.ifra_prefixmask.sin6_family = AF_INET6; ifra.ifra_prefixmask.sin6_len = sizeof(struct sockaddr_in6); - in6_len2mask(&ifra.ifra_prefixmask.sin6_addr, prefixlen); + in6_prefixlen2mask(&ifra.ifra_prefixmask.sin6_addr, prefixlen); ifra.ifra_flags = iflr->flags & ~IFLR_PREFIX; return in6_control(so, SIOCAIFADDR_IN6, (caddr_t)&ifra, @@ -945,7 +931,7 @@ in6_lifaddr_ioctl(so, cmd, data, ifp, p) bzero(&mask, sizeof(mask)); if (iflr->flags & IFLR_PREFIX) { /* lookup a prefix rather than address. */ - in6_len2mask(&mask, iflr->prefixlen); + in6_prefixlen2mask(&mask, iflr->prefixlen); sin6 = (struct sockaddr_in6 *)&iflr->addr; bcopy(&sin6->sin6_addr, &match, sizeof(match)); @@ -965,7 +951,7 @@ in6_lifaddr_ioctl(so, cmd, data, ifp, p) cmp = 0; /*XXX*/ } else { /* on deleting an address, do exact match */ - in6_len2mask(&mask, 128); + in6_prefixlen2mask(&mask, 128); sin6 = (struct sockaddr_in6 *)&iflr->addr; bcopy(&sin6->sin6_addr, &match, sizeof(match)); |