Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/netinet Mmh. Add a missing check: if ARP was disabled on...
details: https://anonhg.NetBSD.org/src/rev/88d640514b4d
branches: trunk
changeset: 829818:88d640514b4d
user: maxv <maxv%NetBSD.org@localhost>
date: Tue Feb 13 14:50:28 2018 +0000
description:
Mmh. Add a missing check: if ARP was disabled on the interface, don't
process ARP packets. Otherwise the kernel will add ARP entries even if
ifconfig wm0 -arp
was entered.
diffstat:
sys/netinet/if_arp.c | 12 +++++++++---
1 files changed, 9 insertions(+), 3 deletions(-)
diffs (54 lines):
diff -r 31f5687a7141 -r 88d640514b4d sys/netinet/if_arp.c
--- a/sys/netinet/if_arp.c Tue Feb 13 13:19:30 2018 +0000
+++ b/sys/netinet/if_arp.c Tue Feb 13 14:50:28 2018 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: if_arp.c,v 1.264 2018/02/13 10:47:41 maxv Exp $ */
+/* $NetBSD: if_arp.c,v 1.265 2018/02/13 14:50:28 maxv 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.264 2018/02/13 10:47:41 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_arp.c,v 1.265 2018/02/13 14:50:28 maxv Exp $");
#ifdef _KERNEL_OPT
#include "opt_ddb.h"
@@ -324,7 +324,7 @@
LLE_WLOCK(lle);
if (callout_pending(&lle->la_timer)) {
/*
- * Here we are a bit odd here in the treatment of
+ * Here we are a bit odd in the treatment of
* active/pending. If the pending bit is set, it got
* rescheduled before I ran. The active
* bit we ignore, since if it was stopped
@@ -725,6 +725,7 @@
bool renew;
int error;
struct ifnet *origifp = ifp;
+
#if NCARP > 0
if (rt != NULL && rt->rt_ifp->if_type == IFT_CARP)
ifp = rt->rt_ifp;
@@ -1058,6 +1059,8 @@
rcvif = ifp = m_get_rcvif_psref(m, &psref);
if (__predict_false(rcvif == NULL))
goto out;
+ if (rcvif->if_flags & IFF_NOARP)
+ goto out;
memcpy(&isaddr, ar_spa(ah), sizeof(isaddr));
memcpy(&itaddr, ar_tpa(ah), sizeof(itaddr));
@@ -1882,6 +1885,9 @@
rcvif = m_get_rcvif(m, &s);
if (__predict_false(rcvif == NULL))
goto out;
+ if (rcvif->if_flags & IFF_NOARP)
+ goto out;
+
switch (rcvif->if_type) {
case IFT_IEEE1394:
/* ARP without target hardware address is not supported */
Home |
Main Index |
Thread Index |
Old Index