Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 33086
b: refs/heads/master
c: e795d09
h: refs/heads/master
v: v3
  • Loading branch information
Tom Tucker authored and David S. Miller committed Aug 2, 2006
1 parent 7446939 commit 51988a1
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 17 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 8d71740c56a9058acc4378504a356d543ff1308b
refs/heads/master: e795d092507d571d66f2ec98d3efdc7dd284bf80
30 changes: 14 additions & 16 deletions trunk/drivers/infiniband/core/addr.c
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
#include <net/arp.h>
#include <net/neighbour.h>
#include <net/route.h>
#include <net/netevent.h>
#include <rdma/ib_addr.h>

MODULE_AUTHOR("Sean Hefty");
Expand Down Expand Up @@ -326,25 +327,22 @@ void rdma_addr_cancel(struct rdma_dev_addr *addr)
}
EXPORT_SYMBOL(rdma_addr_cancel);

static int addr_arp_recv(struct sk_buff *skb, struct net_device *dev,
struct packet_type *pkt, struct net_device *orig_dev)
static int netevent_callback(struct notifier_block *self, unsigned long event,
void *ctx)
{
struct arphdr *arp_hdr;
if (event == NETEVENT_NEIGH_UPDATE) {
struct neighbour *neigh = ctx;

arp_hdr = (struct arphdr *) skb->nh.raw;

if (arp_hdr->ar_op == htons(ARPOP_REQUEST) ||
arp_hdr->ar_op == htons(ARPOP_REPLY))
set_timeout(jiffies);

kfree_skb(skb);
if (neigh->dev->type == ARPHRD_INFINIBAND &&
(neigh->nud_state & NUD_VALID)) {
set_timeout(jiffies);
}
}
return 0;
}

static struct packet_type addr_arp = {
.type = __constant_htons(ETH_P_ARP),
.func = addr_arp_recv,
.af_packet_priv = (void*) 1,
static struct notifier_block nb = {
.notifier_call = netevent_callback
};

static int addr_init(void)
Expand All @@ -353,13 +351,13 @@ static int addr_init(void)
if (!addr_wq)
return -ENOMEM;

dev_add_pack(&addr_arp);
register_netevent_notifier(&nb);
return 0;
}

static void addr_cleanup(void)
{
dev_remove_pack(&addr_arp);
unregister_netevent_notifier(&nb);
destroy_workqueue(addr_wq);
}

Expand Down

0 comments on commit 51988a1

Please sign in to comment.