]> CyberLeo.Net >> Repos - FreeBSD/stable/9.git/commit
MFC r256624:
authormelifaro <melifaro@ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f>
Wed, 30 Oct 2013 16:08:27 +0000 (16:08 +0000)
committermelifaro <melifaro@ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f>
Wed, 30 Oct 2013 16:08:27 +0000 (16:08 +0000)
commit1d13a10fed222b4a176608f028ffe61c97355039
tree0428a2115378f08a095c383d2043eea596758fb0
parentad9aa12975ddc0a0eee76d88196c5a57795eaaaa
MFC r256624:

Fix long-standing issue with incorrect radix mask calculation.

Usual symptoms are messages like
rn_delete: inconsistent annotation
rn_addmask: mask impossibly already in tree
routing daemon constantly deleting IPv6 default route
or inability to flush/delete particular prefix in ipfw table.

Changes:
* Assume 32 bytes as maximum radix key length
* Remove rn_init()
* Statically allocate rn_ones/rn_zeroes
* Make separate mask tree for each "normal" tree instead of system
global one
* Remove "optimization" on masks reusage and key zeroying
* Change rn_addmask() arguments to accept tree pointer (no users in base)

MFC changes:
* keep rn_init()
* create global mask tree, protected with mutex, for old rn_addmask
users (currently 0 in base)
* Add new rn_addmask_r() function (rn_addmask in head) with additional
argument to accept tree pointer

PR: kern/182851, kern/169206, kern/135476, kern/134531
Found by: Slawa Olhovchenkov <slw@zxy.spb.ru>
Reviewed by: glebius (previous versions)
Sponsored by: Yandex LLC

git-svn-id: svn://svn.freebsd.org/base/stable/9@257389 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
sys/net/radix.c
sys/net/radix.h