]> git.baikalelectronics.ru Git - kernel.git/commit
[IPV6] ADDRCONF: Check range of prefix length
authorThomas Graf <tgraf@suug.ch>
Wed, 28 May 2008 14:54:22 +0000 (16:54 +0200)
committerYOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>
Wed, 4 Jun 2008 19:02:31 +0000 (04:02 +0900)
commitde1ed4c497d2622b6db5b6dad36bae1b54a01297
tree766e3dffc0e878bf07e4d9a4aa0b25b19d8e2785
parentd05bfb379cbfad33794fe3c3a3e4acfdda202f35
[IPV6] ADDRCONF: Check range of prefix length

As of now, the prefix length is not vaildated when adding or deleting
addresses. The value is passed directly into the inet6_ifaddr structure
and later passed on to memcmp() as length indicator which relies on
the value never to exceed 128 (bits).

Due to the missing check, the currently code allows for any 8 bit
value to be passed on as prefix length while using the netlink
interface, and any 32 bit value while using the ioctl interface.

[Use unsigned int instead to generate better code - yoshfuji]

Signed-off-by: Thomas Graf <tgraf@suug.ch>
Signed-off-by: YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>
net/ipv6/addrconf.c