[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <29507597-6977-cbe1-3983-1e8e30c94f0b@redfish-solutions.com>
Date: Tue, 2 Aug 2016 11:33:27 -0600
From: Philp Prindeville <philipp@...fish-solutions.com>
To: Feng Gao <gfree.wind@...il.com>
Cc: fgao@...vckh6395k16k5.yundunddos.com,
"David S. Miller" <davem@...emloft.net>,
Stephen Hemminger <stephen@...workplumber.org>,
Pravin B Shelar <pshelar@...ira.com>,
Tom Herbert <tom@...bertland.com>,
Alex Duyck <aduyck@...antis.com>,
Linux Kernel Network Developers <netdev@...r.kernel.org>
Subject: Re: [PATCH 1/1] rps: Inspect PPTP encapsulated by GRE to get flow
hash
Inline...
On 08/02/2016 12:10 AM, Feng Gao wrote:
> Thanks.
> Because the original GRE uses the literal number directly, so I follow
> this style.
>
> Then I have two questions.
> 1. pptp_gre_header is defined in "drivers/net/ppp/pptp.c"; If we want
> to use it, need to create one new header file, is it ok ?
Yes, I would move the relevant constants and packet structures into
include/net/pptp.h ...
While you're at it, there are places like:
islcp = ((data[0] << 8) + data[1]) == PPP_LCP && 1 <= data[2] &&
data[2] <= 7;
that should be written as:
islcp = PPP_PROTOCOL(data-2) == PPP_LCP && CP_CONF_REQ <= data[2]
&& data[2] <= CP_CODE_REJ;
Similarly for:
data[0] = PPP_ALLSTATIONS;
data[1] = PPP_UI;
that should be using:
PPP_ADDRESS(data) = PPP_ALLSTATIONS;
PPP_CONTROL(data) = PPP_UI;
etc. but this cleanup can go in a 2nd patch. The definitions for
CONFREQ and CONFACK and CP_CONF_REQ and CP_CONF_ACK and PPP_LCP_ECHOREQ
and PPP_LCP_ECHOREP are redundant and probably should all go into
ppp_defs.h as well (which would require refactoring
drivers/net/ppp/ppp_async.c).
> 2. The GRE version 0 patch could use the sizeof pptp_gre_header.seq ?
Actually, since you're going to be doing the pptp.h header anyway, I'd
add a v0 as well as a v1 struct just to be more clear/concise.
-Philip
> Best Regards
> Feng
>
>
[snip]
Powered by blists - more mailing lists