aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@woody.linux-foundation.org>2007-06-14 18:08:50 -0400
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-06-14 18:08:50 -0400
commit1e0e76cf1376a0a1b49a23396e945456c329814e (patch)
tree7d78114d02904557320ce802dcf6715e353053ac
parentf701737deb59654dd62e15d5dc379f387cf86c6d (diff)
parent559f0a2857f1d1a93c4f398d2775e228fdb8b8ce (diff)
Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6
* 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6: [IPV6] addrconf: Fix IPv6 on tuntap tunnels [TCP]: Add missing break to TCP option parsing code [SCTP] Don't disable PMTU discovery when mtu is small [SCTP] Flag a pmtu change request [SCTP] Update pmtu handling to be similar to tcp [SCTP] Fix leak in sctp_getsockopt_local_addrs when copy_to_user fails [SCTP]: Allow unspecified port in sctp_bindx() [SCTP]: Correctly set daddr for IPv6 sockets during peeloff [TCP]: Set initial_ssthresh default to zero in Cubic and BIC. [TCP]: Fix left_out setting during FRTO [TCP]: Disable TSO if MD5SIG is enabled. [PPP_MPPE]: Fix "osize too small" check. [PATCH] mac80211: Don't stop tx queue on master device while scanning. [PATCH] mac80211: fix debugfs tx power reduction output [PATCH] cfg80211: fix signed macaddress in sysfs [IrDA]: f-timer reloading when sending rejected frames. [IrDA]: Fix Rx/Tx path race.
-rw-r--r--drivers/net/ppp_mppe.c10
-rw-r--r--include/net/irda/irlap.h17
-rw-r--r--include/net/sctp/sctp.h7
-rw-r--r--include/net/sctp/structs.h7
-rw-r--r--net/ipv4/tcp_bic.c2
-rw-r--r--net/ipv4/tcp_cubic.c2
-rw-r--r--net/ipv4/tcp_input.c3
-rw-r--r--net/ipv4/tcp_ipv4.c3
-rw-r--r--net/ipv6/addrconf.c33
-rw-r--r--net/ipv6/tcp_ipv6.c2
-rw-r--r--net/irda/irlap_event.c28
-rw-r--r--net/irda/irlap_frame.c3
-rw-r--r--net/mac80211/debugfs.c2
-rw-r--r--net/mac80211/ieee80211_sta.c12
-rw-r--r--net/sctp/associola.c4
-rw-r--r--net/sctp/input.c24
-rw-r--r--net/sctp/socket.c31
-rw-r--r--net/sctp/transport.c39
-rw-r--r--net/wireless/sysfs.c2
19 files changed, 150 insertions, 81 deletions
diff --git a/drivers/net/ppp_mppe.c b/drivers/net/ppp_mppe.c
index d5bdd2574659..5ae80bbe2edc 100644
--- a/drivers/net/ppp_mppe.c
+++ b/drivers/net/ppp_mppe.c
@@ -493,14 +493,14 @@ mppe_decompress(void *arg, unsigned char *ibuf, int isize, unsigned char *obuf,
493 493
494 /* 494 /*
495 * Make sure we have enough room to decrypt the packet. 495 * Make sure we have enough room to decrypt the packet.
496 * Note that for our test we only subtract 1 byte whereas in 496 * To account for possible PFC we should only subtract 1
497 * mppe_compress() we added 2 bytes (+MPPE_OVHD); 497 * byte whereas in mppe_compress() we added 2 bytes (+MPPE_OVHD);
498 * this is to account for possible PFC. 498 * However, we assume no PFC, thus subtracting 2 bytes.
499 */ 499 */
500 if (osize < isize - MPPE_OVHD - 1) { 500 if (osize < isize - MPPE_OVHD - 2) {
501 printk(KERN_DEBUG "mppe_decompress[%d]: osize too small! " 501 printk(KERN_DEBUG "mppe_decompress[%d]: osize too small! "
502 "(have: %d need: %d)\n", state->unit, 502 "(have: %d need: %d)\n", state->unit,
503 osize, isize - MPPE_OVHD - 1); 503 osize, isize - MPPE_OVHD - 2);
504 return DECOMP_ERROR; 504 return DECOMP_ERROR;
505 } 505 }
506 osize = isize - MPPE_OVHD - 2; /* assume no PFC */ 506 osize = isize - MPPE_OVHD - 2; /* assume no PFC */
diff --git a/include/net/irda/irlap.h b/include/net/irda/irlap.h
index f0248fb8e196..a3d370efb903 100644
--- a/include/net/irda/irlap.h
+++ b/include/net/irda/irlap.h
@@ -289,4 +289,21 @@ static inline void irlap_clear_disconnect(struct irlap_cb *self)
289 self->disconnect_pending = FALSE; 289 self->disconnect_pending = FALSE;
290} 290}
291 291
292/*
293 * Function irlap_next_state (self, state)
294 *
295 * Switches state and provides debug information
296 *
297 */
298static inline void irlap_next_state(struct irlap_cb *self, IRLAP_STATE state)
299{
300 /*
301 if (!self || self->magic != LAP_MAGIC)
302 return;
303
304 IRDA_DEBUG(4, "next LAP state = %s\n", irlap_state[state]);
305 */
306 self->state = state;
307}
308
292#endif 309#endif
diff --git a/include/net/sctp/sctp.h b/include/net/sctp/sctp.h
index dda72bf5b9b4..16baef4dab7e 100644
--- a/include/net/sctp/sctp.h
+++ b/include/net/sctp/sctp.h
@@ -503,6 +503,13 @@ static inline int sctp_frag_point(const struct sctp_sock *sp, int pmtu)
503 return frag; 503 return frag;
504} 504}
505 505
506static inline void sctp_assoc_pending_pmtu(struct sctp_association *asoc)
507{
508
509 sctp_assoc_sync_pmtu(asoc);
510 asoc->pmtu_pending = 0;
511}
512
506/* Walk through a list of TLV parameters. Don't trust the 513/* Walk through a list of TLV parameters. Don't trust the
507 * individual parameter lengths and instead depend on 514 * individual parameter lengths and instead depend on
508 * the chunk length to indicate when to stop. Make sure 515 * the chunk length to indicate when to stop. Make sure
diff --git a/include/net/sctp/structs.h b/include/net/sctp/structs.h
index 5e81984b8478..ee4559b11302 100644
--- a/include/net/sctp/structs.h
+++ b/include/net/sctp/structs.h
@@ -912,6 +912,9 @@ struct sctp_transport {
912 */ 912 */
913 __u16 pathmaxrxt; 913 __u16 pathmaxrxt;
914 914
915 /* is the Path MTU update pending on this tranport */
916 __u8 pmtu_pending;
917
915 /* PMTU : The current known path MTU. */ 918 /* PMTU : The current known path MTU. */
916 __u32 pathmtu; 919 __u32 pathmtu;
917 920
@@ -1006,6 +1009,7 @@ void sctp_transport_raise_cwnd(struct sctp_transport *, __u32, __u32);
1006void sctp_transport_lower_cwnd(struct sctp_transport *, sctp_lower_cwnd_t); 1009void sctp_transport_lower_cwnd(struct sctp_transport *, sctp_lower_cwnd_t);
1007unsigned long sctp_transport_timeout(struct sctp_transport *); 1010unsigned long sctp_transport_timeout(struct sctp_transport *);
1008void sctp_transport_reset(struct sctp_transport *); 1011void sctp_transport_reset(struct sctp_transport *);
1012void sctp_transport_update_pmtu(struct sctp_transport *, u32);
1009 1013
1010 1014
1011/* This is the structure we use to queue packets as they come into 1015/* This is the structure we use to queue packets as they come into
@@ -1565,6 +1569,9 @@ struct sctp_association {
1565 */ 1569 */
1566 __u16 pathmaxrxt; 1570 __u16 pathmaxrxt;
1567 1571
1572 /* Flag that path mtu update is pending */
1573 __u8 pmtu_pending;
1574
1568 /* Association : The smallest PMTU discovered for all of the 1575 /* Association : The smallest PMTU discovered for all of the
1569 * PMTU : peer's transport addresses. 1576 * PMTU : peer's transport addresses.
1570 */ 1577 */
diff --git a/net/ipv4/tcp_bic.c b/net/ipv4/tcp_bic.c
index 281c9f913257..dd9ef65ad3ff 100644
--- a/net/ipv4/tcp_bic.c
+++ b/net/ipv4/tcp_bic.c
@@ -29,7 +29,7 @@ static int fast_convergence = 1;
29static int max_increment = 16; 29static int max_increment = 16;
30static int low_window = 14; 30static int low_window = 14;
31static int beta = 819; /* = 819/1024 (BICTCP_BETA_SCALE) */ 31static int beta = 819; /* = 819/1024 (BICTCP_BETA_SCALE) */
32static int initial_ssthresh = 100; 32static int initial_ssthresh;
33static int smooth_part = 20; 33static int smooth_part = 20;
34 34
35module_param(fast_convergence, int, 0644); 35module_param(fast_convergence, int, 0644);
diff --git a/net/ipv4/tcp_cubic.c b/net/ipv4/tcp_cubic.c
index 14224487b16b..ebfaac2f9f46 100644
--- a/net/ipv4/tcp_cubic.c
+++ b/net/ipv4/tcp_cubic.c
@@ -29,7 +29,7 @@
29static int fast_convergence __read_mostly = 1; 29static int fast_convergence __read_mostly = 1;
30static int max_increment __read_mostly = 16; 30static int max_increment __read_mostly = 16;
31static int beta __read_mostly = 819; /* = 819/1024 (BICTCP_BETA_SCALE) */ 31static int beta __read_mostly = 819; /* = 819/1024 (BICTCP_BETA_SCALE) */
32static int initial_ssthresh __read_mostly = 100; 32static int initial_ssthresh __read_mostly;
33static int bic_scale __read_mostly = 41; 33static int bic_scale __read_mostly = 41;
34static int tcp_friendliness __read_mostly = 1; 34static int tcp_friendliness __read_mostly = 1;
35 35
diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c
index 74683d81c3f1..d6d0f9b6cdc6 100644
--- a/net/ipv4/tcp_input.c
+++ b/net/ipv4/tcp_input.c
@@ -2037,7 +2037,7 @@ static void tcp_try_to_open(struct sock *sk, int flag)
2037{ 2037{
2038 struct tcp_sock *tp = tcp_sk(sk); 2038 struct tcp_sock *tp = tcp_sk(sk);
2039 2039
2040 tp->left_out = tp->sacked_out; 2040 tcp_sync_left_out(tp);
2041 2041
2042 if (tp->retrans_out == 0) 2042 if (tp->retrans_out == 0)
2043 tp->retrans_stamp = 0; 2043 tp->retrans_stamp = 0;
@@ -2932,6 +2932,7 @@ void tcp_parse_options(struct sk_buff *skb, struct tcp_options_received *opt_rx,
2932 opt_rx->sack_ok) { 2932 opt_rx->sack_ok) {
2933 TCP_SKB_CB(skb)->sacked = (ptr - 2) - (unsigned char *)th; 2933 TCP_SKB_CB(skb)->sacked = (ptr - 2) - (unsigned char *)th;
2934 } 2934 }
2935 break;
2935#ifdef CONFIG_TCP_MD5SIG 2936#ifdef CONFIG_TCP_MD5SIG
2936 case TCPOPT_MD5SIG: 2937 case TCPOPT_MD5SIG:
2937 /* 2938 /*
diff --git a/net/ipv4/tcp_ipv4.c b/net/ipv4/tcp_ipv4.c
index 97e294e82679..354721d67f69 100644
--- a/net/ipv4/tcp_ipv4.c
+++ b/net/ipv4/tcp_ipv4.c
@@ -878,6 +878,7 @@ int tcp_v4_md5_do_add(struct sock *sk, __be32 addr,
878 kfree(newkey); 878 kfree(newkey);
879 return -ENOMEM; 879 return -ENOMEM;
880 } 880 }
881 sk->sk_route_caps &= ~NETIF_F_GSO_MASK;
881 } 882 }
882 if (tcp_alloc_md5sig_pool() == NULL) { 883 if (tcp_alloc_md5sig_pool() == NULL) {
883 kfree(newkey); 884 kfree(newkey);
@@ -1007,7 +1008,7 @@ static int tcp_v4_parse_md5_keys(struct sock *sk, char __user *optval,
1007 return -EINVAL; 1008 return -EINVAL;
1008 1009
1009 tp->md5sig_info = p; 1010 tp->md5sig_info = p;
1010 1011 sk->sk_route_caps &= ~NETIF_F_GSO_MASK;
1011 } 1012 }
1012 1013
1013 newkey = kmemdup(cmd.tcpm_key, cmd.tcpm_keylen, GFP_KERNEL); 1014 newkey = kmemdup(cmd.tcpm_key, cmd.tcpm_keylen, GFP_KERNEL);
diff --git a/net/ipv6/addrconf.c b/net/ipv6/addrconf.c
index 5a5f8bd4597a..f96ed76d8fa4 100644
--- a/net/ipv6/addrconf.c
+++ b/net/ipv6/addrconf.c
@@ -2154,6 +2154,15 @@ static void addrconf_dev_config(struct net_device *dev)
2154 2154
2155 ASSERT_RTNL(); 2155 ASSERT_RTNL();
2156 2156
2157 if ((dev->type != ARPHRD_ETHER) &&
2158 (dev->type != ARPHRD_FDDI) &&
2159 (dev->type != ARPHRD_IEEE802_TR) &&
2160 (dev->type != ARPHRD_ARCNET) &&
2161 (dev->type != ARPHRD_INFINIBAND)) {
2162 /* Alas, we support only Ethernet autoconfiguration. */
2163 return;
2164 }
2165
2157 idev = addrconf_add_dev(dev); 2166 idev = addrconf_add_dev(dev);
2158 if (idev == NULL) 2167 if (idev == NULL)
2159 return; 2168 return;
@@ -2241,36 +2250,16 @@ static void addrconf_ip6_tnl_config(struct net_device *dev)
2241 ip6_tnl_add_linklocal(idev); 2250 ip6_tnl_add_linklocal(idev);
2242} 2251}
2243 2252
2244static int ipv6_hwtype(struct net_device *dev)
2245{
2246 if ((dev->type == ARPHRD_ETHER) ||
2247 (dev->type == ARPHRD_LOOPBACK) ||
2248 (dev->type == ARPHRD_SIT) ||
2249 (dev->type == ARPHRD_TUNNEL6) ||
2250 (dev->type == ARPHRD_FDDI) ||
2251 (dev->type == ARPHRD_IEEE802_TR) ||
2252 (dev->type == ARPHRD_ARCNET) ||
2253 (dev->type == ARPHRD_INFINIBAND))
2254 return 1;
2255
2256 return 0;
2257}
2258
2259static int addrconf_notify(struct notifier_block *this, unsigned long event, 2253static int addrconf_notify(struct notifier_block *this, unsigned long event,
2260 void * data) 2254 void * data)
2261{ 2255{
2262 struct net_device *dev = (struct net_device *) data; 2256 struct net_device *dev = (struct net_device *) data;
2263 struct inet6_dev *idev; 2257 struct inet6_dev *idev = __in6_dev_get(dev);
2264 int run_pending = 0; 2258 int run_pending = 0;
2265 2259
2266 if (!ipv6_hwtype(dev))
2267 return NOTIFY_OK;
2268
2269 idev = __in6_dev_get(dev);
2270
2271 switch(event) { 2260 switch(event) {
2272 case NETDEV_REGISTER: 2261 case NETDEV_REGISTER:
2273 if (!idev) { 2262 if (!idev && dev->mtu >= IPV6_MIN_MTU) {
2274 idev = ipv6_add_dev(dev); 2263 idev = ipv6_add_dev(dev);
2275 if (!idev) 2264 if (!idev)
2276 printk(KERN_WARNING "IPv6: add_dev failed for %s\n", 2265 printk(KERN_WARNING "IPv6: add_dev failed for %s\n",
diff --git a/net/ipv6/tcp_ipv6.c b/net/ipv6/tcp_ipv6.c
index 4f06a51ad4fd..193d9d60bb7a 100644
--- a/net/ipv6/tcp_ipv6.c
+++ b/net/ipv6/tcp_ipv6.c
@@ -590,6 +590,7 @@ static int tcp_v6_md5_do_add(struct sock *sk, struct in6_addr *peer,
590 kfree(newkey); 590 kfree(newkey);
591 return -ENOMEM; 591 return -ENOMEM;
592 } 592 }
593 sk->sk_route_caps &= ~NETIF_F_GSO_MASK;
593 } 594 }
594 tcp_alloc_md5sig_pool(); 595 tcp_alloc_md5sig_pool();
595 if (tp->md5sig_info->alloced6 == tp->md5sig_info->entries6) { 596 if (tp->md5sig_info->alloced6 == tp->md5sig_info->entries6) {
@@ -724,6 +725,7 @@ static int tcp_v6_parse_md5_keys (struct sock *sk, char __user *optval,
724 return -ENOMEM; 725 return -ENOMEM;
725 726
726 tp->md5sig_info = p; 727 tp->md5sig_info = p;
728 sk->sk_route_caps &= ~NETIF_F_GSO_MASK;
727 } 729 }
728 730
729 newkey = kmemdup(cmd.tcpm_key, cmd.tcpm_keylen, GFP_KERNEL); 731 newkey = kmemdup(cmd.tcpm_key, cmd.tcpm_keylen, GFP_KERNEL);
diff --git a/net/irda/irlap_event.c b/net/irda/irlap_event.c
index 0b02073ffdf3..a8b8873aa263 100644
--- a/net/irda/irlap_event.c
+++ b/net/irda/irlap_event.c
@@ -317,23 +317,6 @@ void irlap_do_event(struct irlap_cb *self, IRLAP_EVENT event,
317} 317}
318 318
319/* 319/*
320 * Function irlap_next_state (self, state)
321 *
322 * Switches state and provides debug information
323 *
324 */
325static inline void irlap_next_state(struct irlap_cb *self, IRLAP_STATE state)
326{
327 /*
328 if (!self || self->magic != LAP_MAGIC)
329 return;
330
331 IRDA_DEBUG(4, "next LAP state = %s\n", irlap_state[state]);
332 */
333 self->state = state;
334}
335
336/*
337 * Function irlap_state_ndm (event, skb, frame) 320 * Function irlap_state_ndm (event, skb, frame)
338 * 321 *
339 * NDM (Normal Disconnected Mode) state 322 * NDM (Normal Disconnected Mode) state
@@ -1086,7 +1069,6 @@ static int irlap_state_xmit_p(struct irlap_cb *self, IRLAP_EVENT event,
1086 } else { 1069 } else {
1087 /* Final packet of window */ 1070 /* Final packet of window */
1088 irlap_send_data_primary_poll(self, skb); 1071 irlap_send_data_primary_poll(self, skb);
1089 irlap_next_state(self, LAP_NRM_P);
1090 1072
1091 /* 1073 /*
1092 * Make sure state machine does not try to send 1074 * Make sure state machine does not try to send
@@ -1436,14 +1418,14 @@ static int irlap_state_nrm_p(struct irlap_cb *self, IRLAP_EVENT event,
1436 */ 1418 */
1437 self->remote_busy = FALSE; 1419 self->remote_busy = FALSE;
1438 1420
1421 /* Stop final timer */
1422 del_timer(&self->final_timer);
1423
1439 /* 1424 /*
1440 * Nr as expected? 1425 * Nr as expected?
1441 */ 1426 */
1442 ret = irlap_validate_nr_received(self, info->nr); 1427 ret = irlap_validate_nr_received(self, info->nr);
1443 if (ret == NR_EXPECTED) { 1428 if (ret == NR_EXPECTED) {
1444 /* Stop final timer */
1445 del_timer(&self->final_timer);
1446
1447 /* Update Nr received */ 1429 /* Update Nr received */
1448 irlap_update_nr_received(self, info->nr); 1430 irlap_update_nr_received(self, info->nr);
1449 1431
@@ -1475,14 +1457,12 @@ static int irlap_state_nrm_p(struct irlap_cb *self, IRLAP_EVENT event,
1475 1457
1476 /* Resend rejected frames */ 1458 /* Resend rejected frames */
1477 irlap_resend_rejected_frames(self, CMD_FRAME); 1459 irlap_resend_rejected_frames(self, CMD_FRAME);
1478 1460 irlap_start_final_timer(self, self->final_timeout * 2);
1479 /* Final timer ??? Jean II */
1480 1461
1481 irlap_next_state(self, LAP_NRM_P); 1462 irlap_next_state(self, LAP_NRM_P);
1482 } else if (ret == NR_INVALID) { 1463 } else if (ret == NR_INVALID) {
1483 IRDA_DEBUG(1, "%s(), Received RR with " 1464 IRDA_DEBUG(1, "%s(), Received RR with "
1484 "invalid nr !\n", __FUNCTION__); 1465 "invalid nr !\n", __FUNCTION__);
1485 del_timer(&self->final_timer);
1486 1466
1487 irlap_next_state(self, LAP_RESET_WAIT); 1467 irlap_next_state(self, LAP_RESET_WAIT);
1488 1468
diff --git a/net/irda/irlap_frame.c b/net/irda/irlap_frame.c
index 3c5a68e36414..3013c49ab975 100644
--- a/net/irda/irlap_frame.c
+++ b/net/irda/irlap_frame.c
@@ -798,16 +798,19 @@ void irlap_send_data_primary_poll(struct irlap_cb *self, struct sk_buff *skb)
798 self->vs = (self->vs + 1) % 8; 798 self->vs = (self->vs + 1) % 8;
799 self->ack_required = FALSE; 799 self->ack_required = FALSE;
800 800
801 irlap_next_state(self, LAP_NRM_P);
801 irlap_send_i_frame(self, tx_skb, CMD_FRAME); 802 irlap_send_i_frame(self, tx_skb, CMD_FRAME);
802 } else { 803 } else {
803 IRDA_DEBUG(4, "%s(), sending unreliable frame\n", __FUNCTION__); 804 IRDA_DEBUG(4, "%s(), sending unreliable frame\n", __FUNCTION__);
804 805
805 if (self->ack_required) { 806 if (self->ack_required) {
806 irlap_send_ui_frame(self, skb_get(skb), self->caddr, CMD_FRAME); 807 irlap_send_ui_frame(self, skb_get(skb), self->caddr, CMD_FRAME);
808 irlap_next_state(self, LAP_NRM_P);
807 irlap_send_rr_frame(self, CMD_FRAME); 809 irlap_send_rr_frame(self, CMD_FRAME);
808 self->ack_required = FALSE; 810 self->ack_required = FALSE;
809 } else { 811 } else {
810 skb->data[1] |= PF_BIT; 812 skb->data[1] |= PF_BIT;
813 irlap_next_state(self, LAP_NRM_P);
811 irlap_send_ui_frame(self, skb_get(skb), self->caddr, CMD_FRAME); 814 irlap_send_ui_frame(self, skb_get(skb), self->caddr, CMD_FRAME);
812 } 815 }
813 } 816 }
diff --git a/net/mac80211/debugfs.c b/net/mac80211/debugfs.c
index bb6c0feb2d48..476c8486f789 100644
--- a/net/mac80211/debugfs.c
+++ b/net/mac80211/debugfs.c
@@ -112,7 +112,7 @@ DEBUGFS_READONLY_FILE(wep_iv, 20, "%#06x",
112 local->wep_iv & 0xffffff); 112 local->wep_iv & 0xffffff);
113DEBUGFS_READONLY_FILE(tx_power_reduction, 20, "%d.%d dBm", 113DEBUGFS_READONLY_FILE(tx_power_reduction, 20, "%d.%d dBm",
114 local->hw.conf.tx_power_reduction / 10, 114 local->hw.conf.tx_power_reduction / 10,
115 local->hw.conf.tx_power_reduction & 10); 115 local->hw.conf.tx_power_reduction % 10);
116DEBUGFS_READONLY_FILE(rate_ctrl_alg, 100, "%s", 116DEBUGFS_READONLY_FILE(rate_ctrl_alg, 100, "%s",
117 local->rate_ctrl ? local->rate_ctrl->ops->name : "<unset>"); 117 local->rate_ctrl ? local->rate_ctrl->ops->name : "<unset>");
118 118
diff --git a/net/mac80211/ieee80211_sta.c b/net/mac80211/ieee80211_sta.c
index 9f30ae4c2ab3..91b545c144c1 100644
--- a/net/mac80211/ieee80211_sta.c
+++ b/net/mac80211/ieee80211_sta.c
@@ -2592,11 +2592,17 @@ void ieee80211_scan_completed(struct ieee80211_hw *hw)
2592 2592
2593 read_lock(&local->sub_if_lock); 2593 read_lock(&local->sub_if_lock);
2594 list_for_each_entry(sdata, &local->sub_if_list, list) { 2594 list_for_each_entry(sdata, &local->sub_if_list, list) {
2595
2596 /* No need to wake the master device. */
2597 if (sdata->dev == local->mdev)
2598 continue;
2599
2595 if (sdata->type == IEEE80211_IF_TYPE_STA) { 2600 if (sdata->type == IEEE80211_IF_TYPE_STA) {
2596 if (sdata->u.sta.associated) 2601 if (sdata->u.sta.associated)
2597 ieee80211_send_nullfunc(local, sdata, 0); 2602 ieee80211_send_nullfunc(local, sdata, 0);
2598 ieee80211_sta_timer((unsigned long)sdata); 2603 ieee80211_sta_timer((unsigned long)sdata);
2599 } 2604 }
2605
2600 netif_wake_queue(sdata->dev); 2606 netif_wake_queue(sdata->dev);
2601 } 2607 }
2602 read_unlock(&local->sub_if_lock); 2608 read_unlock(&local->sub_if_lock);
@@ -2738,6 +2744,12 @@ static int ieee80211_sta_start_scan(struct net_device *dev,
2738 2744
2739 read_lock(&local->sub_if_lock); 2745 read_lock(&local->sub_if_lock);
2740 list_for_each_entry(sdata, &local->sub_if_list, list) { 2746 list_for_each_entry(sdata, &local->sub_if_list, list) {
2747
2748 /* Don't stop the master interface, otherwise we can't transmit
2749 * probes! */
2750 if (sdata->dev == local->mdev)
2751 continue;
2752
2741 netif_stop_queue(sdata->dev); 2753 netif_stop_queue(sdata->dev);
2742 if (sdata->type == IEEE80211_IF_TYPE_STA && 2754 if (sdata->type == IEEE80211_IF_TYPE_STA &&
2743 sdata->u.sta.associated) 2755 sdata->u.sta.associated)
diff --git a/net/sctp/associola.c b/net/sctp/associola.c
index df94e3cdfba3..498edb0cd4e5 100644
--- a/net/sctp/associola.c
+++ b/net/sctp/associola.c
@@ -1231,6 +1231,10 @@ void sctp_assoc_sync_pmtu(struct sctp_association *asoc)
1231 /* Get the lowest pmtu of all the transports. */ 1231 /* Get the lowest pmtu of all the transports. */
1232 list_for_each(pos, &asoc->peer.transport_addr_list) { 1232 list_for_each(pos, &asoc->peer.transport_addr_list) {
1233 t = list_entry(pos, struct sctp_transport, transports); 1233 t = list_entry(pos, struct sctp_transport, transports);
1234 if (t->pmtu_pending && t->dst) {
1235 sctp_transport_update_pmtu(t, dst_mtu(t->dst));
1236 t->pmtu_pending = 0;
1237 }
1234 if (!pmtu || (t->pathmtu < pmtu)) 1238 if (!pmtu || (t->pathmtu < pmtu))
1235 pmtu = t->pathmtu; 1239 pmtu = t->pathmtu;
1236 } 1240 }
diff --git a/net/sctp/input.c b/net/sctp/input.c
index 885109fb3dda..d57ff7f3c576 100644
--- a/net/sctp/input.c
+++ b/net/sctp/input.c
@@ -367,24 +367,18 @@ static void sctp_add_backlog(struct sock *sk, struct sk_buff *skb)
367void sctp_icmp_frag_needed(struct sock *sk, struct sctp_association *asoc, 367void sctp_icmp_frag_needed(struct sock *sk, struct sctp_association *asoc,
368 struct sctp_transport *t, __u32 pmtu) 368 struct sctp_transport *t, __u32 pmtu)
369{ 369{
370 if (sock_owned_by_user(sk) || !t || (t->pathmtu == pmtu)) 370 if (!t || (t->pathmtu == pmtu))
371 return; 371 return;
372 372
373 if (sock_owned_by_user(sk)) {
374 asoc->pmtu_pending = 1;
375 t->pmtu_pending = 1;
376 return;
377 }
378
373 if (t->param_flags & SPP_PMTUD_ENABLE) { 379 if (t->param_flags & SPP_PMTUD_ENABLE) {
374 if (unlikely(pmtu < SCTP_DEFAULT_MINSEGMENT)) { 380 /* Update transports view of the MTU */
375 printk(KERN_WARNING "%s: Reported pmtu %d too low, " 381 sctp_transport_update_pmtu(t, pmtu);
376 "using default minimum of %d\n",
377 __FUNCTION__, pmtu,
378 SCTP_DEFAULT_MINSEGMENT);
379 /* Use default minimum segment size and disable
380 * pmtu discovery on this transport.
381 */
382 t->pathmtu = SCTP_DEFAULT_MINSEGMENT;
383 t->param_flags = (t->param_flags & ~SPP_PMTUD) |
384 SPP_PMTUD_DISABLE;
385 } else {
386 t->pathmtu = pmtu;
387 }
388 382
389 /* Update association pmtu. */ 383 /* Update association pmtu. */
390 sctp_assoc_sync_pmtu(asoc); 384 sctp_assoc_sync_pmtu(asoc);
diff --git a/net/sctp/socket.c b/net/sctp/socket.c
index 4dcdabf56473..6edaaa009d62 100644
--- a/net/sctp/socket.c
+++ b/net/sctp/socket.c
@@ -333,12 +333,19 @@ SCTP_STATIC int sctp_do_bind(struct sock *sk, union sctp_addr *addr, int len)
333 if (!sp->pf->bind_verify(sp, addr)) 333 if (!sp->pf->bind_verify(sp, addr))
334 return -EADDRNOTAVAIL; 334 return -EADDRNOTAVAIL;
335 335
336 /* We must either be unbound, or bind to the same port. */ 336 /* We must either be unbound, or bind to the same port.
337 if (bp->port && (snum != bp->port)) { 337 * It's OK to allow 0 ports if we are already bound.
338 SCTP_DEBUG_PRINTK("sctp_do_bind:" 338 * We'll just inhert an already bound port in this case
339 */
340 if (bp->port) {
341 if (!snum)
342 snum = bp->port;
343 else if (snum != bp->port) {
344 SCTP_DEBUG_PRINTK("sctp_do_bind:"
339 " New port %d does not match existing port " 345 " New port %d does not match existing port "
340 "%d.\n", snum, bp->port); 346 "%d.\n", snum, bp->port);
341 return -EINVAL; 347 return -EINVAL;
348 }
342 } 349 }
343 350
344 if (snum && snum < PROT_SOCK && !capable(CAP_NET_BIND_SERVICE)) 351 if (snum && snum < PROT_SOCK && !capable(CAP_NET_BIND_SERVICE))
@@ -1655,6 +1662,9 @@ SCTP_STATIC int sctp_sendmsg(struct kiocb *iocb, struct sock *sk,
1655 goto out_free; 1662 goto out_free;
1656 } 1663 }
1657 1664
1665 if (asoc->pmtu_pending)
1666 sctp_assoc_pending_pmtu(asoc);
1667
1658 /* If fragmentation is disabled and the message length exceeds the 1668 /* If fragmentation is disabled and the message length exceeds the
1659 * association fragmentation point, return EMSGSIZE. The I-D 1669 * association fragmentation point, return EMSGSIZE. The I-D
1660 * does not specify what this error is, but this looks like 1670 * does not specify what this error is, but this looks like
@@ -3550,6 +3560,7 @@ SCTP_STATIC int sctp_do_peeloff(struct sctp_association *asoc,
3550 struct sock *sk = asoc->base.sk; 3560 struct sock *sk = asoc->base.sk;
3551 struct socket *sock; 3561 struct socket *sock;
3552 struct inet_sock *inetsk; 3562 struct inet_sock *inetsk;
3563 struct sctp_af *af;
3553 int err = 0; 3564 int err = 0;
3554 3565
3555 /* An association cannot be branched off from an already peeled-off 3566 /* An association cannot be branched off from an already peeled-off
@@ -3571,8 +3582,9 @@ SCTP_STATIC int sctp_do_peeloff(struct sctp_association *asoc,
3571 /* Make peeled-off sockets more like 1-1 accepted sockets. 3582 /* Make peeled-off sockets more like 1-1 accepted sockets.
3572 * Set the daddr and initialize id to something more random 3583 * Set the daddr and initialize id to something more random
3573 */ 3584 */
3585 af = sctp_get_af_specific(asoc->peer.primary_addr.sa.sa_family);
3586 af->to_sk_daddr(&asoc->peer.primary_addr, sk);
3574 inetsk = inet_sk(sock->sk); 3587 inetsk = inet_sk(sock->sk);
3575 inetsk->daddr = asoc->peer.primary_addr.v4.sin_addr.s_addr;
3576 inetsk->id = asoc->next_tsn ^ jiffies; 3588 inetsk->id = asoc->next_tsn ^ jiffies;
3577 3589
3578 *sockp = sock; 3590 *sockp = sock;
@@ -4343,11 +4355,12 @@ copy_getaddrs:
4343 err = -EFAULT; 4355 err = -EFAULT;
4344 goto error; 4356 goto error;
4345 } 4357 }
4346 if (put_user(cnt, &((struct sctp_getaddrs __user *)optval)->addr_num)) 4358 if (put_user(cnt, &((struct sctp_getaddrs __user *)optval)->addr_num)) {
4347 return -EFAULT; 4359 err = -EFAULT;
4360 goto error;
4361 }
4348 if (put_user(bytes_copied, optlen)) 4362 if (put_user(bytes_copied, optlen))
4349 return -EFAULT; 4363 err = -EFAULT;
4350
4351error: 4364error:
4352 kfree(addrs); 4365 kfree(addrs);
4353 return err; 4366 return err;
diff --git a/net/sctp/transport.c b/net/sctp/transport.c
index 961df275d5b9..5f467c914f80 100644
--- a/net/sctp/transport.c
+++ b/net/sctp/transport.c
@@ -241,6 +241,45 @@ void sctp_transport_pmtu(struct sctp_transport *transport)
241 transport->pathmtu = SCTP_DEFAULT_MAXSEGMENT; 241 transport->pathmtu = SCTP_DEFAULT_MAXSEGMENT;
242} 242}
243 243
244/* this is a complete rip-off from __sk_dst_check
245 * the cookie is always 0 since this is how it's used in the
246 * pmtu code
247 */
248static struct dst_entry *sctp_transport_dst_check(struct sctp_transport *t)
249{
250 struct dst_entry *dst = t->dst;
251
252 if (dst && dst->obsolete && dst->ops->check(dst, 0) == NULL) {
253 dst_release(t->dst);
254 t->dst = NULL;
255 return NULL;
256 }
257
258 return dst;
259}
260
261void sctp_transport_update_pmtu(struct sctp_transport *t, u32 pmtu)
262{
263 struct dst_entry *dst;
264
265 if (unlikely(pmtu < SCTP_DEFAULT_MINSEGMENT)) {
266 printk(KERN_WARNING "%s: Reported pmtu %d too low, "
267 "using default minimum of %d\n",
268 __FUNCTION__, pmtu,
269 SCTP_DEFAULT_MINSEGMENT);
270 /* Use default minimum segment size and disable
271 * pmtu discovery on this transport.
272 */
273 t->pathmtu = SCTP_DEFAULT_MINSEGMENT;
274 } else {
275 t->pathmtu = pmtu;
276 }
277
278 dst = sctp_transport_dst_check(t);
279 if (dst)
280 dst->ops->update_pmtu(dst, pmtu);
281}
282
244/* Caches the dst entry and source address for a transport's destination 283/* Caches the dst entry and source address for a transport's destination
245 * address. 284 * address.
246 */ 285 */
diff --git a/net/wireless/sysfs.c b/net/wireless/sysfs.c
index 3ebae1442963..88aaacd9f822 100644
--- a/net/wireless/sysfs.c
+++ b/net/wireless/sysfs.c
@@ -33,7 +33,7 @@ static ssize_t _show_permaddr(struct device *dev,
33 struct device_attribute *attr, 33 struct device_attribute *attr,
34 char *buf) 34 char *buf)
35{ 35{
36 char *addr = dev_to_rdev(dev)->wiphy.perm_addr; 36 unsigned char *addr = dev_to_rdev(dev)->wiphy.perm_addr;
37 37
38 return sprintf(buf, "%.2x:%.2x:%.2x:%.2x:%.2x:%.2x\n", 38 return sprintf(buf, "%.2x:%.2x:%.2x:%.2x:%.2x:%.2x\n",
39 addr[0], addr[1], addr[2], addr[3], addr[4], addr[5]); 39 addr[0], addr[1], addr[2], addr[3], addr[4], addr[5]);