[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAJieiUg1wqgEqu-LTsGXSP2Wqdq4zU3vsBKg-gWnkZvxuz0A6w@mail.gmail.com>
Date: Mon, 16 Apr 2018 20:57:02 -0700
From: Roopa Prabhu <roopa@...ulusnetworks.com>
To: David Miller <davem@...emloft.net>
Cc: netdev <netdev@...r.kernel.org>,
David Ahern <dsa@...ulusnetworks.com>
Subject: Re: [PATCH net-next 3/5] ipv4: support sport, dport and ip protocol
in RTM_GETROUTE
On Mon, Apr 16, 2018 at 3:58 PM, David Miller <davem@...emloft.net> wrote:
> From: Roopa Prabhu <roopa@...ulusnetworks.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.
>
will do, thanks.
Powered by blists - more mailing lists