lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Thu, 10 Aug 2023 11:10:21 +0200
From: Jiri Pirko <jiri@...nulli.us>
To: Jakub Kicinski <kuba@...nel.org>
Cc: davem@...emloft.net, netdev@...r.kernel.org, edumazet@...gle.com,
	pabeni@...hat.com, johannes@...solutions.net, lorenzo@...nel.org
Subject: Re: [PATCH net-next 08/10] netdev-genl: use struct genl_info for
 reply construction

Wed, Aug 09, 2023 at 08:26:46PM CEST, kuba@...nel.org wrote:

[...]

>@@ -41,6 +41,7 @@ netdev_nl_dev_fill(struct net_device *netdev, struct sk_buff *rsp,
> static void
> netdev_genl_dev_notify(struct net_device *netdev, int cmd)
> {
>+	GENL_INFO_NTF(info, &netdev_nl_family, cmd);

These macros declaring and defining struct on stack always introduce
some level of obfuscation to the code. Again, as I suggested in the
reply to the previous patch, would it be nicer to have initializer
helper instead? Something like:

	struct genl_info info;

	genl_info_nft(&info, &netdev_nl_family, cmd);


> 	struct sk_buff *ntf;
> 
> 	if (!genl_has_listeners(&netdev_nl_family, dev_net(netdev),
>@@ -51,7 +52,7 @@ netdev_genl_dev_notify(struct net_device *netdev, int cmd)
> 	if (!ntf)
> 		return;
> 
>-	if (netdev_nl_dev_fill(netdev, ntf, 0, 0, 0, cmd)) {
>+	if (netdev_nl_dev_fill(netdev, ntf, &info)) {
> 		nlmsg_free(ntf);
> 		return;
> 	}

[...]

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ