Skip to contentSkip to conversation

netlabel: Fix a problem when dumping the default IPv6 static labels

PATCH In review Paul Moore 2 participants 2 messages Jun 25, 2008 – Jun 28, 2008

Subsystems (3)
lore
Share & tools
lore

Paul Moore

author
#0 lore raw

PATCH 1/1 netlabel: Fix a problem when dumping the default IPv6 static labels

There is a missing "!" in a conditional statement which is causing entries to be skipped when dumping the default IPv6 static label entries. This can be demonstrated by running the following:

 # netlabelctl unlbl add default address:::1 \
                                 label:system_u:object_r:unlabeled_t:s0
 # netlabelctl -p unlbl list

... you will notice that the entry for the IPv6 localhost address is not displayed but does exist (works correctly, causes collisions when attempting to add duplicate entries, etc.).

---

 net/netlabel/netlabel_unlabeled.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
net/netlabel/netlabel_unlabeled.c +1 -1
index 0099da5..52b2611 100644
@@ -1534,7 +1534,7 @@ static int netlbl_unlabel_staticlistdef(struct sk_buff *skb,
 		}
 	}
 	list_for_each_entry_rcu(addr6, &iface->addr6_list, list) {
-		if (addr6->valid || iter_addr6++ < skip_addr6)
+		if (!addr6->valid || iter_addr6++ < skip_addr6)
 			continue;
 		if (netlbl_unlabel_staticlist_gen(NLBL_UNLABEL_C_STATICLISTDEF,
 					   iface,
maintainer
#1 lore raw

From: Paul Moore <[email protected]>
Date: Wed, 25 Jun 2008 16:29:13 -0400

Quoted 8 lines

There is a missing "!" in a conditional statement which is causing entries to be skipped when dumping the default IPv6 static label entries. This can be demonstrated by running the following:

 # netlabelctl unlbl add default address:::1 \
                                 label:system_u:object_r:unlabeled_t:s0
 # netlabelctl -p unlbl list
Quoted 5 lines

... you will notice that the entry for the IPv6 localhost address is not displayed but does exist (works correctly, causes collisions when attempting to add duplicate entries, etc.).

Patch applied, thanks Paul.