aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2010-05-12 03:05:35 -0400
committerDavid S. Miller <davem@davemloft.net>2010-05-12 03:05:35 -0400
commit278554bd6579206921f5d8a523649a7a57f8850d (patch)
tree4e6c527daf0910e455b3aa72e2c96b0479e430be /net
parent5a147e8bf982f9dd414c1dd751fe02c1942506b2 (diff)
parentcea0d767c29669bf89f86e4aee46ef462d2ebae8 (diff)
Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6
Conflicts: Documentation/feature-removal-schedule.txt drivers/net/wireless/ath/ar9170/usb.c drivers/scsi/iscsi_tcp.c net/ipv4/ipmr.c
Diffstat (limited to 'net')
-rw-r--r--net/core/dev.c11
-rw-r--r--net/ipv4/arp.c6
-rw-r--r--net/ipv4/ipmr.c3
-rw-r--r--net/ipv4/udp.c6
-rw-r--r--net/ipv6/af_inet6.c2
-rw-r--r--net/ipv6/datagram.c8
-rw-r--r--net/llc/llc_sap.c2
-rw-r--r--net/mac80211/mlme.c3
-rw-r--r--net/sctp/input.c22
-rw-r--r--net/sctp/sm_sideeffect.c35
-rw-r--r--net/sctp/transport.c2
-rw-r--r--net/sunrpc/auth.c2
12 files changed, 79 insertions, 23 deletions
diff --git a/net/core/dev.c b/net/core/dev.c
index 32611c8f1219..3daee30a7c82 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -1470,7 +1470,7 @@ static inline void net_timestamp(struct sk_buff *skb)
1470 * 1470 *
1471 * return values: 1471 * return values:
1472 * NET_RX_SUCCESS (no congestion) 1472 * NET_RX_SUCCESS (no congestion)
1473 * NET_RX_DROP (packet was dropped) 1473 * NET_RX_DROP (packet was dropped, but freed)
1474 * 1474 *
1475 * dev_forward_skb can be used for injecting an skb from the 1475 * dev_forward_skb can be used for injecting an skb from the
1476 * start_xmit function of one device into the receive queue 1476 * start_xmit function of one device into the receive queue
@@ -1484,12 +1484,11 @@ int dev_forward_skb(struct net_device *dev, struct sk_buff *skb)
1484{ 1484{
1485 skb_orphan(skb); 1485 skb_orphan(skb);
1486 1486
1487 if (!(dev->flags & IFF_UP)) 1487 if (!(dev->flags & IFF_UP) ||
1488 return NET_RX_DROP; 1488 (skb->len > (dev->mtu + dev->hard_header_len))) {
1489 1489 kfree_skb(skb);
1490 if (skb->len > (dev->mtu + dev->hard_header_len))
1491 return NET_RX_DROP; 1490 return NET_RX_DROP;
1492 1491 }
1493 skb_set_dev(skb, dev); 1492 skb_set_dev(skb, dev);
1494 skb->tstamp.tv64 = 0; 1493 skb->tstamp.tv64 = 0;
1495 skb->pkt_type = PACKET_HOST; 1494 skb->pkt_type = PACKET_HOST;
diff --git a/net/ipv4/arp.c b/net/ipv4/arp.c
index 6e747065c202..80769f1f9fab 100644
--- a/net/ipv4/arp.c
+++ b/net/ipv4/arp.c
@@ -661,13 +661,13 @@ struct sk_buff *arp_create(int type, int ptype, __be32 dest_ip,
661#endif 661#endif
662#endif 662#endif
663 663
664#ifdef CONFIG_FDDI 664#if defined(CONFIG_FDDI) || defined(CONFIG_FDDI_MODULE)
665 case ARPHRD_FDDI: 665 case ARPHRD_FDDI:
666 arp->ar_hrd = htons(ARPHRD_ETHER); 666 arp->ar_hrd = htons(ARPHRD_ETHER);
667 arp->ar_pro = htons(ETH_P_IP); 667 arp->ar_pro = htons(ETH_P_IP);
668 break; 668 break;
669#endif 669#endif
670#ifdef CONFIG_TR 670#if defined(CONFIG_TR) || defined(CONFIG_TR_MODULE)
671 case ARPHRD_IEEE802_TR: 671 case ARPHRD_IEEE802_TR:
672 arp->ar_hrd = htons(ARPHRD_IEEE802); 672 arp->ar_hrd = htons(ARPHRD_IEEE802);
673 arp->ar_pro = htons(ETH_P_IP); 673 arp->ar_pro = htons(ETH_P_IP);
@@ -1051,7 +1051,7 @@ static int arp_req_set(struct net *net, struct arpreq *r,
1051 return -EINVAL; 1051 return -EINVAL;
1052 } 1052 }
1053 switch (dev->type) { 1053 switch (dev->type) {
1054#ifdef CONFIG_FDDI 1054#if defined(CONFIG_FDDI) || defined(CONFIG_FDDI_MODULE)
1055 case ARPHRD_FDDI: 1055 case ARPHRD_FDDI:
1056 /* 1056 /*
1057 * According to RFC 1390, FDDI devices should accept ARP 1057 * According to RFC 1390, FDDI devices should accept ARP
diff --git a/net/ipv4/ipmr.c b/net/ipv4/ipmr.c
index f3f1c6b5c70c..7a7ee1cc3b5a 100644
--- a/net/ipv4/ipmr.c
+++ b/net/ipv4/ipmr.c
@@ -998,7 +998,8 @@ ipmr_cache_unresolved(struct mr_table *mrt, vifi_t vifi, struct sk_buff *skb)
998 atomic_inc(&mrt->cache_resolve_queue_len); 998 atomic_inc(&mrt->cache_resolve_queue_len);
999 list_add(&c->list, &mrt->mfc_unres_queue); 999 list_add(&c->list, &mrt->mfc_unres_queue);
1000 1000
1001 mod_timer(&mrt->ipmr_expire_timer, c->mfc_un.unres.expires); 1001 if (atomic_read(&mrt->cache_resolve_queue_len) == 1)
1002 mod_timer(&mrt->ipmr_expire_timer, c->mfc_un.unres.expires);
1002 } 1003 }
1003 1004
1004 /* 1005 /*
diff --git a/net/ipv4/udp.c b/net/ipv4/udp.c
index 4560b291180b..f3e00c5cd1ed 100644
--- a/net/ipv4/udp.c
+++ b/net/ipv4/udp.c
@@ -1536,6 +1536,9 @@ int __udp4_lib_rcv(struct sk_buff *skb, struct udp_table *udptable,
1536 1536
1537 uh = udp_hdr(skb); 1537 uh = udp_hdr(skb);
1538 ulen = ntohs(uh->len); 1538 ulen = ntohs(uh->len);
1539 saddr = ip_hdr(skb)->saddr;
1540 daddr = ip_hdr(skb)->daddr;
1541
1539 if (ulen > skb->len) 1542 if (ulen > skb->len)
1540 goto short_packet; 1543 goto short_packet;
1541 1544
@@ -1549,9 +1552,6 @@ int __udp4_lib_rcv(struct sk_buff *skb, struct udp_table *udptable,
1549 if (udp4_csum_init(skb, uh, proto)) 1552 if (udp4_csum_init(skb, uh, proto))
1550 goto csum_error; 1553 goto csum_error;
1551 1554
1552 saddr = ip_hdr(skb)->saddr;
1553 daddr = ip_hdr(skb)->daddr;
1554
1555 if (rt->rt_flags & (RTCF_BROADCAST|RTCF_MULTICAST)) 1555 if (rt->rt_flags & (RTCF_BROADCAST|RTCF_MULTICAST))
1556 return __udp4_lib_mcast_deliver(net, skb, uh, 1556 return __udp4_lib_mcast_deliver(net, skb, uh,
1557 saddr, daddr, udptable); 1557 saddr, daddr, udptable);
diff --git a/net/ipv6/af_inet6.c b/net/ipv6/af_inet6.c
index d2df3144429b..e733942dafe1 100644
--- a/net/ipv6/af_inet6.c
+++ b/net/ipv6/af_inet6.c
@@ -200,7 +200,7 @@ lookup_protocol:
200 200
201 inet_sk(sk)->pinet6 = np = inet6_sk_generic(sk); 201 inet_sk(sk)->pinet6 = np = inet6_sk_generic(sk);
202 np->hop_limit = -1; 202 np->hop_limit = -1;
203 np->mcast_hops = -1; 203 np->mcast_hops = IPV6_DEFAULT_MCASTHOPS;
204 np->mc_loop = 1; 204 np->mc_loop = 1;
205 np->pmtudisc = IPV6_PMTUDISC_WANT; 205 np->pmtudisc = IPV6_PMTUDISC_WANT;
206 np->ipv6only = net->ipv6.sysctl.bindv6only; 206 np->ipv6only = net->ipv6.sysctl.bindv6only;
diff --git a/net/ipv6/datagram.c b/net/ipv6/datagram.c
index 5959230bc6c1..712684687c9a 100644
--- a/net/ipv6/datagram.c
+++ b/net/ipv6/datagram.c
@@ -222,6 +222,8 @@ void ipv6_icmp_error(struct sock *sk, struct sk_buff *skb, int err,
222 if (!skb) 222 if (!skb)
223 return; 223 return;
224 224
225 skb->protocol = htons(ETH_P_IPV6);
226
225 serr = SKB_EXT_ERR(skb); 227 serr = SKB_EXT_ERR(skb);
226 serr->ee.ee_errno = err; 228 serr->ee.ee_errno = err;
227 serr->ee.ee_origin = SO_EE_ORIGIN_ICMP6; 229 serr->ee.ee_origin = SO_EE_ORIGIN_ICMP6;
@@ -255,6 +257,8 @@ void ipv6_local_error(struct sock *sk, int err, struct flowi *fl, u32 info)
255 if (!skb) 257 if (!skb)
256 return; 258 return;
257 259
260 skb->protocol = htons(ETH_P_IPV6);
261
258 skb_put(skb, sizeof(struct ipv6hdr)); 262 skb_put(skb, sizeof(struct ipv6hdr));
259 skb_reset_network_header(skb); 263 skb_reset_network_header(skb);
260 iph = ipv6_hdr(skb); 264 iph = ipv6_hdr(skb);
@@ -358,7 +362,7 @@ int ipv6_recv_error(struct sock *sk, struct msghdr *msg, int len)
358 sin->sin6_flowinfo = 0; 362 sin->sin6_flowinfo = 0;
359 sin->sin6_port = serr->port; 363 sin->sin6_port = serr->port;
360 sin->sin6_scope_id = 0; 364 sin->sin6_scope_id = 0;
361 if (serr->ee.ee_origin == SO_EE_ORIGIN_ICMP6) { 365 if (skb->protocol == htons(ETH_P_IPV6)) {
362 ipv6_addr_copy(&sin->sin6_addr, 366 ipv6_addr_copy(&sin->sin6_addr,
363 (struct in6_addr *)(nh + serr->addr_offset)); 367 (struct in6_addr *)(nh + serr->addr_offset));
364 if (np->sndflow) 368 if (np->sndflow)
@@ -380,7 +384,7 @@ int ipv6_recv_error(struct sock *sk, struct msghdr *msg, int len)
380 sin->sin6_family = AF_INET6; 384 sin->sin6_family = AF_INET6;
381 sin->sin6_flowinfo = 0; 385 sin->sin6_flowinfo = 0;
382 sin->sin6_scope_id = 0; 386 sin->sin6_scope_id = 0;
383 if (serr->ee.ee_origin == SO_EE_ORIGIN_ICMP6) { 387 if (skb->protocol == htons(ETH_P_IPV6)) {
384 ipv6_addr_copy(&sin->sin6_addr, &ipv6_hdr(skb)->saddr); 388 ipv6_addr_copy(&sin->sin6_addr, &ipv6_hdr(skb)->saddr);
385 if (np->rxopt.all) 389 if (np->rxopt.all)
386 datagram_recv_ctl(sk, msg, skb); 390 datagram_recv_ctl(sk, msg, skb);
diff --git a/net/llc/llc_sap.c b/net/llc/llc_sap.c
index a432f0ec051c..94e7fca75b85 100644
--- a/net/llc/llc_sap.c
+++ b/net/llc/llc_sap.c
@@ -31,7 +31,7 @@ static int llc_mac_header_len(unsigned short devtype)
31 case ARPHRD_ETHER: 31 case ARPHRD_ETHER:
32 case ARPHRD_LOOPBACK: 32 case ARPHRD_LOOPBACK:
33 return sizeof(struct ethhdr); 33 return sizeof(struct ethhdr);
34#ifdef CONFIG_TR 34#if defined(CONFIG_TR) || defined(CONFIG_TR_MODULE)
35 case ARPHRD_IEEE802_TR: 35 case ARPHRD_IEEE802_TR:
36 return sizeof(struct trh_hdr); 36 return sizeof(struct trh_hdr);
37#endif 37#endif
diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c
index 11783192a625..3093e46273c3 100644
--- a/net/mac80211/mlme.c
+++ b/net/mac80211/mlme.c
@@ -2178,7 +2178,8 @@ int ieee80211_mgd_deauth(struct ieee80211_sub_if_data *sdata,
2178 continue; 2178 continue;
2179 2179
2180 if (wk->type != IEEE80211_WORK_DIRECT_PROBE && 2180 if (wk->type != IEEE80211_WORK_DIRECT_PROBE &&
2181 wk->type != IEEE80211_WORK_AUTH) 2181 wk->type != IEEE80211_WORK_AUTH &&
2182 wk->type != IEEE80211_WORK_ASSOC)
2182 continue; 2183 continue;
2183 2184
2184 if (memcmp(req->bss->bssid, wk->filter_ta, ETH_ALEN)) 2185 if (memcmp(req->bss->bssid, wk->filter_ta, ETH_ALEN))
diff --git a/net/sctp/input.c b/net/sctp/input.c
index 2a570184e5a9..ea2192444ce6 100644
--- a/net/sctp/input.c
+++ b/net/sctp/input.c
@@ -440,11 +440,25 @@ void sctp_icmp_proto_unreachable(struct sock *sk,
440{ 440{
441 SCTP_DEBUG_PRINTK("%s\n", __func__); 441 SCTP_DEBUG_PRINTK("%s\n", __func__);
442 442
443 sctp_do_sm(SCTP_EVENT_T_OTHER, 443 if (sock_owned_by_user(sk)) {
444 SCTP_ST_OTHER(SCTP_EVENT_ICMP_PROTO_UNREACH), 444 if (timer_pending(&t->proto_unreach_timer))
445 asoc->state, asoc->ep, asoc, t, 445 return;
446 GFP_ATOMIC); 446 else {
447 if (!mod_timer(&t->proto_unreach_timer,
448 jiffies + (HZ/20)))
449 sctp_association_hold(asoc);
450 }
451
452 } else {
453 if (timer_pending(&t->proto_unreach_timer) &&
454 del_timer(&t->proto_unreach_timer))
455 sctp_association_put(asoc);
447 456
457 sctp_do_sm(SCTP_EVENT_T_OTHER,
458 SCTP_ST_OTHER(SCTP_EVENT_ICMP_PROTO_UNREACH),
459 asoc->state, asoc->ep, asoc, t,
460 GFP_ATOMIC);
461 }
448} 462}
449 463
450/* Common lookup code for icmp/icmpv6 error handler. */ 464/* Common lookup code for icmp/icmpv6 error handler. */
diff --git a/net/sctp/sm_sideeffect.c b/net/sctp/sm_sideeffect.c
index 3b7230ef77c2..22e670200449 100644
--- a/net/sctp/sm_sideeffect.c
+++ b/net/sctp/sm_sideeffect.c
@@ -397,6 +397,41 @@ out_unlock:
397 sctp_transport_put(transport); 397 sctp_transport_put(transport);
398} 398}
399 399
400/* Handle the timeout of the ICMP protocol unreachable timer. Trigger
401 * the correct state machine transition that will close the association.
402 */
403void sctp_generate_proto_unreach_event(unsigned long data)
404{
405 struct sctp_transport *transport = (struct sctp_transport *) data;
406 struct sctp_association *asoc = transport->asoc;
407
408 sctp_bh_lock_sock(asoc->base.sk);
409 if (sock_owned_by_user(asoc->base.sk)) {
410 SCTP_DEBUG_PRINTK("%s:Sock is busy.\n", __func__);
411
412 /* Try again later. */
413 if (!mod_timer(&transport->proto_unreach_timer,
414 jiffies + (HZ/20)))
415 sctp_association_hold(asoc);
416 goto out_unlock;
417 }
418
419 /* Is this structure just waiting around for us to actually
420 * get destroyed?
421 */
422 if (asoc->base.dead)
423 goto out_unlock;
424
425 sctp_do_sm(SCTP_EVENT_T_OTHER,
426 SCTP_ST_OTHER(SCTP_EVENT_ICMP_PROTO_UNREACH),
427 asoc->state, asoc->ep, asoc, transport, GFP_ATOMIC);
428
429out_unlock:
430 sctp_bh_unlock_sock(asoc->base.sk);
431 sctp_association_put(asoc);
432}
433
434
400/* Inject a SACK Timeout event into the state machine. */ 435/* Inject a SACK Timeout event into the state machine. */
401static void sctp_generate_sack_event(unsigned long data) 436static void sctp_generate_sack_event(unsigned long data)
402{ 437{
diff --git a/net/sctp/transport.c b/net/sctp/transport.c
index fccf4947aff1..d67501f92ca3 100644
--- a/net/sctp/transport.c
+++ b/net/sctp/transport.c
@@ -92,6 +92,8 @@ static struct sctp_transport *sctp_transport_init(struct sctp_transport *peer,
92 (unsigned long)peer); 92 (unsigned long)peer);
93 setup_timer(&peer->hb_timer, sctp_generate_heartbeat_event, 93 setup_timer(&peer->hb_timer, sctp_generate_heartbeat_event,
94 (unsigned long)peer); 94 (unsigned long)peer);
95 setup_timer(&peer->proto_unreach_timer,
96 sctp_generate_proto_unreach_event, (unsigned long)peer);
95 97
96 /* Initialize the 64-bit random nonce sent with heartbeat. */ 98 /* Initialize the 64-bit random nonce sent with heartbeat. */
97 get_random_bytes(&peer->hb_nonce, sizeof(peer->hb_nonce)); 99 get_random_bytes(&peer->hb_nonce, sizeof(peer->hb_nonce));
diff --git a/net/sunrpc/auth.c b/net/sunrpc/auth.c
index f394fc190a49..95afe79dd9d7 100644
--- a/net/sunrpc/auth.c
+++ b/net/sunrpc/auth.c
@@ -237,7 +237,7 @@ rpcauth_prune_expired(struct list_head *free, int nr_to_scan)
237 list_for_each_entry_safe(cred, next, &cred_unused, cr_lru) { 237 list_for_each_entry_safe(cred, next, &cred_unused, cr_lru) {
238 238
239 /* Enforce a 60 second garbage collection moratorium */ 239 /* Enforce a 60 second garbage collection moratorium */
240 if (time_in_range_open(cred->cr_expire, expired, jiffies) && 240 if (time_in_range(cred->cr_expire, expired, jiffies) &&
241 test_bit(RPCAUTH_CRED_HASHED, &cred->cr_flags) != 0) 241 test_bit(RPCAUTH_CRED_HASHED, &cred->cr_flags) != 0)
242 continue; 242 continue;
243 243