mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Sascha Hauer <s.hauer@pengutronix.de>
To: Barebox List <barebox@lists.infradead.org>
Subject: [PATCH 2/5] net: ifup: use accessor to set network device ip/netmask
Date: Mon, 10 Jun 2024 09:51:02 +0200	[thread overview]
Message-ID: <20240610075105.812496-3-s.hauer@pengutronix.de> (raw)
In-Reply-To: <20240610075105.812496-1-s.hauer@pengutronix.de>

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@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




  parent reply	other threads:[~2024-06-10  7:51 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-06-10  7:51 [PATCH 0/5] net: preparations for integrating a network stack Sascha Hauer
2024-06-10  7:51 ` [PATCH 1/5] net: virtio-net: allow to set current MAC address Sascha Hauer
2024-06-10  7:51 ` Sascha Hauer [this message]
2024-06-10  7:51 ` [PATCH 3/5] net: add edev argument to net_set_gateway() Sascha Hauer
2024-06-10  7:51 ` [PATCH 4/5] net: establish single code path for setting edev parameters Sascha Hauer
2024-06-10  7:51 ` [PATCH 5/5] net: host command: move to commands/ Sascha Hauer
2024-06-13  6:41 ` [PATCH 0/5] net: preparations for integrating a network stack Sascha Hauer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240610075105.812496-3-s.hauer@pengutronix.de \
    --to=s.hauer@pengutronix.de \
    --cc=barebox@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox