From patchwork Tue Jun 1 21:13:39 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christoph Lameter X-Patchwork-Id: 54317 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id A769BB7D1B for ; Wed, 2 Jun 2010 07:13:52 +1000 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756118Ab0FAVNr (ORCPT ); Tue, 1 Jun 2010 17:13:47 -0400 Received: from nlpi157.sbcis.sbc.com ([207.115.36.171]:50318 "EHLO nlpi157.prodigy.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753044Ab0FAVNq (ORCPT ); Tue, 1 Jun 2010 17:13:46 -0400 Received: from router.home (adsl-75-60-5-167.dsl.emhril.sbcglobal.net [75.60.5.167]) (authenticated bits=0) by nlpi157.prodigy.net (8.13.8 smtpauth/dk/map_regex/8.13.8) with ESMTP id o51LDet8000545; Tue, 1 Jun 2010 16:13:44 -0500 Received: from cl (helo=localhost) by router.home with local-esmtp (Exim 4.71) (envelope-from ) id 1OJYmK-0003Vl-Dw; Tue, 01 Jun 2010 16:13:40 -0500 Date: Tue, 1 Jun 2010 16:13:39 -0500 (CDT) From: Christoph Lameter X-X-Sender: cl@router.home To: netdev@vger.kernel.org cc: Stephen Hemminger , David Miller Subject: [PATCH] IP: Increment INADDRERRORS if routing for a packet is not successful Message-ID: User-Agent: Alpine 2.00 (DEB 1167 2008-08-23) MIME-Version: 1.0 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Something like this would have been very helpful during recent debugging of multicast issues. Silent discards are bad. If the kernel perceives that something is wrong with an incoming packet then the IP stack currently silently discards packets. This makes it difficult to diagnose problems with the network configurations (such as a misbehaving kernel subsystem discarding multicast packets because the reverse path filter does not like multicast subscriptions on the second NIC with rp_filter=1). It is also necessary to know how many inbound packets are discarded to assess networking issues in general with a NIC. Signed-off-by: Christoph Lameter Acked-by: Stephen Hemminger --- net/ipv4/route.c | 3 +++ 1 file changed, 3 insertions(+) -- To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Index: linux-2.6/net/ipv4/route.c =================================================================== --- linux-2.6.orig/net/ipv4/route.c 2010-06-01 11:46:10.000000000 -0500 +++ linux-2.6/net/ipv4/route.c 2010-06-01 11:52:55.000000000 -0500 @@ -2981,6 +2981,9 @@ static int inet_rtm_getroute(struct sk_b rt = skb_rtable(skb); if (err == 0 && rt->u.dst.error) err = -rt->u.dst.error; + if (err) + IP_INC_STATS_BH(dev_net(skb->dev), + IPSTATS_MIB_INADDRERRORS); } else { struct flowi fl = { .nl_u = {