aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/infiniband/ulp/ipoib/ipoib_main.c2
-rw-r--r--include/linux/netdevice.h1
-rw-r--r--net/atm/clip.c1
-rw-r--r--net/core/neighbour.c14
4 files changed, 15 insertions, 3 deletions
diff --git a/drivers/infiniband/ulp/ipoib/ipoib_main.c b/drivers/infiniband/ulp/ipoib/ipoib_main.c
index efd7a9636aff..57ae9b9265e3 100644
--- a/drivers/infiniband/ulp/ipoib/ipoib_main.c
+++ b/drivers/infiniband/ulp/ipoib/ipoib_main.c
@@ -1218,6 +1218,8 @@ static struct net_device *ipoib_add_port(const char *format,
1218 priv->dev->mtu = IPOIB_UD_MTU(priv->max_ib_mtu); 1218 priv->dev->mtu = IPOIB_UD_MTU(priv->max_ib_mtu);
1219 priv->mcast_mtu = priv->admin_mtu = priv->dev->mtu; 1219 priv->mcast_mtu = priv->admin_mtu = priv->dev->mtu;
1220 1220
1221 priv->dev->neigh_priv_len = sizeof(struct ipoib_neigh);
1222
1221 result = ib_query_pkey(hca, port, 0, &priv->pkey); 1223 result = ib_query_pkey(hca, port, 0, &priv->pkey);
1222 if (result) { 1224 if (result) {
1223 printk(KERN_WARNING "%s: ib_query_pkey port %d failed (ret = %d)\n", 1225 printk(KERN_WARNING "%s: ib_query_pkey port %d failed (ret = %d)\n",
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
index 97edb3215a5a..5462c2cd5eab 100644
--- a/include/linux/netdevice.h
+++ b/include/linux/netdevice.h
@@ -1080,6 +1080,7 @@ struct net_device {
1080 unsigned char perm_addr[MAX_ADDR_LEN]; /* permanent hw address */ 1080 unsigned char perm_addr[MAX_ADDR_LEN]; /* permanent hw address */
1081 unsigned char addr_assign_type; /* hw address assignment type */ 1081 unsigned char addr_assign_type; /* hw address assignment type */
1082 unsigned char addr_len; /* hardware address length */ 1082 unsigned char addr_len; /* hardware address length */
1083 unsigned char neigh_priv_len;
1083 unsigned short dev_id; /* for shared network cards */ 1084 unsigned short dev_id; /* for shared network cards */
1084 1085
1085 spinlock_t addr_list_lock; 1086 spinlock_t addr_list_lock;
diff --git a/net/atm/clip.c b/net/atm/clip.c
index 11439a7f6782..aea7cad2ece1 100644
--- a/net/atm/clip.c
+++ b/net/atm/clip.c
@@ -535,6 +535,7 @@ static void clip_setup(struct net_device *dev)
535{ 535{
536 dev->netdev_ops = &clip_netdev_ops; 536 dev->netdev_ops = &clip_netdev_ops;
537 dev->type = ARPHRD_ATM; 537 dev->type = ARPHRD_ATM;
538 dev->neigh_priv_len = sizeof(struct atmarp_entry);
538 dev->hard_header_len = RFC1483LLC_LEN; 539 dev->hard_header_len = RFC1483LLC_LEN;
539 dev->mtu = RFC1626_MTU; 540 dev->mtu = RFC1626_MTU;
540 dev->tx_queue_len = 100; /* "normal" queue (packets) */ 541 dev->tx_queue_len = 100; /* "normal" queue (packets) */
diff --git a/net/core/neighbour.c b/net/core/neighbour.c
index 661ad12e0cc9..ef750ff7497e 100644
--- a/net/core/neighbour.c
+++ b/net/core/neighbour.c
@@ -273,7 +273,7 @@ int neigh_ifdown(struct neigh_table *tbl, struct net_device *dev)
273} 273}
274EXPORT_SYMBOL(neigh_ifdown); 274EXPORT_SYMBOL(neigh_ifdown);
275 275
276static struct neighbour *neigh_alloc(struct neigh_table *tbl) 276static struct neighbour *neigh_alloc(struct neigh_table *tbl, struct net_device *dev)
277{ 277{
278 struct neighbour *n = NULL; 278 struct neighbour *n = NULL;
279 unsigned long now = jiffies; 279 unsigned long now = jiffies;
@@ -288,7 +288,15 @@ static struct neighbour *neigh_alloc(struct neigh_table *tbl)
288 goto out_entries; 288 goto out_entries;
289 } 289 }
290 290
291 n = kzalloc(tbl->entry_size, GFP_ATOMIC); 291 if (tbl->entry_size)
292 n = kzalloc(tbl->entry_size, GFP_ATOMIC);
293 else {
294 int sz = sizeof(*n) + tbl->key_len;
295
296 sz = ALIGN(sz, NEIGH_PRIV_ALIGN);
297 sz += dev->neigh_priv_len;
298 n = kzalloc(sz, GFP_ATOMIC);
299 }
292 if (!n) 300 if (!n)
293 goto out_entries; 301 goto out_entries;
294 302
@@ -463,7 +471,7 @@ struct neighbour *neigh_create(struct neigh_table *tbl, const void *pkey,
463 u32 hash_val; 471 u32 hash_val;
464 int key_len = tbl->key_len; 472 int key_len = tbl->key_len;
465 int error; 473 int error;
466 struct neighbour *n1, *rc, *n = neigh_alloc(tbl); 474 struct neighbour *n1, *rc, *n = neigh_alloc(tbl, dev);
467 struct neigh_hash_table *nht; 475 struct neigh_hash_table *nht;
468 476
469 if (!n) { 477 if (!n) {