All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ido Schimmel <idosch@idosch.org>
To: Roopa Prabhu <roopa@cumulusnetworks.com>
Cc: davem@davemloft.net, netdev@vger.kernel.org, dsa@cumulusnetworks.com
Subject: Re: [PATCH net-next 3/5] ipv4: support sport, dport and ip protocol in RTM_GETROUTE
Date: Tue, 17 Apr 2018 11:10:52 +0300	[thread overview]
Message-ID: <20180417081052.GA30335@splinter> (raw)
In-Reply-To: <1523911298-8965-4-git-send-email-roopa@cumulusnetworks.com>

On Mon, Apr 16, 2018 at 01:41:36PM -0700, Roopa Prabhu wrote:
> @@ -2757,6 +2796,12 @@ static int inet_rtm_getroute(struct sk_buff *in_skb, struct nlmsghdr *nlh,
>  	fl4.flowi4_oif = tb[RTA_OIF] ? nla_get_u32(tb[RTA_OIF]) : 0;
>  	fl4.flowi4_mark = mark;
>  	fl4.flowi4_uid = uid;
> +	if (sport)
> +		fl4.fl4_sport = sport;
> +	if (dport)
> +		fl4.fl4_dport = dport;
> +	if (ip_proto)
> +		fl4.flowi4_proto = ip_proto;

Hi Roopa,

This info isn't set in the synthesized skb, but only in the flow info
and therefore not used for input routes. I see you added a test case,
but it's only for output routes. I believe an input route test case will
fail.

Also, note that the skb as synthesized now is invalid - iph->ihl is 0
for example - so the flow dissector will spit it out. It effectively
means that route get is broken when L4 hashing is used. It also affects
output routes because since commit 3765d35ed8b9 ("net: ipv4: Convert
inet_rtm_getroute to rcu versions of route lookup") the skb is used to
calculate the multipath hash.

  parent reply	other threads:[~2018-04-17  8:10 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-04-16 20:41 [PATCH net-next 0/5] fib rules extack support and selftest Roopa Prabhu
2018-04-16 20:41 ` [PATCH net-next 1/5] fib_rules: move common handling of newrule delrule msgs into fib_nl2rule Roopa Prabhu
2018-04-16 20:41 ` [PATCH net-next 2/5] net: fib_rules: add extack support Roopa Prabhu
2018-04-16 20:41 ` [PATCH net-next 3/5] ipv4: support sport, dport and ip protocol in RTM_GETROUTE Roopa Prabhu
2018-04-16 22:58   ` David Miller
2018-04-17  3:57     ` Roopa Prabhu
2018-04-17  8:10   ` Ido Schimmel [this message]
2018-04-18  2:41     ` Roopa Prabhu
2018-04-16 20:41 ` [PATCH net-next 4/5] ipv6: " Roopa Prabhu
2018-04-16 20:41 ` [PATCH net-next 5/5] selftests: net: initial fib rule tests Roopa Prabhu

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=20180417081052.GA30335@splinter \
    --to=idosch@idosch.org \
    --cc=davem@davemloft.net \
    --cc=dsa@cumulusnetworks.com \
    --cc=netdev@vger.kernel.org \
    --cc=roopa@cumulusnetworks.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.