Commit ac40e41f4ddec8882d3f7bc8fa98a4fce8796aff
Committed by
David S. Miller
1 parent
70b57b814e
Exists in
master
and in
7 other branches
[SCTP]: Do not include ABORT chunk header in the notification.
The socket API draft is unclear about whether to include the chunk header or not. Recent discussion on the sctp implementors mailing list clarified that the chunk header shouldn't be included, but the error parameter header still needs to be there. Signed-off-by: Vlad Yasevich <vladislav.yasevich@hp.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Showing 1 changed file with 2 additions and 9 deletions Side-by-side Diff
net/sctp/ulpevent.c
... | ... | @@ -141,11 +141,6 @@ |
141 | 141 | * an ABORT, so we need to include it in the sac_info. |
142 | 142 | */ |
143 | 143 | if (chunk) { |
144 | - /* sctp_inqu_pop() has allready pulled off the chunk | |
145 | - * header. We need to put it back temporarily | |
146 | - */ | |
147 | - skb_push(chunk->skb, sizeof(sctp_chunkhdr_t)); | |
148 | - | |
149 | 144 | /* Copy the chunk data to a new skb and reserve enough |
150 | 145 | * head room to use as notification. |
151 | 146 | */ |
... | ... | @@ -155,9 +150,6 @@ |
155 | 150 | if (!skb) |
156 | 151 | goto fail; |
157 | 152 | |
158 | - /* put back the chunk header now that we have a copy */ | |
159 | - skb_pull(chunk->skb, sizeof(sctp_chunkhdr_t)); | |
160 | - | |
161 | 153 | /* Embed the event fields inside the cloned skb. */ |
162 | 154 | event = sctp_skb2event(skb); |
163 | 155 | sctp_ulpevent_init(event, MSG_NOTIFICATION, skb->truesize); |
... | ... | @@ -168,7 +160,8 @@ |
168 | 160 | |
169 | 161 | /* Trim the buffer to the right length. */ |
170 | 162 | skb_trim(skb, sizeof(struct sctp_assoc_change) + |
171 | - ntohs(chunk->chunk_hdr->length)); | |
163 | + ntohs(chunk->chunk_hdr->length) - | |
164 | + sizeof(sctp_chunkhdr_t)); | |
172 | 165 | } else { |
173 | 166 | event = sctp_ulpevent_new(sizeof(struct sctp_assoc_change), |
174 | 167 | MSG_NOTIFICATION, gfp); |