diff options
| author | Jon Grimm <jgrimm@touki.austin.ibm.com> | 2003-02-18 06:22:04 -0600 |
|---|---|---|
| committer | Jon Grimm <jgrimm@touki.austin.ibm.com> | 2003-02-18 06:22:04 -0600 |
| commit | a276e83e290b51f45fc38206fec7921f9b9fd255 (patch) | |
| tree | a02f2d969d1895d09e98a39a8c40cfcc7529953f /net/sctp/tsnmap.c | |
| parent | 8ae0801a1bdfa3d720c623da0f49e368113efd31 (diff) | |
[SCTP] Renege to make room for CTSN+1 chunk.
If our receive buffer is full, but this is the most important TSN
to receive, make room by reneging less important TSNs. Only renege
if there is a gap and this is the next TSN to fit in the gap.
Diffstat (limited to 'net/sctp/tsnmap.c')
| -rw-r--r-- | net/sctp/tsnmap.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/net/sctp/tsnmap.c b/net/sctp/tsnmap.c index 284a6b56a4f5..8773a7ee3ead 100644 --- a/net/sctp/tsnmap.c +++ b/net/sctp/tsnmap.c @@ -385,3 +385,23 @@ static void sctp_tsnmap_find_gap_ack(__u8 *map, __u16 off, } } } + +/* Renege that we have seen a TSN. */ +void sctp_tsnmap_renege(struct sctp_tsnmap *map, __u32 tsn) +{ + __s32 gap; + + if (TSN_lt(tsn, map->base_tsn)) + return; + if (!TSN_lt(tsn, map->base_tsn + map->len + map->len)) + return; + + /* Assert: TSN is in range. */ + gap = tsn - map->base_tsn; + + /* Pretend we never saw the TSN. */ + if (gap < map->len) + map->tsn_map[gap] = 0; + else + map->overflow_map[gap - map->len] = 0; +} |
