diff -Nru ipxe-1.0.0+git-20161027.b991c67+really20150424.a25a16d/debian/changelog ipxe-1.0.0+git-20161027.b991c67+really20150424.a25a16d/debian/changelog --- ipxe-1.0.0+git-20161027.b991c67+really20150424.a25a16d/debian/changelog 2017-08-29 10:40:52.000000000 -0400 +++ ipxe-1.0.0+git-20161027.b991c67+really20150424.a25a16d/debian/changelog 2017-10-12 16:37:24.000000000 -0400 @@ -1,3 +1,9 @@ +ipxe (1.0.0+git-20161027.b991c67+really20150424.a25a16d-1ubuntu2) artful; urgency=medium + + * debian/patches/handle-dhcp-nack.patch: Handle DHCP NAK and send a re-discover. + + -- Andres Rodriguez Thu, 12 Oct 2017 16:25:52 -0400 + ipxe (1.0.0+git-20161027.b991c67+really20150424.a25a16d-1ubuntu1) artful; urgency=medium * Revert to the former git snapshot 20150424.a25a16d to fix changed diff -Nru ipxe-1.0.0+git-20161027.b991c67+really20150424.a25a16d/debian/patches/handle-dhcp-nack.patch ipxe-1.0.0+git-20161027.b991c67+really20150424.a25a16d/debian/patches/handle-dhcp-nack.patch --- ipxe-1.0.0+git-20161027.b991c67+really20150424.a25a16d/debian/patches/handle-dhcp-nack.patch 1969-12-31 19:00:00.000000000 -0500 +++ ipxe-1.0.0+git-20161027.b991c67+really20150424.a25a16d/debian/patches/handle-dhcp-nack.patch 2017-10-12 16:40:45.000000000 -0400 @@ -0,0 +1,41 @@ +Description: iPXE fails to handle DHCPNACK's + iPXE does not handle DHCPNACK's. If iPXE gets a DHCPNACK it will + not re-attempt to DHCPDISCOVER, which causes iPXE to fail to PXE + boot on situations where there are multiple DHCP servers are + offering an IP. +Author: Blake Rouse +Bug: https://bugs.launchpad.net/maas/+bug/1707999 + +Index: ipxe-1.0.0+git-20161027.b991c67+really20150424.a25a16d/src/net/udp/dhcp.c +=================================================================== +--- ipxe-1.0.0+git-20161027.b991c67+really20150424.a25a16d.orig/src/net/udp/dhcp.c 2017-10-12 16:38:21.527631622 -0400 ++++ ipxe-1.0.0+git-20161027.b991c67+really20150424.a25a16d/src/net/udp/dhcp.c 2017-10-12 16:38:21.523631288 -0400 +@@ -523,9 +523,18 @@ + DBGC ( dhcp, " for %s", inet_ntoa ( ip ) ); + DBGC ( dhcp, "\n" ); + +- /* Filter out unacceptable responses */ ++ /* Filter out invalid port */ + if ( peer->sin_port != htons ( BOOTPS_PORT ) ) + return; ++ ++ /* Handle DHCPNAK */ ++ if ( msgtype /* BOOTP */ && ( msgtype == DHCPNAK ) ) { ++ /* Go back to discover, again. */ ++ dhcp_set_state ( dhcp, &dhcp_state_discover ); ++ return; ++ } ++ ++ /* Filter out unacceptable responses */ + if ( msgtype /* BOOTP */ && ( msgtype != DHCPACK ) ) + return; + if ( server_id.s_addr != dhcp->server.s_addr ) +@@ -907,7 +916,7 @@ + /* Initialise DHCP packet structure */ + memset ( dhcppkt, 0, sizeof ( *dhcppkt ) ); + dhcppkt_init ( dhcppkt, data, max_len ); +- ++ + /* Set DHCP_MESSAGE_TYPE option */ + if ( ( rc = dhcppkt_store ( dhcppkt, DHCP_MESSAGE_TYPE, + &msgtype, sizeof ( msgtype ) ) ) != 0 ) diff -Nru ipxe-1.0.0+git-20161027.b991c67+really20150424.a25a16d/debian/patches/series ipxe-1.0.0+git-20161027.b991c67+really20150424.a25a16d/debian/patches/series --- ipxe-1.0.0+git-20161027.b991c67+really20150424.a25a16d/debian/patches/series 2017-08-29 10:40:52.000000000 -0400 +++ ipxe-1.0.0+git-20161027.b991c67+really20150424.a25a16d/debian/patches/series 2017-10-12 16:26:25.000000000 -0400 @@ -4,3 +4,4 @@ 0004-fix_no-pie_option.patch 0006-build-Fix-.ids.o-creation-for-drivers-not-in-the-all.patch 0007-build-Remove-nested-my-declaration.patch +handle-dhcp-nack.patch