From patchwork Sun Dec 23 14:42:58 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cong Wang X-Patchwork-Id: 207977 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 952972C0087 for ; Mon, 24 Dec 2012 01:51:07 +1100 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751482Ab2LWOvF (ORCPT ); Sun, 23 Dec 2012 09:51:05 -0500 Received: from mail-da0-f50.google.com ([209.85.210.50]:65040 "EHLO mail-da0-f50.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750947Ab2LWOvD (ORCPT ); Sun, 23 Dec 2012 09:51:03 -0500 Received: by mail-da0-f50.google.com with SMTP id h15so2823209dan.23 for ; Sun, 23 Dec 2012 06:51:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:from:to:cc:subject:date:message-id:x-mailer; bh=/WCiYm0QilA6D+zyPKrVopYFYMp1Ay7tBcZ+K0DMVOM=; b=iwd6NXHB7K+x/J1KXeivgiE0EJtgLWHwx9eFbyXNfjZCiuxGHp16zS6q9TsFK1xjKX JZCNwbBZjdTG5+Q7Phexs0wj5GlpPZKoY7Sq9BEDQQeyzyEdE3/HTtPxwbllKsa/aVKE R0C/khb0p3pShAgI/YiWw3g1L6J4jxTLPqLp/qasQO0ppWX0D5iFtBrfGUrr5ElnEq6D lErjdg0kvjlPSTgzEUcCzw34K+8gL8RduhJXKhcMpqOVIMNTN1LimCofsh9QySSfm3zl gQSpdXmp+TsUsZshTibJ0H5wfAmscEQrj8iik2Ko7tkN7p+drKWQu0mNT2cqJn7tZ7By 43jw== X-Received: by 10.68.191.5 with SMTP id gu5mr58061196pbc.145.1356273800365; Sun, 23 Dec 2012 06:43:20 -0800 (PST) Received: from cr0.redhat.com ([58.242.81.22]) by mx.google.com with ESMTPS id j8sm11093171paz.30.2012.12.23.06.43.12 (version=TLSv1/SSLv3 cipher=OTHER); Sun, 23 Dec 2012 06:43:19 -0800 (PST) From: Cong Wang To: netdev@vger.kernel.org Cc: Sedat Dilek , Eric Dumazet , "David S. Miller" , Julian Anastasov , Cong Wang Subject: [Patch] arp: fix a regression in arp_solicit() Date: Sun, 23 Dec 2012 22:42:58 +0800 Message-Id: <1356273778-19113-1-git-send-email-xiyou.wangcong@gmail.com> X-Mailer: git-send-email 1.7.7.6 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: Cong Wang Sedat reported the following commit caused a regression: commit 9650388b5c56578fdccc79c57a8c82fb92b8e7f1 Author: Eric Dumazet Date: Fri Dec 21 07:32:10 2012 +0000 ipv4: arp: fix a lockdep splat in arp_solicit This is due to the 6th parameter of arp_send() needs to be NULL for broatcase case, the above commit changed it to all-zero non-NULL hw addr. Reported-by: Sedat Dilek Tested-by: Sedat Dilek Cc: Sedat Dilek Cc: Eric Dumazet Cc: David S. Miller Cc: Julian Anastasov Signed-off-by: Cong Wang --- -- 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 diff --git a/net/ipv4/arp.c b/net/ipv4/arp.c index 1169ed4..9547a273 100644 --- a/net/ipv4/arp.c +++ b/net/ipv4/arp.c @@ -321,7 +321,7 @@ static void arp_error_report(struct neighbour *neigh, struct sk_buff *skb) static void arp_solicit(struct neighbour *neigh, struct sk_buff *skb) { __be32 saddr = 0; - u8 dst_ha[MAX_ADDR_LEN]; + u8 dst_ha[MAX_ADDR_LEN], *dst_hw = NULL; struct net_device *dev = neigh->dev; __be32 target = *(__be32 *)neigh->primary_key; int probes = atomic_read(&neigh->probes); @@ -364,8 +364,8 @@ static void arp_solicit(struct neighbour *neigh, struct sk_buff *skb) if (!(neigh->nud_state & NUD_VALID)) pr_debug("trying to ucast probe in NUD_INVALID\n"); neigh_ha_snapshot(dst_ha, neigh, dev); + dst_hw = dst_ha; } else { - memset(dst_ha, 0, dev->addr_len); probes -= neigh->parms->app_probes; if (probes < 0) { #ifdef CONFIG_ARPD @@ -376,7 +376,7 @@ static void arp_solicit(struct neighbour *neigh, struct sk_buff *skb) } arp_send(ARPOP_REQUEST, ETH_P_ARP, target, dev, saddr, - dst_ha, dev->dev_addr, NULL); + dst_hw, dev->dev_addr, NULL); } static int arp_ignore(struct in_device *in_dev, __be32 sip, __be32 tip)