]> git.tuebingen.mpg.de Git - paraslash.git/commit
acl: Avoid undefined behaviour due to 32-bit shift.
authorAndre Noll <maan@tuebingen.mpg.de>
Thu, 16 Nov 2017 02:24:47 +0000 (03:24 +0100)
committerAndre Noll <maan@tuebingen.mpg.de>
Tue, 13 Mar 2018 02:28:10 +0000 (03:28 +0100)
commitf17981539ec6877f404b1dfb2e59b55467886e67
tree84acced42e8f073c9a58b4259bf517dc8b7a46a6
parent71c22c2bb151244b2d3db7aa5a1e4a7fec7d2d83
acl: Avoid undefined behaviour due to 32-bit shift.

On x86 a shift by 32-bits is a nop, but this is not backed by any
standard. Moreover, not shifting at all results in an effective netmask
of 32, which is unexpected for for v4_addr_match(), as the function
is supposed to answer the question "do the first zero bits of these
two addresses match?". This should always be true, regardless of the
two addresses.

Fix this, and change the return type of the function while at it.
acl.c