Re: [PATCH nf-next 4/7] netfilter: flowtable: rename ctx.tun.proto to ctx.tun.inner_proto

Lorenzo Bianconi <[email protected]>
Newsgroups gmane.comp.security.firewalls.netfilter.devel
Message-ID <anWfPBLT8x2GHqVs@lore-desk>
> For consistency with the tun.l3proto rename, use same name field.
> No functional changes are intended.
> 
> Signed-off-by: Pablo Neira Ayuso <[email protected]>

Acked-by: Lorenzo Bianconi <[email protected]>

> ---
>  net/netfilter/nf_flow_table_ip.c | 14 +++++++-------
>  1 file changed, 7 insertions(+), 7 deletions(-)
> 
> diff --git a/net/netfilter/nf_flow_table_ip.c b/net/netfilter/nf_flow_table_ip.c
> index e1aa01763f33..ed90809b206e 100644
> --- a/net/netfilter/nf_flow_table_ip.c
> +++ b/net/netfilter/nf_flow_table_ip.c
> @@ -153,7 +153,7 @@ struct nf_flowtable_ctx {
>  		/* Tunnel IP header size */
>  		u32 hdr_size;
>  		/* IP tunnel protocol */
> -		u8 proto;
> +		u8 inner_proto;
>  	} tun;
>  };
>  
> @@ -194,7 +194,7 @@ static void nf_flow_tuple_encap(struct nf_flowtable_ctx *ctx,
>  	switch (inner_proto) {
>  	case htons(ETH_P_IP):
>  		iph = (struct iphdr *)(skb_network_header(skb) + offset);
> -		if (ctx->tun.proto == IPPROTO_IPIP) {
> +		if (ctx->tun.inner_proto == IPPROTO_IPIP) {
>  			tuple->tun.dst_v4.s_addr = iph->daddr;
>  			tuple->tun.src_v4.s_addr = iph->saddr;
>  			tuple->tun.inner_proto = IPPROTO_IPIP;
> @@ -202,7 +202,7 @@ static void nf_flow_tuple_encap(struct nf_flowtable_ctx *ctx,
>  		break;
>  	case htons(ETH_P_IPV6):
>  		ip6h = (struct ipv6hdr *)(skb_network_header(skb) + offset);
> -		if (ctx->tun.proto == IPPROTO_IPV6) {
> +		if (ctx->tun.inner_proto == IPPROTO_IPV6) {
>  			tuple->tun.dst_v6 = ip6h->daddr;
>  			tuple->tun.src_v6 = ip6h->saddr;
>  			tuple->tun.inner_proto = IPPROTO_IPV6;
> @@ -328,7 +328,7 @@ static bool nf_flow_ip4_tunnel_proto(struct nf_flowtable_ctx *ctx,
>  		return false;
>  
>  	if (iph->protocol == IPPROTO_IPIP) {
> -		ctx->tun.proto = iph->protocol;
> +		ctx->tun.inner_proto = iph->protocol;
>  		ctx->tun.hdr_size = size;
>  		ctx->offset += ctx->tun.hdr_size;
>  	}
> @@ -353,7 +353,7 @@ static bool nf_flow_ip6_tunnel_proto(struct nf_flowtable_ctx *ctx,
>  		return false;
>  
>  	if (ip6h->nexthdr == IPPROTO_IPV6) {
> -		ctx->tun.proto = ip6h->nexthdr;
> +		ctx->tun.inner_proto = ip6h->nexthdr;
>  		ctx->tun.hdr_size = sizeof(*ip6h);
>  		ctx->offset += ctx->tun.hdr_size;
>  	}
> @@ -367,8 +367,8 @@ static bool nf_flow_ip6_tunnel_proto(struct nf_flowtable_ctx *ctx,
>  static void nf_flow_ip_tunnel_pop(struct nf_flowtable_ctx *ctx,
>  				  struct sk_buff *skb)
>  {
> -	if (ctx->tun.proto != IPPROTO_IPIP &&
> -	    ctx->tun.proto != IPPROTO_IPV6)
> +	if (ctx->tun.inner_proto != IPPROTO_IPIP &&
> +	    ctx->tun.inner_proto != IPPROTO_IPV6)
>  		return;
>  
>  	skb_pull(skb, ctx->tun.hdr_size);
> -- 
> 2.47.3
>
signature.asc (application/pgp-signature, 228 B)
-----BEGIN PGP SIGNATURE-----

iHUEABYKAB0WIQTquNwa3Txd3rGGn7Y6cBh0uS2trAUCanWfPAAKCRA6cBh0uS2t
rNG5AQCDDtQqSbhb+Cc7D2mrt0VCrMtcja6K2U8wQOJorj8tpAD/f41L3ln6FmtD
ubkdywaK083KjR/yX808uM78ZLeC/w0=
=aT47
-----END PGP SIGNATURE-----
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.