Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 22 Apr 2013 16:01:10 -0400
From:      Juan Mojica <jmojica@gmail.com>
To:        Juan Mojica <jmojica@gmail.com>, FreeBSD Net <freebsd-net@freebsd.org>
Subject:   Re: ARP: Error Message in if_ether.c "arprequest: cannot find matching address"
Message-ID:  <CAPKuH-wjT4ZdJ4CxwRjDZYAcuq3JTHS3i3KgA8BjmVoMShA6kw@mail.gmail.com>
In-Reply-To: <20130422192127.GJ1620@verio.net>
References:  <CAPKuH-w4ugf4KSWBKMoURbNsSrs1O-XNmWdn47VKn9MkCOgRDw@mail.gmail.com> <20130422192127.GJ1620@verio.net>

next in thread | previous in thread | raw e-mail | index | archive | help

[-- Attachment #1 --]
Hey David,

  That's not quite the scenario we're dealing with, but it is disconcerting
to here that it looks like this path can be triggered from an incoming
frame.  We had been seen it frequently when quickly
unconfiguring/configuring interfaces from a host.  An application would
receive the configure message, start trying to send out traffic, but not
get the unconfigure in time.  That was the working theory.  We've not hit
it recently - could just be a dormant race condition.

I have attach my proposed solution, which takes what Gleb provided, adds a
KASSERT, and wraps it all up with a sysctl so that it can be turned off.

Thanks,
Juan

On Mon, Apr 22, 2013 at 3:21 PM, David DeSimone <fox@verio.net> wrote:

> Juan Mojica <jmojica@gmail.com> wrote:
> >
> > We manage to hit the following message with some regularity.
> >
> > arprequest: cannot find matching address
> >
> > The code shows a printf:
> >
> > printf("%s: cannot find matching address\n", __func__);
> >
> >
> > Any reason this is a printf and not a
> >
> > log(LOG_ERR,
> >
> > The only things I can come up with are:
> >
> > a) it is a really severe and should be printed out, which if that is the
> > case why isn't there an assert there?
> > b) whoops, that should probably be a log(LOG_ERR,
> >
> > On our end we need to figure out exactly why we're intermittently hitting
> > this patch of code.
>
>
> We see this regularly on our network, because we have multiple overlaid
> subnets on the same VLAN.  The server sees an ARP request come in, but
> it does not match any of its confgired subnets, so it generates this
> error when trying to formulate an ARP reply.
>
> For example, the server might be configured to use 192.168.1.10/24 on an
> interface, but if it receives an ARP request for 172.31.250.249 on that
> interface, it won't know how to reply, and will generate this error.
>
>
> You might see this error if someone is inserting hosts with wrong IP's
> on your network, and they start trying to ARP for one another.
>
> --
> David DeSimone == Network Admin == fox@verio.net
>   "I don't like spinach, and I'm glad I don't, because if I
>    liked it I'd eat it, and I just hate it." -- Clarence Darrow
>
>
> This email message is intended for the use of the person to whom it has
> been sent, and may contain information that is confidential or legally
> protected. If you are not the intended recipient or have received this
> message in error, you are not authorized to copy, distribute, or otherwise
> use this message or its attachments. Please notify the sender immediately
> by return e-mail and permanently delete this message and any attachments.
> Verio Inc. makes no warranty that this email is error or virus free.  Thank
> you.
>



-- 
Juan Mojica
Email: jmojica@gmail.com

[-- Attachment #2 --]
Index: sys/netinet/if_ether.c
===================================================================
--- sys/netinet/if_ether.c	(revision 249776)
+++ sys/netinet/if_ether.c	(working copy)
@@ -50,6 +50,7 @@
 #include <sys/proc.h>
 #include <sys/socket.h>
 #include <sys/syslog.h>
+#include <sys/systm.h>
 
 #include <net/if.h>
 #include <net/if_dl.h>
@@ -122,6 +123,11 @@
 	&VNET_NAME(arp_maxhold), 0,
 	"Number of packets to hold per ARP entry");
 
+static int log_arp_no_iface = 1;
+SYSCTL_INT(_net_link_ether_inet, OID_AUTO, log_arp_no_iface, CTLFLAG_RW,
+		   &log_arp_no_iface, 0,
+		   "log arp requests with no corresponding interface");
+
 static void	arp_init(void);
 static void	arpintr(struct mbuf *);
 static void	arptimer(void *);
@@ -250,7 +256,13 @@
 		}
 		IF_ADDR_RUNLOCK(ifp);
 		if (sip == NULL) {
-			printf("%s: cannot find matching address\n", __func__);
+			if (log_arp_no_iface) {
+				KASSERT(false, ("%s: cannot find matching address for "
+								"%s on %s\n", __func__, inet_ntoa(*tip),
+								if_name(ifp)));
+				log(LOG_ERR, "%s: cannot find matching address for "
+					"%s on %s\n", __func__, inet_ntoa(*tip), if_name(ifp));
+			}
 			return;
 		}
 	}

Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAPKuH-wjT4ZdJ4CxwRjDZYAcuq3JTHS3i3KgA8BjmVoMShA6kw>