Skip to content

Commit bbfa7f8

Browse files
committed
pc-bios/s390-ccw/netmain: Fix error messages with regards to the TFTP server
The code in net_init_ip() currently bails out early if "rc" is less than 0, so the if-statements that check for negative "rc" codes to print out some specific error messages with regards to the TFTP server are never reached. Move them earlier to bring that dead code back to life. Reviewed-by: Jared Rossi <jrossi@linux.ibm.com> Reviewed-by: Eric Farman <farman@linux.ibm.com> Tested-by: Jared Rossi <jrossi@linux.ibm.com> Message-ID: <20250116115826.192047-4-thuth@redhat.com> Signed-off-by: Thomas Huth <thuth@redhat.com>
1 parent 68c95ed commit bbfa7f8

File tree

1 file changed

+8
-11
lines changed

1 file changed

+8
-11
lines changed

pc-bios/s390-ccw/netmain.c

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,14 @@ static int net_init_ip(filename_ip_t *fn_ip)
168168
if (fn_ip->ip_version == 4) {
169169
set_ipv4_address(fn_ip->own_ip);
170170
}
171+
} else if (rc == -2) {
172+
printf("ARP request to TFTP server (%d.%d.%d.%d) failed\n",
173+
(fn_ip->server_ip >> 24) & 0xFF, (fn_ip->server_ip >> 16) & 0xFF,
174+
(fn_ip->server_ip >> 8) & 0xFF, fn_ip->server_ip & 0xFF);
175+
return -102;
176+
} else if (rc == -4 || rc == -3) {
177+
puts("Can't obtain TFTP server IP address");
178+
return -107;
171179
} else {
172180
puts("Could not get IP address");
173181
return -101;
@@ -183,17 +191,6 @@ static int net_init_ip(filename_ip_t *fn_ip)
183191
printf(" Using IPv6 address: %s\n", ip6_str);
184192
}
185193

186-
if (rc == -2) {
187-
printf("ARP request to TFTP server (%d.%d.%d.%d) failed\n",
188-
(fn_ip->server_ip >> 24) & 0xFF, (fn_ip->server_ip >> 16) & 0xFF,
189-
(fn_ip->server_ip >> 8) & 0xFF, fn_ip->server_ip & 0xFF);
190-
return -102;
191-
}
192-
if (rc == -4 || rc == -3) {
193-
puts("Can't obtain TFTP server IP address");
194-
return -107;
195-
}
196-
197194
printf(" Using TFTP server: ");
198195
if (fn_ip->ip_version == 4) {
199196
printf("%d.%d.%d.%d\n",

0 commit comments

Comments
 (0)