From: David Miller <davem@davemloft.net>
To: roopa@cumulusnetworks.com
Cc: 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: Mon, 16 Apr 2018 18:58:55 -0400 (EDT) [thread overview]
Message-ID: <20180416.185855.2220085572245129235.davem@davemloft.net> (raw)
In-Reply-To: <1523911298-8965-4-git-send-email-roopa@cumulusnetworks.com>
From: Roopa Prabhu <roopa@cumulusnetworks.com>
Date: Mon, 16 Apr 2018 13:41:36 -0700
> diff --git a/include/uapi/linux/rtnetlink.h b/include/uapi/linux/rtnetlink.h
> index 9b15005..7947252 100644
> --- a/include/uapi/linux/rtnetlink.h
> +++ b/include/uapi/linux/rtnetlink.h
> @@ -327,6 +327,9 @@ enum rtattr_type_t {
> RTA_PAD,
> RTA_UID,
> RTA_TTL_PROPAGATE,
> + RTA_SPORT,
> + RTA_DPORT,
> + RTA_IP_PROTO,
> __RTA_MAX
> };
>
> diff --git a/net/ipv4/route.c b/net/ipv4/route.c
> index ccb25d8..ae55711 100644
> --- a/net/ipv4/route.c
> +++ b/net/ipv4/route.c
> @@ -2663,6 +2663,18 @@ static int rt_fill_info(struct net *net, __be32 dst, __be32 src, u32 table_id,
> from_kuid_munged(current_user_ns(), fl4->flowi4_uid)))
> goto nla_put_failure;
>
> + if (fl4->fl4_sport &&
> + nla_put_u16(skb, RTA_SPORT, ntohs(fl4->fl4_sport)))
> + goto nla_put_failure;
The addreeses are given over netlink in network byte order, so let's
be consistent and do the same for the ports et al. as well.
Thanks.
next prev parent reply other threads:[~2018-04-16 22:58 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 [this message]
2018-04-17 3:57 ` Roopa Prabhu
2018-04-17 8:10 ` Ido Schimmel
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=20180416.185855.2220085572245129235.davem@davemloft.net \
--to=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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).