[SLOF] [PATCH] libnet/Makefile: Define DHCPARCH in CFLAGS

Murilo Opsfelder Araujo muriloo at linux.vnet.ibm.com
Fri Jun 23 05:11:21 AEST 2017


Some applications, e.g. https://maas.io/, trust on the dhcp code 93
option to reply the correct pxelinux.0 file according to client
architecture.

Today, dhcp.c is compiled without DHCPARCH, which causes it not to
send client architecture in the dhcp request, i.e. dhcpd server can
reply a pxelinux.0 binary that is not intended for client
architecture.

This patch makes sure client architecture is sent in the dhcp request.

Signed-off-by: Murilo Opsfelder Araujo <muriloo at linux.vnet.ibm.com>
---
 board-qemu/config   | 3 ++-
 lib/libnet/Makefile | 2 +-
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/board-qemu/config b/board-qemu/config
index f194091..7307c4a 100644
--- a/board-qemu/config
+++ b/board-qemu/config
@@ -1,7 +1,8 @@
 BOARD=qemu
 TARG=ppc64
-export FLAG="-DRTAS_NVRAM -DBROKEN_SC1 -DDHCPARCH=0x0C "
+export FLAG="-DRTAS_NVRAM -DBROKEN_SC1"
 export CPUARCH=ppcp7
 export CPUARCHDEF=-DCPU_PPCP7
+export DHCPARCH=-DDHCPARCH=0x0C
 #export SNK_BIOSEMU_APPS=1
 FLASH_SIZE=8388608
diff --git a/lib/libnet/Makefile b/lib/libnet/Makefile
index 83ac1e5..33fc66e 100644
--- a/lib/libnet/Makefile
+++ b/lib/libnet/Makefile
@@ -16,7 +16,7 @@ ifndef TOP
 endif
 include $(TOP)/make.rules
 
-CFLAGS += -I. -I.. -I../libc/include -I$(TOP)/include
+CFLAGS += -I. -I.. -I../libc/include -I$(TOP)/include $(DHCPARCH)
 
 SRCS =	ethernet.c ipv4.c udp.c tcp.c dns.c bootp.c dhcp.c tftp.c \
 	ipv6.c dhcpv6.c icmpv6.c ndp.c netload.c ping.c args.c
-- 
2.9.4



More information about the SLOF mailing list