diff options
Diffstat (limited to 'net/sctp/sm_make_chunk.c')
-rw-r--r-- | net/sctp/sm_make_chunk.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/net/sctp/sm_make_chunk.c b/net/sctp/sm_make_chunk.c index a85eeeb55dd0..b6de71efb140 100644 --- a/net/sctp/sm_make_chunk.c +++ b/net/sctp/sm_make_chunk.c | |||
@@ -734,8 +734,10 @@ struct sctp_chunk *sctp_make_sack(const struct sctp_association *asoc) | |||
734 | int len; | 734 | int len; |
735 | __u32 ctsn; | 735 | __u32 ctsn; |
736 | __u16 num_gabs, num_dup_tsns; | 736 | __u16 num_gabs, num_dup_tsns; |
737 | struct sctp_association *aptr = (struct sctp_association *)asoc; | ||
737 | struct sctp_tsnmap *map = (struct sctp_tsnmap *)&asoc->peer.tsn_map; | 738 | struct sctp_tsnmap *map = (struct sctp_tsnmap *)&asoc->peer.tsn_map; |
738 | struct sctp_gap_ack_block gabs[SCTP_MAX_GABS]; | 739 | struct sctp_gap_ack_block gabs[SCTP_MAX_GABS]; |
740 | struct sctp_transport *trans; | ||
739 | 741 | ||
740 | memset(gabs, 0, sizeof(gabs)); | 742 | memset(gabs, 0, sizeof(gabs)); |
741 | ctsn = sctp_tsnmap_get_ctsn(map); | 743 | ctsn = sctp_tsnmap_get_ctsn(map); |
@@ -805,6 +807,20 @@ struct sctp_chunk *sctp_make_sack(const struct sctp_association *asoc) | |||
805 | sctp_addto_chunk(retval, sizeof(__u32) * num_dup_tsns, | 807 | sctp_addto_chunk(retval, sizeof(__u32) * num_dup_tsns, |
806 | sctp_tsnmap_get_dups(map)); | 808 | sctp_tsnmap_get_dups(map)); |
807 | 809 | ||
810 | /* Once we have a sack generated, check to see what our sack | ||
811 | * generation is, if its 0, reset the transports to 0, and reset | ||
812 | * the association generation to 1 | ||
813 | * | ||
814 | * The idea is that zero is never used as a valid generation for the | ||
815 | * association so no transport will match after a wrap event like this, | ||
816 | * Until the next sack | ||
817 | */ | ||
818 | if (++aptr->peer.sack_generation == 0) { | ||
819 | list_for_each_entry(trans, &asoc->peer.transport_addr_list, | ||
820 | transports) | ||
821 | trans->sack_generation = 0; | ||
822 | aptr->peer.sack_generation = 1; | ||
823 | } | ||
808 | nodata: | 824 | nodata: |
809 | return retval; | 825 | return retval; |
810 | } | 826 | } |