[PATCH 2/5] net: ifup: use accessor to set network device ip/netmask
Sascha Hauer
s.hauer at pengutronix.de
Mon Jun 10 00:51:02 PDT 2024
We have accessors to set a network devices ip/netmask. Use them
instead of accessing the struct members directly.
Signed-off-by: Sascha Hauer <s.hauer at pengutronix.de>
---
net/ifup.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/net/ifup.c b/net/ifup.c
index 5b92ee794d..2e1a5529a8 100644
--- a/net/ifup.c
+++ b/net/ifup.c
@@ -133,8 +133,8 @@ static int source_env_network(struct eth_device *edev)
memcpy(edev->ethaddr, ethaddr, 6);
if (mode == ETH_MODE_STATIC) {
- edev->ipaddr = ipaddr;
- edev->netmask = netmask;
+ net_set_ip(edev, ipaddr);
+ net_set_netmask(edev, netmask);
if (gateway)
net_set_gateway(gateway);
if (serverip)
--
2.39.2
More information about the barebox
mailing list