Source-Changes-HG archive

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

[src/trunk]: src/sbin/ifconfig grab eui64 only from the same interface.



details:   https://anonhg.NetBSD.org/src/rev/d4ff15f3f653
branches:  trunk
changeset: 532754:d4ff15f3f653
user:      itojun <itojun%NetBSD.org@localhost>
date:      Fri Jun 14 09:12:08 2002 +0000

description:
grab eui64 only from the same interface.

diffstat:

 sbin/ifconfig/ifconfig.c |  7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)

diffs (28 lines):

diff -r 45e4ee0b0e7e -r d4ff15f3f653 sbin/ifconfig/ifconfig.c
--- a/sbin/ifconfig/ifconfig.c  Fri Jun 14 09:05:21 2002 +0000
+++ b/sbin/ifconfig/ifconfig.c  Fri Jun 14 09:12:08 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ifconfig.c,v 1.127 2002/06/14 09:02:00 itojun Exp $    */
+/*     $NetBSD: ifconfig.c,v 1.128 2002/06/14 09:12:08 itojun Exp $    */
 
 /*-
  * Copyright (c) 1997, 1998, 2000 The NetBSD Foundation, Inc.
@@ -80,7 +80,7 @@
 #if 0
 static char sccsid[] = "@(#)ifconfig.c 8.2 (Berkeley) 2/16/94";
 #else
-__RCSID("$NetBSD: ifconfig.c,v 1.127 2002/06/14 09:02:00 itojun Exp $");
+__RCSID("$NetBSD: ifconfig.c,v 1.128 2002/06/14 09:12:08 itojun Exp $");
 #endif
 #endif /* not lint */
 
@@ -1242,7 +1242,8 @@
        if (getifaddrs(&ifap) != 0)
                err(EXIT_FAILURE, "getifaddrs");
        for (ifa = ifap; ifa; ifa = ifa->ifa_next) {
-               if (ifa->ifa_addr->sa_family == AF_INET6) {
+               if (ifa->ifa_addr->sa_family == AF_INET6 &&
+                   strcmp(ifa->ifa_name, name) == 0) {
                        sin6 = (const struct sockaddr_in6 *)ifa->ifa_addr;
                        if (IN6_IS_ADDR_LINKLOCAL(&sin6->sin6_addr)) {
                                lladdr = &sin6->sin6_addr;



Home | Main Index | Thread Index | Old Index