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:   Sun, 18 Sep 2022 09:43:31 +0000
From:   Jian Shen <shenjian15@...wei.com>
To:     <davem@...emloft.net>, <kuba@...nel.org>, <ecree.xilinx@...il.com>,
        <andrew@...n.ch>, <hkallweit1@...il.com>,
        <alexandr.lobakin@...el.com>, <saeed@...nel.org>, <leon@...nel.org>
CC:     <netdev@...r.kernel.org>, <linuxarm@...wei.com>
Subject: [RFCv8 PATCH net-next 50/55] net: tap: adjust the prototype of update_features()

The function tap_dev.update_features() using netdev_features_t
as parameters.

For the prototype of netdev_features_t will be extended to be
larger than 8 bytes, so change the prototype of the function,
change the prototype of input features to 'netdev_features_t *'.

Signed-off-by: Jian Shen <shenjian15@...wei.com>
---
 drivers/net/ipvlan/ipvtap.c | 4 ++--
 drivers/net/macvtap.c       | 4 ++--
 drivers/net/tap.c           | 2 +-
 include/linux/if_tap.h      | 3 ++-
 4 files changed, 7 insertions(+), 6 deletions(-)

diff --git a/drivers/net/ipvlan/ipvtap.c b/drivers/net/ipvlan/ipvtap.c
index ba2730ba5c1f..37988c869f6e 100644
--- a/drivers/net/ipvlan/ipvtap.c
+++ b/drivers/net/ipvlan/ipvtap.c
@@ -63,12 +63,12 @@ static void ipvtap_count_rx_dropped(struct tap_dev *tap)
 }
 
 static void ipvtap_update_features(struct tap_dev *tap,
-				   netdev_features_t features)
+				   const netdev_features_t *features)
 {
 	struct ipvtap_dev *vlantap = container_of(tap, struct ipvtap_dev, tap);
 	struct ipvl_dev *vlan = &vlantap->vlan;
 
-	vlan->sfeatures = features;
+	netdev_features_copy(vlan->sfeatures, *features);
 	netdev_update_features(vlan->dev);
 }
 
diff --git a/drivers/net/macvtap.c b/drivers/net/macvtap.c
index 14f75986f4c4..1a6cbb987ad2 100644
--- a/drivers/net/macvtap.c
+++ b/drivers/net/macvtap.c
@@ -67,12 +67,12 @@ static void macvtap_count_rx_dropped(struct tap_dev *tap)
 }
 
 static void macvtap_update_features(struct tap_dev *tap,
-				    netdev_features_t features)
+				    const netdev_features_t *features)
 {
 	struct macvtap_dev *vlantap = container_of(tap, struct macvtap_dev, tap);
 	struct macvlan_dev *vlan = &vlantap->vlan;
 
-	vlan->set_features = features;
+	netdev_features_copy(vlan->set_features, *features);
 	netdev_update_features(vlan->dev);
 }
 
diff --git a/drivers/net/tap.c b/drivers/net/tap.c
index e3045a7badd8..a13c0479079f 100644
--- a/drivers/net/tap.c
+++ b/drivers/net/tap.c
@@ -985,7 +985,7 @@ static int set_offload(struct tap_queue *q, unsigned long arg)
 	 */
 	tap->tap_features = feature_mask;
 	if (tap->update_features)
-		tap->update_features(tap, features);
+		tap->update_features(tap, &features);
 
 	return 0;
 }
diff --git a/include/linux/if_tap.h b/include/linux/if_tap.h
index 553552fa635c..7f5678f9df09 100644
--- a/include/linux/if_tap.h
+++ b/include/linux/if_tap.h
@@ -44,7 +44,8 @@ struct tap_dev {
 	netdev_features_t	tap_features;
 	int			minor;
 
-	void (*update_features)(struct tap_dev *tap, netdev_features_t features);
+	void (*update_features)(struct tap_dev *tap,
+				const netdev_features_t *features);
 	void (*count_tx_dropped)(struct tap_dev *tap);
 	void (*count_rx_dropped)(struct tap_dev *tap);
 };
-- 
2.33.0

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ