Skip to contentSkip to conversation

net/netlabel: copy and paste bug in netlbl_cfg_unlbl_map_add()

PATCH Applied Dan Carpenter 3 participants 3 messages Nov 24, 2011 – Nov 29, 2011

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 net/netlabel: copy and paste bug in netlbl_cfg_unlbl_map_add()

This was copy and pasted from the IPv4 code. We're calling the ip4 version of that function and map4 is NULL.

net/netlabel/netlabel_kapi.c +2 -2
index 8ed67dcc..3735297 100644
@@ -162,8 +162,8 @@ int netlbl_cfg_unlbl_map_add(const char *domain,
 			map6->list.addr.s6_addr32[3] &= mask6->s6_addr32[3];
 			map6->list.mask = *mask6;
 			map6->list.valid = 1;
-			ret_val = netlbl_af4list_add(&map4->list,
-						     &addrmap->list4);
+			ret_val = netlbl_af6list_add(&map6->list,
+						     &addrmap->list6);
 			if (ret_val != 0)
 				goto cfg_unlbl_map_add_failure;
 			break;
maintainer
#2 lore raw
In reply to Dan Carpenter
Quoted 10 lines · Dan Carpenter

This was copy and pasted from the IPv4 code. We're calling the ip4 version of that function and map4 is NULL.

net/netlabel/netlabel_kapi.c +0 -0
index 8ed67dcc..3735297 100644

net/netlabel/netlabel_kapi.c int netlbl_cfg_unlbl_map_add(const char *domain, · line 169

Quoted 10 lines
net/netlabel/netlabel_kapi.c +2 -2
@@ -162,8 +162,8 @@ int netlbl_cfg_unlbl_map_add(const char *domain,
 			map6->list.addr.s6_addr32[3] &= mask6->s6_addr32[3];
 			map6->list.mask = *mask6;
 			map6->list.valid = 1;
-			ret_val = netlbl_af4list_add(&map4->list,
-						     &addrmap->list4);
+			ret_val = netlbl_af6list_add(&map6->list,
+						     &addrmap->list6);
 			if (ret_val != 0)
 				goto cfg_unlbl_map_add_failure;
 			break;

Thanks for fixing this. I actually stumbled across this just last week while working on the CALIPSO stuff and queued up a patch but didn't get a chance to verify it before Thanksgiving - you just saved me the effort :)

Signature · 2 lines
paul moore
www.paul-moore.com