[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <d33c8463-e3ae-46a6-a34d-ced78228c2c2@kernel.org>
Date: Thu, 9 Jan 2025 08:33:55 -0700
From: David Ahern <dsahern@...nel.org>
To: Yuyang Huang <yuyanghuang@...gle.com>
Cc: "David S. Miller" <davem@...emloft.net>,
Eric Dumazet <edumazet@...gle.com>, Jakub Kicinski <kuba@...nel.org>,
Paolo Abeni <pabeni@...hat.com>, Simon Horman <horms@...nel.org>,
roopa@...ulusnetworks.com, jiri@...nulli.us, stephen@...workplumber.org,
jimictw@...gle.com, prohr@...gle.com, liuhangbin@...il.com,
nicolas.dichtel@...nd.com, andrew@...n.ch, netdev@...r.kernel.org,
Maciej Żenczykowski <maze@...gle.com>,
Lorenzo Colitti <lorenzo@...gle.com>
Subject: Re: [PATCH net-next, v4] netlink: support dumping IPv4 multicast
addresses
On 1/9/25 12:22 AM, Yuyang Huang wrote:
> @@ -1889,15 +1935,16 @@ static u32 inet_base_seq(const struct net *net)
> return res;
> }
>
> -static int inet_dump_ifaddr(struct sk_buff *skb, struct netlink_callback *cb)
> +static int inet_dump_addr(struct sk_buff *skb, struct netlink_callback *cb,
> + enum addr_type_t type)
> {
> const struct nlmsghdr *nlh = cb->nlh;
> struct inet_fill_args fillargs = {
> .portid = NETLINK_CB(cb->skb).portid,
> .seq = nlh->nlmsg_seq,
> - .event = RTM_NEWADDR,
> .flags = NLM_F_MULTI,
> .netnsid = -1,
> + .type = type,
my comment meant that this `type` should be removed and the wrappers
below just call the intended function. No need for the extra layers.
> };
> struct net *net = sock_net(skb->sk);
> struct net *tgt_net = net;
> @@ -1949,6 +1996,20 @@ static int inet_dump_ifaddr(struct sk_buff *skb, struct netlink_callback *cb)
> return err;
> }
>
> +static int inet_dump_ifaddr(struct sk_buff *skb, struct netlink_callback *cb)
> +{
> + enum addr_type_t type = UNICAST_ADDR;
> +
> + return inet_dump_addr(skb, cb, type);
> +}
> +
> +static int inet_dump_ifmcaddr(struct sk_buff *skb, struct netlink_callback *cb)
> +{
> + enum addr_type_t type = MULTICAST_ADDR;
> +
> + return inet_dump_addr(skb, cb, type);
> +}
> +
> static void rtmsg_ifa(int event, struct in_ifaddr *ifa, struct nlmsghdr *nlh,
> u32 portid)
> {
Powered by blists - more mailing lists