MCPcopy Create free account
hub / github.com/F-Stack/f-stack / advance_window

Function advance_window

freebsd/netipsec/ipsec.c:1203–1222  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1201}
1202
1203static inline void
1204advance_window(const struct secreplay *replay, uint64_t seq)
1205{
1206 int i;
1207 uint64_t index, index_cur, diff;
1208
1209 index_cur = replay->last >> IPSEC_REDUNDANT_BIT_SHIFTS;
1210 index = seq >> IPSEC_REDUNDANT_BIT_SHIFTS;
1211 diff = index - index_cur;
1212
1213 if (diff > replay->bitmap_size) {
1214 /* something unusual in this case */
1215 diff = replay->bitmap_size;
1216 }
1217
1218 for (i = 0; i < diff; i++) {
1219 replay->bitmap[(i + index_cur + 1)
1220 & IPSEC_BITMAP_INDEX_MASK(replay->bitmap_size)] = 0;
1221 }
1222}
1223
1224static inline void
1225set_window(const struct secreplay *replay, uint64_t seq)

Callers 1

ipsec_updatereplayFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected