Re: [PATCHv5 net-next 1/4] rtnetlink: add new helper rtnl_configure_link_notify()

Guillaume Nault
2022-09-30T16:29:08Z

> @@ -3856,7 +3856,7 @@ int __dev_change_flags(struct net_device *dev, unsigned int flags,
> int dev_change_flags(struct net_device *dev, unsigned int flags,
> struct netlink_ext_ack *extack);
> void __dev_notify_flags(struct net_device *, unsigned int old_flags,
> - unsigned int gchanges);
> + unsigned int gchanges, u32 pid, struct nlmsghdr *nlh);

In all the modified functions, you could make struct nlmsghdr * a const
pointer. You just need to also update rtnl_notify() to make its nlh
parameter const too.

> +void rtmsg_ifinfo_nlh(int type, struct net_device *dev, unsigned int change,
> + gfp_t flags, u32 pid, struct nlmsghdr *nlh)
> +{
> + rtmsg_ifinfo_event(type, dev, change, rtnl_get_event(0), flags,
> + NULL, 0, pid, nlh);
> }

Can't we just add the extra parameters to rtmsg_ifinfo() and trivially
adapt the few users to the new prototype? Maybe that's a personal
taste, but I find such wrapper unnecessary.