mirror of
https://github.com/openvswitch/ovs
synced 2025-09-01 14:55:18 +00:00
datapath: fix drvinfo strings set in drivers
Use strlcpy where possible to ensure the string is \0 terminated. Use always sizeof(string) instead of 32, ETHTOOL_BUSINFO_LEN and custom defines. Use snprintf instead of sprint. Remove unnecessary inits of ->fw_version Remove unnecessary inits of drvinfo struct. Signed-off-by: Jiri Pirko <jiri@resnulli.us> Signed-off-by: David S. Miller <davem@davemloft.net> Signed-off-by: Jesse Gross <jesse@nicira.com>
This commit is contained in:
@@ -115,7 +115,7 @@ static int internal_dev_stop(struct net_device *netdev)
|
|||||||
static void internal_dev_getinfo(struct net_device *netdev,
|
static void internal_dev_getinfo(struct net_device *netdev,
|
||||||
struct ethtool_drvinfo *info)
|
struct ethtool_drvinfo *info)
|
||||||
{
|
{
|
||||||
strcpy(info->driver, "openvswitch");
|
strlcpy(info->driver, "openvswitch", sizeof(info->driver));
|
||||||
}
|
}
|
||||||
|
|
||||||
static const struct ethtool_ops internal_dev_ethtool_ops = {
|
static const struct ethtool_ops internal_dev_ethtool_ops = {
|
||||||
|
Reference in New Issue
Block a user