diff options
author | Linus Torvalds <torvalds@g5.osdl.org> | 2005-09-10 20:42:47 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2005-09-10 20:42:47 -0400 |
commit | 2f79f458d2ab4a77f1b9df8d0041e51ce085d7c0 (patch) | |
tree | 0f6652830f84a1150c72094c572ab83fe502b057 | |
parent | 2d21247998c5d183179a7e822c4032974a53ff49 (diff) | |
parent | e130af5dab2abbf01c5d92ec5ac05912cf3d9aa7 (diff) |
Merge master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6
-rw-r--r-- | include/linux/in6.h | 56 | ||||
-rw-r--r-- | include/linux/ipv6.h | 2 | ||||
-rw-r--r-- | net/dccp/ccids/ccid3.c | 166 | ||||
-rw-r--r-- | net/dccp/ccids/ccid3.h | 2 | ||||
-rw-r--r-- | net/dccp/ipv4.c | 4 | ||||
-rw-r--r-- | net/dccp/output.c | 3 | ||||
-rw-r--r-- | net/ipv4/tcp_output.c | 5 | ||||
-rw-r--r-- | net/ipv6/exthdrs.c | 3 | ||||
-rw-r--r-- | net/ipv6/netfilter/ip6t_rt.c | 14 |
9 files changed, 115 insertions, 140 deletions
diff --git a/include/linux/in6.h b/include/linux/in6.h index bd32b79d6295..304aaedea305 100644 --- a/include/linux/in6.h +++ b/include/linux/in6.h | |||
@@ -198,27 +198,43 @@ struct in6_flowlabel_req | |||
198 | * MCAST_MSFILTER 48 | 198 | * MCAST_MSFILTER 48 |
199 | */ | 199 | */ |
200 | 200 | ||
201 | /* RFC3542 advanced socket options (50-67) */ | 201 | /* |
202 | #define IPV6_RECVPKTINFO 50 | 202 | * Advanced API (RFC3542) (1) |
203 | #define IPV6_PKTINFO 51 | 203 | * |
204 | #if 0 | 204 | * Note: IPV6_RECVRTHDRDSTOPTS does not exist. see net/ipv6/datagram.c. |
205 | #define IPV6_RECVPATHMTU 52 | 205 | */ |
206 | #define IPV6_PATHMTU 53 | 206 | |
207 | #define IPV6_DONTFRAG 54 | 207 | #define IPV6_RECVPKTINFO 49 |
208 | #define IPV6_USE_MIN_MTU 55 | 208 | #define IPV6_PKTINFO 50 |
209 | #endif | 209 | #define IPV6_RECVHOPLIMIT 51 |
210 | #define IPV6_RECVHOPOPTS 56 | 210 | #define IPV6_HOPLIMIT 52 |
211 | #define IPV6_HOPOPTS 57 | 211 | #define IPV6_RECVHOPOPTS 53 |
212 | #if 0 | 212 | #define IPV6_HOPOPTS 54 |
213 | #define IPV6_RECVRTHDRDSTOPTS 58 /* Unused, see net/ipv6/datagram.c */ | 213 | #define IPV6_RTHDRDSTOPTS 55 |
214 | #define IPV6_RECVRTHDR 56 | ||
215 | #define IPV6_RTHDR 57 | ||
216 | #define IPV6_RECVDSTOPTS 58 | ||
217 | #define IPV6_DSTOPTS 59 | ||
218 | #if 0 /* not yet */ | ||
219 | #define IPV6_RECVPATHMTU 60 | ||
220 | #define IPV6_PATHMTU 61 | ||
221 | #define IPV6_DONTFRAG 62 | ||
222 | #define IPV6_USE_MIN_MTU 63 | ||
214 | #endif | 223 | #endif |
215 | #define IPV6_RTHDRDSTOPTS 59 | 224 | |
216 | #define IPV6_RECVRTHDR 60 | 225 | /* |
217 | #define IPV6_RTHDR 61 | 226 | * Netfilter |
218 | #define IPV6_RECVDSTOPTS 62 | 227 | * |
219 | #define IPV6_DSTOPTS 63 | 228 | * Following socket options are used in ip6_tables; |
220 | #define IPV6_RECVHOPLIMIT 64 | 229 | * see include/linux/netfilter_ipv6/ip6_tables.h. |
221 | #define IPV6_HOPLIMIT 65 | 230 | * |
231 | * IP6T_SO_SET_REPLACE / IP6T_SO_GET_INFO 64 | ||
232 | * IP6T_SO_SET_ADD_COUNTERS / IP6T_SO_GET_ENTRIES 65 | ||
233 | */ | ||
234 | |||
235 | /* | ||
236 | * Advanced API (RFC3542) (2) | ||
237 | */ | ||
222 | #define IPV6_RECVTCLASS 66 | 238 | #define IPV6_RECVTCLASS 66 |
223 | #define IPV6_TCLASS 67 | 239 | #define IPV6_TCLASS 67 |
224 | 240 | ||
diff --git a/include/linux/ipv6.h b/include/linux/ipv6.h index 6c5f7b39a4b0..bb6f88e14061 100644 --- a/include/linux/ipv6.h +++ b/include/linux/ipv6.h | |||
@@ -68,7 +68,7 @@ struct ipv6_opt_hdr { | |||
68 | 68 | ||
69 | struct rt0_hdr { | 69 | struct rt0_hdr { |
70 | struct ipv6_rt_hdr rt_hdr; | 70 | struct ipv6_rt_hdr rt_hdr; |
71 | __u32 bitmap; /* strict/loose bit map */ | 71 | __u32 reserved; |
72 | struct in6_addr addr[0]; | 72 | struct in6_addr addr[0]; |
73 | 73 | ||
74 | #define rt0_type rt_hdr.type | 74 | #define rt0_type rt_hdr.type |
diff --git a/net/dccp/ccids/ccid3.c b/net/dccp/ccids/ccid3.c index ea30012dd195..e05f4f955eee 100644 --- a/net/dccp/ccids/ccid3.c +++ b/net/dccp/ccids/ccid3.c | |||
@@ -78,13 +78,11 @@ static struct dccp_li_hist *ccid3_li_hist; | |||
78 | 78 | ||
79 | static int ccid3_init(struct sock *sk) | 79 | static int ccid3_init(struct sock *sk) |
80 | { | 80 | { |
81 | ccid3_pr_debug("%s, sk=%p\n", dccp_role(sk), sk); | ||
82 | return 0; | 81 | return 0; |
83 | } | 82 | } |
84 | 83 | ||
85 | static void ccid3_exit(struct sock *sk) | 84 | static void ccid3_exit(struct sock *sk) |
86 | { | 85 | { |
87 | ccid3_pr_debug("%s, sk=%p\n", dccp_role(sk), sk); | ||
88 | } | 86 | } |
89 | 87 | ||
90 | /* TFRC sender states */ | 88 | /* TFRC sender states */ |
@@ -287,14 +285,14 @@ static int ccid3_hc_tx_send_packet(struct sock *sk, | |||
287 | long delay; | 285 | long delay; |
288 | int rc = -ENOTCONN; | 286 | int rc = -ENOTCONN; |
289 | 287 | ||
290 | /* Check if pure ACK or Terminating*/ | 288 | BUG_ON(hctx == NULL || hctx->ccid3hctx_state == TFRC_SSTATE_TERM); |
291 | 289 | ||
290 | /* Check if pure ACK or Terminating*/ | ||
292 | /* | 291 | /* |
293 | * XXX: We only call this function for DATA and DATAACK, on, these | 292 | * XXX: We only call this function for DATA and DATAACK, on, these |
294 | * packets can have zero length, but why the comment about "pure ACK"? | 293 | * packets can have zero length, but why the comment about "pure ACK"? |
295 | */ | 294 | */ |
296 | if (hctx == NULL || len == 0 || | 295 | if (unlikely(len == 0)) |
297 | hctx->ccid3hctx_state == TFRC_SSTATE_TERM) | ||
298 | goto out; | 296 | goto out; |
299 | 297 | ||
300 | /* See if last packet allocated was not sent */ | 298 | /* See if last packet allocated was not sent */ |
@@ -304,10 +302,10 @@ static int ccid3_hc_tx_send_packet(struct sock *sk, | |||
304 | SLAB_ATOMIC); | 302 | SLAB_ATOMIC); |
305 | 303 | ||
306 | rc = -ENOBUFS; | 304 | rc = -ENOBUFS; |
307 | if (new_packet == NULL) { | 305 | if (unlikely(new_packet == NULL)) { |
308 | ccid3_pr_debug("%s, sk=%p, not enough mem to add " | 306 | LIMIT_NETDEBUG(KERN_WARNING "%s: %s, sk=%p, not enough " |
309 | "to history, send refused\n", | 307 | "mem to add to history, send refused\n", |
310 | dccp_role(sk), sk); | 308 | __FUNCTION__, dccp_role(sk), sk); |
311 | goto out; | 309 | goto out; |
312 | } | 310 | } |
313 | 311 | ||
@@ -318,9 +316,6 @@ static int ccid3_hc_tx_send_packet(struct sock *sk, | |||
318 | 316 | ||
319 | switch (hctx->ccid3hctx_state) { | 317 | switch (hctx->ccid3hctx_state) { |
320 | case TFRC_SSTATE_NO_SENT: | 318 | case TFRC_SSTATE_NO_SENT: |
321 | ccid3_pr_debug("%s, sk=%p, first packet(%llu)\n", | ||
322 | dccp_role(sk), sk, dp->dccps_gss); | ||
323 | |||
324 | hctx->ccid3hctx_no_feedback_timer.function = ccid3_hc_tx_no_feedback_timer; | 319 | hctx->ccid3hctx_no_feedback_timer.function = ccid3_hc_tx_no_feedback_timer; |
325 | hctx->ccid3hctx_no_feedback_timer.data = (unsigned long)sk; | 320 | hctx->ccid3hctx_no_feedback_timer.data = (unsigned long)sk; |
326 | sk_reset_timer(sk, &hctx->ccid3hctx_no_feedback_timer, | 321 | sk_reset_timer(sk, &hctx->ccid3hctx_no_feedback_timer, |
@@ -328,7 +323,7 @@ static int ccid3_hc_tx_send_packet(struct sock *sk, | |||
328 | hctx->ccid3hctx_last_win_count = 0; | 323 | hctx->ccid3hctx_last_win_count = 0; |
329 | hctx->ccid3hctx_t_last_win_count = now; | 324 | hctx->ccid3hctx_t_last_win_count = now; |
330 | ccid3_hc_tx_set_state(sk, TFRC_SSTATE_NO_FBACK); | 325 | ccid3_hc_tx_set_state(sk, TFRC_SSTATE_NO_FBACK); |
331 | hctx->ccid3hctx_t_ipi = TFRC_INITIAL_TIMEOUT; | 326 | hctx->ccid3hctx_t_ipi = TFRC_INITIAL_IPI; |
332 | 327 | ||
333 | /* Set nominal send time for initial packet */ | 328 | /* Set nominal send time for initial packet */ |
334 | hctx->ccid3hctx_t_nom = now; | 329 | hctx->ccid3hctx_t_nom = now; |
@@ -341,7 +336,6 @@ static int ccid3_hc_tx_send_packet(struct sock *sk, | |||
341 | case TFRC_SSTATE_FBACK: | 336 | case TFRC_SSTATE_FBACK: |
342 | delay = (timeval_delta(&now, &hctx->ccid3hctx_t_nom) - | 337 | delay = (timeval_delta(&now, &hctx->ccid3hctx_t_nom) - |
343 | hctx->ccid3hctx_delta); | 338 | hctx->ccid3hctx_delta); |
344 | ccid3_pr_debug("send_packet delay=%ld\n", delay); | ||
345 | delay /= -1000; | 339 | delay /= -1000; |
346 | /* divide by -1000 is to convert to ms and get sign right */ | 340 | /* divide by -1000 is to convert to ms and get sign right */ |
347 | rc = delay > 0 ? delay : 0; | 341 | rc = delay > 0 ? delay : 0; |
@@ -371,13 +365,7 @@ static void ccid3_hc_tx_packet_sent(struct sock *sk, int more, int len) | |||
371 | struct ccid3_hc_tx_sock *hctx = ccid3_hc_tx_sk(sk); | 365 | struct ccid3_hc_tx_sock *hctx = ccid3_hc_tx_sk(sk); |
372 | struct timeval now; | 366 | struct timeval now; |
373 | 367 | ||
374 | BUG_ON(hctx == NULL); | 368 | BUG_ON(hctx == NULL || hctx->ccid3hctx_state == TFRC_SSTATE_TERM); |
375 | |||
376 | if (hctx->ccid3hctx_state == TFRC_SSTATE_TERM) { | ||
377 | ccid3_pr_debug("%s, sk=%p, while state is TFRC_SSTATE_TERM!\n", | ||
378 | dccp_role(sk), sk); | ||
379 | return; | ||
380 | } | ||
381 | 369 | ||
382 | dccp_timestamp(sk, &now); | 370 | dccp_timestamp(sk, &now); |
383 | 371 | ||
@@ -387,14 +375,14 @@ static void ccid3_hc_tx_packet_sent(struct sock *sk, int more, int len) | |||
387 | struct dccp_tx_hist_entry *packet; | 375 | struct dccp_tx_hist_entry *packet; |
388 | 376 | ||
389 | packet = dccp_tx_hist_head(&hctx->ccid3hctx_hist); | 377 | packet = dccp_tx_hist_head(&hctx->ccid3hctx_hist); |
390 | if (packet == NULL) { | 378 | if (unlikely(packet == NULL)) { |
391 | printk(KERN_CRIT "%s: packet doesn't exists in " | 379 | LIMIT_NETDEBUG(KERN_WARNING "%s: packet doesn't " |
392 | "history!\n", __FUNCTION__); | 380 | "exists in history!\n", __FUNCTION__); |
393 | return; | 381 | return; |
394 | } | 382 | } |
395 | if (packet->dccphtx_sent) { | 383 | if (unlikely(packet->dccphtx_sent)) { |
396 | printk(KERN_CRIT "%s: no unsent packet in history!\n", | 384 | LIMIT_NETDEBUG(KERN_WARNING "%s: no unsent packet in " |
397 | __FUNCTION__); | 385 | "history!\n", __FUNCTION__); |
398 | return; | 386 | return; |
399 | } | 387 | } |
400 | packet->dccphtx_tstamp = now; | 388 | packet->dccphtx_tstamp = now; |
@@ -465,14 +453,7 @@ static void ccid3_hc_tx_packet_recv(struct sock *sk, struct sk_buff *skb) | |||
465 | u32 x_recv; | 453 | u32 x_recv; |
466 | u32 r_sample; | 454 | u32 r_sample; |
467 | 455 | ||
468 | if (hctx == NULL) | 456 | BUG_ON(hctx == NULL || hctx->ccid3hctx_state == TFRC_SSTATE_TERM); |
469 | return; | ||
470 | |||
471 | if (hctx->ccid3hctx_state == TFRC_SSTATE_TERM) { | ||
472 | ccid3_pr_debug("%s, sk=%p, received a packet when " | ||
473 | "terminating!\n", dccp_role(sk), sk); | ||
474 | return; | ||
475 | } | ||
476 | 457 | ||
477 | /* we are only interested in ACKs */ | 458 | /* we are only interested in ACKs */ |
478 | if (!(DCCP_SKB_CB(skb)->dccpd_type == DCCP_PKT_ACK || | 459 | if (!(DCCP_SKB_CB(skb)->dccpd_type == DCCP_PKT_ACK || |
@@ -496,12 +477,12 @@ static void ccid3_hc_tx_packet_recv(struct sock *sk, struct sk_buff *skb) | |||
496 | /* get t_recvdata from history */ | 477 | /* get t_recvdata from history */ |
497 | packet = dccp_tx_hist_find_entry(&hctx->ccid3hctx_hist, | 478 | packet = dccp_tx_hist_find_entry(&hctx->ccid3hctx_hist, |
498 | DCCP_SKB_CB(skb)->dccpd_ack_seq); | 479 | DCCP_SKB_CB(skb)->dccpd_ack_seq); |
499 | if (packet == NULL) { | 480 | if (unlikely(packet == NULL)) { |
500 | ccid3_pr_debug("%s, sk=%p, seqno %llu(%s) does't " | 481 | LIMIT_NETDEBUG(KERN_WARNING "%s: %s, sk=%p, seqno " |
501 | "exist in history!\n", | 482 | "%llu(%s) does't exist in history!\n", |
502 | dccp_role(sk), sk, | 483 | __FUNCTION__, dccp_role(sk), sk, |
503 | DCCP_SKB_CB(skb)->dccpd_ack_seq, | 484 | (unsigned long long)DCCP_SKB_CB(skb)->dccpd_ack_seq, |
504 | dccp_packet_name(DCCP_SKB_CB(skb)->dccpd_type)); | 485 | dccp_packet_name(DCCP_SKB_CB(skb)->dccpd_type)); |
505 | return; | 486 | return; |
506 | } | 487 | } |
507 | 488 | ||
@@ -509,8 +490,8 @@ static void ccid3_hc_tx_packet_recv(struct sock *sk, struct sk_buff *skb) | |||
509 | dccp_timestamp(sk, &now); | 490 | dccp_timestamp(sk, &now); |
510 | r_sample = timeval_delta(&now, &packet->dccphtx_tstamp); | 491 | r_sample = timeval_delta(&now, &packet->dccphtx_tstamp); |
511 | if (unlikely(r_sample <= t_elapsed)) | 492 | if (unlikely(r_sample <= t_elapsed)) |
512 | LIMIT_NETDEBUG(KERN_WARNING | 493 | LIMIT_NETDEBUG(KERN_WARNING "%s: r_sample=%uus, " |
513 | "%s: r_sample=%uus, t_elapsed=%uus\n", | 494 | "t_elapsed=%uus\n", |
514 | __FUNCTION__, r_sample, t_elapsed); | 495 | __FUNCTION__, r_sample, t_elapsed); |
515 | else | 496 | else |
516 | r_sample -= t_elapsed; | 497 | r_sample -= t_elapsed; |
@@ -606,10 +587,11 @@ static void ccid3_hc_tx_packet_recv(struct sock *sk, struct sk_buff *skb) | |||
606 | 587 | ||
607 | static void ccid3_hc_tx_insert_options(struct sock *sk, struct sk_buff *skb) | 588 | static void ccid3_hc_tx_insert_options(struct sock *sk, struct sk_buff *skb) |
608 | { | 589 | { |
609 | struct ccid3_hc_tx_sock *hctx = ccid3_hc_tx_sk(sk); | 590 | const struct ccid3_hc_tx_sock *hctx = ccid3_hc_tx_sk(sk); |
610 | 591 | ||
611 | if (hctx == NULL || !(sk->sk_state == DCCP_OPEN || | 592 | BUG_ON(hctx == NULL); |
612 | sk->sk_state == DCCP_PARTOPEN)) | 593 | |
594 | if (!(sk->sk_state == DCCP_OPEN || sk->sk_state == DCCP_PARTOPEN)) | ||
613 | return; | 595 | return; |
614 | 596 | ||
615 | DCCP_SKB_CB(skb)->dccpd_ccval = hctx->ccid3hctx_last_win_count; | 597 | DCCP_SKB_CB(skb)->dccpd_ccval = hctx->ccid3hctx_last_win_count; |
@@ -624,8 +606,7 @@ static int ccid3_hc_tx_parse_options(struct sock *sk, unsigned char option, | |||
624 | struct ccid3_hc_tx_sock *hctx = ccid3_hc_tx_sk(sk); | 606 | struct ccid3_hc_tx_sock *hctx = ccid3_hc_tx_sk(sk); |
625 | struct ccid3_options_received *opt_recv; | 607 | struct ccid3_options_received *opt_recv; |
626 | 608 | ||
627 | if (hctx == NULL) | 609 | BUG_ON(hctx == NULL); |
628 | return 0; | ||
629 | 610 | ||
630 | opt_recv = &hctx->ccid3hctx_options_received; | 611 | opt_recv = &hctx->ccid3hctx_options_received; |
631 | 612 | ||
@@ -639,10 +620,10 @@ static int ccid3_hc_tx_parse_options(struct sock *sk, unsigned char option, | |||
639 | 620 | ||
640 | switch (option) { | 621 | switch (option) { |
641 | case TFRC_OPT_LOSS_EVENT_RATE: | 622 | case TFRC_OPT_LOSS_EVENT_RATE: |
642 | if (len != 4) { | 623 | if (unlikely(len != 4)) { |
643 | ccid3_pr_debug("%s, sk=%p, invalid len for " | 624 | LIMIT_NETDEBUG(KERN_WARNING "%s: %s, sk=%p, invalid " |
644 | "TFRC_OPT_LOSS_EVENT_RATE\n", | 625 | "len for TFRC_OPT_LOSS_EVENT_RATE\n", |
645 | dccp_role(sk), sk); | 626 | __FUNCTION__, dccp_role(sk), sk); |
646 | rc = -EINVAL; | 627 | rc = -EINVAL; |
647 | } else { | 628 | } else { |
648 | opt_recv->ccid3or_loss_event_rate = ntohl(*(u32 *)value); | 629 | opt_recv->ccid3or_loss_event_rate = ntohl(*(u32 *)value); |
@@ -660,10 +641,10 @@ static int ccid3_hc_tx_parse_options(struct sock *sk, unsigned char option, | |||
660 | opt_recv->ccid3or_loss_intervals_len); | 641 | opt_recv->ccid3or_loss_intervals_len); |
661 | break; | 642 | break; |
662 | case TFRC_OPT_RECEIVE_RATE: | 643 | case TFRC_OPT_RECEIVE_RATE: |
663 | if (len != 4) { | 644 | if (unlikely(len != 4)) { |
664 | ccid3_pr_debug("%s, sk=%p, invalid len for " | 645 | LIMIT_NETDEBUG(KERN_WARNING "%s: %s, sk=%p, invalid " |
665 | "TFRC_OPT_RECEIVE_RATE\n", | 646 | "len for TFRC_OPT_RECEIVE_RATE\n", |
666 | dccp_role(sk), sk); | 647 | __FUNCTION__, dccp_role(sk), sk); |
667 | rc = -EINVAL; | 648 | rc = -EINVAL; |
668 | } else { | 649 | } else { |
669 | opt_recv->ccid3or_receive_rate = ntohl(*(u32 *)value); | 650 | opt_recv->ccid3or_receive_rate = ntohl(*(u32 *)value); |
@@ -682,8 +663,6 @@ static int ccid3_hc_tx_init(struct sock *sk) | |||
682 | struct dccp_sock *dp = dccp_sk(sk); | 663 | struct dccp_sock *dp = dccp_sk(sk); |
683 | struct ccid3_hc_tx_sock *hctx; | 664 | struct ccid3_hc_tx_sock *hctx; |
684 | 665 | ||
685 | ccid3_pr_debug("%s, sk=%p\n", dccp_role(sk), sk); | ||
686 | |||
687 | dp->dccps_hc_tx_ccid_private = kmalloc(sizeof(*hctx), gfp_any()); | 666 | dp->dccps_hc_tx_ccid_private = kmalloc(sizeof(*hctx), gfp_any()); |
688 | if (dp->dccps_hc_tx_ccid_private == NULL) | 667 | if (dp->dccps_hc_tx_ccid_private == NULL) |
689 | return -ENOMEM; | 668 | return -ENOMEM; |
@@ -712,7 +691,6 @@ static void ccid3_hc_tx_exit(struct sock *sk) | |||
712 | struct dccp_sock *dp = dccp_sk(sk); | 691 | struct dccp_sock *dp = dccp_sk(sk); |
713 | struct ccid3_hc_tx_sock *hctx = ccid3_hc_tx_sk(sk); | 692 | struct ccid3_hc_tx_sock *hctx = ccid3_hc_tx_sk(sk); |
714 | 693 | ||
715 | ccid3_pr_debug("%s, sk=%p\n", dccp_role(sk), sk); | ||
716 | BUG_ON(hctx == NULL); | 694 | BUG_ON(hctx == NULL); |
717 | 695 | ||
718 | ccid3_hc_tx_set_state(sk, TFRC_SSTATE_TERM); | 696 | ccid3_hc_tx_set_state(sk, TFRC_SSTATE_TERM); |
@@ -792,10 +770,10 @@ static void ccid3_hc_rx_send_feedback(struct sock *sk) | |||
792 | } | 770 | } |
793 | 771 | ||
794 | packet = dccp_rx_hist_find_data_packet(&hcrx->ccid3hcrx_hist); | 772 | packet = dccp_rx_hist_find_data_packet(&hcrx->ccid3hcrx_hist); |
795 | if (packet == NULL) { | 773 | if (unlikely(packet == NULL)) { |
796 | printk(KERN_CRIT "%s: %s, sk=%p, no data packet in history!\n", | 774 | LIMIT_NETDEBUG(KERN_WARNING "%s: %s, sk=%p, no data packet " |
797 | __FUNCTION__, dccp_role(sk), sk); | 775 | "in history!\n", |
798 | dump_stack(); | 776 | __FUNCTION__, dccp_role(sk), sk); |
799 | return; | 777 | return; |
800 | } | 778 | } |
801 | 779 | ||
@@ -817,11 +795,12 @@ static void ccid3_hc_rx_send_feedback(struct sock *sk) | |||
817 | 795 | ||
818 | static void ccid3_hc_rx_insert_options(struct sock *sk, struct sk_buff *skb) | 796 | static void ccid3_hc_rx_insert_options(struct sock *sk, struct sk_buff *skb) |
819 | { | 797 | { |
820 | struct ccid3_hc_rx_sock *hcrx = ccid3_hc_rx_sk(sk); | 798 | const struct ccid3_hc_rx_sock *hcrx = ccid3_hc_rx_sk(sk); |
821 | u32 x_recv, pinv; | 799 | u32 x_recv, pinv; |
822 | 800 | ||
823 | if (hcrx == NULL || !(sk->sk_state == DCCP_OPEN || | 801 | BUG_ON(hcrx == NULL); |
824 | sk->sk_state == DCCP_PARTOPEN)) | 802 | |
803 | if (!(sk->sk_state == DCCP_OPEN || sk->sk_state == DCCP_PARTOPEN)) | ||
825 | return; | 804 | return; |
826 | 805 | ||
827 | DCCP_SKB_CB(skb)->dccpd_ccval = hcrx->ccid3hcrx_last_counter; | 806 | DCCP_SKB_CB(skb)->dccpd_ccval = hcrx->ccid3hcrx_last_counter; |
@@ -878,17 +857,17 @@ static u32 ccid3_hc_rx_calc_first_li(struct sock *sk) | |||
878 | } | 857 | } |
879 | } | 858 | } |
880 | 859 | ||
881 | if (step == 0) { | 860 | if (unlikely(step == 0)) { |
882 | printk(KERN_CRIT "%s: %s, sk=%p, packet history contains no " | 861 | LIMIT_NETDEBUG(KERN_WARNING "%s: %s, sk=%p, packet history " |
883 | "data packets!\n", | 862 | "contains no data packets!\n", |
884 | __FUNCTION__, dccp_role(sk), sk); | 863 | __FUNCTION__, dccp_role(sk), sk); |
885 | return ~0; | 864 | return ~0; |
886 | } | 865 | } |
887 | 866 | ||
888 | if (interval == 0) { | 867 | if (unlikely(interval == 0)) { |
889 | ccid3_pr_debug("%s, sk=%p, Could not find a win_count " | 868 | LIMIT_NETDEBUG(KERN_WARNING "%s: %s, sk=%p, Could not find a " |
890 | "interval > 0. Defaulting to 1\n", | 869 | "win_count interval > 0. Defaulting to 1\n", |
891 | dccp_role(sk), sk); | 870 | __FUNCTION__, dccp_role(sk), sk); |
892 | interval = 1; | 871 | interval = 1; |
893 | } | 872 | } |
894 | found: | 873 | found: |
@@ -931,8 +910,9 @@ static void ccid3_hc_rx_update_li(struct sock *sk, u64 seq_loss, u8 win_loss) | |||
931 | if (li_tail == NULL) | 910 | if (li_tail == NULL) |
932 | return; | 911 | return; |
933 | li_tail->dccplih_interval = ccid3_hc_rx_calc_first_li(sk); | 912 | li_tail->dccplih_interval = ccid3_hc_rx_calc_first_li(sk); |
934 | } | 913 | } else |
935 | /* FIXME: find end of interval */ | 914 | LIMIT_NETDEBUG(KERN_WARNING "%s: FIXME: find end of " |
915 | "interval\n", __FUNCTION__); | ||
936 | } | 916 | } |
937 | 917 | ||
938 | static void ccid3_hc_rx_detect_loss(struct sock *sk) | 918 | static void ccid3_hc_rx_detect_loss(struct sock *sk) |
@@ -956,10 +936,8 @@ static void ccid3_hc_rx_packet_recv(struct sock *sk, struct sk_buff *skb) | |||
956 | u32 p_prev, r_sample, t_elapsed; | 936 | u32 p_prev, r_sample, t_elapsed; |
957 | int ins; | 937 | int ins; |
958 | 938 | ||
959 | if (hcrx == NULL) | 939 | BUG_ON(hcrx == NULL || |
960 | return; | 940 | !(hcrx->ccid3hcrx_state == TFRC_RSTATE_NO_DATA || |
961 | |||
962 | BUG_ON(!(hcrx->ccid3hcrx_state == TFRC_RSTATE_NO_DATA || | ||
963 | hcrx->ccid3hcrx_state == TFRC_RSTATE_DATA)); | 941 | hcrx->ccid3hcrx_state == TFRC_RSTATE_DATA)); |
964 | 942 | ||
965 | opt_recv = &dccp_sk(sk)->dccps_options_received; | 943 | opt_recv = &dccp_sk(sk)->dccps_options_received; |
@@ -978,8 +956,8 @@ static void ccid3_hc_rx_packet_recv(struct sock *sk, struct sk_buff *skb) | |||
978 | t_elapsed = opt_recv->dccpor_elapsed_time * 10; | 956 | t_elapsed = opt_recv->dccpor_elapsed_time * 10; |
979 | 957 | ||
980 | if (unlikely(r_sample <= t_elapsed)) | 958 | if (unlikely(r_sample <= t_elapsed)) |
981 | LIMIT_NETDEBUG(KERN_WARNING | 959 | LIMIT_NETDEBUG(KERN_WARNING "%s: r_sample=%uus, " |
982 | "%s: r_sample=%uus, t_elapsed=%uus\n", | 960 | "t_elapsed=%uus\n", |
983 | __FUNCTION__, r_sample, t_elapsed); | 961 | __FUNCTION__, r_sample, t_elapsed); |
984 | else | 962 | else |
985 | r_sample -= t_elapsed; | 963 | r_sample -= t_elapsed; |
@@ -997,19 +975,16 @@ static void ccid3_hc_rx_packet_recv(struct sock *sk, struct sk_buff *skb) | |||
997 | break; | 975 | break; |
998 | case DCCP_PKT_DATA: | 976 | case DCCP_PKT_DATA: |
999 | break; | 977 | break; |
1000 | default: | 978 | default: /* We're not interested in other packet types, move along */ |
1001 | ccid3_pr_debug("%s, sk=%p, not DATA/DATAACK/ACK packet(%s)\n", | ||
1002 | dccp_role(sk), sk, | ||
1003 | dccp_packet_name(DCCP_SKB_CB(skb)->dccpd_type)); | ||
1004 | return; | 979 | return; |
1005 | } | 980 | } |
1006 | 981 | ||
1007 | packet = dccp_rx_hist_entry_new(ccid3_rx_hist, sk, opt_recv->dccpor_ndp, | 982 | packet = dccp_rx_hist_entry_new(ccid3_rx_hist, sk, opt_recv->dccpor_ndp, |
1008 | skb, SLAB_ATOMIC); | 983 | skb, SLAB_ATOMIC); |
1009 | if (packet == NULL) { | 984 | if (unlikely(packet == NULL)) { |
1010 | ccid3_pr_debug("%s, sk=%p, Not enough mem to add rx packet " | 985 | LIMIT_NETDEBUG(KERN_WARNING "%s: %s, sk=%p, Not enough mem to " |
1011 | "to history (consider it lost)!", | 986 | "add rx packet to history, consider it lost!\n", |
1012 | dccp_role(sk), sk); | 987 | __FUNCTION__, dccp_role(sk), sk); |
1013 | return; | 988 | return; |
1014 | } | 989 | } |
1015 | 990 | ||
@@ -1102,10 +1077,7 @@ static void ccid3_hc_rx_exit(struct sock *sk) | |||
1102 | struct ccid3_hc_rx_sock *hcrx = ccid3_hc_rx_sk(sk); | 1077 | struct ccid3_hc_rx_sock *hcrx = ccid3_hc_rx_sk(sk); |
1103 | struct dccp_sock *dp = dccp_sk(sk); | 1078 | struct dccp_sock *dp = dccp_sk(sk); |
1104 | 1079 | ||
1105 | ccid3_pr_debug("%s, sk=%p\n", dccp_role(sk), sk); | 1080 | BUG_ON(hcrx == NULL); |
1106 | |||
1107 | if (hcrx == NULL) | ||
1108 | return; | ||
1109 | 1081 | ||
1110 | ccid3_hc_rx_set_state(sk, TFRC_RSTATE_TERM); | 1082 | ccid3_hc_rx_set_state(sk, TFRC_RSTATE_TERM); |
1111 | 1083 | ||
@@ -1123,8 +1095,7 @@ static void ccid3_hc_rx_get_info(struct sock *sk, struct tcp_info *info) | |||
1123 | { | 1095 | { |
1124 | const struct ccid3_hc_rx_sock *hcrx = ccid3_hc_rx_sk(sk); | 1096 | const struct ccid3_hc_rx_sock *hcrx = ccid3_hc_rx_sk(sk); |
1125 | 1097 | ||
1126 | if (hcrx == NULL) | 1098 | BUG_ON(hcrx == NULL); |
1127 | return; | ||
1128 | 1099 | ||
1129 | info->tcpi_ca_state = hcrx->ccid3hcrx_state; | 1100 | info->tcpi_ca_state = hcrx->ccid3hcrx_state; |
1130 | info->tcpi_options |= TCPI_OPT_TIMESTAMPS; | 1101 | info->tcpi_options |= TCPI_OPT_TIMESTAMPS; |
@@ -1135,8 +1106,7 @@ static void ccid3_hc_tx_get_info(struct sock *sk, struct tcp_info *info) | |||
1135 | { | 1106 | { |
1136 | const struct ccid3_hc_tx_sock *hctx = ccid3_hc_tx_sk(sk); | 1107 | const struct ccid3_hc_tx_sock *hctx = ccid3_hc_tx_sk(sk); |
1137 | 1108 | ||
1138 | if (hctx == NULL) | 1109 | BUG_ON(hctx == NULL); |
1139 | return; | ||
1140 | 1110 | ||
1141 | info->tcpi_rto = hctx->ccid3hctx_t_rto; | 1111 | info->tcpi_rto = hctx->ccid3hctx_t_rto; |
1142 | info->tcpi_rtt = hctx->ccid3hctx_rtt; | 1112 | info->tcpi_rtt = hctx->ccid3hctx_rtt; |
diff --git a/net/dccp/ccids/ccid3.h b/net/dccp/ccids/ccid3.h index d16f00d784f3..eb248778eea3 100644 --- a/net/dccp/ccids/ccid3.h +++ b/net/dccp/ccids/ccid3.h | |||
@@ -48,6 +48,8 @@ | |||
48 | /* Two seconds as per CCID3 spec */ | 48 | /* Two seconds as per CCID3 spec */ |
49 | #define TFRC_INITIAL_TIMEOUT (2 * USEC_PER_SEC) | 49 | #define TFRC_INITIAL_TIMEOUT (2 * USEC_PER_SEC) |
50 | 50 | ||
51 | #define TFRC_INITIAL_IPI (USEC_PER_SEC / 4) | ||
52 | |||
51 | /* In usecs - half the scheduling granularity as per RFC3448 4.6 */ | 53 | /* In usecs - half the scheduling granularity as per RFC3448 4.6 */ |
52 | #define TFRC_OPSYS_HALF_TIME_GRAN (USEC_PER_SEC / (2 * HZ)) | 54 | #define TFRC_OPSYS_HALF_TIME_GRAN (USEC_PER_SEC / (2 * HZ)) |
53 | 55 | ||
diff --git a/net/dccp/ipv4.c b/net/dccp/ipv4.c index fee9a8c3777b..2afaa464e7f0 100644 --- a/net/dccp/ipv4.c +++ b/net/dccp/ipv4.c | |||
@@ -641,16 +641,12 @@ int dccp_v4_send_reset(struct sock *sk, enum dccp_reset_codes code) | |||
641 | 641 | ||
642 | skb = dccp_make_reset(sk, sk->sk_dst_cache, code); | 642 | skb = dccp_make_reset(sk, sk->sk_dst_cache, code); |
643 | if (skb != NULL) { | 643 | if (skb != NULL) { |
644 | const struct dccp_sock *dp = dccp_sk(sk); | ||
645 | const struct inet_sock *inet = inet_sk(sk); | 644 | const struct inet_sock *inet = inet_sk(sk); |
646 | 645 | ||
647 | err = ip_build_and_send_pkt(skb, sk, | 646 | err = ip_build_and_send_pkt(skb, sk, |
648 | inet->saddr, inet->daddr, NULL); | 647 | inet->saddr, inet->daddr, NULL); |
649 | if (err == NET_XMIT_CN) | 648 | if (err == NET_XMIT_CN) |
650 | err = 0; | 649 | err = 0; |
651 | |||
652 | ccid_hc_rx_exit(dp->dccps_hc_rx_ccid, sk); | ||
653 | ccid_hc_tx_exit(dp->dccps_hc_tx_ccid, sk); | ||
654 | } | 650 | } |
655 | 651 | ||
656 | return err; | 652 | return err; |
diff --git a/net/dccp/output.c b/net/dccp/output.c index 28de157a4326..ea6d0e91e511 100644 --- a/net/dccp/output.c +++ b/net/dccp/output.c | |||
@@ -522,7 +522,4 @@ void dccp_send_close(struct sock *sk, const int active) | |||
522 | dccp_transmit_skb(sk, skb_clone(skb, prio)); | 522 | dccp_transmit_skb(sk, skb_clone(skb, prio)); |
523 | } else | 523 | } else |
524 | dccp_transmit_skb(sk, skb); | 524 | dccp_transmit_skb(sk, skb); |
525 | |||
526 | ccid_hc_rx_exit(dp->dccps_hc_rx_ccid, sk); | ||
527 | ccid_hc_tx_exit(dp->dccps_hc_tx_ccid, sk); | ||
528 | } | 525 | } |
diff --git a/net/ipv4/tcp_output.c b/net/ipv4/tcp_output.c index 15e1134da1b2..c10e4435e3b1 100644 --- a/net/ipv4/tcp_output.c +++ b/net/ipv4/tcp_output.c | |||
@@ -485,11 +485,6 @@ int tcp_fragment(struct sock *sk, struct sk_buff *skb, u32 len, unsigned int mss | |||
485 | TCP_SKB_CB(buff)->when = TCP_SKB_CB(skb)->when; | 485 | TCP_SKB_CB(buff)->when = TCP_SKB_CB(skb)->when; |
486 | buff->tstamp = skb->tstamp; | 486 | buff->tstamp = skb->tstamp; |
487 | 487 | ||
488 | if (TCP_SKB_CB(skb)->sacked & TCPCB_LOST) { | ||
489 | tp->lost_out -= tcp_skb_pcount(skb); | ||
490 | tp->left_out -= tcp_skb_pcount(skb); | ||
491 | } | ||
492 | |||
493 | old_factor = tcp_skb_pcount(skb); | 488 | old_factor = tcp_skb_pcount(skb); |
494 | 489 | ||
495 | /* Fix up tso_factor for both original and new SKB. */ | 490 | /* Fix up tso_factor for both original and new SKB. */ |
diff --git a/net/ipv6/exthdrs.c b/net/ipv6/exthdrs.c index 47122728212a..922549581abc 100644 --- a/net/ipv6/exthdrs.c +++ b/net/ipv6/exthdrs.c | |||
@@ -406,8 +406,7 @@ ipv6_invert_rthdr(struct sock *sk, struct ipv6_rt_hdr *hdr) | |||
406 | 406 | ||
407 | memcpy(opt->srcrt, hdr, sizeof(*hdr)); | 407 | memcpy(opt->srcrt, hdr, sizeof(*hdr)); |
408 | irthdr = (struct rt0_hdr*)opt->srcrt; | 408 | irthdr = (struct rt0_hdr*)opt->srcrt; |
409 | /* Obsolete field, MBZ, when originated by us */ | 409 | irthdr->reserved = 0; |
410 | irthdr->bitmap = 0; | ||
411 | opt->srcrt->segments_left = n; | 410 | opt->srcrt->segments_left = n; |
412 | for (i=0; i<n; i++) | 411 | for (i=0; i<n; i++) |
413 | memcpy(irthdr->addr+i, rthdr->addr+(n-1-i), 16); | 412 | memcpy(irthdr->addr+i, rthdr->addr+(n-1-i), 16); |
diff --git a/net/ipv6/netfilter/ip6t_rt.c b/net/ipv6/netfilter/ip6t_rt.c index a9526b773d28..2bb670037df3 100644 --- a/net/ipv6/netfilter/ip6t_rt.c +++ b/net/ipv6/netfilter/ip6t_rt.c | |||
@@ -161,8 +161,8 @@ match(const struct sk_buff *skb, | |||
161 | ((rtinfo->hdrlen == hdrlen) ^ | 161 | ((rtinfo->hdrlen == hdrlen) ^ |
162 | !!(rtinfo->invflags & IP6T_RT_INV_LEN)))); | 162 | !!(rtinfo->invflags & IP6T_RT_INV_LEN)))); |
163 | DEBUGP("res %02X %02X %02X ", | 163 | DEBUGP("res %02X %02X %02X ", |
164 | (rtinfo->flags & IP6T_RT_RES), ((struct rt0_hdr *)rh)->bitmap, | 164 | (rtinfo->flags & IP6T_RT_RES), ((struct rt0_hdr *)rh)->reserved, |
165 | !((rtinfo->flags & IP6T_RT_RES) && (((struct rt0_hdr *)rh)->bitmap))); | 165 | !((rtinfo->flags & IP6T_RT_RES) && (((struct rt0_hdr *)rh)->reserved))); |
166 | 166 | ||
167 | ret = (rh != NULL) | 167 | ret = (rh != NULL) |
168 | && | 168 | && |
@@ -179,12 +179,12 @@ match(const struct sk_buff *skb, | |||
179 | !!(rtinfo->invflags & IP6T_RT_INV_TYP))); | 179 | !!(rtinfo->invflags & IP6T_RT_INV_TYP))); |
180 | 180 | ||
181 | if (ret && (rtinfo->flags & IP6T_RT_RES)) { | 181 | if (ret && (rtinfo->flags & IP6T_RT_RES)) { |
182 | u_int32_t *bp, _bitmap; | 182 | u_int32_t *rp, _reserved; |
183 | bp = skb_header_pointer(skb, | 183 | rp = skb_header_pointer(skb, |
184 | ptr + offsetof(struct rt0_hdr, bitmap), | 184 | ptr + offsetof(struct rt0_hdr, reserved), |
185 | sizeof(_bitmap), &_bitmap); | 185 | sizeof(_reserved), &_reserved); |
186 | 186 | ||
187 | ret = (*bp == 0); | 187 | ret = (*rp == 0); |
188 | } | 188 | } |
189 | 189 | ||
190 | DEBUGP("#%d ",rtinfo->addrnr); | 190 | DEBUGP("#%d ",rtinfo->addrnr); |