HomeFreeBSD

netlink: avoid underflow of groups bitset index

Description

netlink: avoid underflow of groups bitset index

The subtraction is absolutely unnecessary and created an underflow with
926d2eadcb67. I don't see why it was useful before 926d2eadcb67 and even
before edf5608bfef3. The bitset addresses bits from zero to
NLP_MAX_GROUPS-1. Note that check of user supplied argument for
NETLINK_ADD_MEMBERSHIP and NETLINK_DROP_MEMBERSHIP socket options is
already correct !(optval >= NLP_MAX_GROUPS).

Fixes: 926d2eadcb671dd26431a1082d4c49c3d5ad7f22

Details

Provenance
glebiusAuthored on Mon, Jan 13, 9:27 PM
Parents
rG63f28490237f: ng_ksocket: fix build without INET6
Branches
Unknown
Tags
Unknown