Skip to content

Commit

Permalink
14114 loader: dev_net.c should use __func__ with printf
Browse files Browse the repository at this point in the history
Reviewed by: Sebastian Wiedenroth <wiedi@frubar.net>
Reviewed by: Andy Fiddaman <andy@omnios.org>
Approved by: Robert Mustacchi <rm@fingolfin.org>
  • Loading branch information
tsoome committed Sep 28, 2021
1 parent 52fac30 commit 46baa6f
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 16 deletions.
2 changes: 1 addition & 1 deletion usr/src/boot/Makefile.version
Expand Up @@ -34,4 +34,4 @@ LOADER_VERSION = 1.1
# Use date like formatting here, YYYY.MM.DD.XX, without leading zeroes.
# The version is processed from left to right, the version number can only
# be increased.
BOOT_VERSION = $(LOADER_VERSION)-2021.09.12.1
BOOT_VERSION = $(LOADER_VERSION)-2021.09.25.1
35 changes: 20 additions & 15 deletions usr/src/boot/sys/boot/common/dev_net.c
Expand Up @@ -142,13 +142,14 @@ net_open(struct open_file *f, ...)
if (netdev_sock < 0) {
netdev_sock = netif_open(dev);
if (netdev_sock < 0) {
printf("net_open: netif_open() failed\n");
printf("%s: netif_open() failed\n", __func__);
return (ENXIO);
}
netdev_name = strdup(devname);
#ifdef NETIF_DEBUG
if (debug)
printf("net_open: netif_open() succeeded\n");
printf("%s: netif_open() succeeded\n",
__func__);
#endif
}
/*
Expand Down Expand Up @@ -202,7 +203,7 @@ net_close(struct open_file *f)

#ifdef NETIF_DEBUG
if (debug)
printf("net_close: opens=%d\n", netdev_opens);
printf("%s: opens=%d\n", __func__, netdev_opens);
#endif

f->f_devdata = NULL;
Expand All @@ -217,7 +218,7 @@ net_cleanup(void)
if (netdev_sock >= 0) {
#ifdef NETIF_DEBUG
if (debug)
printf("net_cleanup: calling netif_close()\n");
printf("%s: calling netif_close()\n", __func__);
#endif
rootip.s_addr = 0;
free(netdev_name);
Expand Down Expand Up @@ -260,27 +261,27 @@ net_getparams(int sock)
goto exit;
#ifdef NETIF_DEBUG
if (debug)
printf("net_open: BOOTP failed, trying RARP/RPC...\n");
printf("%s: BOOTP failed, trying RARP/RPC...\n", __func__);
#endif

/*
* Use RARP to get our IP address. This also sets our
* netmask to the "natural" default for our address.
*/
if (rarp_getipaddress(sock)) {
printf("net_open: RARP failed\n");
printf("%s: RARP failed\n", __func__);
return (EIO);
}
printf("net_open: client addr: %s\n", inet_ntoa(myip));
printf("%s: client addr: %s\n", __func__, inet_ntoa(myip));

/* Get our hostname, server IP address, gateway. */
if (bp_whoami(sock)) {
printf("net_open: bootparam/whoami RPC failed\n");
printf("%s: bootparam/whoami RPC failed\n", __func__);
return (EIO);
}
#ifdef NETIF_DEBUG
if (debug)
printf("net_open: client name: %s\n", hostname);
printf("%s: client name: %s\n", __func__, hostname);
#endif

/*
Expand All @@ -297,17 +298,18 @@ net_getparams(int sock)
netmask = smask;
#ifdef NETIF_DEBUG
if (debug)
printf("net_open: subnet mask: %s\n", intoa(netmask));
printf("%s: subnet mask: %s\n", __func__,
intoa(netmask));
#endif
}
#ifdef NETIF_DEBUG
if (gateip.s_addr && debug)
printf("net_open: net gateway: %s\n", inet_ntoa(gateip));
printf("%s: net gateway: %s\n", __func__, inet_ntoa(gateip));
#endif

/* Get the root server and pathname. */
if (bp_getfile(sock, "root", &rootip, rootpath)) {
printf("net_open: bootparam/getfile RPC failed\n");
printf("%s: bootparam/getfile RPC failed\n", __func__);
return (EIO);
}
exit:
Expand All @@ -316,8 +318,9 @@ net_getparams(int sock)

#ifdef NETIF_DEBUG
if (debug) {
printf("net_open: server addr: %s\n", inet_ntoa(rootip));
printf("net_open: server path: %s\n", rootpath);
printf("%s: server addr: %s\n", __func__,
inet_ntoa(rootip));
printf("%s: server path: %s\n", __func__, rootpath);
}
#endif

Expand Down Expand Up @@ -409,7 +412,9 @@ net_parse_rootpath(void)
} else {
ptr += strlen(uri_schemes[i].scheme);
if (*ptr == '/') {
/* we are in the form <scheme>://, we do expect an ip */
/*
* We are in the form <scheme>://, we do expect an ip.
*/
ptr++;
/*
* XXX when http will be there we will need to check for
Expand Down

0 comments on commit 46baa6f

Please sign in to comment.