Skip to content

Commit a6a8fe9

Browse files
pcmooredavem330
authored andcommitted
netlabel: fix build problems when CONFIG_IPV6=n
My last patch to solve a problem where the static/fallback labels were not fully displayed resulted in build problems when IPv6 was disabled. This patch resolves the IPv6 build problems; sorry for the screw-up. Please queue for -stable or simply merge with the previous patch. Reported-by: Kbuild Test Robot <fengguang.wu@intel.com> Signed-off-by: Paul Moore <pmoore@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent f394793 commit a6a8fe9

1 file changed

Lines changed: 5 additions & 10 deletions

File tree

‎net/netlabel/netlabel_unlabeled.c‎

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1189,8 +1189,6 @@ static int netlbl_unlabel_staticlist(struct sk_buff *skb,
11891189
struct netlbl_unlhsh_walk_arg cb_arg;
11901190
u32 skip_bkt = cb->args[0];
11911191
u32 skip_chain = cb->args[1];
1192-
u32 skip_addr4 = cb->args[2];
1193-
u32 skip_addr6 = cb->args[3];
11941192
u32 iter_bkt;
11951193
u32 iter_chain = 0, iter_addr4 = 0, iter_addr6 = 0;
11961194
struct netlbl_unlhsh_iface *iface;
@@ -1215,7 +1213,7 @@ static int netlbl_unlabel_staticlist(struct sk_buff *skb,
12151213
continue;
12161214
netlbl_af4list_foreach_rcu(addr4,
12171215
&iface->addr4_list) {
1218-
if (iter_addr4++ < skip_addr4)
1216+
if (iter_addr4++ < cb->args[2])
12191217
continue;
12201218
if (netlbl_unlabel_staticlist_gen(
12211219
NLBL_UNLABEL_C_STATICLIST,
@@ -1231,7 +1229,7 @@ static int netlbl_unlabel_staticlist(struct sk_buff *skb,
12311229
#if IS_ENABLED(CONFIG_IPV6)
12321230
netlbl_af6list_foreach_rcu(addr6,
12331231
&iface->addr6_list) {
1234-
if (iter_addr6++ < skip_addr6)
1232+
if (iter_addr6++ < cb->args[3])
12351233
continue;
12361234
if (netlbl_unlabel_staticlist_gen(
12371235
NLBL_UNLABEL_C_STATICLIST,
@@ -1273,12 +1271,9 @@ static int netlbl_unlabel_staticlistdef(struct sk_buff *skb,
12731271
{
12741272
struct netlbl_unlhsh_walk_arg cb_arg;
12751273
struct netlbl_unlhsh_iface *iface;
1276-
u32 skip_addr4 = cb->args[0];
1277-
u32 skip_addr6 = cb->args[1];
1278-
u32 iter_addr4 = 0;
1274+
u32 iter_addr4 = 0, iter_addr6 = 0;
12791275
struct netlbl_af4list *addr4;
12801276
#if IS_ENABLED(CONFIG_IPV6)
1281-
u32 iter_addr6 = 0;
12821277
struct netlbl_af6list *addr6;
12831278
#endif
12841279

@@ -1292,7 +1287,7 @@ static int netlbl_unlabel_staticlistdef(struct sk_buff *skb,
12921287
goto unlabel_staticlistdef_return;
12931288

12941289
netlbl_af4list_foreach_rcu(addr4, &iface->addr4_list) {
1295-
if (iter_addr4++ < skip_addr4)
1290+
if (iter_addr4++ < cb->args[0])
12961291
continue;
12971292
if (netlbl_unlabel_staticlist_gen(NLBL_UNLABEL_C_STATICLISTDEF,
12981293
iface,
@@ -1305,7 +1300,7 @@ static int netlbl_unlabel_staticlistdef(struct sk_buff *skb,
13051300
}
13061301
#if IS_ENABLED(CONFIG_IPV6)
13071302
netlbl_af6list_foreach_rcu(addr6, &iface->addr6_list) {
1308-
if (iter_addr6++ < skip_addr6)
1303+
if (iter_addr6++ < cb->args[1])
13091304
continue;
13101305
if (netlbl_unlabel_staticlist_gen(NLBL_UNLABEL_C_STATICLISTDEF,
13111306
iface,

0 commit comments

Comments
 (0)