summaryrefslogtreecommitdiff
path: root/sys/netinet6/ip6_id.c
diff options
context:
space:
mode:
authorDavid Gwynne <dlg@cvs.openbsd.org>2022-11-10 17:17:48 +0000
committerDavid Gwynne <dlg@cvs.openbsd.org>2022-11-10 17:17:48 +0000
commit5ce20f77c86c88b950fc6a1418106c5bcf39eb93 (patch)
tree97c00a1ef0abd058714c1fd3255d09f1ad269078 /sys/netinet6/ip6_id.c
parente0ad0cfd200ffcc54c0871dfa268e3bc2c6e224e (diff)
bring back r1.673: replace SRP with SMR in the if_idxmap.
when i first wrote if_idxmap i didn't realise (and no one thought to tell me) that index 0 was special and means "no interface", so while here use the 0th slot in the interface map to store the length of the map instead of prepending the map with a length field. if_get() now special cases index 0 and returns NULL directly. this also means the size of the map is now always a power of 2, which is a nicer fit with what the kernel malloc aprovides. the problem with r1.673 that hrvoje popovski found was that attaching a lot of interfaces during autoconf would lock up when growing the map called smr_barrier. the fix in this diff is to (ab)use the usedidx bitmap to store an smr_entry and defer the freeing of the interface pointer map with it. tested by hrvoje popovski tweaks and ok visa@
Diffstat (limited to 'sys/netinet6/ip6_id.c')
0 files changed, 0 insertions, 0 deletions