提交 74a14504 编写于 作者: M Maxim Levitsky 提交者: Stefan Richter

firewire: net: invalidate ARP entries of removed nodes

This makes it possible to resume communication with a node that dropped
off the bus for a brief period.  Otherwise communication will only be
possible after ARP cache entry timeouts.
Signed-off-by: NMaxim Levitsky <maximlevitsky@gmail.com>
Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de> (rebased)
上级 c56eb8fb
...@@ -191,6 +191,7 @@ struct fwnet_peer { ...@@ -191,6 +191,7 @@ struct fwnet_peer {
struct fwnet_device *dev; struct fwnet_device *dev;
u64 guid; u64 guid;
u64 fifo; u64 fifo;
__be32 ip;
/* guarded by dev->lock */ /* guarded by dev->lock */
struct list_head pd_list; /* received partial datagrams */ struct list_head pd_list; /* received partial datagrams */
...@@ -570,6 +571,8 @@ static int fwnet_finish_incoming_packet(struct net_device *net, ...@@ -570,6 +571,8 @@ static int fwnet_finish_incoming_packet(struct net_device *net,
peer->speed = sspd; peer->speed = sspd;
if (peer->max_payload > max_payload) if (peer->max_payload > max_payload)
peer->max_payload = max_payload; peer->max_payload = max_payload;
peer->ip = arp1394->sip;
} }
spin_unlock_irqrestore(&dev->lock, flags); spin_unlock_irqrestore(&dev->lock, flags);
...@@ -1470,6 +1473,7 @@ static int fwnet_add_peer(struct fwnet_device *dev, ...@@ -1470,6 +1473,7 @@ static int fwnet_add_peer(struct fwnet_device *dev,
peer->dev = dev; peer->dev = dev;
peer->guid = (u64)device->config_rom[3] << 32 | device->config_rom[4]; peer->guid = (u64)device->config_rom[3] << 32 | device->config_rom[4];
peer->fifo = FWNET_NO_FIFO_ADDR; peer->fifo = FWNET_NO_FIFO_ADDR;
peer->ip = 0;
INIT_LIST_HEAD(&peer->pd_list); INIT_LIST_HEAD(&peer->pd_list);
peer->pdg_size = 0; peer->pdg_size = 0;
peer->datagram_label = 0; peer->datagram_label = 0;
...@@ -1589,10 +1593,13 @@ static int fwnet_remove(struct device *_dev) ...@@ -1589,10 +1593,13 @@ static int fwnet_remove(struct device *_dev)
mutex_lock(&fwnet_device_mutex); mutex_lock(&fwnet_device_mutex);
net = dev->netdev;
if (net && peer->ip)
arp_invalidate(net, peer->ip);
fwnet_remove_peer(peer, dev); fwnet_remove_peer(peer, dev);
if (list_empty(&dev->peer_list)) { if (list_empty(&dev->peer_list)) {
net = dev->netdev;
unregister_netdev(net); unregister_netdev(net);
if (dev->local_fifo != FWNET_NO_FIFO_ADDR) if (dev->local_fifo != FWNET_NO_FIFO_ADDR)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册