Skip to content

Commit 3fbb555

Browse files
committed
Fix kni build error, compatible with both strlcpy and strscpy.
1 parent 08fb383 commit 3fbb555

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

dpdk/kernel/linux/kni/kni_net.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -806,8 +806,13 @@ static const struct net_device_ops kni_net_netdev_ops = {
806806
static void kni_get_drvinfo(struct net_device *dev,
807807
struct ethtool_drvinfo *info)
808808
{
809+
#if __GNUC__ >= 13
809810
strscpy(info->version, KNI_VERSION, sizeof(info->version));
810811
strscpy(info->driver, "kni", sizeof(info->driver));
812+
#else
813+
strlcpy(info->version, KNI_VERSION, sizeof(info->version));
814+
strlcpy(info->driver, "kni", sizeof(info->driver));
815+
#endif
811816
}
812817

813818
static const struct ethtool_ops kni_net_ethtool_ops = {

0 commit comments

Comments
 (0)