ethtool: 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>
此提交包含在:
@@ -585,8 +585,8 @@ static int macvlan_fdb_del(struct ndmsg *ndm,
|
||||
static void macvlan_ethtool_get_drvinfo(struct net_device *dev,
|
||||
struct ethtool_drvinfo *drvinfo)
|
||||
{
|
||||
snprintf(drvinfo->driver, 32, "macvlan");
|
||||
snprintf(drvinfo->version, 32, "0.1");
|
||||
strlcpy(drvinfo->driver, "macvlan", sizeof(drvinfo->driver));
|
||||
strlcpy(drvinfo->version, "0.1", sizeof(drvinfo->version));
|
||||
}
|
||||
|
||||
static int macvlan_ethtool_get_settings(struct net_device *dev,
|
||||
|
新增問題並參考
封鎖使用者