summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEshenko Dmitriy <dmitriy.eshenko@vyos.io>2022-05-07 14:35:35 +0300
committerGitHub <noreply@github.com>2022-05-07 14:35:35 +0300
commitb75f468e3a366837fdb139dd772eb856b293fbec (patch)
treec927e1a376646afe4497d61344cb8c2eb723a6ed
parent85beb6bf4f1df582d54f2d8d83b08d434a485f2e (diff)
parente2131adfd01a1993e895df8c51b740b790f087a1 (diff)
downloadaccel-ppp-b75f468e3a366837fdb139dd772eb856b293fbec.tar.gz
accel-ppp-b75f468e3a366837fdb139dd772eb856b293fbec.zip
Merge pull request #47 from p3dda/fix_ipoe_device_address
Use helper method to set ipoe device function
-rw-r--r--drivers/ipoe/ipoe.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/drivers/ipoe/ipoe.c b/drivers/ipoe/ipoe.c
index 5e220e94..5a5f68b8 100644
--- a/drivers/ipoe/ipoe.c
+++ b/drivers/ipoe/ipoe.c
@@ -1154,7 +1154,11 @@ static int ipoe_create(__be32 peer_addr, __be32 addr, __be32 gw, int ifindex, co
if (link_dev) {
dev->features = link_dev->features & ~(NETIF_F_HW_VLAN_FILTER | NETIF_F_LRO);
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(5,15,0)
+ dev_addr_mod(dev, 0, link_dev->dev_addr, ETH_ALEN);
+#else
memcpy(dev->dev_addr, link_dev->dev_addr, ETH_ALEN);
+#endif
memcpy(dev->broadcast, link_dev->broadcast, ETH_ALEN);
}
@@ -1446,7 +1450,11 @@ static int ipoe_nl_cmd_modify(struct sk_buff *skb, struct genl_info *info)
if (link_dev) {
ses->dev->features = link_dev->features & ~(NETIF_F_HW_VLAN_FILTER | NETIF_F_LRO);
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(5,15,0)
+ dev_addr_mod(dev, 0, link_dev->dev_addr, ETH_ALEN);
+#else
memcpy(dev->dev_addr, link_dev->dev_addr, ETH_ALEN);
+#endif
memcpy(dev->broadcast, link_dev->broadcast, ETH_ALEN);
}
}