diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2011-04-01 11:53:50 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2011-04-01 11:53:50 -0400 |
commit | 84daeb09ef2b11cb0b29e100766e38e206c8bc47 (patch) | |
tree | c89748e1bb8618aac7ad0d2079fba43543844483 /net | |
parent | ecb78ab6f30106ab72a575a25b1cdfd1633b7ca2 (diff) | |
parent | c100c8f4c3c6f2a407bdbaaad2c4f1062e6a473a (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:
appletalk: Fix OOPS in atalk_release().
mlx4: Fixing bad size of event queue buffer
mlx4: Fixing use after free
bonding:typo in comment
sctp: Pass __GFP_NOWARN to hash table allocation attempts.
connector: convert to synchronous netlink message processing
fib: add rtnl locking in ip_fib_net_exit
atm/solos-pci: Don't flap VCs when carrier state changes
atm/solos-pci: Don't include frame pseudo-header on transmit hex-dump
atm/solos-pci: Use VPI.VCI notation uniformly.
Atheros, atl2: Fix mem leaks in error paths of atl2_set_eeprom
netdev: fix mtu check when TSO is enabled
net/usb: Ethernet quirks for the LG-VL600 4G modem
phylib: phy_attach_direct: phy_init_hw can fail, add cleanup
bridge: mcast snooping, fix length check of snooped MLDv1/2
via-ircc: Pass PCI device pointer to dma_{alloc, free}_coherent()
via-ircc: Use pci_{get, set}_drvdata() instead of static pointer variable
net: gre: provide multicast mappings for ipv4 and ipv6
bridge: Fix compilation warning in function br_stp_recalculate_bridge_id()
net: Fix warnings caused by MAX_SKB_FRAGS change.
Diffstat (limited to 'net')
-rw-r--r-- | net/appletalk/ddp.c | 11 | ||||
-rw-r--r-- | net/atm/common.c | 1 | ||||
-rw-r--r-- | net/bridge/br_multicast.c | 2 | ||||
-rw-r--r-- | net/bridge/br_stp_if.c | 2 | ||||
-rw-r--r-- | net/core/dev.c | 24 | ||||
-rw-r--r-- | net/ipv4/arp.c | 3 | ||||
-rw-r--r-- | net/ipv4/fib_frontend.c | 2 | ||||
-rw-r--r-- | net/ipv6/ndisc.c | 2 | ||||
-rw-r--r-- | net/sctp/protocol.c | 4 |
9 files changed, 40 insertions, 11 deletions
diff --git a/net/appletalk/ddp.c b/net/appletalk/ddp.c index 206e771e82d1..956a5302002a 100644 --- a/net/appletalk/ddp.c +++ b/net/appletalk/ddp.c | |||
@@ -1051,16 +1051,17 @@ static int atalk_release(struct socket *sock) | |||
1051 | { | 1051 | { |
1052 | struct sock *sk = sock->sk; | 1052 | struct sock *sk = sock->sk; |
1053 | 1053 | ||
1054 | sock_hold(sk); | ||
1055 | lock_sock(sk); | ||
1056 | if (sk) { | 1054 | if (sk) { |
1055 | sock_hold(sk); | ||
1056 | lock_sock(sk); | ||
1057 | |||
1057 | sock_orphan(sk); | 1058 | sock_orphan(sk); |
1058 | sock->sk = NULL; | 1059 | sock->sk = NULL; |
1059 | atalk_destroy_socket(sk); | 1060 | atalk_destroy_socket(sk); |
1060 | } | ||
1061 | release_sock(sk); | ||
1062 | sock_put(sk); | ||
1063 | 1061 | ||
1062 | release_sock(sk); | ||
1063 | sock_put(sk); | ||
1064 | } | ||
1064 | return 0; | 1065 | return 0; |
1065 | } | 1066 | } |
1066 | 1067 | ||
diff --git a/net/atm/common.c b/net/atm/common.c index 1b9c52a02cd3..22b963d06a10 100644 --- a/net/atm/common.c +++ b/net/atm/common.c | |||
@@ -252,6 +252,7 @@ void atm_dev_release_vccs(struct atm_dev *dev) | |||
252 | } | 252 | } |
253 | write_unlock_irq(&vcc_sklist_lock); | 253 | write_unlock_irq(&vcc_sklist_lock); |
254 | } | 254 | } |
255 | EXPORT_SYMBOL(atm_dev_release_vccs); | ||
255 | 256 | ||
256 | static int adjust_tp(struct atm_trafprm *tp, unsigned char aal) | 257 | static int adjust_tp(struct atm_trafprm *tp, unsigned char aal) |
257 | { | 258 | { |
diff --git a/net/bridge/br_multicast.c b/net/bridge/br_multicast.c index f61eb2eff3fd..59660c909a7c 100644 --- a/net/bridge/br_multicast.c +++ b/net/bridge/br_multicast.c | |||
@@ -1475,7 +1475,7 @@ static int br_multicast_ipv6_rcv(struct net_bridge *br, | |||
1475 | ip6h->payload_len == 0) | 1475 | ip6h->payload_len == 0) |
1476 | return 0; | 1476 | return 0; |
1477 | 1477 | ||
1478 | len = ntohs(ip6h->payload_len); | 1478 | len = ntohs(ip6h->payload_len) + sizeof(*ip6h); |
1479 | if (skb->len < len) | 1479 | if (skb->len < len) |
1480 | return -EINVAL; | 1480 | return -EINVAL; |
1481 | 1481 | ||
diff --git a/net/bridge/br_stp_if.c b/net/bridge/br_stp_if.c index 5593f5aec942..9b61d09de9b9 100644 --- a/net/bridge/br_stp_if.c +++ b/net/bridge/br_stp_if.c | |||
@@ -213,7 +213,7 @@ bool br_stp_recalculate_bridge_id(struct net_bridge *br) | |||
213 | 213 | ||
214 | /* user has chosen a value so keep it */ | 214 | /* user has chosen a value so keep it */ |
215 | if (br->flags & BR_SET_MAC_ADDR) | 215 | if (br->flags & BR_SET_MAC_ADDR) |
216 | return; | 216 | return false; |
217 | 217 | ||
218 | list_for_each_entry(p, &br->port_list, list) { | 218 | list_for_each_entry(p, &br->port_list, list) { |
219 | if (addr == br_mac_zero || | 219 | if (addr == br_mac_zero || |
diff --git a/net/core/dev.c b/net/core/dev.c index 563ddc28139d..3da9fb06d47a 100644 --- a/net/core/dev.c +++ b/net/core/dev.c | |||
@@ -1454,6 +1454,27 @@ static inline void net_timestamp_check(struct sk_buff *skb) | |||
1454 | __net_timestamp(skb); | 1454 | __net_timestamp(skb); |
1455 | } | 1455 | } |
1456 | 1456 | ||
1457 | static inline bool is_skb_forwardable(struct net_device *dev, | ||
1458 | struct sk_buff *skb) | ||
1459 | { | ||
1460 | unsigned int len; | ||
1461 | |||
1462 | if (!(dev->flags & IFF_UP)) | ||
1463 | return false; | ||
1464 | |||
1465 | len = dev->mtu + dev->hard_header_len + VLAN_HLEN; | ||
1466 | if (skb->len <= len) | ||
1467 | return true; | ||
1468 | |||
1469 | /* if TSO is enabled, we don't care about the length as the packet | ||
1470 | * could be forwarded without being segmented before | ||
1471 | */ | ||
1472 | if (skb_is_gso(skb)) | ||
1473 | return true; | ||
1474 | |||
1475 | return false; | ||
1476 | } | ||
1477 | |||
1457 | /** | 1478 | /** |
1458 | * dev_forward_skb - loopback an skb to another netif | 1479 | * dev_forward_skb - loopback an skb to another netif |
1459 | * | 1480 | * |
@@ -1477,8 +1498,7 @@ int dev_forward_skb(struct net_device *dev, struct sk_buff *skb) | |||
1477 | skb_orphan(skb); | 1498 | skb_orphan(skb); |
1478 | nf_reset(skb); | 1499 | nf_reset(skb); |
1479 | 1500 | ||
1480 | if (unlikely(!(dev->flags & IFF_UP) || | 1501 | if (unlikely(!is_skb_forwardable(dev, skb))) { |
1481 | (skb->len > (dev->mtu + dev->hard_header_len + VLAN_HLEN)))) { | ||
1482 | atomic_long_inc(&dev->rx_dropped); | 1502 | atomic_long_inc(&dev->rx_dropped); |
1483 | kfree_skb(skb); | 1503 | kfree_skb(skb); |
1484 | return NET_RX_DROP; | 1504 | return NET_RX_DROP; |
diff --git a/net/ipv4/arp.c b/net/ipv4/arp.c index 090d273d7865..1b74d3b64371 100644 --- a/net/ipv4/arp.c +++ b/net/ipv4/arp.c | |||
@@ -215,6 +215,9 @@ int arp_mc_map(__be32 addr, u8 *haddr, struct net_device *dev, int dir) | |||
215 | case ARPHRD_INFINIBAND: | 215 | case ARPHRD_INFINIBAND: |
216 | ip_ib_mc_map(addr, dev->broadcast, haddr); | 216 | ip_ib_mc_map(addr, dev->broadcast, haddr); |
217 | return 0; | 217 | return 0; |
218 | case ARPHRD_IPGRE: | ||
219 | ip_ipgre_mc_map(addr, dev->broadcast, haddr); | ||
220 | return 0; | ||
218 | default: | 221 | default: |
219 | if (dir) { | 222 | if (dir) { |
220 | memcpy(haddr, dev->broadcast, dev->addr_len); | 223 | memcpy(haddr, dev->broadcast, dev->addr_len); |
diff --git a/net/ipv4/fib_frontend.c b/net/ipv4/fib_frontend.c index f116ce8f1b46..451088330bbb 100644 --- a/net/ipv4/fib_frontend.c +++ b/net/ipv4/fib_frontend.c | |||
@@ -1068,6 +1068,7 @@ static void ip_fib_net_exit(struct net *net) | |||
1068 | fib4_rules_exit(net); | 1068 | fib4_rules_exit(net); |
1069 | #endif | 1069 | #endif |
1070 | 1070 | ||
1071 | rtnl_lock(); | ||
1071 | for (i = 0; i < FIB_TABLE_HASHSZ; i++) { | 1072 | for (i = 0; i < FIB_TABLE_HASHSZ; i++) { |
1072 | struct fib_table *tb; | 1073 | struct fib_table *tb; |
1073 | struct hlist_head *head; | 1074 | struct hlist_head *head; |
@@ -1080,6 +1081,7 @@ static void ip_fib_net_exit(struct net *net) | |||
1080 | fib_free_table(tb); | 1081 | fib_free_table(tb); |
1081 | } | 1082 | } |
1082 | } | 1083 | } |
1084 | rtnl_unlock(); | ||
1083 | kfree(net->ipv4.fib_table_hash); | 1085 | kfree(net->ipv4.fib_table_hash); |
1084 | } | 1086 | } |
1085 | 1087 | ||
diff --git a/net/ipv6/ndisc.c b/net/ipv6/ndisc.c index 0e49c9db3c98..92f952d093db 100644 --- a/net/ipv6/ndisc.c +++ b/net/ipv6/ndisc.c | |||
@@ -341,6 +341,8 @@ int ndisc_mc_map(struct in6_addr *addr, char *buf, struct net_device *dev, int d | |||
341 | case ARPHRD_INFINIBAND: | 341 | case ARPHRD_INFINIBAND: |
342 | ipv6_ib_mc_map(addr, dev->broadcast, buf); | 342 | ipv6_ib_mc_map(addr, dev->broadcast, buf); |
343 | return 0; | 343 | return 0; |
344 | case ARPHRD_IPGRE: | ||
345 | return ipv6_ipgre_mc_map(addr, dev->broadcast, buf); | ||
344 | default: | 346 | default: |
345 | if (dir) { | 347 | if (dir) { |
346 | memcpy(buf, dev->broadcast, dev->addr_len); | 348 | memcpy(buf, dev->broadcast, dev->addr_len); |
diff --git a/net/sctp/protocol.c b/net/sctp/protocol.c index 152976ec0b74..d5bf91d04f63 100644 --- a/net/sctp/protocol.c +++ b/net/sctp/protocol.c | |||
@@ -1205,7 +1205,7 @@ SCTP_STATIC __init int sctp_init(void) | |||
1205 | if ((sctp_assoc_hashsize > (64 * 1024)) && order > 0) | 1205 | if ((sctp_assoc_hashsize > (64 * 1024)) && order > 0) |
1206 | continue; | 1206 | continue; |
1207 | sctp_assoc_hashtable = (struct sctp_hashbucket *) | 1207 | sctp_assoc_hashtable = (struct sctp_hashbucket *) |
1208 | __get_free_pages(GFP_ATOMIC, order); | 1208 | __get_free_pages(GFP_ATOMIC|__GFP_NOWARN, order); |
1209 | } while (!sctp_assoc_hashtable && --order > 0); | 1209 | } while (!sctp_assoc_hashtable && --order > 0); |
1210 | if (!sctp_assoc_hashtable) { | 1210 | if (!sctp_assoc_hashtable) { |
1211 | pr_err("Failed association hash alloc\n"); | 1211 | pr_err("Failed association hash alloc\n"); |
@@ -1238,7 +1238,7 @@ SCTP_STATIC __init int sctp_init(void) | |||
1238 | if ((sctp_port_hashsize > (64 * 1024)) && order > 0) | 1238 | if ((sctp_port_hashsize > (64 * 1024)) && order > 0) |
1239 | continue; | 1239 | continue; |
1240 | sctp_port_hashtable = (struct sctp_bind_hashbucket *) | 1240 | sctp_port_hashtable = (struct sctp_bind_hashbucket *) |
1241 | __get_free_pages(GFP_ATOMIC, order); | 1241 | __get_free_pages(GFP_ATOMIC|__GFP_NOWARN, order); |
1242 | } while (!sctp_port_hashtable && --order > 0); | 1242 | } while (!sctp_port_hashtable && --order > 0); |
1243 | if (!sctp_port_hashtable) { | 1243 | if (!sctp_port_hashtable) { |
1244 | pr_err("Failed bind hash alloc\n"); | 1244 | pr_err("Failed bind hash alloc\n"); |