From 35fad84fecc84b7a83f02f87c32aaffb1b95a8e4 Mon Sep 17 00:00:00 2001 From: Baptiste Daroussin Date: Wed, 16 Dec 2015 17:45:03 +0000 Subject: [PATCH] Use human readable representation of ip for the pxeboot.ip kenv While here use colon as a separator for pxeboot.hwaddr kenv Sponsored by: Gandi.net --- sys/boot/i386/libi386/pxe.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/sys/boot/i386/libi386/pxe.c b/sys/boot/i386/libi386/pxe.c index 0704672bea7..efa04fc8152 100644 --- a/sys/boot/i386/libi386/pxe.c +++ b/sys/boot/i386/libi386/pxe.c @@ -323,10 +323,9 @@ pxe_open(struct open_file *f, ...) #endif setenv("dhcp.host-name", hostname, 1); - sprintf(temp, "%08X", ntohl(myip.s_addr)); - setenv("pxeboot.ip", temp, 1); + setenv("pxeboot.ip", inet_ntoa(myip), 1); if (bootplayer.Hardware == ETHER_TYPE) { - sprintf(temp, "%6D", bootplayer.CAddr, "-"); + sprintf(temp, "%6D", bootplayer.CAddr, ":"); setenv("pxeboot.hwaddr", temp, 1); } }