From: Wei Yongjun Date: Wed, 2 Sep 2009 05:05:33 +0000 (+0800) Subject: sctp: fix to reset packet information after packet transmit X-Git-Tag: v2.6.32-rc1~703^2~59 X-Git-Url: http://ftp.safe.ca/?p=safe%2Fjmp%2Flinux-2.6;a=commitdiff_plain;h=d521c08f4c16d27f193718da778503a6472501da 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 Signed-off-by: Vlad Yasevich --- diff --git a/net/sctp/output.c b/net/sctp/output.c index b801bc9..1f93361 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);