]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
ethtool: make the size of 'features' array static
authorYu Watanabe <watanabe.yu+github@gmail.com>
Mon, 16 Aug 2021 14:47:40 +0000 (23:47 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Mon, 16 Aug 2021 15:48:18 +0000 (00:48 +0900)
src/shared/ethtool-util.c
src/shared/ethtool-util.h

index f77f6943ca4faf643d3cfcfff4e3feb4fda86298..699c7a97ab97ceb11d3726748ea87a8f04e7c189 100644 (file)
@@ -501,7 +501,7 @@ static int set_features_bit(
         return found ? 0 : -ENODATA;
 }
 
-int ethtool_set_features(int *ethtool_fd, const char *ifname, const int *features) {
+int ethtool_set_features(int *ethtool_fd, const char *ifname, const int features[static _NET_DEV_FEAT_MAX]) {
         _cleanup_free_ struct ethtool_gstrings *strings = NULL;
         struct ethtool_sfeatures *sfeatures;
         struct ifreq ifr = {};
index 7d287666249ae55fc8ceccf400dfd5a6bf46ffcc..f0fc40b0595fcb3aa82336d1dd21653de7f07800 100644 (file)
@@ -88,7 +88,7 @@ int ethtool_get_link_info(int *ethtool_fd, const char *ifname,
 int ethtool_get_permanent_macaddr(int *ethtool_fd, const char *ifname, struct ether_addr *ret);
 int ethtool_set_wol(int *ethtool_fd, const char *ifname, uint32_t wolopts);
 int ethtool_set_nic_buffer_size(int *ethtool_fd, const char *ifname, const netdev_ring_param *ring);
-int ethtool_set_features(int *ethtool_fd, const char *ifname, const int *features);
+int ethtool_set_features(int *ethtool_fd, const char *ifname, const int features[static _NET_DEV_FEAT_MAX]);
 int ethtool_set_glinksettings(int *ethtool_fd, const char *ifname,
                               int autonegotiation, const uint32_t advertise[static N_ADVERTISE],
                               uint64_t speed, Duplex duplex, NetDevPort port);