aboutsummaryrefslogtreecommitdiffstats
path: root/net/core
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2008-03-26 21:35:50 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2008-03-26 21:35:50 -0400
commitee20a0dd5400e771ff93eb7f2bcc731eab1f377e (patch)
tree43743bd300a5b1ed94888881689e1d6a8ecac1e1 /net/core
parentd55a4528f7f607ca2872fec18574bc8cec060f05 (diff)
parent732c8bd590625e8bc0b88313b82930e336b2bec4 (diff)
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6
* git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6: (43 commits) [IPSEC]: Fix BEET output [ICMP]: Dst entry leak in icmp_send host re-lookup code (v2). [AX25]: Remove obsolete references to BKL from TODO file. [NET]: Fix multicast device ioctl checks [IRDA]: Store irnet_socket termios properly. [UML]: uml-net: don't set IFF_ALLMULTI in set_multicast_list [VLAN]: Don't copy ALLMULTI/PROMISC flags from underlying device netxen, phy/marvell, skge: minor checkpatch fixes S2io: Handle TX completions on the same CPU as the sender for MIS-X interrupts b44: Truncate PHY address skge napi->poll() locking bug rndis_host: fix oops when query for OID_GEN_PHYSICAL_MEDIUM fails cxgb3: Fix lockdep problems with sge.reg_lock ehea: Fix IPv6 support dm9000: Support promisc and all-multi modes dm9601: configure MAC to drop invalid (crc/length) packets dm9601: add Hirose USB-100 device ID Marvell PHY m88e1111 driver fix netxen: fix rx dropped stats netxen: remove low level tx lock ...
Diffstat (limited to 'net/core')
-rw-r--r--net/core/dev.c4
-rw-r--r--net/core/neighbour.c23
2 files changed, 25 insertions, 2 deletions
diff --git a/net/core/dev.c b/net/core/dev.c
index fcdf03cf3b3f..460e7f99ce3e 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -3329,7 +3329,7 @@ static int dev_ifsioc(struct net *net, struct ifreq *ifr, unsigned int cmd)
3329 return -EOPNOTSUPP; 3329 return -EOPNOTSUPP;
3330 3330
3331 case SIOCADDMULTI: 3331 case SIOCADDMULTI:
3332 if (!dev->set_multicast_list || 3332 if ((!dev->set_multicast_list && !dev->set_rx_mode) ||
3333 ifr->ifr_hwaddr.sa_family != AF_UNSPEC) 3333 ifr->ifr_hwaddr.sa_family != AF_UNSPEC)
3334 return -EINVAL; 3334 return -EINVAL;
3335 if (!netif_device_present(dev)) 3335 if (!netif_device_present(dev))
@@ -3338,7 +3338,7 @@ static int dev_ifsioc(struct net *net, struct ifreq *ifr, unsigned int cmd)
3338 dev->addr_len, 1); 3338 dev->addr_len, 1);
3339 3339
3340 case SIOCDELMULTI: 3340 case SIOCDELMULTI:
3341 if (!dev->set_multicast_list || 3341 if ((!dev->set_multicast_list && !dev->set_rx_mode) ||
3342 ifr->ifr_hwaddr.sa_family != AF_UNSPEC) 3342 ifr->ifr_hwaddr.sa_family != AF_UNSPEC)
3343 return -EINVAL; 3343 return -EINVAL;
3344 if (!netif_device_present(dev)) 3344 if (!netif_device_present(dev))
diff --git a/net/core/neighbour.c b/net/core/neighbour.c
index d9a02b2cc289..19b8e003f150 100644
--- a/net/core/neighbour.c
+++ b/net/core/neighbour.c
@@ -466,6 +466,28 @@ out_neigh_release:
466 goto out; 466 goto out;
467} 467}
468 468
469struct pneigh_entry *__pneigh_lookup(struct neigh_table *tbl,
470 struct net *net, const void *pkey, struct net_device *dev)
471{
472 struct pneigh_entry *n;
473 int key_len = tbl->key_len;
474 u32 hash_val = *(u32 *)(pkey + key_len - 4);
475
476 hash_val ^= (hash_val >> 16);
477 hash_val ^= hash_val >> 8;
478 hash_val ^= hash_val >> 4;
479 hash_val &= PNEIGH_HASHMASK;
480
481 for (n = tbl->phash_buckets[hash_val]; n; n = n->next) {
482 if (!memcmp(n->key, pkey, key_len) &&
483 (n->net == net) &&
484 (n->dev == dev || !n->dev))
485 break;
486 }
487
488 return n;
489}
490
469struct pneigh_entry * pneigh_lookup(struct neigh_table *tbl, 491struct pneigh_entry * pneigh_lookup(struct neigh_table *tbl,
470 struct net *net, const void *pkey, 492 struct net *net, const void *pkey,
471 struct net_device *dev, int creat) 493 struct net_device *dev, int creat)
@@ -2803,6 +2825,7 @@ EXPORT_SYMBOL(neigh_table_init_no_netlink);
2803EXPORT_SYMBOL(neigh_update); 2825EXPORT_SYMBOL(neigh_update);
2804EXPORT_SYMBOL(pneigh_enqueue); 2826EXPORT_SYMBOL(pneigh_enqueue);
2805EXPORT_SYMBOL(pneigh_lookup); 2827EXPORT_SYMBOL(pneigh_lookup);
2828EXPORT_SYMBOL_GPL(__pneigh_lookup);
2806 2829
2807#ifdef CONFIG_ARPD 2830#ifdef CONFIG_ARPD
2808EXPORT_SYMBOL(neigh_app_ns); 2831EXPORT_SYMBOL(neigh_app_ns);