Skip to content

Commit 75ca4dc

Browse files
committed
kni_net.c compatible with -Wstringop-overflow with different gcc versions.
1 parent afcab23 commit 75ca4dc

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

dpdk/kernel/linux/kni/kni_net.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -832,8 +832,13 @@ static const struct net_device_ops kni_net_netdev_ops = {
832832
static void kni_get_drvinfo(struct net_device *dev,
833833
struct ethtool_drvinfo *info)
834834
{
835+
#if __GNUC__ >= 13
835836
strscpy(info->version, KNI_VERSION, sizeof(info->version));
836837
strscpy(info->driver, "kni", sizeof(info->driver));
838+
#else
839+
strlcpy(info->version, KNI_VERSION, sizeof(info->version));
840+
strlcpy(info->driver, "kni", sizeof(info->driver));
841+
#endif
837842
}
838843

839844
static const struct ethtool_ops kni_net_ethtool_ops = {

0 commit comments

Comments
 (0)