Skip to content

Commit

Permalink
sctp: fix to reset packet information after packet transmit
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Wei Yongjun authored and Vlad Yasevich committed Sep 4, 2009
1 parent 31b02e1 commit d521c08
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion net/sctp/output.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit d521c08

Please sign in to comment.