netfilter-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 net-next] netfilter: ipset: Fixing unnamed union init
@ 2015-08-22  5:44 Elad Raz
  2015-08-22 18:11 ` Jozsef Kadlecsik
  0 siblings, 1 reply; 10+ messages in thread
From: Elad Raz @ 2015-08-22  5:44 UTC (permalink / raw)
  To: netdev, netfilter-devel, Oliver Smith, Pablo Neira Ayuso,
	Vinson Lee
  Cc: Elad Raz, Jiri Pirko, David S. Miller, Patrick McHardy,
	Sergey Popovich, Jozsef Kadlecsik, Anton Danilov, Guenter Roeck,
	Akemi Yagi, Cong Wang

In continue to proposed Vinson Lee's post [1], this patch fixes compilation
issues founded at gcc 4.4.7. The initialization of .cidr field of unnamed
unions causes compilation error in gcc 4.4.x.

References

Visible links
[1] https://lkml.org/lkml/2015/7/5/74

Signed-off-by: Elad Raz <eladr@mellanox.com>
---
 net/netfilter/ipset/ip_set_hash_netnet.c     | 20 ++++++++++++++++++--
 net/netfilter/ipset/ip_set_hash_netportnet.c | 20 ++++++++++++++++++--
 2 files changed, 36 insertions(+), 4 deletions(-)

diff --git a/net/netfilter/ipset/ip_set_hash_netnet.c b/net/netfilter/ipset/ip_set_hash_netnet.c
index 3c862c0..a93dfeb 100644
--- a/net/netfilter/ipset/ip_set_hash_netnet.c
+++ b/net/netfilter/ipset/ip_set_hash_netnet.c
@@ -131,6 +131,13 @@ hash_netnet4_data_next(struct hash_netnet4_elem *next,
 #define HOST_MASK	32
 #include "ip_set_hash_gen.h"
 
+static void
+hash_netnet4_init(struct hash_netnet4_elem *e)
+{
+	e->cidr[0] = HOST_MASK;
+	e->cidr[1] = HOST_MASK;
+}
+
 static int
 hash_netnet4_kadt(struct ip_set *set, const struct sk_buff *skb,
 		  const struct xt_action_param *par,
@@ -160,7 +167,7 @@ hash_netnet4_uadt(struct ip_set *set, struct nlattr *tb[],
 {
 	const struct hash_netnet *h = set->data;
 	ipset_adtfn adtfn = set->variant->adt[adt];
-	struct hash_netnet4_elem e = { .cidr = { HOST_MASK, HOST_MASK, }, };
+	struct hash_netnet4_elem e = { };
 	struct ip_set_ext ext = IP_SET_INIT_UEXT(set);
 	u32 ip = 0, ip_to = 0, last;
 	u32 ip2 = 0, ip2_from = 0, ip2_to = 0, last2;
@@ -169,6 +176,7 @@ hash_netnet4_uadt(struct ip_set *set, struct nlattr *tb[],
 	if (tb[IPSET_ATTR_LINENO])
 		*lineno = nla_get_u32(tb[IPSET_ATTR_LINENO]);
 
+	hash_netnet4_init(&e);
 	if (unlikely(!tb[IPSET_ATTR_IP] || !tb[IPSET_ATTR_IP2] ||
 		     !ip_set_optattr_netorder(tb, IPSET_ATTR_CADT_FLAGS)))
 		return -IPSET_ERR_PROTOCOL;
@@ -357,6 +365,13 @@ hash_netnet6_data_next(struct hash_netnet4_elem *next,
 #define IP_SET_EMIT_CREATE
 #include "ip_set_hash_gen.h"
 
+static void
+hash_netnet6_init(struct hash_netnet6_elem *e)
+{
+	e->cidr[0] = HOST_MASK;
+	e->cidr[1] = HOST_MASK;
+}
+
 static int
 hash_netnet6_kadt(struct ip_set *set, const struct sk_buff *skb,
 		  const struct xt_action_param *par,
@@ -385,13 +400,14 @@ hash_netnet6_uadt(struct ip_set *set, struct nlattr *tb[],
 		  enum ipset_adt adt, u32 *lineno, u32 flags, bool retried)
 {
 	ipset_adtfn adtfn = set->variant->adt[adt];
-	struct hash_netnet6_elem e = { .cidr = { HOST_MASK, HOST_MASK, }, };
+	struct hash_netnet6_elem e = { };
 	struct ip_set_ext ext = IP_SET_INIT_UEXT(set);
 	int ret;
 
 	if (tb[IPSET_ATTR_LINENO])
 		*lineno = nla_get_u32(tb[IPSET_ATTR_LINENO]);
 
+	hash_netnet6_init(&e);
 	if (unlikely(!tb[IPSET_ATTR_IP] || !tb[IPSET_ATTR_IP2] ||
 		     !ip_set_optattr_netorder(tb, IPSET_ATTR_CADT_FLAGS)))
 		return -IPSET_ERR_PROTOCOL;
diff --git a/net/netfilter/ipset/ip_set_hash_netportnet.c b/net/netfilter/ipset/ip_set_hash_netportnet.c
index 0c68734..9a14c23 100644
--- a/net/netfilter/ipset/ip_set_hash_netportnet.c
+++ b/net/netfilter/ipset/ip_set_hash_netportnet.c
@@ -142,6 +142,13 @@ hash_netportnet4_data_next(struct hash_netportnet4_elem *next,
 #define HOST_MASK	32
 #include "ip_set_hash_gen.h"
 
+static void
+hash_netportnet4_init(struct hash_netportnet4_elem *e)
+{
+	e->cidr[0] = HOST_MASK;
+	e->cidr[1] = HOST_MASK;
+}
+
 static int
 hash_netportnet4_kadt(struct ip_set *set, const struct sk_buff *skb,
 		      const struct xt_action_param *par,
@@ -175,7 +182,7 @@ hash_netportnet4_uadt(struct ip_set *set, struct nlattr *tb[],
 {
 	const struct hash_netportnet *h = set->data;
 	ipset_adtfn adtfn = set->variant->adt[adt];
-	struct hash_netportnet4_elem e = { .cidr = { HOST_MASK, HOST_MASK, }, };
+	struct hash_netportnet4_elem e = { };
 	struct ip_set_ext ext = IP_SET_INIT_UEXT(set);
 	u32 ip = 0, ip_to = 0, ip_last, p = 0, port, port_to;
 	u32 ip2_from = 0, ip2_to = 0, ip2_last, ip2;
@@ -185,6 +192,7 @@ hash_netportnet4_uadt(struct ip_set *set, struct nlattr *tb[],
 	if (tb[IPSET_ATTR_LINENO])
 		*lineno = nla_get_u32(tb[IPSET_ATTR_LINENO]);
 
+	hash_netportnet4_init(&e);
 	if (unlikely(!tb[IPSET_ATTR_IP] || !tb[IPSET_ATTR_IP2] ||
 		     !ip_set_attr_netorder(tb, IPSET_ATTR_PORT) ||
 		     !ip_set_optattr_netorder(tb, IPSET_ATTR_PORT_TO) ||
@@ -412,6 +420,13 @@ hash_netportnet6_data_next(struct hash_netportnet4_elem *next,
 #define IP_SET_EMIT_CREATE
 #include "ip_set_hash_gen.h"
 
+static void
+hash_netportnet6_init(struct hash_netportnet6_elem *e)
+{
+	e->cidr[0] = HOST_MASK;
+	e->cidr[1] = HOST_MASK;
+}
+
 static int
 hash_netportnet6_kadt(struct ip_set *set, const struct sk_buff *skb,
 		      const struct xt_action_param *par,
@@ -445,7 +460,7 @@ hash_netportnet6_uadt(struct ip_set *set, struct nlattr *tb[],
 {
 	const struct hash_netportnet *h = set->data;
 	ipset_adtfn adtfn = set->variant->adt[adt];
-	struct hash_netportnet6_elem e = { .cidr = { HOST_MASK, HOST_MASK, }, };
+	struct hash_netportnet6_elem e = { };
 	struct ip_set_ext ext = IP_SET_INIT_UEXT(set);
 	u32 port, port_to;
 	bool with_ports = false;
@@ -454,6 +469,7 @@ hash_netportnet6_uadt(struct ip_set *set, struct nlattr *tb[],
 	if (tb[IPSET_ATTR_LINENO])
 		*lineno = nla_get_u32(tb[IPSET_ATTR_LINENO]);
 
+	hash_netportnet6_init(&e);
 	if (unlikely(!tb[IPSET_ATTR_IP] || !tb[IPSET_ATTR_IP2] ||
 		     !ip_set_attr_netorder(tb, IPSET_ATTR_PORT) ||
 		     !ip_set_optattr_netorder(tb, IPSET_ATTR_PORT_TO) ||
-- 
2.3.5


^ permalink raw reply related	[flat|nested] 10+ messages in thread

* Re: [PATCH v2 net-next] netfilter: ipset: Fixing unnamed union init
  2015-08-22  5:44 [PATCH v2 net-next] netfilter: ipset: Fixing unnamed union init Elad Raz
@ 2015-08-22 18:11 ` Jozsef Kadlecsik
  2015-08-22 18:21   ` Akemi Yagi
  2015-08-22 18:44   ` Pablo Neira Ayuso
  0 siblings, 2 replies; 10+ messages in thread
From: Jozsef Kadlecsik @ 2015-08-22 18:11 UTC (permalink / raw)
  To: Elad Raz
  Cc: netdev, netfilter-devel, Oliver Smith, Pablo Neira Ayuso,
	Vinson Lee, Jiri Pirko, David S. Miller, Patrick McHardy,
	Sergey Popovich, Anton Danilov, Guenter Roeck, Akemi Yagi,
	Cong Wang

On Sat, 22 Aug 2015, Elad Raz wrote:

> In continue to proposed Vinson Lee's post [1], this patch fixes compilation
> issues founded at gcc 4.4.7. The initialization of .cidr field of unnamed
> unions causes compilation error in gcc 4.4.x.

There's already a (couple of weeks old) patch in the -mm tree to fix the 
gcc compatilibity issue, see the last comment in the thread you refer to:

> Visible links
> [1] https://lkml.org/lkml/2015/7/5/74

So I'm unsure whether a new patch should be submitted for this.

Best regards,
Jozsef
 
> Signed-off-by: Elad Raz <eladr@mellanox.com>
> ---
>  net/netfilter/ipset/ip_set_hash_netnet.c     | 20 ++++++++++++++++++--
>  net/netfilter/ipset/ip_set_hash_netportnet.c | 20 ++++++++++++++++++--
>  2 files changed, 36 insertions(+), 4 deletions(-)
> 
> diff --git a/net/netfilter/ipset/ip_set_hash_netnet.c b/net/netfilter/ipset/ip_set_hash_netnet.c
> index 3c862c0..a93dfeb 100644
> --- a/net/netfilter/ipset/ip_set_hash_netnet.c
> +++ b/net/netfilter/ipset/ip_set_hash_netnet.c
> @@ -131,6 +131,13 @@ hash_netnet4_data_next(struct hash_netnet4_elem *next,
>  #define HOST_MASK	32
>  #include "ip_set_hash_gen.h"
>  
> +static void
> +hash_netnet4_init(struct hash_netnet4_elem *e)
> +{
> +	e->cidr[0] = HOST_MASK;
> +	e->cidr[1] = HOST_MASK;
> +}
> +
>  static int
>  hash_netnet4_kadt(struct ip_set *set, const struct sk_buff *skb,
>  		  const struct xt_action_param *par,
> @@ -160,7 +167,7 @@ hash_netnet4_uadt(struct ip_set *set, struct nlattr *tb[],
>  {
>  	const struct hash_netnet *h = set->data;
>  	ipset_adtfn adtfn = set->variant->adt[adt];
> -	struct hash_netnet4_elem e = { .cidr = { HOST_MASK, HOST_MASK, }, };
> +	struct hash_netnet4_elem e = { };
>  	struct ip_set_ext ext = IP_SET_INIT_UEXT(set);
>  	u32 ip = 0, ip_to = 0, last;
>  	u32 ip2 = 0, ip2_from = 0, ip2_to = 0, last2;
> @@ -169,6 +176,7 @@ hash_netnet4_uadt(struct ip_set *set, struct nlattr *tb[],
>  	if (tb[IPSET_ATTR_LINENO])
>  		*lineno = nla_get_u32(tb[IPSET_ATTR_LINENO]);
>  
> +	hash_netnet4_init(&e);
>  	if (unlikely(!tb[IPSET_ATTR_IP] || !tb[IPSET_ATTR_IP2] ||
>  		     !ip_set_optattr_netorder(tb, IPSET_ATTR_CADT_FLAGS)))
>  		return -IPSET_ERR_PROTOCOL;
> @@ -357,6 +365,13 @@ hash_netnet6_data_next(struct hash_netnet4_elem *next,
>  #define IP_SET_EMIT_CREATE
>  #include "ip_set_hash_gen.h"
>  
> +static void
> +hash_netnet6_init(struct hash_netnet6_elem *e)
> +{
> +	e->cidr[0] = HOST_MASK;
> +	e->cidr[1] = HOST_MASK;
> +}
> +
>  static int
>  hash_netnet6_kadt(struct ip_set *set, const struct sk_buff *skb,
>  		  const struct xt_action_param *par,
> @@ -385,13 +400,14 @@ hash_netnet6_uadt(struct ip_set *set, struct nlattr *tb[],
>  		  enum ipset_adt adt, u32 *lineno, u32 flags, bool retried)
>  {
>  	ipset_adtfn adtfn = set->variant->adt[adt];
> -	struct hash_netnet6_elem e = { .cidr = { HOST_MASK, HOST_MASK, }, };
> +	struct hash_netnet6_elem e = { };
>  	struct ip_set_ext ext = IP_SET_INIT_UEXT(set);
>  	int ret;
>  
>  	if (tb[IPSET_ATTR_LINENO])
>  		*lineno = nla_get_u32(tb[IPSET_ATTR_LINENO]);
>  
> +	hash_netnet6_init(&e);
>  	if (unlikely(!tb[IPSET_ATTR_IP] || !tb[IPSET_ATTR_IP2] ||
>  		     !ip_set_optattr_netorder(tb, IPSET_ATTR_CADT_FLAGS)))
>  		return -IPSET_ERR_PROTOCOL;
> diff --git a/net/netfilter/ipset/ip_set_hash_netportnet.c b/net/netfilter/ipset/ip_set_hash_netportnet.c
> index 0c68734..9a14c23 100644
> --- a/net/netfilter/ipset/ip_set_hash_netportnet.c
> +++ b/net/netfilter/ipset/ip_set_hash_netportnet.c
> @@ -142,6 +142,13 @@ hash_netportnet4_data_next(struct hash_netportnet4_elem *next,
>  #define HOST_MASK	32
>  #include "ip_set_hash_gen.h"
>  
> +static void
> +hash_netportnet4_init(struct hash_netportnet4_elem *e)
> +{
> +	e->cidr[0] = HOST_MASK;
> +	e->cidr[1] = HOST_MASK;
> +}
> +
>  static int
>  hash_netportnet4_kadt(struct ip_set *set, const struct sk_buff *skb,
>  		      const struct xt_action_param *par,
> @@ -175,7 +182,7 @@ hash_netportnet4_uadt(struct ip_set *set, struct nlattr *tb[],
>  {
>  	const struct hash_netportnet *h = set->data;
>  	ipset_adtfn adtfn = set->variant->adt[adt];
> -	struct hash_netportnet4_elem e = { .cidr = { HOST_MASK, HOST_MASK, }, };
> +	struct hash_netportnet4_elem e = { };
>  	struct ip_set_ext ext = IP_SET_INIT_UEXT(set);
>  	u32 ip = 0, ip_to = 0, ip_last, p = 0, port, port_to;
>  	u32 ip2_from = 0, ip2_to = 0, ip2_last, ip2;
> @@ -185,6 +192,7 @@ hash_netportnet4_uadt(struct ip_set *set, struct nlattr *tb[],
>  	if (tb[IPSET_ATTR_LINENO])
>  		*lineno = nla_get_u32(tb[IPSET_ATTR_LINENO]);
>  
> +	hash_netportnet4_init(&e);
>  	if (unlikely(!tb[IPSET_ATTR_IP] || !tb[IPSET_ATTR_IP2] ||
>  		     !ip_set_attr_netorder(tb, IPSET_ATTR_PORT) ||
>  		     !ip_set_optattr_netorder(tb, IPSET_ATTR_PORT_TO) ||
> @@ -412,6 +420,13 @@ hash_netportnet6_data_next(struct hash_netportnet4_elem *next,
>  #define IP_SET_EMIT_CREATE
>  #include "ip_set_hash_gen.h"
>  
> +static void
> +hash_netportnet6_init(struct hash_netportnet6_elem *e)
> +{
> +	e->cidr[0] = HOST_MASK;
> +	e->cidr[1] = HOST_MASK;
> +}
> +
>  static int
>  hash_netportnet6_kadt(struct ip_set *set, const struct sk_buff *skb,
>  		      const struct xt_action_param *par,
> @@ -445,7 +460,7 @@ hash_netportnet6_uadt(struct ip_set *set, struct nlattr *tb[],
>  {
>  	const struct hash_netportnet *h = set->data;
>  	ipset_adtfn adtfn = set->variant->adt[adt];
> -	struct hash_netportnet6_elem e = { .cidr = { HOST_MASK, HOST_MASK, }, };
> +	struct hash_netportnet6_elem e = { };
>  	struct ip_set_ext ext = IP_SET_INIT_UEXT(set);
>  	u32 port, port_to;
>  	bool with_ports = false;
> @@ -454,6 +469,7 @@ hash_netportnet6_uadt(struct ip_set *set, struct nlattr *tb[],
>  	if (tb[IPSET_ATTR_LINENO])
>  		*lineno = nla_get_u32(tb[IPSET_ATTR_LINENO]);
>  
> +	hash_netportnet6_init(&e);
>  	if (unlikely(!tb[IPSET_ATTR_IP] || !tb[IPSET_ATTR_IP2] ||
>  		     !ip_set_attr_netorder(tb, IPSET_ATTR_PORT) ||
>  		     !ip_set_optattr_netorder(tb, IPSET_ATTR_PORT_TO) ||
> -- 
> 2.3.5
> 
> --
> To unsubscribe from this list: send the line "unsubscribe netfilter-devel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 

-
E-mail  : kadlec@blackhole.kfki.hu, kadlecsik.jozsef@wigner.mta.hu
PGP key : http://www.kfki.hu/~kadlec/pgp_public_key.txt
Address : Wigner Research Centre for Physics, Hungarian Academy of Sciences
          H-1525 Budapest 114, POB. 49, Hungary

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH v2 net-next] netfilter: ipset: Fixing unnamed union init
  2015-08-22 18:11 ` Jozsef Kadlecsik
@ 2015-08-22 18:21   ` Akemi Yagi
  2015-08-22 18:44   ` Pablo Neira Ayuso
  1 sibling, 0 replies; 10+ messages in thread
From: Akemi Yagi @ 2015-08-22 18:21 UTC (permalink / raw)
  To: Jozsef Kadlecsik
  Cc: Elad Raz, netdev, netfilter-devel, Oliver Smith,
	Pablo Neira Ayuso, Vinson Lee, Jiri Pirko, David S. Miller,
	Patrick McHardy, Sergey Popovich, Anton Danilov, Guenter Roeck,
	Cong Wang, Alan Bartlett

I was wondering about that, too. The referenced patch,

net-netfilter-ipset-work-around-gcc-444-initializer-bug.patch

was confirmed to fix the issue. What I cannot figure out is the
procedure by which this patch gets added to Linus' tree. It was in the
-mm tree back in mid June but still is not in the current 4.2-rc7.
Without this fix, Linux 4.2 will not build under RHEL-6 (for example).

Akemi

On Sat, Aug 22, 2015 at 11:11 AM, Jozsef Kadlecsik
<kadlec@blackhole.kfki.hu> wrote:
> On Sat, 22 Aug 2015, Elad Raz wrote:
>
>> In continue to proposed Vinson Lee's post [1], this patch fixes compilation
>> issues founded at gcc 4.4.7. The initialization of .cidr field of unnamed
>> unions causes compilation error in gcc 4.4.x.
>
> There's already a (couple of weeks old) patch in the -mm tree to fix the
> gcc compatilibity issue, see the last comment in the thread you refer to:
>
>> Visible links
>> [1] https://lkml.org/lkml/2015/7/5/74
>
> So I'm unsure whether a new patch should be submitted for this.
>
> Best regards,
> Jozsef
>
>> Signed-off-by: Elad Raz <eladr@mellanox.com>
>> ---
>>  net/netfilter/ipset/ip_set_hash_netnet.c     | 20 ++++++++++++++++++--
>>  net/netfilter/ipset/ip_set_hash_netportnet.c | 20 ++++++++++++++++++--
>>  2 files changed, 36 insertions(+), 4 deletions(-)
>>
>> diff --git a/net/netfilter/ipset/ip_set_hash_netnet.c b/net/netfilter/ipset/ip_set_hash_netnet.c
>> index 3c862c0..a93dfeb 100644
>> --- a/net/netfilter/ipset/ip_set_hash_netnet.c
>> +++ b/net/netfilter/ipset/ip_set_hash_netnet.c
>> @@ -131,6 +131,13 @@ hash_netnet4_data_next(struct hash_netnet4_elem *next,
>>  #define HOST_MASK    32
>>  #include "ip_set_hash_gen.h"
>>
>> +static void
>> +hash_netnet4_init(struct hash_netnet4_elem *e)
>> +{
>> +     e->cidr[0] = HOST_MASK;
>> +     e->cidr[1] = HOST_MASK;
>> +}
>> +
>>  static int
>>  hash_netnet4_kadt(struct ip_set *set, const struct sk_buff *skb,
>>                 const struct xt_action_param *par,
>> @@ -160,7 +167,7 @@ hash_netnet4_uadt(struct ip_set *set, struct nlattr *tb[],
>>  {
>>       const struct hash_netnet *h = set->data;
>>       ipset_adtfn adtfn = set->variant->adt[adt];
>> -     struct hash_netnet4_elem e = { .cidr = { HOST_MASK, HOST_MASK, }, };
>> +     struct hash_netnet4_elem e = { };
>>       struct ip_set_ext ext = IP_SET_INIT_UEXT(set);
>>       u32 ip = 0, ip_to = 0, last;
>>       u32 ip2 = 0, ip2_from = 0, ip2_to = 0, last2;
>> @@ -169,6 +176,7 @@ hash_netnet4_uadt(struct ip_set *set, struct nlattr *tb[],
>>       if (tb[IPSET_ATTR_LINENO])
>>               *lineno = nla_get_u32(tb[IPSET_ATTR_LINENO]);
>>
>> +     hash_netnet4_init(&e);
>>       if (unlikely(!tb[IPSET_ATTR_IP] || !tb[IPSET_ATTR_IP2] ||
>>                    !ip_set_optattr_netorder(tb, IPSET_ATTR_CADT_FLAGS)))
>>               return -IPSET_ERR_PROTOCOL;
>> @@ -357,6 +365,13 @@ hash_netnet6_data_next(struct hash_netnet4_elem *next,
>>  #define IP_SET_EMIT_CREATE
>>  #include "ip_set_hash_gen.h"
>>
>> +static void
>> +hash_netnet6_init(struct hash_netnet6_elem *e)
>> +{
>> +     e->cidr[0] = HOST_MASK;
>> +     e->cidr[1] = HOST_MASK;
>> +}
>> +
>>  static int
>>  hash_netnet6_kadt(struct ip_set *set, const struct sk_buff *skb,
>>                 const struct xt_action_param *par,
>> @@ -385,13 +400,14 @@ hash_netnet6_uadt(struct ip_set *set, struct nlattr *tb[],
>>                 enum ipset_adt adt, u32 *lineno, u32 flags, bool retried)
>>  {
>>       ipset_adtfn adtfn = set->variant->adt[adt];
>> -     struct hash_netnet6_elem e = { .cidr = { HOST_MASK, HOST_MASK, }, };
>> +     struct hash_netnet6_elem e = { };
>>       struct ip_set_ext ext = IP_SET_INIT_UEXT(set);
>>       int ret;
>>
>>       if (tb[IPSET_ATTR_LINENO])
>>               *lineno = nla_get_u32(tb[IPSET_ATTR_LINENO]);
>>
>> +     hash_netnet6_init(&e);
>>       if (unlikely(!tb[IPSET_ATTR_IP] || !tb[IPSET_ATTR_IP2] ||
>>                    !ip_set_optattr_netorder(tb, IPSET_ATTR_CADT_FLAGS)))
>>               return -IPSET_ERR_PROTOCOL;
>> diff --git a/net/netfilter/ipset/ip_set_hash_netportnet.c b/net/netfilter/ipset/ip_set_hash_netportnet.c
>> index 0c68734..9a14c23 100644
>> --- a/net/netfilter/ipset/ip_set_hash_netportnet.c
>> +++ b/net/netfilter/ipset/ip_set_hash_netportnet.c
>> @@ -142,6 +142,13 @@ hash_netportnet4_data_next(struct hash_netportnet4_elem *next,
>>  #define HOST_MASK    32
>>  #include "ip_set_hash_gen.h"
>>
>> +static void
>> +hash_netportnet4_init(struct hash_netportnet4_elem *e)
>> +{
>> +     e->cidr[0] = HOST_MASK;
>> +     e->cidr[1] = HOST_MASK;
>> +}
>> +
>>  static int
>>  hash_netportnet4_kadt(struct ip_set *set, const struct sk_buff *skb,
>>                     const struct xt_action_param *par,
>> @@ -175,7 +182,7 @@ hash_netportnet4_uadt(struct ip_set *set, struct nlattr *tb[],
>>  {
>>       const struct hash_netportnet *h = set->data;
>>       ipset_adtfn adtfn = set->variant->adt[adt];
>> -     struct hash_netportnet4_elem e = { .cidr = { HOST_MASK, HOST_MASK, }, };
>> +     struct hash_netportnet4_elem e = { };
>>       struct ip_set_ext ext = IP_SET_INIT_UEXT(set);
>>       u32 ip = 0, ip_to = 0, ip_last, p = 0, port, port_to;
>>       u32 ip2_from = 0, ip2_to = 0, ip2_last, ip2;
>> @@ -185,6 +192,7 @@ hash_netportnet4_uadt(struct ip_set *set, struct nlattr *tb[],
>>       if (tb[IPSET_ATTR_LINENO])
>>               *lineno = nla_get_u32(tb[IPSET_ATTR_LINENO]);
>>
>> +     hash_netportnet4_init(&e);
>>       if (unlikely(!tb[IPSET_ATTR_IP] || !tb[IPSET_ATTR_IP2] ||
>>                    !ip_set_attr_netorder(tb, IPSET_ATTR_PORT) ||
>>                    !ip_set_optattr_netorder(tb, IPSET_ATTR_PORT_TO) ||
>> @@ -412,6 +420,13 @@ hash_netportnet6_data_next(struct hash_netportnet4_elem *next,
>>  #define IP_SET_EMIT_CREATE
>>  #include "ip_set_hash_gen.h"
>>
>> +static void
>> +hash_netportnet6_init(struct hash_netportnet6_elem *e)
>> +{
>> +     e->cidr[0] = HOST_MASK;
>> +     e->cidr[1] = HOST_MASK;
>> +}
>> +
>>  static int
>>  hash_netportnet6_kadt(struct ip_set *set, const struct sk_buff *skb,
>>                     const struct xt_action_param *par,
>> @@ -445,7 +460,7 @@ hash_netportnet6_uadt(struct ip_set *set, struct nlattr *tb[],
>>  {
>>       const struct hash_netportnet *h = set->data;
>>       ipset_adtfn adtfn = set->variant->adt[adt];
>> -     struct hash_netportnet6_elem e = { .cidr = { HOST_MASK, HOST_MASK, }, };
>> +     struct hash_netportnet6_elem e = { };
>>       struct ip_set_ext ext = IP_SET_INIT_UEXT(set);
>>       u32 port, port_to;
>>       bool with_ports = false;
>> @@ -454,6 +469,7 @@ hash_netportnet6_uadt(struct ip_set *set, struct nlattr *tb[],
>>       if (tb[IPSET_ATTR_LINENO])
>>               *lineno = nla_get_u32(tb[IPSET_ATTR_LINENO]);
>>
>> +     hash_netportnet6_init(&e);
>>       if (unlikely(!tb[IPSET_ATTR_IP] || !tb[IPSET_ATTR_IP2] ||
>>                    !ip_set_attr_netorder(tb, IPSET_ATTR_PORT) ||
>>                    !ip_set_optattr_netorder(tb, IPSET_ATTR_PORT_TO) ||
>> --
>> 2.3.5
>>
>> --
>> To unsubscribe from this list: send the line "unsubscribe netfilter-devel" in
>> the body of a message to majordomo@vger.kernel.org
>> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>>
>
> -
> E-mail  : kadlec@blackhole.kfki.hu, kadlecsik.jozsef@wigner.mta.hu
> PGP key : http://www.kfki.hu/~kadlec/pgp_public_key.txt
> Address : Wigner Research Centre for Physics, Hungarian Academy of Sciences
>           H-1525 Budapest 114, POB. 49, Hungary

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH v2 net-next] netfilter: ipset: Fixing unnamed union init
  2015-08-22 18:11 ` Jozsef Kadlecsik
  2015-08-22 18:21   ` Akemi Yagi
@ 2015-08-22 18:44   ` Pablo Neira Ayuso
  2015-08-28 22:59     ` [PATCH v2 net-next] netfilter: ipset: Fixing unnamed union initg Pablo Neira Ayuso
  1 sibling, 1 reply; 10+ messages in thread
From: Pablo Neira Ayuso @ 2015-08-22 18:44 UTC (permalink / raw)
  To: Jozsef Kadlecsik
  Cc: Elad Raz, netdev, Andrew Morton, netfilter-devel, Oliver Smith,
	Vinson Lee, Jiri Pirko, David S. Miller, Patrick McHardy,
	Sergey Popovich, Anton Danilov, Guenter Roeck, Akemi Yagi,
	Cong Wang

Cc'ing Andrew, since he's got a similar patch in mmotm [1].

On Sat, Aug 22, 2015 at 08:11:18PM +0200, Jozsef Kadlecsik wrote:
> On Sat, 22 Aug 2015, Elad Raz wrote:
> 
> > In continue to proposed Vinson Lee's post [1], this patch fixes compilation
> > issues founded at gcc 4.4.7. The initialization of .cidr field of unnamed
> > unions causes compilation error in gcc 4.4.x.
> 
> There's already a (couple of weeks old) patch in the -mm tree to fix the 
> gcc compatilibity issue, see the last comment in the thread you refer to:
> 
> > Visible links
> > [1] https://lkml.org/lkml/2015/7/5/74
> 
> So I'm unsure whether a new patch should be submitted for this.

I'll take this patch so this follows the usual path through David's
net tree. IIRC, duplicates get automatically dropped from the mmotm
tree.

[1] http://git.cmpxchg.org/cgit.cgi/linux-mmotm.git/commit/?id=18b386426ff0a90e405c962ec8f51ea70e7df637

I'll wait for some little time just in case someone raises any
concern.

Thanks!

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH v2 net-next] netfilter: ipset: Fixing unnamed union initg
  2015-08-22 18:44   ` Pablo Neira Ayuso
@ 2015-08-28 22:59     ` Pablo Neira Ayuso
  2015-08-28 23:21       ` Akemi Yagi
  0 siblings, 1 reply; 10+ messages in thread
From: Pablo Neira Ayuso @ 2015-08-28 22:59 UTC (permalink / raw)
  To: Jozsef Kadlecsik
  Cc: Elad Raz, netdev, Andrew Morton, netfilter-devel, Oliver Smith,
	Vinson Lee, Jiri Pirko, David S. Miller, Patrick McHardy,
	Sergey Popovich, Anton Danilov, Guenter Roeck, Akemi Yagi,
	Cong Wang

On Sat, Aug 22, 2015 at 08:44:48PM +0200, Pablo Neira Ayuso wrote:
[...]
> I'll wait for some little time just in case someone raises any
> concern.

JFYI, I'll be passing up this patch to David via the nf tree soon.
Thanks.

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH v2 net-next] netfilter: ipset: Fixing unnamed union initg
  2015-08-28 22:59     ` [PATCH v2 net-next] netfilter: ipset: Fixing unnamed union initg Pablo Neira Ayuso
@ 2015-08-28 23:21       ` Akemi Yagi
  2015-08-31  7:16         ` Vinson Lee
  0 siblings, 1 reply; 10+ messages in thread
From: Akemi Yagi @ 2015-08-28 23:21 UTC (permalink / raw)
  To: Pablo Neira Ayuso
  Cc: Jozsef Kadlecsik, Elad Raz, netdev, Andrew Morton,
	netfilter-devel, Oliver Smith, Vinson Lee, Jiri Pirko,
	David S. Miller, Patrick McHardy, Sergey Popovich, Anton Danilov,
	Guenter Roeck, Cong Wang, Alan Bartlett

On Fri, Aug 28, 2015 at 3:59 PM, Pablo Neira Ayuso <pablo@netfilter.org> wrote:
> On Sat, Aug 22, 2015 at 08:44:48PM +0200, Pablo Neira Ayuso wrote:
> [...]
>> I'll wait for some little time just in case someone raises any
>> concern.
>
> JFYI, I'll be passing up this patch to David via the nf tree soon.
> Thanks.

Thank you for pushing this forward.

Akemi

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH v2 net-next] netfilter: ipset: Fixing unnamed union initg
  2015-08-28 23:21       ` Akemi Yagi
@ 2015-08-31  7:16         ` Vinson Lee
  2015-09-13  1:01           ` Akemi Yagi
  0 siblings, 1 reply; 10+ messages in thread
From: Vinson Lee @ 2015-08-31  7:16 UTC (permalink / raw)
  To: Pablo Neira Ayuso, David S. Miller
  Cc: Akemi Yagi, Jozsef Kadlecsik, Elad Raz, Netdev, Andrew Morton,
	netfilter-devel, Oliver Smith, Jiri Pirko, Patrick McHardy,
	Sergey Popovich, Anton Danilov, Guenter Roeck, Cong Wang,
	Alan Bartlett

On Fri, Aug 28, 2015 at 4:21 PM, Akemi Yagi <amyagi@gmail.com> wrote:
> On Fri, Aug 28, 2015 at 3:59 PM, Pablo Neira Ayuso <pablo@netfilter.org> wrote:
>> On Sat, Aug 22, 2015 at 08:44:48PM +0200, Pablo Neira Ayuso wrote:
>> [...]
>>> I'll wait for some little time just in case someone raises any
>>> concern.
>>
>> JFYI, I'll be passing up this patch to David via the nf tree soon.
>> Thanks.
>
> Thank you for pushing this forward.
>
> Akemi

Linux 4.2 was released without this patch. Please also backport it to
the 4.2 stable branch.

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH v2 net-next] netfilter: ipset: Fixing unnamed union initg
  2015-08-31  7:16         ` Vinson Lee
@ 2015-09-13  1:01           ` Akemi Yagi
  2015-09-13 11:52             ` Pablo Neira Ayuso
  0 siblings, 1 reply; 10+ messages in thread
From: Akemi Yagi @ 2015-09-13  1:01 UTC (permalink / raw)
  To: Netdev
  Cc: Pablo Neira Ayuso, David S. Miller, Jozsef Kadlecsik, Elad Raz,
	Andrew Morton, netfilter-devel, Oliver Smith, Jiri Pirko,
	Patrick McHardy, Sergey Popovich, Anton Danilov, Guenter Roeck,
	Cong Wang, Alan Bartlett, Vinson Lee

On Mon, Aug 31, 2015 at 12:16 AM, Vinson Lee <vlee@twopensource.com> wrote:
> On Fri, Aug 28, 2015 at 4:21 PM, Akemi Yagi <amyagi@gmail.com> wrote:
>> On Fri, Aug 28, 2015 at 3:59 PM, Pablo Neira Ayuso <pablo@netfilter.org> wrote:
>>> On Sat, Aug 22, 2015 at 08:44:48PM +0200, Pablo Neira Ayuso wrote:
>>> [...]
>>>> I'll wait for some little time just in case someone raises any
>>>> concern.
>>>
>>> JFYI, I'll be passing up this patch to David via the nf tree soon.
>>> Thanks.
>>
>> Thank you for pushing this forward.
>>
>> Akemi
>
> Linux 4.2 was released without this patch. Please also backport it to
> the 4.2 stable branch.

Thanks to all for this effort. The patch is finally in the mainline
kernel 4.3-rc1 released today. Now I wish backporting to the 4.2
branch goes smoothly.

Akemi

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH v2 net-next] netfilter: ipset: Fixing unnamed union initg
  2015-09-13  1:01           ` Akemi Yagi
@ 2015-09-13 11:52             ` Pablo Neira Ayuso
  2015-10-19 20:51               ` Akemi Yagi
  0 siblings, 1 reply; 10+ messages in thread
From: Pablo Neira Ayuso @ 2015-09-13 11:52 UTC (permalink / raw)
  To: Akemi Yagi
  Cc: Netdev, David S. Miller, Jozsef Kadlecsik, Elad Raz,
	Andrew Morton, netfilter-devel, Oliver Smith, Jiri Pirko,
	Patrick McHardy, Sergey Popovich, Anton Danilov, Guenter Roeck,
	Cong Wang, Alan Bartlett, Vinson Lee, stable

On Sat, Sep 12, 2015 at 06:01:27PM -0700, Akemi Yagi wrote:
> Thanks to all for this effort. The patch is finally in the mainline
> kernel 4.3-rc1 released today. Now I wish backporting to the 4.2
> branch goes smoothly.

It's on its path to 4.2:

http://patchwork.ozlabs.org/patch/516795/

so I think this will hit 4.2 soon. Thanks!

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH v2 net-next] netfilter: ipset: Fixing unnamed union initg
  2015-09-13 11:52             ` Pablo Neira Ayuso
@ 2015-10-19 20:51               ` Akemi Yagi
  0 siblings, 0 replies; 10+ messages in thread
From: Akemi Yagi @ 2015-10-19 20:51 UTC (permalink / raw)
  To: Pablo Neira Ayuso
  Cc: Netdev, David S. Miller, Jozsef Kadlecsik, Elad Raz,
	Andrew Morton, netfilter-devel, Oliver Smith, Jiri Pirko,
	Patrick McHardy, Sergey Popovich, Anton Danilov, Guenter Roeck,
	Cong Wang, Alan Bartlett, Vinson Lee, stable

On Sun, Sep 13, 2015 at 4:52 AM, Pablo Neira Ayuso <pablo@netfilter.org> wrote:
> On Sat, Sep 12, 2015 at 06:01:27PM -0700, Akemi Yagi wrote:
>> Thanks to all for this effort. The patch is finally in the mainline
>> kernel 4.3-rc1 released today. Now I wish backporting to the 4.2
>> branch goes smoothly.
>
> It's on its path to 4.2:
>
> http://patchwork.ozlabs.org/patch/516795/
>
> so I think this will hit 4.2 soon. Thanks!

Yes, I finally see it in 4.2.4 to be released in the next few days.

Thank you,

Akemi

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2015-10-19 20:51 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-08-22  5:44 [PATCH v2 net-next] netfilter: ipset: Fixing unnamed union init Elad Raz
2015-08-22 18:11 ` Jozsef Kadlecsik
2015-08-22 18:21   ` Akemi Yagi
2015-08-22 18:44   ` Pablo Neira Ayuso
2015-08-28 22:59     ` [PATCH v2 net-next] netfilter: ipset: Fixing unnamed union initg Pablo Neira Ayuso
2015-08-28 23:21       ` Akemi Yagi
2015-08-31  7:16         ` Vinson Lee
2015-09-13  1:01           ` Akemi Yagi
2015-09-13 11:52             ` Pablo Neira Ayuso
2015-10-19 20:51               ` Akemi Yagi

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).