From patchwork Wed Feb 26 09:43:04 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Timo Teras X-Patchwork-Id: 324235 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 2B63C2C00A2 for ; Wed, 26 Feb 2014 20:42:55 +1100 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751447AbaBZJmc (ORCPT ); Wed, 26 Feb 2014 04:42:32 -0500 Received: from mail-la0-f47.google.com ([209.85.215.47]:38538 "EHLO mail-la0-f47.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751106AbaBZJm3 (ORCPT ); Wed, 26 Feb 2014 04:42:29 -0500 Received: by mail-la0-f47.google.com with SMTP id y1so435336lam.20 for ; Wed, 26 Feb 2014 01:42:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-type:content-transfer-encoding; bh=mGY8KDWwPDeq85E2K2FPZEvJgC/7u2DMBuRPU9dFrt8=; b=iHKFB+fZcnfxMcNhenzHAzyxZqRZW0KOqObcYZAO9kD3HL+IHbkSGjbZSKfbPyLDUA GCuJusioF+QyVGMdsxS8suBYHMK6eO9R/kRxaomJJQ5cqmtxLk9DCujDBNuvcLcEo1ML yioAmE5h5NqCPeC7kfDaMsEV00cjjjGxlBpqwi+jWnXDKQahMWjl+CQASABR/ZcmTu4T 4aycq3ufj7A3zYFy9QjoI+LNdniIQwdNwgFkg9g0IQhJ0TxpMjmz8bIr9xC01JZcsTS0 VlWAYhBwCfkOdb5XUVxse75DrIemw09jFIB0MIsbOTWl/uTQsNCW7bJRLUeu5ZDB7DSU xr7Q== X-Received: by 10.112.73.100 with SMTP id k4mr1643944lbv.25.1393407747536; Wed, 26 Feb 2014 01:42:27 -0800 (PST) Received: from vostro.util.wtbts.net ([83.145.235.199]) by mx.google.com with ESMTPSA id th3sm495022lbb.11.2014.02.26.01.42.26 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 26 Feb 2014 01:42:26 -0800 (PST) From: =?UTF-8?q?Timo=20Ter=C3=A4s?= To: David Miller , netdev@vger.kernel.org Cc: =?UTF-8?q?Timo=20Ter=C3=A4s?= Subject: [PATCH net-next] neigh: probe application via netlink in NUD_PROBE Date: Wed, 26 Feb 2014 11:43:04 +0200 Message-Id: <1393407784-8906-1-git-send-email-timo.teras@iki.fi> X-Mailer: git-send-email 1.9.0 In-Reply-To: <20140225.181844.1715731388552960836.davem@davemloft.net> References: <20140225.181844.1715731388552960836.davem@davemloft.net> MIME-Version: 1.0 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org iproute2 arpd seems to expect this as there's code and comments to handle netlink probes with NUD_PROBE set. It is used to flush the arpd cached mappings. opennhrp instead turns off unicast probes (so it can handle all neighbour discovery). Without this change it will not see NUD_PROBE probes and cannot reconfirm the mapping. Thus currently neigh entry will just fail and can cause few packets dropped until broadcast discovery is restarted. Earlier discussion on the subject: http://marc.info/?t=139305877100001&r=1&w=2 Signed-off-by: Timo Teräs --- net/core/neighbour.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/net/core/neighbour.c b/net/core/neighbour.c index b9e9e0d..36d3f8c 100644 --- a/net/core/neighbour.c +++ b/net/core/neighbour.c @@ -836,10 +836,10 @@ out: static __inline__ int neigh_max_probes(struct neighbour *n) { struct neigh_parms *p = n->parms; - return (n->nud_state & NUD_PROBE) ? - NEIGH_VAR(p, UCAST_PROBES) : - NEIGH_VAR(p, UCAST_PROBES) + NEIGH_VAR(p, APP_PROBES) + - NEIGH_VAR(p, MCAST_PROBES); + int max_probes = NEIGH_VAR(p, UCAST_PROBES) + NEIGH_VAR(p, APP_PROBES); + if (!(n->nud_state & NUD_PROBE)) + max_probes += NEIGH_VAR(p, MCAST_PROBES); + return max_probes; } static void neigh_invalidate(struct neighbour *neigh)