Source-Changes-HG archive

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

[src/trunk]: src/sys/netinet Simply use the ifa_addr pointer, rather than tak...



details:   https://anonhg.NetBSD.org/src/rev/6aa5da4ce9fe
branches:  trunk
changeset: 779652:6aa5da4ce9fe
user:      gdt <gdt%NetBSD.org@localhost>
date:      Fri Jun 08 15:01:51 2012 +0000

description:
Simply use the ifa_addr pointer, rather than taking its address.
Resolves failure to match addresses in SIOC[GD]LIFADDR calls.
Diagnosis and fix is due to Mark Keaton of BBN.

diffstat:

 sys/netinet/in.c |  6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diffs (27 lines):

diff -r 3e69a5e8e26d -r 6aa5da4ce9fe sys/netinet/in.c
--- a/sys/netinet/in.c  Fri Jun 08 12:39:42 2012 +0000
+++ b/sys/netinet/in.c  Fri Jun 08 15:01:51 2012 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: in.c,v 1.142 2011/12/12 00:06:39 roy Exp $     */
+/*     $NetBSD: in.c,v 1.143 2012/06/08 15:01:51 gdt Exp $     */
 
 /*
  * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
@@ -91,7 +91,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: in.c,v 1.142 2011/12/12 00:06:39 roy Exp $");
+__KERNEL_RCSID(0, "$NetBSD: in.c,v 1.143 2012/06/08 15:01:51 gdt Exp $");
 
 #include "opt_inet.h"
 #include "opt_inet_conf.h"
@@ -729,7 +729,7 @@
                                continue;
                        if (cmp == 0)
                                break;
-                       candidate.s_addr = ((struct sockaddr_in *)&ifa->ifa_addr)->sin_addr.s_addr;
+                       candidate.s_addr = ((struct sockaddr_in *)ifa->ifa_addr)->sin_addr.s_addr;
                        candidate.s_addr &= mask.s_addr;
                        if (candidate.s_addr == match.s_addr)
                                break;



Home | Main Index | Thread Index | Old Index