Files
linux/net
Xi Wang 0c9f79be29 ipv4: avoid undefined behavior in do_ip_setsockopt()
(1<<optname) is undefined behavior in C with a negative optname or
optname larger than 31.  In those cases the result of the shift is
not necessarily zero (e.g., on x86).

This patch simplifies the code with a switch statement on optname.
It also allows the compiler to generate better code (e.g., using a
64-bit mask).

Signed-off-by: Xi Wang <xi.wang@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2012-11-11 17:53:13 -05:00
..
2012-07-19 10:48:00 -07:00
2012-11-09 17:11:17 -05:00
2012-10-14 22:41:27 -07:00
2012-06-15 15:30:15 -07:00
2012-10-09 13:57:23 -04:00
2012-11-01 11:55:19 -04:00
2012-09-17 13:00:13 -04:00
2012-09-26 21:10:25 -04:00