Source-Changes-HG archive

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

[src/trunk]: src/sys/netinet Handle RFC 5227 ARP probes properly, don't drop ...



details:   https://anonhg.NetBSD.org/src/rev/df44453de431
branches:  trunk
changeset: 748718:df44453de431
user:      christos <christos%NetBSD.org@localhost>
date:      Tue Nov 03 00:57:42 2009 +0000

description:
Handle RFC 5227 ARP probes properly, don't drop 0.0.0.0 source packets
silently. (Patrik Lahti <plahti at qnx dot com>)

diffstat:

 sys/netinet/if_arp.c |  21 ++++++++++-----------
 1 files changed, 10 insertions(+), 11 deletions(-)

diffs (49 lines):

diff -r cc3766d83724 -r df44453de431 sys/netinet/if_arp.c
--- a/sys/netinet/if_arp.c      Tue Nov 03 00:38:56 2009 +0000
+++ b/sys/netinet/if_arp.c      Tue Nov 03 00:57:42 2009 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if_arp.c,v 1.147 2009/09/16 15:23:04 pooka Exp $       */
+/*     $NetBSD: if_arp.c,v 1.148 2009/11/03 00:57:42 christos Exp $    */
 
 /*-
  * Copyright (c) 1998, 2000, 2008 The NetBSD Foundation, Inc.
@@ -68,7 +68,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_arp.c,v 1.147 2009/09/16 15:23:04 pooka Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_arp.c,v 1.148 2009/11/03 00:57:42 christos Exp $");
 
 #include "opt_ddb.h"
 #include "opt_inet.h"
@@ -968,15 +968,6 @@
                goto out;
        }
 
-       /*
-        * If the source IP address is zero, this is most likely a
-        * confused host trying to use IP address zero. (Windoze?)
-        * XXX: Should we bother trying to reply to these?
-        */
-       if (in_nullhost(isaddr)) {
-               ARP_STATINC(ARP_STAT_RCVZEROSPA);
-               goto out;
-       }
 
        /*
         * Search for a matching interface address
@@ -1054,6 +1045,14 @@
                goto out;
        }
 
+       /*
+        * If the source IP address is zero, this is an RFC 5227 ARP probe
+        */
+       if (in_nullhost(isaddr)) {
+               ARP_STATINC(ARP_STAT_RCVZEROSPA);
+               goto reply;
+       }
+
        if (in_hosteq(isaddr, myaddr)) {
                ARP_STATINC(ARP_STAT_RCVLOCALSPA);
                log(LOG_ERR,



Home | Main Index | Thread Index | Old Index