From patchwork Mon Nov 29 02:09:52 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maxim Levitsky X-Patchwork-Id: 73361 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 4AF0DB70A7 for ; Mon, 29 Nov 2010 13:10:48 +1100 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754462Ab0K2CKm (ORCPT ); Sun, 28 Nov 2010 21:10:42 -0500 Received: from mail-bw0-f46.google.com ([209.85.214.46]:48670 "EHLO mail-bw0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754474Ab0K2CKl (ORCPT ); Sun, 28 Nov 2010 21:10:41 -0500 Received: by mail-bw0-f46.google.com with SMTP id 15so3474612bwz.19 for ; Sun, 28 Nov 2010 18:10:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:from:to:cc:subject:date :message-id:x-mailer:in-reply-to:references; bh=EYaR1jHa3AUE7eTCAPUaYQvLDxYv3Au4+b5QgyDmU6w=; b=QoMfDTfSfhnzbzdQ/ZvOI/mSRYJEDLpPa6TWQsriRQvurv3vowiw/wKzfNutMP0Zz7 x2Xij5HIopxDXmCIRpM9mUIlaJIUjmmyP7P1CsZpCtOeZTbeaGKW63d1bEFR9jkBha1V K8b8BSaz/Sl3yLayEpxJrVejeN9WlEz1Ma68o= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references; b=sg9gf+eKRci5Tqo9lnrIgsmtAJKASM8mhHSzeqRObLa3P3j2hXfLZm6VRwgas6GFUd 9DpggxmPXacQcE8gMDNehM9SBO6/tAfmY8jOsn5vnV0p+sVENaxVv5N9JEZHvzfidfFG 8UTjPoTY2fVkV2EDem/YHqhRxYF/Jowwa/pfQ= Received: by 10.204.56.194 with SMTP id z2mr4310035bkg.129.1290996640670; Sun, 28 Nov 2010 18:10:40 -0800 (PST) Received: from maxim-laptop ([77.125.106.104]) by mx.google.com with ESMTPS id p22sm1742200bkp.9.2010.11.28.18.10.38 (version=SSLv3 cipher=RC4-MD5); Sun, 28 Nov 2010 18:10:39 -0800 (PST) From: Maxim Levitsky To: linux1394-devel Cc: Stefan Richter , netdev@vger.kernel.org, Maxim Levitsky Subject: [PATCH 4/5] firewire: net: invalidate ARP entries of removed nodes. Date: Mon, 29 Nov 2010 04:09:52 +0200 Message-Id: <1290996593-32416-5-git-send-email-maximlevitsky@gmail.com> X-Mailer: git-send-email 1.7.1 In-Reply-To: <1290996593-32416-1-git-send-email-maximlevitsky@gmail.com> References: <1290996593-32416-1-git-send-email-maximlevitsky@gmail.com> Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org This makes it possible to resume communication with a node that dropped off the bus for a brief period. Otherwice communication will only be possible after ARP cache entry timeouts Signed-off-by: Maxim Levitsky --- drivers/firewire/net.c | 7 +++++++ 1 files changed, 7 insertions(+), 0 deletions(-) diff --git a/drivers/firewire/net.c b/drivers/firewire/net.c index 1a467a9..d422519 100644 --- a/drivers/firewire/net.c +++ b/drivers/firewire/net.c @@ -189,6 +189,7 @@ struct fwnet_peer { struct fwnet_device *dev; u64 guid; u64 fifo; + __be32 ip; /* guarded by dev->lock */ struct list_head pd_list; /* received partial datagrams */ @@ -568,6 +569,8 @@ static int fwnet_finish_incoming_packet(struct net_device *net, peer->speed = sspd; if (peer->max_payload > max_payload) peer->max_payload = max_payload; + + peer->ip = arp1394->sip; } spin_unlock_irqrestore(&dev->lock, flags); @@ -1443,6 +1446,7 @@ static int fwnet_add_peer(struct fwnet_device *dev, peer->dev = dev; peer->guid = (u64)device->config_rom[3] << 32 | device->config_rom[4]; peer->fifo = FWNET_NO_FIFO_ADDR; + peer->ip = 0; INIT_LIST_HEAD(&peer->pd_list); peer->pdg_size = 0; peer->datagram_label = 0; @@ -1558,6 +1562,9 @@ static int fwnet_remove(struct device *_dev) mutex_lock(&fwnet_device_mutex); + if (dev->netdev && peer->ip) + arp_invalidate(dev->netdev, peer->ip); + fwnet_remove_peer(peer); if (list_empty(&dev->peer_list)) {