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:   Wed, 12 Jun 2019 18:05:26 +0200
From:   Andrew Lunn <andrew@...n.ch>
To:     netdev <netdev@...r.kernel.org>
Cc:     Florian Fainelli <f.fainelli@...il.com>,
        Heiner Kallweit <hkallweit1@...il.com>,
        Raju.Lakkaraju@...rochip.com, Andrew Lunn <andrew@...n.ch>
Subject: [PATCH RFC 05/13] net: ethtool: Make helpers public

Move Some helpers for building ethtool netlink messages into public
locations so drivers can make use of them.

Signed-off-by: Andrew Lunn <andrew@...n.ch>
---
 include/linux/ethtool_netlink.h | 11 +++++++++++
 net/ethtool/netlink.h           |  3 ---
 2 files changed, 11 insertions(+), 3 deletions(-)

diff --git a/include/linux/ethtool_netlink.h b/include/linux/ethtool_netlink.h
index 288e90f4dbb9..7d98592cd8a1 100644
--- a/include/linux/ethtool_netlink.h
+++ b/include/linux/ethtool_netlink.h
@@ -6,6 +6,7 @@
 #include <uapi/linux/ethtool_netlink.h>
 #include <linux/ethtool.h>
 #include <linux/netdevice.h>
+#include <net/netlink.h>
 
 #define __ETHTOOL_LINK_MODE_MASK_NWORDS \
 	DIV_ROUND_UP(__ETHTOOL_LINK_MODE_MASK_NBITS, 32)
@@ -20,4 +21,14 @@ struct ethtool_rxflow_notification_info {
 	u32	flow_type;
 };
 
+static inline struct nlattr *ethnl_nest_start(struct sk_buff *skb,
+					      int attrtype)
+{
+	return nla_nest_start(skb, attrtype | NLA_F_NESTED);
+}
+
+int ethnl_fill_dev(struct sk_buff *msg, struct net_device *dev, u16 attrtype);
+void *ethnl_bcastmsg_put(struct sk_buff *skb, u8 cmd);
+int ethnl_multicast(struct sk_buff *skb, struct net_device *dev);
+
 #endif /* _LINUX_ETHTOOL_NETLINK_H_ */
diff --git a/net/ethtool/netlink.h b/net/ethtool/netlink.h
index 4e7b40a8401d..d54fe7b6dac2 100644
--- a/net/ethtool/netlink.h
+++ b/net/ethtool/netlink.h
@@ -20,13 +20,10 @@ extern const char *const link_mode_names[];
 extern const char *const reset_flag_names[];
 
 struct net_device *ethnl_dev_get(struct genl_info *info, struct nlattr *nest);
-int ethnl_fill_dev(struct sk_buff *msg, struct net_device *dev, u16 attrtype);
 
 struct sk_buff *ethnl_reply_init(size_t payload, struct net_device *dev, u8 cmd,
 				 u16 dev_attrtype, struct genl_info *info,
 				 void **ehdrp);
-void *ethnl_bcastmsg_put(struct sk_buff *skb, u8 cmd);
-int ethnl_multicast(struct sk_buff *skb, struct net_device *dev);
 
 #if BITS_PER_LONG == 64 && defined(__BIG_ENDIAN)
 void ethnl_bitmap_to_u32(unsigned long *bitmap, unsigned int nwords);
-- 
2.20.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ