aboutsummaryrefslogtreecommitdiffstats
path: root/net/sctp
diff options
context:
space:
mode:
Diffstat (limited to 'net/sctp')
-rw-r--r--net/sctp/associola.c8
-rw-r--r--net/sctp/chunk.c2
-rw-r--r--net/sctp/input.c2
-rw-r--r--net/sctp/ipv6.c13
-rw-r--r--net/sctp/output.c14
-rw-r--r--net/sctp/outqueue.c17
-rw-r--r--net/sctp/proc.c20
-rw-r--r--net/sctp/protocol.c15
-rw-r--r--net/sctp/sm_sideeffect.c6
-rw-r--r--net/sctp/sm_statefuns.c12
-rw-r--r--net/sctp/socket.c14
-rw-r--r--net/sctp/transport.c10
12 files changed, 75 insertions, 58 deletions
diff --git a/net/sctp/associola.c b/net/sctp/associola.c
index d29f792e0529..422c98aa9d5c 100644
--- a/net/sctp/associola.c
+++ b/net/sctp/associola.c
@@ -1330,7 +1330,7 @@ void sctp_assoc_sync_pmtu(struct sctp_association *asoc)
1330 } 1330 }
1331 1331
1332 SCTP_DEBUG_PRINTK("%s: asoc:%p, pmtu:%d, frag_point:%d\n", 1332 SCTP_DEBUG_PRINTK("%s: asoc:%p, pmtu:%d, frag_point:%d\n",
1333 __FUNCTION__, asoc, asoc->pathmtu, asoc->frag_point); 1333 __func__, asoc, asoc->pathmtu, asoc->frag_point);
1334} 1334}
1335 1335
1336/* Should we send a SACK to update our peer? */ 1336/* Should we send a SACK to update our peer? */
@@ -1370,7 +1370,7 @@ void sctp_assoc_rwnd_increase(struct sctp_association *asoc, unsigned len)
1370 } 1370 }
1371 1371
1372 SCTP_DEBUG_PRINTK("%s: asoc %p rwnd increased by %d to (%u, %u) " 1372 SCTP_DEBUG_PRINTK("%s: asoc %p rwnd increased by %d to (%u, %u) "
1373 "- %u\n", __FUNCTION__, asoc, len, asoc->rwnd, 1373 "- %u\n", __func__, asoc, len, asoc->rwnd,
1374 asoc->rwnd_over, asoc->a_rwnd); 1374 asoc->rwnd_over, asoc->a_rwnd);
1375 1375
1376 /* Send a window update SACK if the rwnd has increased by at least the 1376 /* Send a window update SACK if the rwnd has increased by at least the
@@ -1381,7 +1381,7 @@ void sctp_assoc_rwnd_increase(struct sctp_association *asoc, unsigned len)
1381 if (sctp_peer_needs_update(asoc)) { 1381 if (sctp_peer_needs_update(asoc)) {
1382 asoc->a_rwnd = asoc->rwnd; 1382 asoc->a_rwnd = asoc->rwnd;
1383 SCTP_DEBUG_PRINTK("%s: Sending window update SACK- asoc: %p " 1383 SCTP_DEBUG_PRINTK("%s: Sending window update SACK- asoc: %p "
1384 "rwnd: %u a_rwnd: %u\n", __FUNCTION__, 1384 "rwnd: %u a_rwnd: %u\n", __func__,
1385 asoc, asoc->rwnd, asoc->a_rwnd); 1385 asoc, asoc->rwnd, asoc->a_rwnd);
1386 sack = sctp_make_sack(asoc); 1386 sack = sctp_make_sack(asoc);
1387 if (!sack) 1387 if (!sack)
@@ -1410,7 +1410,7 @@ void sctp_assoc_rwnd_decrease(struct sctp_association *asoc, unsigned len)
1410 asoc->rwnd = 0; 1410 asoc->rwnd = 0;
1411 } 1411 }
1412 SCTP_DEBUG_PRINTK("%s: asoc %p rwnd decreased by %d to (%u, %u)\n", 1412 SCTP_DEBUG_PRINTK("%s: asoc %p rwnd decreased by %d to (%u, %u)\n",
1413 __FUNCTION__, asoc, len, asoc->rwnd, 1413 __func__, asoc, len, asoc->rwnd,
1414 asoc->rwnd_over); 1414 asoc->rwnd_over);
1415} 1415}
1416 1416
diff --git a/net/sctp/chunk.c b/net/sctp/chunk.c
index 4d3128f5ccc3..e1f355080026 100644
--- a/net/sctp/chunk.c
+++ b/net/sctp/chunk.c
@@ -189,7 +189,7 @@ struct sctp_datamsg *sctp_datamsg_from_user(struct sctp_association *asoc,
189 msecs_to_jiffies(sinfo->sinfo_timetolive); 189 msecs_to_jiffies(sinfo->sinfo_timetolive);
190 msg->can_abandon = 1; 190 msg->can_abandon = 1;
191 SCTP_DEBUG_PRINTK("%s: msg:%p expires_at: %ld jiffies:%ld\n", 191 SCTP_DEBUG_PRINTK("%s: msg:%p expires_at: %ld jiffies:%ld\n",
192 __FUNCTION__, msg, msg->expires_at, jiffies); 192 __func__, msg, msg->expires_at, jiffies);
193 } 193 }
194 194
195 max = asoc->frag_point; 195 max = asoc->frag_point;
diff --git a/net/sctp/input.c b/net/sctp/input.c
index 812ff1756c3e..c1d7e3b5c4b4 100644
--- a/net/sctp/input.c
+++ b/net/sctp/input.c
@@ -409,7 +409,7 @@ void sctp_icmp_proto_unreachable(struct sock *sk,
409 struct sctp_association *asoc, 409 struct sctp_association *asoc,
410 struct sctp_transport *t) 410 struct sctp_transport *t)
411{ 411{
412 SCTP_DEBUG_PRINTK("%s\n", __FUNCTION__); 412 SCTP_DEBUG_PRINTK("%s\n", __func__);
413 413
414 sctp_do_sm(SCTP_EVENT_T_OTHER, 414 sctp_do_sm(SCTP_EVENT_T_OTHER,
415 SCTP_ST_OTHER(SCTP_EVENT_ICMP_PROTO_UNREACH), 415 SCTP_ST_OTHER(SCTP_EVENT_ICMP_PROTO_UNREACH),
diff --git a/net/sctp/ipv6.c b/net/sctp/ipv6.c
index b1e05d719f9b..46c5b3c5cb99 100644
--- a/net/sctp/ipv6.c
+++ b/net/sctp/ipv6.c
@@ -225,7 +225,7 @@ static int sctp_v6_xmit(struct sk_buff *skb, struct sctp_transport *transport,
225 225
226 SCTP_DEBUG_PRINTK("%s: skb:%p, len:%d, " 226 SCTP_DEBUG_PRINTK("%s: skb:%p, len:%d, "
227 "src:" NIP6_FMT " dst:" NIP6_FMT "\n", 227 "src:" NIP6_FMT " dst:" NIP6_FMT "\n",
228 __FUNCTION__, skb, skb->len, 228 __func__, skb, skb->len,
229 NIP6(fl.fl6_src), NIP6(fl.fl6_dst)); 229 NIP6(fl.fl6_src), NIP6(fl.fl6_dst));
230 230
231 SCTP_INC_STATS(SCTP_MIB_OUTSCTPPACKS); 231 SCTP_INC_STATS(SCTP_MIB_OUTSCTPPACKS);
@@ -250,7 +250,7 @@ static struct dst_entry *sctp_v6_get_dst(struct sctp_association *asoc,
250 250
251 251
252 SCTP_DEBUG_PRINTK("%s: DST=" NIP6_FMT " ", 252 SCTP_DEBUG_PRINTK("%s: DST=" NIP6_FMT " ",
253 __FUNCTION__, NIP6(fl.fl6_dst)); 253 __func__, NIP6(fl.fl6_dst));
254 254
255 if (saddr) { 255 if (saddr) {
256 ipv6_addr_copy(&fl.fl6_src, &saddr->v6.sin6_addr); 256 ipv6_addr_copy(&fl.fl6_src, &saddr->v6.sin6_addr);
@@ -259,7 +259,7 @@ static struct dst_entry *sctp_v6_get_dst(struct sctp_association *asoc,
259 NIP6(fl.fl6_src)); 259 NIP6(fl.fl6_src));
260 } 260 }
261 261
262 dst = ip6_route_output(NULL, &fl); 262 dst = ip6_route_output(&init_net, NULL, &fl);
263 if (!dst->error) { 263 if (!dst->error) {
264 struct rt6_info *rt; 264 struct rt6_info *rt;
265 rt = (struct rt6_info *)dst; 265 rt = (struct rt6_info *)dst;
@@ -312,10 +312,11 @@ static void sctp_v6_get_saddr(struct sctp_association *asoc,
312 312
313 SCTP_DEBUG_PRINTK("%s: asoc:%p dst:%p " 313 SCTP_DEBUG_PRINTK("%s: asoc:%p dst:%p "
314 "daddr:" NIP6_FMT " ", 314 "daddr:" NIP6_FMT " ",
315 __FUNCTION__, asoc, dst, NIP6(daddr->v6.sin6_addr)); 315 __func__, asoc, dst, NIP6(daddr->v6.sin6_addr));
316 316
317 if (!asoc) { 317 if (!asoc) {
318 ipv6_get_saddr(dst, &daddr->v6.sin6_addr,&saddr->v6.sin6_addr); 318 ipv6_dev_get_saddr(dst ? ip6_dst_idev(dst)->dev : NULL,
319 &daddr->v6.sin6_addr, &saddr->v6.sin6_addr);
319 SCTP_DEBUG_PRINTK("saddr from ipv6_get_saddr: " NIP6_FMT "\n", 320 SCTP_DEBUG_PRINTK("saddr from ipv6_get_saddr: " NIP6_FMT "\n",
320 NIP6(saddr->v6.sin6_addr)); 321 NIP6(saddr->v6.sin6_addr));
321 return; 322 return;
@@ -350,7 +351,7 @@ static void sctp_v6_get_saddr(struct sctp_association *asoc,
350 } else { 351 } else {
351 printk(KERN_ERR "%s: asoc:%p Could not find a valid source " 352 printk(KERN_ERR "%s: asoc:%p Could not find a valid source "
352 "address for the dest:" NIP6_FMT "\n", 353 "address for the dest:" NIP6_FMT "\n",
353 __FUNCTION__, asoc, NIP6(daddr->v6.sin6_addr)); 354 __func__, asoc, NIP6(daddr->v6.sin6_addr));
354 } 355 }
355 356
356 rcu_read_unlock(); 357 rcu_read_unlock();
diff --git a/net/sctp/output.c b/net/sctp/output.c
index aa700feea76c..cf4f9fb6819d 100644
--- a/net/sctp/output.c
+++ b/net/sctp/output.c
@@ -74,7 +74,7 @@ struct sctp_packet *sctp_packet_config(struct sctp_packet *packet,
74{ 74{
75 struct sctp_chunk *chunk = NULL; 75 struct sctp_chunk *chunk = NULL;
76 76
77 SCTP_DEBUG_PRINTK("%s: packet:%p vtag:0x%x\n", __FUNCTION__, 77 SCTP_DEBUG_PRINTK("%s: packet:%p vtag:0x%x\n", __func__,
78 packet, vtag); 78 packet, vtag);
79 79
80 packet->vtag = vtag; 80 packet->vtag = vtag;
@@ -106,7 +106,7 @@ struct sctp_packet *sctp_packet_init(struct sctp_packet *packet,
106 struct sctp_association *asoc = transport->asoc; 106 struct sctp_association *asoc = transport->asoc;
107 size_t overhead; 107 size_t overhead;
108 108
109 SCTP_DEBUG_PRINTK("%s: packet:%p transport:%p\n", __FUNCTION__, 109 SCTP_DEBUG_PRINTK("%s: packet:%p transport:%p\n", __func__,
110 packet, transport); 110 packet, transport);
111 111
112 packet->transport = transport; 112 packet->transport = transport;
@@ -138,7 +138,7 @@ void sctp_packet_free(struct sctp_packet *packet)
138{ 138{
139 struct sctp_chunk *chunk, *tmp; 139 struct sctp_chunk *chunk, *tmp;
140 140
141 SCTP_DEBUG_PRINTK("%s: packet:%p\n", __FUNCTION__, packet); 141 SCTP_DEBUG_PRINTK("%s: packet:%p\n", __func__, packet);
142 142
143 list_for_each_entry_safe(chunk, tmp, &packet->chunk_list, list) { 143 list_for_each_entry_safe(chunk, tmp, &packet->chunk_list, list) {
144 list_del_init(&chunk->list); 144 list_del_init(&chunk->list);
@@ -162,7 +162,7 @@ sctp_xmit_t sctp_packet_transmit_chunk(struct sctp_packet *packet,
162 sctp_xmit_t retval; 162 sctp_xmit_t retval;
163 int error = 0; 163 int error = 0;
164 164
165 SCTP_DEBUG_PRINTK("%s: packet:%p chunk:%p\n", __FUNCTION__, 165 SCTP_DEBUG_PRINTK("%s: packet:%p chunk:%p\n", __func__,
166 packet, chunk); 166 packet, chunk);
167 167
168 switch ((retval = (sctp_packet_append_chunk(packet, chunk)))) { 168 switch ((retval = (sctp_packet_append_chunk(packet, chunk)))) {
@@ -264,7 +264,7 @@ sctp_xmit_t sctp_packet_append_chunk(struct sctp_packet *packet,
264 size_t pmtu; 264 size_t pmtu;
265 int too_big; 265 int too_big;
266 266
267 SCTP_DEBUG_PRINTK("%s: packet:%p chunk:%p\n", __FUNCTION__, packet, 267 SCTP_DEBUG_PRINTK("%s: packet:%p chunk:%p\n", __func__, packet,
268 chunk); 268 chunk);
269 269
270 /* Try to bundle AUTH chunk */ 270 /* Try to bundle AUTH chunk */
@@ -372,7 +372,7 @@ int sctp_packet_transmit(struct sctp_packet *packet)
372 unsigned char *auth = NULL; /* pointer to auth in skb data */ 372 unsigned char *auth = NULL; /* pointer to auth in skb data */
373 __u32 cksum_buf_len = sizeof(struct sctphdr); 373 __u32 cksum_buf_len = sizeof(struct sctphdr);
374 374
375 SCTP_DEBUG_PRINTK("%s: packet:%p\n", __FUNCTION__, packet); 375 SCTP_DEBUG_PRINTK("%s: packet:%p\n", __func__, packet);
376 376
377 /* Do NOT generate a chunkless packet. */ 377 /* Do NOT generate a chunkless packet. */
378 if (list_empty(&packet->chunk_list)) 378 if (list_empty(&packet->chunk_list))
@@ -677,7 +677,7 @@ static sctp_xmit_t sctp_packet_append_data(struct sctp_packet *packet,
677 "transport: %p, cwnd: %d, " 677 "transport: %p, cwnd: %d, "
678 "ssthresh: %d, flight_size: %d, " 678 "ssthresh: %d, flight_size: %d, "
679 "pba: %d\n", 679 "pba: %d\n",
680 __FUNCTION__, transport, 680 __func__, transport,
681 transport->cwnd, 681 transport->cwnd,
682 transport->ssthresh, 682 transport->ssthresh,
683 transport->flight_size, 683 transport->flight_size,
diff --git a/net/sctp/outqueue.c b/net/sctp/outqueue.c
index 1bb3c5c35d2a..392012f5ab83 100644
--- a/net/sctp/outqueue.c
+++ b/net/sctp/outqueue.c
@@ -469,7 +469,7 @@ void sctp_retransmit_mark(struct sctp_outq *q,
469 469
470 SCTP_DEBUG_PRINTK("%s: transport: %p, reason: %d, " 470 SCTP_DEBUG_PRINTK("%s: transport: %p, reason: %d, "
471 "cwnd: %d, ssthresh: %d, flight_size: %d, " 471 "cwnd: %d, ssthresh: %d, flight_size: %d, "
472 "pba: %d\n", __FUNCTION__, 472 "pba: %d\n", __func__,
473 transport, reason, 473 transport, reason,
474 transport->cwnd, transport->ssthresh, 474 transport->cwnd, transport->ssthresh,
475 transport->flight_size, 475 transport->flight_size,
@@ -494,6 +494,8 @@ void sctp_retransmit(struct sctp_outq *q, struct sctp_transport *transport,
494 */ 494 */
495 if (transport == transport->asoc->peer.retran_path) 495 if (transport == transport->asoc->peer.retran_path)
496 sctp_assoc_update_retran_path(transport->asoc); 496 sctp_assoc_update_retran_path(transport->asoc);
497 transport->asoc->rtx_data_chunks +=
498 transport->asoc->unack_data;
497 break; 499 break;
498 case SCTP_RTXR_FAST_RTX: 500 case SCTP_RTXR_FAST_RTX:
499 SCTP_INC_STATS(SCTP_MIB_FAST_RETRANSMITS); 501 SCTP_INC_STATS(SCTP_MIB_FAST_RETRANSMITS);
@@ -504,6 +506,7 @@ void sctp_retransmit(struct sctp_outq *q, struct sctp_transport *transport,
504 break; 506 break;
505 case SCTP_RTXR_T1_RTX: 507 case SCTP_RTXR_T1_RTX:
506 SCTP_INC_STATS(SCTP_MIB_T1_RETRANSMITS); 508 SCTP_INC_STATS(SCTP_MIB_T1_RETRANSMITS);
509 transport->asoc->init_retries++;
507 break; 510 break;
508 default: 511 default:
509 BUG(); 512 BUG();
@@ -1203,10 +1206,10 @@ int sctp_outq_sack(struct sctp_outq *q, struct sctp_sackhdr *sack)
1203 sctp_generate_fwdtsn(q, sack_ctsn); 1206 sctp_generate_fwdtsn(q, sack_ctsn);
1204 1207
1205 SCTP_DEBUG_PRINTK("%s: sack Cumulative TSN Ack is 0x%x.\n", 1208 SCTP_DEBUG_PRINTK("%s: sack Cumulative TSN Ack is 0x%x.\n",
1206 __FUNCTION__, sack_ctsn); 1209 __func__, sack_ctsn);
1207 SCTP_DEBUG_PRINTK("%s: Cumulative TSN Ack of association, " 1210 SCTP_DEBUG_PRINTK("%s: Cumulative TSN Ack of association, "
1208 "%p is 0x%x. Adv peer ack point: 0x%x\n", 1211 "%p is 0x%x. Adv peer ack point: 0x%x\n",
1209 __FUNCTION__, asoc, ctsn, asoc->adv_peer_ack_point); 1212 __func__, asoc, ctsn, asoc->adv_peer_ack_point);
1210 1213
1211 /* See if all chunks are acked. 1214 /* See if all chunks are acked.
1212 * Make sure the empty queue handler will get run later. 1215 * Make sure the empty queue handler will get run later.
@@ -1441,7 +1444,7 @@ static void sctp_check_transmitted(struct sctp_outq *q,
1441 if (tchunk->tsn_gap_acked) { 1444 if (tchunk->tsn_gap_acked) {
1442 SCTP_DEBUG_PRINTK("%s: Receiver reneged on " 1445 SCTP_DEBUG_PRINTK("%s: Receiver reneged on "
1443 "data TSN: 0x%x\n", 1446 "data TSN: 0x%x\n",
1444 __FUNCTION__, 1447 __func__,
1445 tsn); 1448 tsn);
1446 tchunk->tsn_gap_acked = 0; 1449 tchunk->tsn_gap_acked = 0;
1447 1450
@@ -1558,7 +1561,7 @@ static void sctp_check_transmitted(struct sctp_outq *q,
1558 (sack_ctsn+2 == q->asoc->next_tsn)) { 1561 (sack_ctsn+2 == q->asoc->next_tsn)) {
1559 SCTP_DEBUG_PRINTK("%s: SACK received for zero " 1562 SCTP_DEBUG_PRINTK("%s: SACK received for zero "
1560 "window probe: %u\n", 1563 "window probe: %u\n",
1561 __FUNCTION__, sack_ctsn); 1564 __func__, sack_ctsn);
1562 q->asoc->overall_error_count = 0; 1565 q->asoc->overall_error_count = 0;
1563 transport->error_count = 0; 1566 transport->error_count = 0;
1564 } 1567 }
@@ -1623,7 +1626,7 @@ static void sctp_mark_missing(struct sctp_outq *q,
1623 1626
1624 SCTP_DEBUG_PRINTK( 1627 SCTP_DEBUG_PRINTK(
1625 "%s: TSN 0x%x missing counter: %d\n", 1628 "%s: TSN 0x%x missing counter: %d\n",
1626 __FUNCTION__, tsn, 1629 __func__, tsn,
1627 chunk->tsn_missing_report); 1630 chunk->tsn_missing_report);
1628 } 1631 }
1629 } 1632 }
@@ -1646,7 +1649,7 @@ static void sctp_mark_missing(struct sctp_outq *q,
1646 1649
1647 SCTP_DEBUG_PRINTK("%s: transport: %p, cwnd: %d, " 1650 SCTP_DEBUG_PRINTK("%s: transport: %p, cwnd: %d, "
1648 "ssthresh: %d, flight_size: %d, pba: %d\n", 1651 "ssthresh: %d, flight_size: %d, pba: %d\n",
1649 __FUNCTION__, transport, transport->cwnd, 1652 __func__, transport, transport->cwnd,
1650 transport->ssthresh, transport->flight_size, 1653 transport->ssthresh, transport->flight_size,
1651 transport->partial_bytes_acked); 1654 transport->partial_bytes_acked);
1652 } 1655 }
diff --git a/net/sctp/proc.c b/net/sctp/proc.c
index 973f1dbc2ec3..ddca90e5e3a5 100644
--- a/net/sctp/proc.c
+++ b/net/sctp/proc.c
@@ -279,8 +279,10 @@ static void * sctp_assocs_seq_start(struct seq_file *seq, loff_t *pos)
279 *pos = 0; 279 *pos = 0;
280 280
281 if (*pos == 0) 281 if (*pos == 0)
282 seq_printf(seq, " ASSOC SOCK STY SST ST HBKT ASSOC-ID TX_QUEUE RX_QUEUE UID INODE LPORT " 282 seq_printf(seq, " ASSOC SOCK STY SST ST HBKT "
283 "RPORT LADDRS <-> RADDRS\n"); 283 "ASSOC-ID TX_QUEUE RX_QUEUE UID INODE LPORT "
284 "RPORT LADDRS <-> RADDRS "
285 "HBINT INS OUTS MAXRT T1X T2X RTXC\n");
284 286
285 return (void *)pos; 287 return (void *)pos;
286} 288}
@@ -319,15 +321,21 @@ static int sctp_assocs_seq_show(struct seq_file *seq, void *v)
319 assoc = sctp_assoc(epb); 321 assoc = sctp_assoc(epb);
320 sk = epb->sk; 322 sk = epb->sk;
321 seq_printf(seq, 323 seq_printf(seq,
322 "%8p %8p %-3d %-3d %-2d %-4d %4d %8d %8d %7d %5lu %-5d %5d ", 324 "%8p %8p %-3d %-3d %-2d %-4d "
325 "%4d %8d %8d %7d %5lu %-5d %5d "
326 "%8lu %5d %5d %4d %4d %4d %8d ",
323 assoc, sk, sctp_sk(sk)->type, sk->sk_state, 327 assoc, sk, sctp_sk(sk)->type, sk->sk_state,
324 assoc->state, hash, assoc->assoc_id, 328 assoc->state, hash,
329 assoc->assoc_id,
325 assoc->sndbuf_used, 330 assoc->sndbuf_used,
326 atomic_read(&assoc->rmem_alloc), 331 atomic_read(&assoc->rmem_alloc),
327 sock_i_uid(sk), sock_i_ino(sk), 332 sock_i_uid(sk), sock_i_ino(sk),
328 epb->bind_addr.port, 333 epb->bind_addr.port,
329 assoc->peer.port); 334 assoc->peer.port,
330 335 assoc->hbinterval, assoc->c.sinit_max_instreams,
336 assoc->c.sinit_num_ostreams, assoc->max_retrans,
337 assoc->init_retries, assoc->shutdown_retries,
338 assoc->rtx_data_chunks);
331 seq_printf(seq, " "); 339 seq_printf(seq, " ");
332 sctp_seq_dump_local_addrs(seq, epb); 340 sctp_seq_dump_local_addrs(seq, epb);
333 seq_printf(seq, "<-> "); 341 seq_printf(seq, "<-> ");
diff --git a/net/sctp/protocol.c b/net/sctp/protocol.c
index f90091a1b9ce..beea2fb18b15 100644
--- a/net/sctp/protocol.c
+++ b/net/sctp/protocol.c
@@ -363,7 +363,7 @@ static int sctp_v4_addr_valid(union sctp_addr *addr,
363 return 0; 363 return 0;
364 364
365 /* Is this a broadcast address? */ 365 /* Is this a broadcast address? */
366 if (skb && ((struct rtable *)skb->dst)->rt_flags & RTCF_BROADCAST) 366 if (skb && skb->rtable->rt_flags & RTCF_BROADCAST)
367 return 0; 367 return 0;
368 368
369 return 1; 369 return 1;
@@ -451,7 +451,7 @@ static struct dst_entry *sctp_v4_get_dst(struct sctp_association *asoc,
451 fl.fl4_src = saddr->v4.sin_addr.s_addr; 451 fl.fl4_src = saddr->v4.sin_addr.s_addr;
452 452
453 SCTP_DEBUG_PRINTK("%s: DST:%u.%u.%u.%u, SRC:%u.%u.%u.%u - ", 453 SCTP_DEBUG_PRINTK("%s: DST:%u.%u.%u.%u, SRC:%u.%u.%u.%u - ",
454 __FUNCTION__, NIPQUAD(fl.fl4_dst), 454 __func__, NIPQUAD(fl.fl4_dst),
455 NIPQUAD(fl.fl4_src)); 455 NIPQUAD(fl.fl4_src));
456 456
457 if (!ip_route_output_key(&init_net, &rt, &fl)) { 457 if (!ip_route_output_key(&init_net, &rt, &fl)) {
@@ -539,7 +539,7 @@ static void sctp_v4_get_saddr(struct sctp_association *asoc,
539/* What interface did this skb arrive on? */ 539/* What interface did this skb arrive on? */
540static int sctp_v4_skb_iif(const struct sk_buff *skb) 540static int sctp_v4_skb_iif(const struct sk_buff *skb)
541{ 541{
542 return ((struct rtable *)skb->dst)->rt_iif; 542 return skb->rtable->rt_iif;
543} 543}
544 544
545/* Was this packet marked by Explicit Congestion Notification? */ 545/* Was this packet marked by Explicit Congestion Notification? */
@@ -630,6 +630,9 @@ static int sctp_inetaddr_event(struct notifier_block *this, unsigned long ev,
630 struct sctp_sockaddr_entry *temp; 630 struct sctp_sockaddr_entry *temp;
631 int found = 0; 631 int found = 0;
632 632
633 if (ifa->ifa_dev->dev->nd_net != &init_net)
634 return NOTIFY_DONE;
635
633 switch (ev) { 636 switch (ev) {
634 case NETDEV_UP: 637 case NETDEV_UP:
635 addr = kmalloc(sizeof(struct sctp_sockaddr_entry), GFP_ATOMIC); 638 addr = kmalloc(sizeof(struct sctp_sockaddr_entry), GFP_ATOMIC);
@@ -826,9 +829,9 @@ static inline int sctp_v4_xmit(struct sk_buff *skb,
826{ 829{
827 SCTP_DEBUG_PRINTK("%s: skb:%p, len:%d, " 830 SCTP_DEBUG_PRINTK("%s: skb:%p, len:%d, "
828 "src:%u.%u.%u.%u, dst:%u.%u.%u.%u\n", 831 "src:%u.%u.%u.%u, dst:%u.%u.%u.%u\n",
829 __FUNCTION__, skb, skb->len, 832 __func__, skb, skb->len,
830 NIPQUAD(((struct rtable *)skb->dst)->rt_src), 833 NIPQUAD(skb->rtable->rt_src),
831 NIPQUAD(((struct rtable *)skb->dst)->rt_dst)); 834 NIPQUAD(skb->rtable->rt_dst));
832 835
833 SCTP_INC_STATS(SCTP_MIB_OUTSCTPPACKS); 836 SCTP_INC_STATS(SCTP_MIB_OUTSCTPPACKS);
834 return ip_queue_xmit(skb, ipfragok); 837 return ip_queue_xmit(skb, ipfragok);
diff --git a/net/sctp/sm_sideeffect.c b/net/sctp/sm_sideeffect.c
index 28eb38eb6083..02bf32c30263 100644
--- a/net/sctp/sm_sideeffect.c
+++ b/net/sctp/sm_sideeffect.c
@@ -243,7 +243,7 @@ void sctp_generate_t3_rtx_event(unsigned long peer)
243 243
244 sctp_bh_lock_sock(asoc->base.sk); 244 sctp_bh_lock_sock(asoc->base.sk);
245 if (sock_owned_by_user(asoc->base.sk)) { 245 if (sock_owned_by_user(asoc->base.sk)) {
246 SCTP_DEBUG_PRINTK("%s:Sock is busy.\n", __FUNCTION__); 246 SCTP_DEBUG_PRINTK("%s:Sock is busy.\n", __func__);
247 247
248 /* Try again later. */ 248 /* Try again later. */
249 if (!mod_timer(&transport->T3_rtx_timer, jiffies + (HZ/20))) 249 if (!mod_timer(&transport->T3_rtx_timer, jiffies + (HZ/20)))
@@ -283,7 +283,7 @@ static void sctp_generate_timeout_event(struct sctp_association *asoc,
283 sctp_bh_lock_sock(asoc->base.sk); 283 sctp_bh_lock_sock(asoc->base.sk);
284 if (sock_owned_by_user(asoc->base.sk)) { 284 if (sock_owned_by_user(asoc->base.sk)) {
285 SCTP_DEBUG_PRINTK("%s:Sock is busy: timer %d\n", 285 SCTP_DEBUG_PRINTK("%s:Sock is busy: timer %d\n",
286 __FUNCTION__, 286 __func__,
287 timeout_type); 287 timeout_type);
288 288
289 /* Try again later. */ 289 /* Try again later. */
@@ -361,7 +361,7 @@ void sctp_generate_heartbeat_event(unsigned long data)
361 361
362 sctp_bh_lock_sock(asoc->base.sk); 362 sctp_bh_lock_sock(asoc->base.sk);
363 if (sock_owned_by_user(asoc->base.sk)) { 363 if (sock_owned_by_user(asoc->base.sk)) {
364 SCTP_DEBUG_PRINTK("%s:Sock is busy.\n", __FUNCTION__); 364 SCTP_DEBUG_PRINTK("%s:Sock is busy.\n", __func__);
365 365
366 /* Try again later. */ 366 /* Try again later. */
367 if (!mod_timer(&transport->hb_timer, jiffies + (HZ/20))) 367 if (!mod_timer(&transport->hb_timer, jiffies + (HZ/20)))
diff --git a/net/sctp/sm_statefuns.c b/net/sctp/sm_statefuns.c
index f2ed6473feef..c0c6bee77cf5 100644
--- a/net/sctp/sm_statefuns.c
+++ b/net/sctp/sm_statefuns.c
@@ -1124,7 +1124,7 @@ sctp_disposition_t sctp_sf_backbeat_8_3(const struct sctp_endpoint *ep,
1124 printk(KERN_WARNING 1124 printk(KERN_WARNING
1125 "%s association %p could not find address " 1125 "%s association %p could not find address "
1126 NIP6_FMT "\n", 1126 NIP6_FMT "\n",
1127 __FUNCTION__, 1127 __func__,
1128 asoc, 1128 asoc,
1129 NIP6(from_addr.v6.sin6_addr)); 1129 NIP6(from_addr.v6.sin6_addr));
1130 } else { 1130 } else {
@@ -1132,7 +1132,7 @@ sctp_disposition_t sctp_sf_backbeat_8_3(const struct sctp_endpoint *ep,
1132 printk(KERN_WARNING 1132 printk(KERN_WARNING
1133 "%s association %p could not find address " 1133 "%s association %p could not find address "
1134 NIPQUAD_FMT "\n", 1134 NIPQUAD_FMT "\n",
1135 __FUNCTION__, 1135 __func__,
1136 asoc, 1136 asoc,
1137 NIPQUAD(from_addr.v4.sin_addr.s_addr)); 1137 NIPQUAD(from_addr.v4.sin_addr.s_addr));
1138 } 1138 }
@@ -1150,7 +1150,7 @@ sctp_disposition_t sctp_sf_backbeat_8_3(const struct sctp_endpoint *ep,
1150 time_after(jiffies, hbinfo->sent_at + max_interval)) { 1150 time_after(jiffies, hbinfo->sent_at + max_interval)) {
1151 SCTP_DEBUG_PRINTK("%s: HEARTBEAT ACK with invalid timestamp " 1151 SCTP_DEBUG_PRINTK("%s: HEARTBEAT ACK with invalid timestamp "
1152 "received for transport: %p\n", 1152 "received for transport: %p\n",
1153 __FUNCTION__, link); 1153 __func__, link);
1154 return SCTP_DISPOSITION_DISCARD; 1154 return SCTP_DISPOSITION_DISCARD;
1155 } 1155 }
1156 1156
@@ -3668,7 +3668,7 @@ sctp_disposition_t sctp_sf_eat_fwd_tsn(const struct sctp_endpoint *ep,
3668 skb_pull(chunk->skb, len); 3668 skb_pull(chunk->skb, len);
3669 3669
3670 tsn = ntohl(fwdtsn_hdr->new_cum_tsn); 3670 tsn = ntohl(fwdtsn_hdr->new_cum_tsn);
3671 SCTP_DEBUG_PRINTK("%s: TSN 0x%x.\n", __FUNCTION__, tsn); 3671 SCTP_DEBUG_PRINTK("%s: TSN 0x%x.\n", __func__, tsn);
3672 3672
3673 /* The TSN is too high--silently discard the chunk and count on it 3673 /* The TSN is too high--silently discard the chunk and count on it
3674 * getting retransmitted later. 3674 * getting retransmitted later.
@@ -3728,7 +3728,7 @@ sctp_disposition_t sctp_sf_eat_fwd_tsn_fast(
3728 skb_pull(chunk->skb, len); 3728 skb_pull(chunk->skb, len);
3729 3729
3730 tsn = ntohl(fwdtsn_hdr->new_cum_tsn); 3730 tsn = ntohl(fwdtsn_hdr->new_cum_tsn);
3731 SCTP_DEBUG_PRINTK("%s: TSN 0x%x.\n", __FUNCTION__, tsn); 3731 SCTP_DEBUG_PRINTK("%s: TSN 0x%x.\n", __func__, tsn);
3732 3732
3733 /* The TSN is too high--silently discard the chunk and count on it 3733 /* The TSN is too high--silently discard the chunk and count on it
3734 * getting retransmitted later. 3734 * getting retransmitted later.
@@ -5312,6 +5312,8 @@ sctp_disposition_t sctp_sf_t2_timer_expire(const struct sctp_endpoint *ep,
5312 SCTP_DEBUG_PRINTK("Timer T2 expired.\n"); 5312 SCTP_DEBUG_PRINTK("Timer T2 expired.\n");
5313 SCTP_INC_STATS(SCTP_MIB_T2_SHUTDOWN_EXPIREDS); 5313 SCTP_INC_STATS(SCTP_MIB_T2_SHUTDOWN_EXPIREDS);
5314 5314
5315 ((struct sctp_association *)asoc)->shutdown_retries++;
5316
5315 if (asoc->overall_error_count >= asoc->max_retrans) { 5317 if (asoc->overall_error_count >= asoc->max_retrans) {
5316 sctp_add_cmd_sf(commands, SCTP_CMD_SET_SK_ERR, 5318 sctp_add_cmd_sf(commands, SCTP_CMD_SET_SK_ERR,
5317 SCTP_ERROR(ETIMEDOUT)); 5319 SCTP_ERROR(ETIMEDOUT));
diff --git a/net/sctp/socket.c b/net/sctp/socket.c
index d994d822900d..a3138a0fe2c5 100644
--- a/net/sctp/socket.c
+++ b/net/sctp/socket.c
@@ -525,7 +525,7 @@ static int sctp_send_asconf_add_ip(struct sock *sk,
525 ep = sp->ep; 525 ep = sp->ep;
526 526
527 SCTP_DEBUG_PRINTK("%s: (sk: %p, addrs: %p, addrcnt: %d)\n", 527 SCTP_DEBUG_PRINTK("%s: (sk: %p, addrs: %p, addrcnt: %d)\n",
528 __FUNCTION__, sk, addrs, addrcnt); 528 __func__, sk, addrs, addrcnt);
529 529
530 list_for_each(pos, &ep->asocs) { 530 list_for_each(pos, &ep->asocs) {
531 asoc = list_entry(pos, struct sctp_association, asocs); 531 asoc = list_entry(pos, struct sctp_association, asocs);
@@ -711,7 +711,7 @@ static int sctp_send_asconf_del_ip(struct sock *sk,
711 ep = sp->ep; 711 ep = sp->ep;
712 712
713 SCTP_DEBUG_PRINTK("%s: (sk: %p, addrs: %p, addrcnt: %d)\n", 713 SCTP_DEBUG_PRINTK("%s: (sk: %p, addrs: %p, addrcnt: %d)\n",
714 __FUNCTION__, sk, addrs, addrcnt); 714 __func__, sk, addrs, addrcnt);
715 715
716 list_for_each(pos, &ep->asocs) { 716 list_for_each(pos, &ep->asocs) {
717 asoc = list_entry(pos, struct sctp_association, asocs); 717 asoc = list_entry(pos, struct sctp_association, asocs);
@@ -1197,7 +1197,7 @@ SCTP_STATIC int sctp_setsockopt_connectx(struct sock* sk,
1197 struct sockaddr *kaddrs; 1197 struct sockaddr *kaddrs;
1198 1198
1199 SCTP_DEBUG_PRINTK("%s - sk %p addrs %p addrs_size %d\n", 1199 SCTP_DEBUG_PRINTK("%s - sk %p addrs %p addrs_size %d\n",
1200 __FUNCTION__, sk, addrs, addrs_size); 1200 __func__, sk, addrs, addrs_size);
1201 1201
1202 if (unlikely(addrs_size <= 0)) 1202 if (unlikely(addrs_size <= 0))
1203 return -EINVAL; 1203 return -EINVAL;
@@ -3302,7 +3302,7 @@ SCTP_STATIC int sctp_connect(struct sock *sk, struct sockaddr *addr,
3302 sctp_lock_sock(sk); 3302 sctp_lock_sock(sk);
3303 3303
3304 SCTP_DEBUG_PRINTK("%s - sk: %p, sockaddr: %p, addr_len: %d\n", 3304 SCTP_DEBUG_PRINTK("%s - sk: %p, sockaddr: %p, addr_len: %d\n",
3305 __FUNCTION__, sk, addr, addr_len); 3305 __func__, sk, addr, addr_len);
3306 3306
3307 /* Validate addr_len before calling common connect/connectx routine. */ 3307 /* Validate addr_len before calling common connect/connectx routine. */
3308 af = sctp_get_af_specific(addr->sa_family); 3308 af = sctp_get_af_specific(addr->sa_family);
@@ -3823,7 +3823,7 @@ static int sctp_getsockopt_peeloff(struct sock *sk, int len, char __user *optval
3823 goto out; 3823 goto out;
3824 } 3824 }
3825 3825
3826 SCTP_DEBUG_PRINTK("%s: sk: %p asoc: %p\n", __FUNCTION__, sk, asoc); 3826 SCTP_DEBUG_PRINTK("%s: sk: %p asoc: %p\n", __func__, sk, asoc);
3827 3827
3828 retval = sctp_do_peeloff(asoc, &newsock); 3828 retval = sctp_do_peeloff(asoc, &newsock);
3829 if (retval < 0) 3829 if (retval < 0)
@@ -3837,7 +3837,7 @@ static int sctp_getsockopt_peeloff(struct sock *sk, int len, char __user *optval
3837 } 3837 }
3838 3838
3839 SCTP_DEBUG_PRINTK("%s: sk: %p asoc: %p newsk: %p sd: %d\n", 3839 SCTP_DEBUG_PRINTK("%s: sk: %p asoc: %p newsk: %p sd: %d\n",
3840 __FUNCTION__, sk, asoc, newsock->sk, retval); 3840 __func__, sk, asoc, newsock->sk, retval);
3841 3841
3842 /* Return the fd mapped to the new socket. */ 3842 /* Return the fd mapped to the new socket. */
3843 peeloff.sd = retval; 3843 peeloff.sd = retval;
@@ -6233,7 +6233,7 @@ static int sctp_wait_for_connect(struct sctp_association *asoc, long *timeo_p)
6233 long current_timeo = *timeo_p; 6233 long current_timeo = *timeo_p;
6234 DEFINE_WAIT(wait); 6234 DEFINE_WAIT(wait);
6235 6235
6236 SCTP_DEBUG_PRINTK("%s: asoc=%p, timeo=%ld\n", __FUNCTION__, asoc, 6236 SCTP_DEBUG_PRINTK("%s: asoc=%p, timeo=%ld\n", __func__, asoc,
6237 (long)(*timeo_p)); 6237 (long)(*timeo_p));
6238 6238
6239 /* Increment the association's refcnt. */ 6239 /* Increment the association's refcnt. */
diff --git a/net/sctp/transport.c b/net/sctp/transport.c
index d9f8af852b56..f4938f6c5abe 100644
--- a/net/sctp/transport.c
+++ b/net/sctp/transport.c
@@ -260,7 +260,7 @@ void sctp_transport_update_pmtu(struct sctp_transport *t, u32 pmtu)
260 if (unlikely(pmtu < SCTP_DEFAULT_MINSEGMENT)) { 260 if (unlikely(pmtu < SCTP_DEFAULT_MINSEGMENT)) {
261 printk(KERN_WARNING "%s: Reported pmtu %d too low, " 261 printk(KERN_WARNING "%s: Reported pmtu %d too low, "
262 "using default minimum of %d\n", 262 "using default minimum of %d\n",
263 __FUNCTION__, pmtu, 263 __func__, pmtu,
264 SCTP_DEFAULT_MINSEGMENT); 264 SCTP_DEFAULT_MINSEGMENT);
265 /* Use default minimum segment size and disable 265 /* Use default minimum segment size and disable
266 * pmtu discovery on this transport. 266 * pmtu discovery on this transport.
@@ -388,7 +388,7 @@ void sctp_transport_update_rto(struct sctp_transport *tp, __u32 rtt)
388 tp->rto_pending = 0; 388 tp->rto_pending = 0;
389 389
390 SCTP_DEBUG_PRINTK("%s: transport: %p, rtt: %d, srtt: %d " 390 SCTP_DEBUG_PRINTK("%s: transport: %p, rtt: %d, srtt: %d "
391 "rttvar: %d, rto: %ld\n", __FUNCTION__, 391 "rttvar: %d, rto: %ld\n", __func__,
392 tp, rtt, tp->srtt, tp->rttvar, tp->rto); 392 tp, rtt, tp->srtt, tp->rttvar, tp->rto);
393} 393}
394 394
@@ -434,7 +434,7 @@ void sctp_transport_raise_cwnd(struct sctp_transport *transport,
434 SCTP_DEBUG_PRINTK("%s: SLOW START: transport: %p, " 434 SCTP_DEBUG_PRINTK("%s: SLOW START: transport: %p, "
435 "bytes_acked: %d, cwnd: %d, ssthresh: %d, " 435 "bytes_acked: %d, cwnd: %d, ssthresh: %d, "
436 "flight_size: %d, pba: %d\n", 436 "flight_size: %d, pba: %d\n",
437 __FUNCTION__, 437 __func__,
438 transport, bytes_acked, cwnd, 438 transport, bytes_acked, cwnd,
439 ssthresh, flight_size, pba); 439 ssthresh, flight_size, pba);
440 } else { 440 } else {
@@ -460,7 +460,7 @@ void sctp_transport_raise_cwnd(struct sctp_transport *transport,
460 SCTP_DEBUG_PRINTK("%s: CONGESTION AVOIDANCE: " 460 SCTP_DEBUG_PRINTK("%s: CONGESTION AVOIDANCE: "
461 "transport: %p, bytes_acked: %d, cwnd: %d, " 461 "transport: %p, bytes_acked: %d, cwnd: %d, "
462 "ssthresh: %d, flight_size: %d, pba: %d\n", 462 "ssthresh: %d, flight_size: %d, pba: %d\n",
463 __FUNCTION__, 463 __func__,
464 transport, bytes_acked, cwnd, 464 transport, bytes_acked, cwnd,
465 ssthresh, flight_size, pba); 465 ssthresh, flight_size, pba);
466 } 466 }
@@ -546,7 +546,7 @@ void sctp_transport_lower_cwnd(struct sctp_transport *transport,
546 546
547 transport->partial_bytes_acked = 0; 547 transport->partial_bytes_acked = 0;
548 SCTP_DEBUG_PRINTK("%s: transport: %p reason: %d cwnd: " 548 SCTP_DEBUG_PRINTK("%s: transport: %p reason: %d cwnd: "
549 "%d ssthresh: %d\n", __FUNCTION__, 549 "%d ssthresh: %d\n", __func__,
550 transport, reason, 550 transport, reason,
551 transport->cwnd, transport->ssthresh); 551 transport->cwnd, transport->ssthresh);
552} 552}