public inbox for netdev@vger.kernel.org 
 help / color / mirror / Atom feed
From: Stephen Hemminger <stephen@networkplumber•org>
To: Tom Herbert <therbert@google•com>
Cc: davem@davemloft•net, netdev@vger•kernel.org
Subject: Re: [PATCH] flow_diseector: Add support for IPPROTO_IPV6
Date: Mon, 29 Jul 2013 08:37:35 -0700	[thread overview]
Message-ID: <20130729083735.25ccdaae@nehalam.linuxnetplumber.net> (raw)
In-Reply-To: <alpine.DEB.2.02.1307290805030.13533@tomh.mtv.corp.google.com>

On Mon, 29 Jul 2013 08:06:51 -0700 (PDT)
Tom Herbert <therbert@google•com> wrote:

> Add support for dissecting flows in IPv6/IPv4 packets.
> 
> Signed-off-by: Tom Herbert <therbert@google•com>
> ---
>  net/core/flow_dissector.c | 6 +++++-
>  1 file changed, 5 insertions(+), 1 deletion(-)
> 
> diff --git a/net/core/flow_dissector.c b/net/core/flow_dissector.c
> index 00ee068..96901de 100644
> --- a/net/core/flow_dissector.c
> +++ b/net/core/flow_dissector.c
> @@ -139,7 +139,11 @@ ipv6:
>  		break;
>  	}
>  	case IPPROTO_IPIP:
> -		goto again;
> +		proto = __constant_htons(ETH_P_IP);
> +		goto ip;
> +	case IPPROTO_IPV6:
> +		proto = __constant_htons(ETH_P_IPV6);
> +		goto ipv6;
>  	default:
>  		break;
>  	}

The __constant_htons() is unnecessary, the simple macro htons()
is smart enough to figure out what is constant. The current style
preference is to use htons() instead; shorter is better.

  reply	other threads:[~2013-07-29 15:37 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-07-29 15:06 [PATCH] flow_diseector: Add support for IPPROTO_IPV6 Tom Herbert
2013-07-29 15:37 ` Stephen Hemminger [this message]
2013-07-29 17:10 ` Eric Dumazet

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20130729083735.25ccdaae@nehalam.linuxnetplumber.net \
    --to=stephen@networkplumber$(echo .)org \
    --cc=davem@davemloft$(echo .)net \
    --cc=netdev@vger$(echo .)kernel.org \
    --cc=therbert@google$(echo .)com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox