aboutsummaryrefslogtreecommitdiff
path: root/drivers/net/ethernet/intel/igc/igc_ptp.c
diff options
context:
space:
mode:
authorDaniel Borkmann <[email protected]>2021-10-13 15:21:38 +0200
committerJakub Kicinski <[email protected]>2021-10-14 19:16:21 -0700
commit507c2f1d2936e07aef83734983a36df01b458ef9 (patch)
tree039b87bb94c7a7a0874ca532bb6711c59b1923a8 /drivers/net/ethernet/intel/igc/igc_ptp.c
parent20d446f24f378ee63a29b259b375691d25002448 (diff)
net, neigh: Add build-time assertion to avoid neigh->flags overflow
Currently, NDA_FLAGS_EXT flags allow a maximum of 24 bits to be used for extended neighbor flags. These are eventually fed into neigh->flags by shifting with NTF_EXT_SHIFT as per commit 2c611ad97a82 ("net, neigh: Extend neigh->flags to 32 bit to allow for extensions"). If really ever needed in future, the full 32 bits from NDA_FLAGS_EXT can be used, it would only require to move neigh->flags from u32 to u64 inside the kernel. Add a build-time assertion such that when extending the NTF_EXT_MASK with new bits, we'll trigger an error once we surpass the 24th bit. This assumes that no bit holes in new NTF_EXT_* flags will slip in from UAPI, but I think this is reasonable to assume. Suggested-by: David Ahern <[email protected]> Signed-off-by: Daniel Borkmann <[email protected]> Reviewed-by: David Ahern <[email protected]> Signed-off-by: Jakub Kicinski <[email protected]>
Diffstat (limited to 'drivers/net/ethernet/intel/igc/igc_ptp.c')
0 files changed, 0 insertions, 0 deletions