summaryrefslogtreecommitdiff
path: root/net/sctp/output.c
diff options
context:
space:
mode:
authorWei Yongjun <yjwei@cn.fujitsu.com>2009-09-02 13:05:33 +0800
committerVlad Yasevich <vladislav.yasevich@hp.com>2009-09-04 18:21:00 -0400
commitd521c08f4c16d27f193718da778503a6472501da (patch)
tree44bc280f8711bf13942a192037cf5f96670053b7 /net/sctp/output.c
parent31b02e1549406efa346534acad956a42bc3f28c4 (diff)
downloadlinux-rt-d521c08f4c16d27f193718da778503a6472501da.tar.gz
sctp: fix to reset packet information after packet transmit
The packet information does not reset after packet transmit, this may cause some problems such as following DATA chunk be sent without AUTH chunk, even if the authentication of DATA chunk has been requested by the peer. Signed-off-by: Wei Yongjun <yjwei@cn.fujitsu.com> Signed-off-by: Vlad Yasevich <vladislav.yasevich@hp.com>
Diffstat (limited to 'net/sctp/output.c')
-rw-r--r--net/sctp/output.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/net/sctp/output.c b/net/sctp/output.c
index b801bc9fb639..1f9336177ee2 100644
--- a/net/sctp/output.c
+++ b/net/sctp/output.c
@@ -136,6 +136,17 @@ struct sctp_packet *sctp_packet_init(struct sctp_packet *packet,
return packet;
}
+static void sctp_packet_reset(struct sctp_packet *packet)
+{
+ packet->size = packet->overhead;
+ packet->has_cookie_echo = 0;
+ packet->has_sack = 0;
+ packet->has_data = 0;
+ packet->has_auth = 0;
+ packet->ipfragok = 0;
+ packet->auth = NULL;
+}
+
/* Free a packet. */
void sctp_packet_free(struct sctp_packet *packet)
{
@@ -576,7 +587,7 @@ int sctp_packet_transmit(struct sctp_packet *packet)
(*tp->af_specific->sctp_xmit)(nskb, tp);
out:
- packet->size = packet->overhead;
+ sctp_packet_reset(packet);
return err;
no_route:
kfree_skb(nskb);