aboutsummaryrefslogtreecommitdiff
path: root/net
diff options
context:
space:
mode:
Diffstat (limited to 'net')
-rw-r--r--net/bootp.c5
-rw-r--r--net/net.c24
2 files changed, 15 insertions, 14 deletions
diff --git a/net/bootp.c b/net/bootp.c
index 58e30cd..d83e4eb 100644
--- a/net/bootp.c
+++ b/net/bootp.c
@@ -148,10 +148,12 @@ static int check_reply_packet(uchar *pkt, unsigned dest, unsigned src,
static void store_bootp_params(struct bootp_hdr *bp)
{
-#if !defined(CONFIG_BOOTP_SERVERIP)
struct in_addr tmp_ip;
bool overwrite_serverip = true;
+ if (IS_ENABLED(CONFIG_BOOTP_SERVERIP))
+ return;
+
#if defined(CONFIG_BOOTP_PREFER_SERVERIP)
overwrite_serverip = false;
#endif
@@ -179,7 +181,6 @@ static void store_bootp_params(struct bootp_hdr *bp)
*/
if (*net_boot_file_name)
env_set("bootfile", net_boot_file_name);
-#endif
}
/*
diff --git a/net/net.c b/net/net.c
index 43e230a..072a82d 100644
--- a/net/net.c
+++ b/net/net.c
@@ -302,12 +302,12 @@ void net_auto_load(void)
if (s != NULL && strcmp(s, "NFS") == 0) {
if (net_check_prereq(NFS)) {
/* We aren't expecting to get a serverip, so just accept the assigned IP */
-#ifdef CONFIG_BOOTP_SERVERIP
- net_set_state(NETLOOP_SUCCESS);
-#else
- printf("Cannot autoload with NFS\n");
- net_set_state(NETLOOP_FAIL);
-#endif
+ if (IS_ENABLED(CONFIG_BOOTP_SERVERIP)) {
+ net_set_state(NETLOOP_SUCCESS);
+ } else {
+ printf("Cannot autoload with NFS\n");
+ net_set_state(NETLOOP_FAIL);
+ }
return;
}
/*
@@ -327,12 +327,12 @@ void net_auto_load(void)
}
if (net_check_prereq(TFTPGET)) {
/* We aren't expecting to get a serverip, so just accept the assigned IP */
-#ifdef CONFIG_BOOTP_SERVERIP
- net_set_state(NETLOOP_SUCCESS);
-#else
- printf("Cannot autoload with TFTPGET\n");
- net_set_state(NETLOOP_FAIL);
-#endif
+ if (IS_ENABLED(CONFIG_BOOTP_SERVERIP)) {
+ net_set_state(NETLOOP_SUCCESS);
+ } else {
+ printf("Cannot autoload with TFTPGET\n");
+ net_set_state(NETLOOP_FAIL);
+ }
return;
}
tftp_start(TFTPGET);