diff options
author | James Bottomley <jejb@titanic.(none)> | 2005-05-20 16:27:44 -0400 |
---|---|---|
committer | James Bottomley <jejb@titanic.(none)> | 2005-05-20 16:27:44 -0400 |
commit | ad34ea2cc3845ef4dcd7d12fb0fa8484734bd672 (patch) | |
tree | ad434400f5ecaa33b433c8f830e40792d8d6c05c /net/sctp | |
parent | 90356ac3194bf91a441a5f9c3067af386ef62462 (diff) | |
parent | 88d7bd8cb9eb8d64bf7997600b0d64f7834047c5 (diff) |
merge by hand - fix up rejections in Documentation/DocBook/Makefile
Diffstat (limited to 'net/sctp')
-rw-r--r-- | net/sctp/endpointola.c | 1 | ||||
-rw-r--r-- | net/sctp/ipv6.c | 4 | ||||
-rw-r--r-- | net/sctp/output.c | 4 | ||||
-rw-r--r-- | net/sctp/protocol.c | 7 | ||||
-rw-r--r-- | net/sctp/sm_make_chunk.c | 19 | ||||
-rw-r--r-- | net/sctp/sm_statefuns.c | 77 | ||||
-rw-r--r-- | net/sctp/socket.c | 38 | ||||
-rw-r--r-- | net/sctp/sysctl.c | 8 |
8 files changed, 111 insertions, 47 deletions
diff --git a/net/sctp/endpointola.c b/net/sctp/endpointola.c index 544b75077dbd..334f61773e6d 100644 --- a/net/sctp/endpointola.c +++ b/net/sctp/endpointola.c | |||
@@ -125,6 +125,7 @@ static struct sctp_endpoint *sctp_endpoint_init(struct sctp_endpoint *ep, | |||
125 | sp->autoclose * HZ; | 125 | sp->autoclose * HZ; |
126 | 126 | ||
127 | /* Use SCTP specific send buffer space queues. */ | 127 | /* Use SCTP specific send buffer space queues. */ |
128 | ep->sndbuf_policy = sctp_sndbuf_policy; | ||
128 | sk->sk_write_space = sctp_write_space; | 129 | sk->sk_write_space = sctp_write_space; |
129 | sock_set_flag(sk, SOCK_USE_WRITE_QUEUE); | 130 | sock_set_flag(sk, SOCK_USE_WRITE_QUEUE); |
130 | 131 | ||
diff --git a/net/sctp/ipv6.c b/net/sctp/ipv6.c index e42c74e3ec1e..c9d9ea064734 100644 --- a/net/sctp/ipv6.c +++ b/net/sctp/ipv6.c | |||
@@ -496,9 +496,7 @@ static void sctp_v6_inaddr_any(union sctp_addr *addr, unsigned short port) | |||
496 | /* Is this a wildcard address? */ | 496 | /* Is this a wildcard address? */ |
497 | static int sctp_v6_is_any(const union sctp_addr *addr) | 497 | static int sctp_v6_is_any(const union sctp_addr *addr) |
498 | { | 498 | { |
499 | int type; | 499 | return ipv6_addr_any(&addr->v6.sin6_addr); |
500 | type = ipv6_addr_type((struct in6_addr *)&addr->v6.sin6_addr); | ||
501 | return IPV6_ADDR_ANY == type; | ||
502 | } | 500 | } |
503 | 501 | ||
504 | /* Should this be available for binding? */ | 502 | /* Should this be available for binding? */ |
diff --git a/net/sctp/output.c b/net/sctp/output.c index 9013f64f5219..84b5b370b09d 100644 --- a/net/sctp/output.c +++ b/net/sctp/output.c | |||
@@ -313,12 +313,12 @@ int sctp_packet_transmit(struct sctp_packet *packet) | |||
313 | sk = chunk->skb->sk; | 313 | sk = chunk->skb->sk; |
314 | 314 | ||
315 | /* Allocate the new skb. */ | 315 | /* Allocate the new skb. */ |
316 | nskb = dev_alloc_skb(packet->size); | 316 | nskb = alloc_skb(packet->size + LL_MAX_HEADER, GFP_ATOMIC); |
317 | if (!nskb) | 317 | if (!nskb) |
318 | goto nomem; | 318 | goto nomem; |
319 | 319 | ||
320 | /* Make sure the outbound skb has enough header room reserved. */ | 320 | /* Make sure the outbound skb has enough header room reserved. */ |
321 | skb_reserve(nskb, packet->overhead); | 321 | skb_reserve(nskb, packet->overhead + LL_MAX_HEADER); |
322 | 322 | ||
323 | /* Set the owning socket so that we know where to get the | 323 | /* Set the owning socket so that we know where to get the |
324 | * destination IP address. | 324 | * destination IP address. |
diff --git a/net/sctp/protocol.c b/net/sctp/protocol.c index b9813cf3d91c..2e1f9c3556f5 100644 --- a/net/sctp/protocol.c +++ b/net/sctp/protocol.c | |||
@@ -1043,6 +1043,9 @@ SCTP_STATIC __init int sctp_init(void) | |||
1043 | sctp_max_retrans_path = 5; | 1043 | sctp_max_retrans_path = 5; |
1044 | sctp_max_retrans_init = 8; | 1044 | sctp_max_retrans_init = 8; |
1045 | 1045 | ||
1046 | /* Sendbuffer growth - do per-socket accounting */ | ||
1047 | sctp_sndbuf_policy = 0; | ||
1048 | |||
1046 | /* HB.interval - 30 seconds */ | 1049 | /* HB.interval - 30 seconds */ |
1047 | sctp_hb_interval = 30 * HZ; | 1050 | sctp_hb_interval = 30 * HZ; |
1048 | 1051 | ||
@@ -1159,8 +1162,6 @@ SCTP_STATIC __init int sctp_init(void) | |||
1159 | status = 0; | 1162 | status = 0; |
1160 | out: | 1163 | out: |
1161 | return status; | 1164 | return status; |
1162 | err_add_protocol: | ||
1163 | proto_unregister(&sctp_prot); | ||
1164 | err_ctl_sock_init: | 1165 | err_ctl_sock_init: |
1165 | sctp_v6_exit(); | 1166 | sctp_v6_exit(); |
1166 | err_v6_init: | 1167 | err_v6_init: |
@@ -1188,6 +1189,8 @@ err_bucket_cachep: | |||
1188 | inet_del_protocol(&sctp_protocol, IPPROTO_SCTP); | 1189 | inet_del_protocol(&sctp_protocol, IPPROTO_SCTP); |
1189 | inet_unregister_protosw(&sctp_seqpacket_protosw); | 1190 | inet_unregister_protosw(&sctp_seqpacket_protosw); |
1190 | inet_unregister_protosw(&sctp_stream_protosw); | 1191 | inet_unregister_protosw(&sctp_stream_protosw); |
1192 | err_add_protocol: | ||
1193 | proto_unregister(&sctp_prot); | ||
1191 | goto out; | 1194 | goto out; |
1192 | } | 1195 | } |
1193 | 1196 | ||
diff --git a/net/sctp/sm_make_chunk.c b/net/sctp/sm_make_chunk.c index 1db12cc18cf7..33ac8bf47b0e 100644 --- a/net/sctp/sm_make_chunk.c +++ b/net/sctp/sm_make_chunk.c | |||
@@ -710,7 +710,9 @@ struct sctp_chunk *sctp_make_shutdown_complete( | |||
710 | struct sctp_chunk *retval; | 710 | struct sctp_chunk *retval; |
711 | __u8 flags = 0; | 711 | __u8 flags = 0; |
712 | 712 | ||
713 | /* Maybe set the T-bit if we have no association. */ | 713 | /* Set the T-bit if we have no association (vtag will be |
714 | * reflected) | ||
715 | */ | ||
714 | flags |= asoc ? 0 : SCTP_CHUNK_FLAG_T; | 716 | flags |= asoc ? 0 : SCTP_CHUNK_FLAG_T; |
715 | 717 | ||
716 | retval = sctp_make_chunk(asoc, SCTP_CID_SHUTDOWN_COMPLETE, flags, 0); | 718 | retval = sctp_make_chunk(asoc, SCTP_CID_SHUTDOWN_COMPLETE, flags, 0); |
@@ -732,7 +734,7 @@ struct sctp_chunk *sctp_make_shutdown_complete( | |||
732 | } | 734 | } |
733 | 735 | ||
734 | /* Create an ABORT. Note that we set the T bit if we have no | 736 | /* Create an ABORT. Note that we set the T bit if we have no |
735 | * association. | 737 | * association, except when responding to an INIT (sctpimpguide 2.41). |
736 | */ | 738 | */ |
737 | struct sctp_chunk *sctp_make_abort(const struct sctp_association *asoc, | 739 | struct sctp_chunk *sctp_make_abort(const struct sctp_association *asoc, |
738 | const struct sctp_chunk *chunk, | 740 | const struct sctp_chunk *chunk, |
@@ -741,8 +743,16 @@ struct sctp_chunk *sctp_make_abort(const struct sctp_association *asoc, | |||
741 | struct sctp_chunk *retval; | 743 | struct sctp_chunk *retval; |
742 | __u8 flags = 0; | 744 | __u8 flags = 0; |
743 | 745 | ||
744 | /* Maybe set the T-bit if we have no association. */ | 746 | /* Set the T-bit if we have no association and 'chunk' is not |
745 | flags |= asoc ? 0 : SCTP_CHUNK_FLAG_T; | 747 | * an INIT (vtag will be reflected). |
748 | */ | ||
749 | if (!asoc) { | ||
750 | if (chunk && chunk->chunk_hdr && | ||
751 | chunk->chunk_hdr->type == SCTP_CID_INIT) | ||
752 | flags = 0; | ||
753 | else | ||
754 | flags = SCTP_CHUNK_FLAG_T; | ||
755 | } | ||
746 | 756 | ||
747 | retval = sctp_make_chunk(asoc, SCTP_CID_ABORT, flags, hint); | 757 | retval = sctp_make_chunk(asoc, SCTP_CID_ABORT, flags, hint); |
748 | 758 | ||
@@ -2744,7 +2754,6 @@ struct sctp_chunk *sctp_make_fwdtsn(const struct sctp_association *asoc, | |||
2744 | 2754 | ||
2745 | hint = (nstreams + 1) * sizeof(__u32); | 2755 | hint = (nstreams + 1) * sizeof(__u32); |
2746 | 2756 | ||
2747 | /* Maybe set the T-bit if we have no association. */ | ||
2748 | retval = sctp_make_chunk(asoc, SCTP_CID_FWD_TSN, 0, hint); | 2757 | retval = sctp_make_chunk(asoc, SCTP_CID_FWD_TSN, 0, hint); |
2749 | 2758 | ||
2750 | if (!retval) | 2759 | if (!retval) |
diff --git a/net/sctp/sm_statefuns.c b/net/sctp/sm_statefuns.c index 278c56a2d076..8e01b8f09ac2 100644 --- a/net/sctp/sm_statefuns.c +++ b/net/sctp/sm_statefuns.c | |||
@@ -126,15 +126,18 @@ sctp_chunk_length_valid(struct sctp_chunk *chunk, | |||
126 | * should stop the T2-shutdown timer and remove all knowledge of the | 126 | * should stop the T2-shutdown timer and remove all knowledge of the |
127 | * association (and thus the association enters the CLOSED state). | 127 | * association (and thus the association enters the CLOSED state). |
128 | * | 128 | * |
129 | * Verification Tag: 8.5.1(C) | 129 | * Verification Tag: 8.5.1(C), sctpimpguide 2.41. |
130 | * C) Rules for packet carrying SHUTDOWN COMPLETE: | 130 | * C) Rules for packet carrying SHUTDOWN COMPLETE: |
131 | * ... | 131 | * ... |
132 | * - The receiver of a SHUTDOWN COMPLETE shall accept the packet if the | 132 | * - The receiver of a SHUTDOWN COMPLETE shall accept the packet |
133 | * Verification Tag field of the packet matches its own tag OR it is | 133 | * if the Verification Tag field of the packet matches its own tag and |
134 | * set to its peer's tag and the T bit is set in the Chunk Flags. | 134 | * the T bit is not set |
135 | * Otherwise, the receiver MUST silently discard the packet and take | 135 | * OR |
136 | * no further action. An endpoint MUST ignore the SHUTDOWN COMPLETE if | 136 | * it is set to its peer's tag and the T bit is set in the Chunk |
137 | * it is not in the SHUTDOWN-ACK-SENT state. | 137 | * Flags. |
138 | * Otherwise, the receiver MUST silently discard the packet | ||
139 | * and take no further action. An endpoint MUST ignore the | ||
140 | * SHUTDOWN COMPLETE if it is not in the SHUTDOWN-ACK-SENT state. | ||
138 | * | 141 | * |
139 | * Inputs | 142 | * Inputs |
140 | * (endpoint, asoc, chunk) | 143 | * (endpoint, asoc, chunk) |
@@ -2858,16 +2861,16 @@ sctp_disposition_t sctp_sf_eat_sack_6_2(const struct sctp_endpoint *ep, | |||
2858 | /* | 2861 | /* |
2859 | * Generate an ABORT in response to a packet. | 2862 | * Generate an ABORT in response to a packet. |
2860 | * | 2863 | * |
2861 | * Section: 8.4 Handle "Out of the blue" Packets | 2864 | * Section: 8.4 Handle "Out of the blue" Packets, sctpimpguide 2.41 |
2862 | * | 2865 | * |
2863 | * 8) The receiver should respond to the sender of the OOTB packet | 2866 | * 8) The receiver should respond to the sender of the OOTB packet with |
2864 | * with an ABORT. When sending the ABORT, the receiver of the | 2867 | * an ABORT. When sending the ABORT, the receiver of the OOTB packet |
2865 | * OOTB packet MUST fill in the Verification Tag field of the | 2868 | * MUST fill in the Verification Tag field of the outbound packet |
2866 | * outbound packet with the value found in the Verification Tag | 2869 | * with the value found in the Verification Tag field of the OOTB |
2867 | * field of the OOTB packet and set the T-bit in the Chunk Flags | 2870 | * packet and set the T-bit in the Chunk Flags to indicate that the |
2868 | * to indicate that no TCB was found. After sending this ABORT, | 2871 | * Verification Tag is reflected. After sending this ABORT, the |
2869 | * the receiver of the OOTB packet shall discard the OOTB packet | 2872 | * receiver of the OOTB packet shall discard the OOTB packet and take |
2870 | * and take no further action. | 2873 | * no further action. |
2871 | * | 2874 | * |
2872 | * Verification Tag: | 2875 | * Verification Tag: |
2873 | * | 2876 | * |
@@ -2895,6 +2898,10 @@ sctp_disposition_t sctp_sf_tabort_8_4_8(const struct sctp_endpoint *ep, | |||
2895 | return SCTP_DISPOSITION_NOMEM; | 2898 | return SCTP_DISPOSITION_NOMEM; |
2896 | } | 2899 | } |
2897 | 2900 | ||
2901 | /* Reflect vtag if T-Bit is set */ | ||
2902 | if (sctp_test_T_bit(abort)) | ||
2903 | packet->vtag = ntohl(chunk->sctp_hdr->vtag); | ||
2904 | |||
2898 | /* Set the skb to the belonging sock for accounting. */ | 2905 | /* Set the skb to the belonging sock for accounting. */ |
2899 | abort->skb->sk = ep->base.sk; | 2906 | abort->skb->sk = ep->base.sk; |
2900 | 2907 | ||
@@ -3026,22 +3033,24 @@ nomem: | |||
3026 | } | 3033 | } |
3027 | 3034 | ||
3028 | /* | 3035 | /* |
3029 | * RFC 2960, 8.4 - Handle "Out of the blue" Packets | 3036 | * RFC 2960, 8.4 - Handle "Out of the blue" Packets, sctpimpguide 2.41. |
3037 | * | ||
3030 | * 5) If the packet contains a SHUTDOWN ACK chunk, the receiver should | 3038 | * 5) If the packet contains a SHUTDOWN ACK chunk, the receiver should |
3031 | * respond to the sender of the OOTB packet with a SHUTDOWN COMPLETE. | 3039 | * respond to the sender of the OOTB packet with a SHUTDOWN COMPLETE. |
3032 | * When sending the SHUTDOWN COMPLETE, the receiver of the OOTB | 3040 | * When sending the SHUTDOWN COMPLETE, the receiver of the OOTB |
3033 | * packet must fill in the Verification Tag field of the outbound | 3041 | * packet must fill in the Verification Tag field of the outbound |
3034 | * packet with the Verification Tag received in the SHUTDOWN ACK and | 3042 | * packet with the Verification Tag received in the SHUTDOWN ACK and |
3035 | * set the T-bit in the Chunk Flags to indicate that no TCB was | 3043 | * set the T-bit in the Chunk Flags to indicate that the Verification |
3036 | * found. Otherwise, | 3044 | * Tag is reflected. |
3037 | * | 3045 | * |
3038 | * 8) The receiver should respond to the sender of the OOTB packet with | 3046 | * 8) The receiver should respond to the sender of the OOTB packet with |
3039 | * an ABORT. When sending the ABORT, the receiver of the OOTB packet | 3047 | * an ABORT. When sending the ABORT, the receiver of the OOTB packet |
3040 | * MUST fill in the Verification Tag field of the outbound packet | 3048 | * MUST fill in the Verification Tag field of the outbound packet |
3041 | * with the value found in the Verification Tag field of the OOTB | 3049 | * with the value found in the Verification Tag field of the OOTB |
3042 | * packet and set the T-bit in the Chunk Flags to indicate that no | 3050 | * packet and set the T-bit in the Chunk Flags to indicate that the |
3043 | * TCB was found. After sending this ABORT, the receiver of the OOTB | 3051 | * Verification Tag is reflected. After sending this ABORT, the |
3044 | * packet shall discard the OOTB packet and take no further action. | 3052 | * receiver of the OOTB packet shall discard the OOTB packet and take |
3053 | * no further action. | ||
3045 | */ | 3054 | */ |
3046 | sctp_disposition_t sctp_sf_ootb(const struct sctp_endpoint *ep, | 3055 | sctp_disposition_t sctp_sf_ootb(const struct sctp_endpoint *ep, |
3047 | const struct sctp_association *asoc, | 3056 | const struct sctp_association *asoc, |
@@ -3090,13 +3099,15 @@ sctp_disposition_t sctp_sf_ootb(const struct sctp_endpoint *ep, | |||
3090 | /* | 3099 | /* |
3091 | * Handle an "Out of the blue" SHUTDOWN ACK. | 3100 | * Handle an "Out of the blue" SHUTDOWN ACK. |
3092 | * | 3101 | * |
3093 | * Section: 8.4 5) | 3102 | * Section: 8.4 5, sctpimpguide 2.41. |
3103 | * | ||
3094 | * 5) If the packet contains a SHUTDOWN ACK chunk, the receiver should | 3104 | * 5) If the packet contains a SHUTDOWN ACK chunk, the receiver should |
3095 | * respond to the sender of the OOTB packet with a SHUTDOWN COMPLETE. | 3105 | * respond to the sender of the OOTB packet with a SHUTDOWN COMPLETE. |
3096 | * When sending the SHUTDOWN COMPLETE, the receiver of the OOTB packet | 3106 | * When sending the SHUTDOWN COMPLETE, the receiver of the OOTB |
3097 | * must fill in the Verification Tag field of the outbound packet with | 3107 | * packet must fill in the Verification Tag field of the outbound |
3098 | * the Verification Tag received in the SHUTDOWN ACK and set the | 3108 | * packet with the Verification Tag received in the SHUTDOWN ACK and |
3099 | * T-bit in the Chunk Flags to indicate that no TCB was found. | 3109 | * set the T-bit in the Chunk Flags to indicate that the Verification |
3110 | * Tag is reflected. | ||
3100 | * | 3111 | * |
3101 | * Inputs | 3112 | * Inputs |
3102 | * (endpoint, asoc, type, arg, commands) | 3113 | * (endpoint, asoc, type, arg, commands) |
@@ -3128,6 +3139,10 @@ static sctp_disposition_t sctp_sf_shut_8_4_5(const struct sctp_endpoint *ep, | |||
3128 | return SCTP_DISPOSITION_NOMEM; | 3139 | return SCTP_DISPOSITION_NOMEM; |
3129 | } | 3140 | } |
3130 | 3141 | ||
3142 | /* Reflect vtag if T-Bit is set */ | ||
3143 | if (sctp_test_T_bit(shut)) | ||
3144 | packet->vtag = ntohl(chunk->sctp_hdr->vtag); | ||
3145 | |||
3131 | /* Set the skb to the belonging sock for accounting. */ | 3146 | /* Set the skb to the belonging sock for accounting. */ |
3132 | shut->skb->sk = ep->base.sk; | 3147 | shut->skb->sk = ep->base.sk; |
3133 | 3148 | ||
@@ -3591,7 +3606,6 @@ sctp_disposition_t sctp_sf_discard_chunk(const struct sctp_endpoint *ep, | |||
3591 | * | 3606 | * |
3592 | * 2) If the OOTB packet contains an ABORT chunk, the receiver MUST | 3607 | * 2) If the OOTB packet contains an ABORT chunk, the receiver MUST |
3593 | * silently discard the OOTB packet and take no further action. | 3608 | * silently discard the OOTB packet and take no further action. |
3594 | * Otherwise, | ||
3595 | * | 3609 | * |
3596 | * Verification Tag: No verification necessary | 3610 | * Verification Tag: No verification necessary |
3597 | * | 3611 | * |
@@ -4961,6 +4975,11 @@ static struct sctp_packet *sctp_abort_pkt_new(const struct sctp_endpoint *ep, | |||
4961 | sctp_ootb_pkt_free(packet); | 4975 | sctp_ootb_pkt_free(packet); |
4962 | return NULL; | 4976 | return NULL; |
4963 | } | 4977 | } |
4978 | |||
4979 | /* Reflect vtag if T-Bit is set */ | ||
4980 | if (sctp_test_T_bit(abort)) | ||
4981 | packet->vtag = ntohl(chunk->sctp_hdr->vtag); | ||
4982 | |||
4964 | /* Add specified error causes, i.e., payload, to the | 4983 | /* Add specified error causes, i.e., payload, to the |
4965 | * end of the chunk. | 4984 | * end of the chunk. |
4966 | */ | 4985 | */ |
diff --git a/net/sctp/socket.c b/net/sctp/socket.c index e8c210182571..0b338eca6dc0 100644 --- a/net/sctp/socket.c +++ b/net/sctp/socket.c | |||
@@ -115,9 +115,17 @@ static inline int sctp_wspace(struct sctp_association *asoc) | |||
115 | struct sock *sk = asoc->base.sk; | 115 | struct sock *sk = asoc->base.sk; |
116 | int amt = 0; | 116 | int amt = 0; |
117 | 117 | ||
118 | amt = sk->sk_sndbuf - asoc->sndbuf_used; | 118 | if (asoc->ep->sndbuf_policy) { |
119 | /* make sure that no association uses more than sk_sndbuf */ | ||
120 | amt = sk->sk_sndbuf - asoc->sndbuf_used; | ||
121 | } else { | ||
122 | /* do socket level accounting */ | ||
123 | amt = sk->sk_sndbuf - atomic_read(&sk->sk_wmem_alloc); | ||
124 | } | ||
125 | |||
119 | if (amt < 0) | 126 | if (amt < 0) |
120 | amt = 0; | 127 | amt = 0; |
128 | |||
121 | return amt; | 129 | return amt; |
122 | } | 130 | } |
123 | 131 | ||
@@ -138,12 +146,21 @@ static inline void sctp_set_owner_w(struct sctp_chunk *chunk) | |||
138 | /* The sndbuf space is tracked per association. */ | 146 | /* The sndbuf space is tracked per association. */ |
139 | sctp_association_hold(asoc); | 147 | sctp_association_hold(asoc); |
140 | 148 | ||
149 | skb_set_owner_w(chunk->skb, sk); | ||
150 | |||
141 | chunk->skb->destructor = sctp_wfree; | 151 | chunk->skb->destructor = sctp_wfree; |
142 | /* Save the chunk pointer in skb for sctp_wfree to use later. */ | 152 | /* Save the chunk pointer in skb for sctp_wfree to use later. */ |
143 | *((struct sctp_chunk **)(chunk->skb->cb)) = chunk; | 153 | *((struct sctp_chunk **)(chunk->skb->cb)) = chunk; |
144 | 154 | ||
145 | asoc->sndbuf_used += SCTP_DATA_SNDSIZE(chunk); | 155 | asoc->sndbuf_used += SCTP_DATA_SNDSIZE(chunk) + |
146 | sk->sk_wmem_queued += SCTP_DATA_SNDSIZE(chunk); | 156 | sizeof(struct sk_buff) + |
157 | sizeof(struct sctp_chunk); | ||
158 | |||
159 | sk->sk_wmem_queued += SCTP_DATA_SNDSIZE(chunk) + | ||
160 | sizeof(struct sk_buff) + | ||
161 | sizeof(struct sctp_chunk); | ||
162 | |||
163 | atomic_add(sizeof(struct sctp_chunk), &sk->sk_wmem_alloc); | ||
147 | } | 164 | } |
148 | 165 | ||
149 | /* Verify that this is a valid address. */ | 166 | /* Verify that this is a valid address. */ |
@@ -3473,7 +3490,7 @@ static int sctp_getsockopt_associnfo(struct sock *sk, int len, | |||
3473 | return -EINVAL; | 3490 | return -EINVAL; |
3474 | 3491 | ||
3475 | /* Values correspoinding to the specific association */ | 3492 | /* Values correspoinding to the specific association */ |
3476 | if (assocparams.sasoc_assoc_id != 0) { | 3493 | if (asoc) { |
3477 | assocparams.sasoc_asocmaxrxt = asoc->max_retrans; | 3494 | assocparams.sasoc_asocmaxrxt = asoc->max_retrans; |
3478 | assocparams.sasoc_peer_rwnd = asoc->peer.rwnd; | 3495 | assocparams.sasoc_peer_rwnd = asoc->peer.rwnd; |
3479 | assocparams.sasoc_local_rwnd = asoc->a_rwnd; | 3496 | assocparams.sasoc_local_rwnd = asoc->a_rwnd; |
@@ -4422,8 +4439,17 @@ static void sctp_wfree(struct sk_buff *skb) | |||
4422 | chunk = *((struct sctp_chunk **)(skb->cb)); | 4439 | chunk = *((struct sctp_chunk **)(skb->cb)); |
4423 | asoc = chunk->asoc; | 4440 | asoc = chunk->asoc; |
4424 | sk = asoc->base.sk; | 4441 | sk = asoc->base.sk; |
4425 | asoc->sndbuf_used -= SCTP_DATA_SNDSIZE(chunk); | 4442 | asoc->sndbuf_used -= SCTP_DATA_SNDSIZE(chunk) + |
4426 | sk->sk_wmem_queued -= SCTP_DATA_SNDSIZE(chunk); | 4443 | sizeof(struct sk_buff) + |
4444 | sizeof(struct sctp_chunk); | ||
4445 | |||
4446 | sk->sk_wmem_queued -= SCTP_DATA_SNDSIZE(chunk) + | ||
4447 | sizeof(struct sk_buff) + | ||
4448 | sizeof(struct sctp_chunk); | ||
4449 | |||
4450 | atomic_sub(sizeof(struct sctp_chunk), &sk->sk_wmem_alloc); | ||
4451 | |||
4452 | sock_wfree(skb); | ||
4427 | __sctp_write_space(asoc); | 4453 | __sctp_write_space(asoc); |
4428 | 4454 | ||
4429 | sctp_association_put(asoc); | 4455 | sctp_association_put(asoc); |
diff --git a/net/sctp/sysctl.c b/net/sctp/sysctl.c index 89fa20c73a5c..7fc31849312b 100644 --- a/net/sctp/sysctl.c +++ b/net/sctp/sysctl.c | |||
@@ -110,6 +110,14 @@ static ctl_table sctp_table[] = { | |||
110 | .proc_handler = &proc_dointvec | 110 | .proc_handler = &proc_dointvec |
111 | }, | 111 | }, |
112 | { | 112 | { |
113 | .ctl_name = NET_SCTP_SNDBUF_POLICY, | ||
114 | .procname = "sndbuf_policy", | ||
115 | .data = &sctp_sndbuf_policy, | ||
116 | .maxlen = sizeof(int), | ||
117 | .mode = 0644, | ||
118 | .proc_handler = &proc_dointvec | ||
119 | }, | ||
120 | { | ||
113 | .ctl_name = NET_SCTP_PATH_MAX_RETRANS, | 121 | .ctl_name = NET_SCTP_PATH_MAX_RETRANS, |
114 | .procname = "path_max_retrans", | 122 | .procname = "path_max_retrans", |
115 | .data = &sctp_max_retrans_path, | 123 | .data = &sctp_max_retrans_path, |