From owner-freebsd-net@FreeBSD.ORG Mon Apr 22 09:58:02 2013 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 42DF35C8 for ; Mon, 22 Apr 2013 09:58:02 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from cell.glebius.int.ru (glebius.int.ru [81.19.69.10]) by mx1.freebsd.org (Postfix) with ESMTP id C31C51C39 for ; Mon, 22 Apr 2013 09:58:01 +0000 (UTC) Received: from cell.glebius.int.ru (localhost [127.0.0.1]) by cell.glebius.int.ru (8.14.6/8.14.6) with ESMTP id r3M9vxAD045504; Mon, 22 Apr 2013 13:57:59 +0400 (MSK) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebius.int.ru (8.14.6/8.14.6/Submit) id r3M9vxsm045503; Mon, 22 Apr 2013 13:57:59 +0400 (MSK) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.glebius.int.ru: glebius set sender to glebius@FreeBSD.org using -f Date: Mon, 22 Apr 2013 13:57:59 +0400 From: Gleb Smirnoff To: Juan Mojica Subject: Re: ARP: Error Message in if_ether.c "arprequest: cannot find matching address" Message-ID: <20130422095759.GC76816@FreeBSD.org> References: MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="45nhIriPRwzWsBkh" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) Cc: FreeBSD Net X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Apr 2013 09:58:02 -0000 --45nhIriPRwzWsBkh Content-Type: text/plain; charset=koi8-r Content-Disposition: inline On Wed, Apr 17, 2013 at 08:46:42AM -0400, Juan Mojica wrote: J> We manage to hit the following message with some regularity. J> J> arprequest: cannot find matching address J> J> The code shows a printf: J> J> printf("%s: cannot find matching address\n", __func__); J> J> J> Any reason this is a printf and not a J> J> log(LOG_ERR, J> J> The only things I can come up with are: J> J> a) it is a really severe and should be printed out, which if that is the J> case why isn't there an assert there? J> b) whoops, that should probably be a log(LOG_ERR, J> On our end we need to figure out exactly why we're intermittently hitting J> this patch of code. Can you please try this patch? Let's see what's going on. printf()ing in kernel is especially unsafe when the event can be triggered remotely. The arprequest() is called on output path of a packet, however I'm not sure that it can't be triggered by incoming packet. -- Totus tuus, Glebius. --45nhIriPRwzWsBkh Content-Type: text/x-diff; charset=koi8-r Content-Disposition: attachment; filename="if_ether.c.diff" Index: if_ether.c =================================================================== --- if_ether.c (revision 249764) +++ if_ether.c (working copy) @@ -250,7 +250,9 @@ arprequest(struct ifnet *ifp, struct in_addr *sip, } IF_ADDR_RUNLOCK(ifp); if (sip == NULL) { - printf("%s: cannot find matching address\n", __func__); + log(LOG_ERR, "%s: cannot find matching address for " + "%s on %s\n", __func__, inet_ntoa(*tip), + if_name(ifp)); return; } } --45nhIriPRwzWsBkh--