From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ido Schimmel 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 Message-ID: <20180417081052.GA30335@splinter> References: <1523911298-8965-1-git-send-email-roopa@cumulusnetworks.com> <1523911298-8965-4-git-send-email-roopa@cumulusnetworks.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: davem@davemloft.net, netdev@vger.kernel.org, dsa@cumulusnetworks.com To: Roopa Prabhu Return-path: Received: from out3-smtp.messagingengine.com ([66.111.4.27]:43461 "EHLO out3-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751158AbeDQIKz (ORCPT ); Tue, 17 Apr 2018 04:10:55 -0400 Content-Disposition: inline In-Reply-To: <1523911298-8965-4-git-send-email-roopa@cumulusnetworks.com> Sender: netdev-owner@vger.kernel.org List-ID: 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.