Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/usr.sbin/mountd check scope id when we compare two AF_INET6 ...



details:   https://anonhg.NetBSD.org/src/rev/870adfaead18
branches:  trunk
changeset: 487633:870adfaead18
user:      itojun <itojun%NetBSD.org@localhost>
date:      Sat Jun 10 08:01:07 2000 +0000

description:
check scope id when we compare two AF_INET6 sockaddrs.
XXX still not sure if it is enough, so I do not remove warning from
documentation yet.

diffstat:

 usr.sbin/mountd/mountd.c |  10 ++++++++--
 1 files changed, 8 insertions(+), 2 deletions(-)

diffs (38 lines):

diff -r 36ab485b38d6 -r 870adfaead18 usr.sbin/mountd/mountd.c
--- a/usr.sbin/mountd/mountd.c  Sat Jun 10 07:04:13 2000 +0000
+++ b/usr.sbin/mountd/mountd.c  Sat Jun 10 08:01:07 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: mountd.c,v 1.66 2000/06/10 07:04:14 itojun Exp $        */
+/*     $NetBSD: mountd.c,v 1.67 2000/06/10 08:01:07 itojun Exp $        */
 
 /*
  * Copyright (c) 1989, 1993
@@ -51,7 +51,7 @@
 #if 0
 static char     sccsid[] = "@(#)mountd.c  8.15 (Berkeley) 5/1/95";
 #else
-__RCSID("$NetBSD: mountd.c,v 1.66 2000/06/10 07:04:14 itojun Exp $");
+__RCSID("$NetBSD: mountd.c,v 1.67 2000/06/10 08:01:07 itojun Exp $");
 #endif
 #endif                         /* not lint */
 
@@ -1422,6 +1422,9 @@
        case AF_INET6:
                src = &((struct sockaddr_in6 *)s1)->sin6_addr;
                dst = &((struct sockaddr_in6 *)s2)->sin6_addr;
+               if (((struct sockaddr_in6 *)s1)->sin6_scope_id !=
+                   ((struct sockaddr_in6 *)s2)->sin6_scope_id)
+                       return 1;
                if (bitlen > sizeof(((struct sockaddr_in6 *)s1)->sin6_addr) * 8)
                        return 1;
                break;
@@ -1523,6 +1526,9 @@
                p1 = &((struct sockaddr_in6 *)sa1)->sin6_addr;
                p2 = &((struct sockaddr_in6 *)sa2)->sin6_addr;
                len = 16;
+               if (((struct sockaddr_in6 *)sa1)->sin6_scope_id !=
+                   ((struct sockaddr_in6 *)sa2)->sin6_scope_id)
+                       return 1;
                break;
        default:
                return 1;



Home | Main Index | Thread Index | Old Index