netlabel: Always remove the correct address selector
authorPaul Moore <paul.moore@hp.com>
Tue, 21 Apr 2009 10:04:22 +0000 (10:04 +0000)
committerDavid S. Miller <davem@davemloft.net>
Wed, 22 Apr 2009 07:46:09 +0000 (00:46 -0700)
commit50b2ff1bc47baacb8e9882b2b2a74b240ddbeecf
tree8ee63f5f2e28a501d5a91ac13ffea112d2018afc
parentcef309cf6112f9a44b1ebcefc1641d01d35c83dc
netlabel: Always remove the correct address selector

The NetLabel address selector mechanism has a problem where it can get
mistakenly remove the wrong selector when similar addresses are used.  The
problem is caused when multiple addresses are configured that have different
netmasks but the same address, e.g. 127.0.0.0/8 and 127.0.0.0/24.  This patch
fixes the problem.

Reported-by: Etienne Basset <etienne.basset@numericable.fr>
Signed-off-by: Paul Moore <paul.moore@hp.com>
Acked-by: James Morris <jmorris@namei.org>
Tested-by: Etienne Basset <etienne.basset@numericable.fr>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/netlabel/netlabel_addrlist.c