Re: [PATCH v2] net: Use nlmsg_unicast() instead of netlink_unicast()

From: David Ahern
Date: Tue Jul 13 2021 - 12:24:27 EST


On 7/12/21 8:48 PM, Yajun Deng wrote:
> diff --git a/net/ipv4/raw_diag.c b/net/ipv4/raw_diag.c
> index 1b5b8af27aaf..ccacbde30a2c 100644
> --- a/net/ipv4/raw_diag.c
> +++ b/net/ipv4/raw_diag.c
> @@ -119,11 +119,8 @@ static int raw_diag_dump_one(struct netlink_callback *cb,
> return err;
> }
>
> - err = netlink_unicast(net->diag_nlsk, rep,
> - NETLINK_CB(in_skb).portid,
> - MSG_DONTWAIT);
> - if (err > 0)
> - err = 0;
> + err = nlmsg_unicast(net->diag_nlsk, rep, NETLINK_CB(in_skb).portid);
> +
> return err;

can be shortened to:

return nlmsg_unicast(net->diag_nlsk, rep, NETLINK_CB(in_skb).portid);



other than that it's a good cleanup:

Reviewed-by: David Ahern <dsahern@xxxxxxxxxx>