Commit d521c08f authored by Wei Yongjun's avatar Wei Yongjun Committed by Vlad Yasevich

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: default avatarWei Yongjun <yjwei@cn.fujitsu.com>
Signed-off-by: default avatarVlad Yasevich <vladislav.yasevich@hp.com>
parent 31b02e15
...@@ -136,6 +136,17 @@ struct sctp_packet *sctp_packet_init(struct sctp_packet *packet, ...@@ -136,6 +136,17 @@ struct sctp_packet *sctp_packet_init(struct sctp_packet *packet,
return 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. */ /* Free a packet. */
void sctp_packet_free(struct sctp_packet *packet) void sctp_packet_free(struct sctp_packet *packet)
{ {
...@@ -576,7 +587,7 @@ int sctp_packet_transmit(struct sctp_packet *packet) ...@@ -576,7 +587,7 @@ int sctp_packet_transmit(struct sctp_packet *packet)
(*tp->af_specific->sctp_xmit)(nskb, tp); (*tp->af_specific->sctp_xmit)(nskb, tp);
out: out:
packet->size = packet->overhead; sctp_packet_reset(packet);
return err; return err;
no_route: no_route:
kfree_skb(nskb); kfree_skb(nskb);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment