提交 a6a8fe95 编写于 作者: P Paul Moore 提交者: David S. Miller

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: NKbuild Test Robot <fengguang.wu@intel.com>
Signed-off-by: NPaul Moore <pmoore@redhat.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 f3947936
...@@ -1189,8 +1189,6 @@ static int netlbl_unlabel_staticlist(struct sk_buff *skb, ...@@ -1189,8 +1189,6 @@ static int netlbl_unlabel_staticlist(struct sk_buff *skb,
struct netlbl_unlhsh_walk_arg cb_arg; struct netlbl_unlhsh_walk_arg cb_arg;
u32 skip_bkt = cb->args[0]; u32 skip_bkt = cb->args[0];
u32 skip_chain = cb->args[1]; u32 skip_chain = cb->args[1];
u32 skip_addr4 = cb->args[2];
u32 skip_addr6 = cb->args[3];
u32 iter_bkt; u32 iter_bkt;
u32 iter_chain = 0, iter_addr4 = 0, iter_addr6 = 0; u32 iter_chain = 0, iter_addr4 = 0, iter_addr6 = 0;
struct netlbl_unlhsh_iface *iface; struct netlbl_unlhsh_iface *iface;
...@@ -1215,7 +1213,7 @@ static int netlbl_unlabel_staticlist(struct sk_buff *skb, ...@@ -1215,7 +1213,7 @@ static int netlbl_unlabel_staticlist(struct sk_buff *skb,
continue; continue;
netlbl_af4list_foreach_rcu(addr4, netlbl_af4list_foreach_rcu(addr4,
&iface->addr4_list) { &iface->addr4_list) {
if (iter_addr4++ < skip_addr4) if (iter_addr4++ < cb->args[2])
continue; continue;
if (netlbl_unlabel_staticlist_gen( if (netlbl_unlabel_staticlist_gen(
NLBL_UNLABEL_C_STATICLIST, NLBL_UNLABEL_C_STATICLIST,
...@@ -1231,7 +1229,7 @@ static int netlbl_unlabel_staticlist(struct sk_buff *skb, ...@@ -1231,7 +1229,7 @@ static int netlbl_unlabel_staticlist(struct sk_buff *skb,
#if IS_ENABLED(CONFIG_IPV6) #if IS_ENABLED(CONFIG_IPV6)
netlbl_af6list_foreach_rcu(addr6, netlbl_af6list_foreach_rcu(addr6,
&iface->addr6_list) { &iface->addr6_list) {
if (iter_addr6++ < skip_addr6) if (iter_addr6++ < cb->args[3])
continue; continue;
if (netlbl_unlabel_staticlist_gen( if (netlbl_unlabel_staticlist_gen(
NLBL_UNLABEL_C_STATICLIST, NLBL_UNLABEL_C_STATICLIST,
...@@ -1273,12 +1271,9 @@ static int netlbl_unlabel_staticlistdef(struct sk_buff *skb, ...@@ -1273,12 +1271,9 @@ static int netlbl_unlabel_staticlistdef(struct sk_buff *skb,
{ {
struct netlbl_unlhsh_walk_arg cb_arg; struct netlbl_unlhsh_walk_arg cb_arg;
struct netlbl_unlhsh_iface *iface; struct netlbl_unlhsh_iface *iface;
u32 skip_addr4 = cb->args[0]; u32 iter_addr4 = 0, iter_addr6 = 0;
u32 skip_addr6 = cb->args[1];
u32 iter_addr4 = 0;
struct netlbl_af4list *addr4; struct netlbl_af4list *addr4;
#if IS_ENABLED(CONFIG_IPV6) #if IS_ENABLED(CONFIG_IPV6)
u32 iter_addr6 = 0;
struct netlbl_af6list *addr6; struct netlbl_af6list *addr6;
#endif #endif
...@@ -1292,7 +1287,7 @@ static int netlbl_unlabel_staticlistdef(struct sk_buff *skb, ...@@ -1292,7 +1287,7 @@ static int netlbl_unlabel_staticlistdef(struct sk_buff *skb,
goto unlabel_staticlistdef_return; goto unlabel_staticlistdef_return;
netlbl_af4list_foreach_rcu(addr4, &iface->addr4_list) { netlbl_af4list_foreach_rcu(addr4, &iface->addr4_list) {
if (iter_addr4++ < skip_addr4) if (iter_addr4++ < cb->args[0])
continue; continue;
if (netlbl_unlabel_staticlist_gen(NLBL_UNLABEL_C_STATICLISTDEF, if (netlbl_unlabel_staticlist_gen(NLBL_UNLABEL_C_STATICLISTDEF,
iface, iface,
...@@ -1305,7 +1300,7 @@ static int netlbl_unlabel_staticlistdef(struct sk_buff *skb, ...@@ -1305,7 +1300,7 @@ static int netlbl_unlabel_staticlistdef(struct sk_buff *skb,
} }
#if IS_ENABLED(CONFIG_IPV6) #if IS_ENABLED(CONFIG_IPV6)
netlbl_af6list_foreach_rcu(addr6, &iface->addr6_list) { netlbl_af6list_foreach_rcu(addr6, &iface->addr6_list) {
if (iter_addr6++ < skip_addr6) if (iter_addr6++ < cb->args[1])
continue; continue;
if (netlbl_unlabel_staticlist_gen(NLBL_UNLABEL_C_STATICLISTDEF, if (netlbl_unlabel_staticlist_gen(NLBL_UNLABEL_C_STATICLISTDEF,
iface, iface,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册