diff options
| author | Toomas Soome <tsoome@me.com> | 2017-05-24 17:01:53 +0300 |
|---|---|---|
| committer | Robert Mustacchi <rm@joyent.com> | 2017-05-30 03:57:04 +0000 |
| commit | 8186848379535a7535e73f719d8d947abf86522d (patch) | |
| tree | 4325703150aee8b47b9aa16ec1cfdb81d85be200 | |
| parent | 1a1df1dbef1b5c57672433301a296dfe4311e6db (diff) | |
| download | illumos-joyent-8186848379535a7535e73f719d8d947abf86522d.tar.gz | |
8271 loader: Replacing iterating over rootpath by strsep
Reviewed by: Yuri Pankov <yuripv@gmx.com>
Reviewed by: Alexander Pyhalov <alp@rsu.ru>
Approved by: Robert Mustacchi <rm@joyent.com>
| -rw-r--r-- | usr/src/boot/Makefile.version | 2 | ||||
| -rw-r--r-- | usr/src/boot/sys/boot/common/dev_net.c | 14 |
2 files changed, 7 insertions, 9 deletions
diff --git a/usr/src/boot/Makefile.version b/usr/src/boot/Makefile.version index 4c2ac95fd9..8884ee547c 100644 --- a/usr/src/boot/Makefile.version +++ b/usr/src/boot/Makefile.version @@ -33,4 +33,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)-2017.5.6.1 +BOOT_VERSION = $(LOADER_VERSION)-2017.5.25.1 diff --git a/usr/src/boot/sys/boot/common/dev_net.c b/usr/src/boot/sys/boot/common/dev_net.c index 08ee5c8a86..6321db7c5b 100644 --- a/usr/src/boot/sys/boot/common/dev_net.c +++ b/usr/src/boot/sys/boot/common/dev_net.c @@ -363,16 +363,14 @@ net_print(int verbose) uint32_t net_parse_rootpath() { - int i; n_long addr = INADDR_NONE; + char *ptr; - for (i = 0; rootpath[i] != '\0' && i < FNAME_SIZE; i++) - if (rootpath[i] == ':') - break; - if (i && i != FNAME_SIZE && rootpath[i] == ':') { - rootpath[i++] = '\0'; - addr = inet_addr(&rootpath[0]); - bcopy(&rootpath[i], rootpath, strlen(&rootpath[i])+1); + ptr = rootpath; + (void)strsep(&ptr, ":"); + if (ptr != NULL) { + addr = inet_addr(rootpath); + bcopy(ptr, rootpath, strlen(ptr) + 1); } return (addr); } |
