diff options
Diffstat (limited to 'net/dccp/ccids/ccid3.c')
-rw-r--r-- | net/dccp/ccids/ccid3.c | 35 |
1 files changed, 6 insertions, 29 deletions
diff --git a/net/dccp/ccids/ccid3.c b/net/dccp/ccids/ccid3.c index 49338370eb04..2ba0a7c470d1 100644 --- a/net/dccp/ccids/ccid3.c +++ b/net/dccp/ccids/ccid3.c | |||
@@ -49,8 +49,6 @@ static int ccid3_debug; | |||
49 | #define ccid3_pr_debug(format, a...) | 49 | #define ccid3_pr_debug(format, a...) |
50 | #endif | 50 | #endif |
51 | 51 | ||
52 | static struct dccp_rx_hist *ccid3_rx_hist; | ||
53 | |||
54 | /* | 52 | /* |
55 | * Transmitter Half-Connection Routines | 53 | * Transmitter Half-Connection Routines |
56 | */ | 54 | */ |
@@ -807,9 +805,9 @@ static int ccid3_hc_rx_detect_loss(struct sock *sk, | |||
807 | } | 805 | } |
808 | 806 | ||
809 | detect_out: | 807 | detect_out: |
810 | dccp_rx_hist_add_packet(ccid3_rx_hist, &hcrx->ccid3hcrx_hist, | 808 | dccp_rx_hist_add_packet(&hcrx->ccid3hcrx_hist, |
811 | &hcrx->ccid3hcrx_li_hist, packet, | 809 | &hcrx->ccid3hcrx_li_hist, packet, |
812 | hcrx->ccid3hcrx_seqno_nonloss); | 810 | hcrx->ccid3hcrx_seqno_nonloss); |
813 | return loss; | 811 | return loss; |
814 | } | 812 | } |
815 | 813 | ||
@@ -852,8 +850,7 @@ static void ccid3_hc_rx_packet_recv(struct sock *sk, struct sk_buff *skb) | |||
852 | return; | 850 | return; |
853 | } | 851 | } |
854 | 852 | ||
855 | packet = dccp_rx_hist_entry_new(ccid3_rx_hist, opt_recv->dccpor_ndp, | 853 | packet = dccp_rx_hist_entry_new(opt_recv->dccpor_ndp, skb, GFP_ATOMIC); |
856 | skb, GFP_ATOMIC); | ||
857 | if (unlikely(packet == NULL)) { | 854 | if (unlikely(packet == NULL)) { |
858 | DCCP_WARN("%s(%p), Not enough mem to add rx packet " | 855 | DCCP_WARN("%s(%p), Not enough mem to add rx packet " |
859 | "to history, consider it lost!\n", dccp_role(sk), sk); | 856 | "to history, consider it lost!\n", dccp_role(sk), sk); |
@@ -936,7 +933,7 @@ static void ccid3_hc_rx_exit(struct sock *sk) | |||
936 | ccid3_hc_rx_set_state(sk, TFRC_RSTATE_TERM); | 933 | ccid3_hc_rx_set_state(sk, TFRC_RSTATE_TERM); |
937 | 934 | ||
938 | /* Empty packet history */ | 935 | /* Empty packet history */ |
939 | dccp_rx_hist_purge(ccid3_rx_hist, &hcrx->ccid3hcrx_hist); | 936 | dccp_rx_hist_purge(&hcrx->ccid3hcrx_hist); |
940 | 937 | ||
941 | /* Empty loss interval history */ | 938 | /* Empty loss interval history */ |
942 | dccp_li_hist_purge(&hcrx->ccid3hcrx_li_hist); | 939 | dccp_li_hist_purge(&hcrx->ccid3hcrx_li_hist); |
@@ -1013,33 +1010,13 @@ MODULE_PARM_DESC(ccid3_debug, "Enable debug messages"); | |||
1013 | 1010 | ||
1014 | static __init int ccid3_module_init(void) | 1011 | static __init int ccid3_module_init(void) |
1015 | { | 1012 | { |
1016 | int rc = -ENOBUFS; | 1013 | return ccid_register(&ccid3); |
1017 | |||
1018 | ccid3_rx_hist = dccp_rx_hist_new("ccid3"); | ||
1019 | if (ccid3_rx_hist == NULL) | ||
1020 | goto out; | ||
1021 | |||
1022 | rc = ccid_register(&ccid3); | ||
1023 | if (rc != 0) | ||
1024 | goto out_free_rx; | ||
1025 | out: | ||
1026 | return rc; | ||
1027 | |||
1028 | out_free_rx: | ||
1029 | dccp_rx_hist_delete(ccid3_rx_hist); | ||
1030 | ccid3_rx_hist = NULL; | ||
1031 | goto out; | ||
1032 | } | 1014 | } |
1033 | module_init(ccid3_module_init); | 1015 | module_init(ccid3_module_init); |
1034 | 1016 | ||
1035 | static __exit void ccid3_module_exit(void) | 1017 | static __exit void ccid3_module_exit(void) |
1036 | { | 1018 | { |
1037 | ccid_unregister(&ccid3); | 1019 | ccid_unregister(&ccid3); |
1038 | |||
1039 | if (ccid3_rx_hist != NULL) { | ||
1040 | dccp_rx_hist_delete(ccid3_rx_hist); | ||
1041 | ccid3_rx_hist = NULL; | ||
1042 | } | ||
1043 | } | 1020 | } |
1044 | module_exit(ccid3_module_exit); | 1021 | module_exit(ccid3_module_exit); |
1045 | 1022 | ||