Module Name:    src
Committed By:   christos
Date:           Tue Nov  3 00:57:42 UTC 2009

Modified Files:
        src/sys/netinet: if_arp.c

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


To generate a diff of this commit:
cvs rdiff -u -r1.147 -r1.148 src/sys/netinet/if_arp.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/netinet/if_arp.c
diff -u src/sys/netinet/if_arp.c:1.147 src/sys/netinet/if_arp.c:1.148
--- src/sys/netinet/if_arp.c:1.147	Wed Sep 16 11:23:04 2009
+++ src/sys/netinet/if_arp.c	Mon Nov  2 19:57:42 2009
@@ -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,

Reply via email to