diff mbox

libnet/Makefile: Define DHCPARCH in CFLAGS

Message ID 20170622191121.25959-1-muriloo@linux.vnet.ibm.com
State Superseded
Headers show

Commit Message

Murilo Opsfelder Araujo June 22, 2017, 7:11 p.m. UTC
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@linux.vnet.ibm.com>
---
 board-qemu/config   | 3 ++-
 lib/libnet/Makefile | 2 +-
 2 files changed, 3 insertions(+), 2 deletions(-)

Comments

Thomas Huth June 23, 2017, 6:33 a.m. UTC | #1
On 22.06.2017 21:11, Murilo Opsfelder Araujo wrote:
> 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.

Funnily, the original commit (37826933b20b0eddb84) that introduced the
code stated in the commit message: "Set the qemu-board DHCPARCH type to
0x0c which is the correct value for slof." - but it did not do that.
Looks like some hunks got lost there.

 Thomas
diff mbox

Patch

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