|
@@ -832,9 +832,10 @@ static int dhcp_deliver_raw ( struct xfer_interface *xfer,
|
832
|
832
|
const struct dhcphdr *dhcphdr = data;
|
833
|
833
|
struct dhcp_option_block *options;
|
834
|
834
|
struct dhcp_option_block **store_options;
|
835
|
|
- int is_proxy;
|
836
|
835
|
unsigned int msgtype;
|
837
|
836
|
unsigned long elapsed;
|
|
837
|
+ int is_proxy;
|
|
838
|
+ int ignore_proxy;
|
838
|
839
|
|
839
|
840
|
/* Check for matching transaction ID */
|
840
|
841
|
if ( dhcphdr->xid != dhcp_xid ( dhcp->netdev ) ) {
|
|
@@ -878,17 +879,22 @@ static int dhcp_deliver_raw ( struct xfer_interface *xfer,
|
878
|
879
|
dhcpopt_put ( options );
|
879
|
880
|
}
|
880
|
881
|
|
|
882
|
+ /* If we don't yet have a standard DHCP response (i.e. one
|
|
883
|
+ * with an IP address), then just leave the timer running.
|
|
884
|
+ */
|
|
885
|
+ if ( ! dhcp->options )
|
|
886
|
+ goto out;
|
|
887
|
+
|
881
|
888
|
/* Handle DHCP response */
|
|
889
|
+ ignore_proxy = find_dhcp_num_option ( dhcp->options,
|
|
890
|
+ DHCP_EB_NO_PROXYDHCP );
|
882
|
891
|
switch ( dhcp->state ) {
|
883
|
892
|
case DHCPDISCOVER:
|
884
|
|
- /* If we have received a valid standard DHCP response
|
885
|
|
- * (i.e. one with an IP address), and we have allowed
|
886
|
|
- * sufficient time for ProxyDHCP reponses, then
|
887
|
|
- * transition to making the DHCPREQUEST.
|
|
893
|
+ /* If we have allowed sufficient time for ProxyDHCP
|
|
894
|
+ * reponses, then transition to making the DHCPREQUEST.
|
888
|
895
|
*/
|
889
|
896
|
elapsed = ( currticks() - dhcp->start );
|
890
|
|
- if ( dhcp->options &&
|
891
|
|
- ( elapsed > PROXYDHCP_WAIT_TIME ) ) {
|
|
897
|
+ if ( ignore_proxy || ( elapsed > PROXYDHCP_WAIT_TIME ) ) {
|
892
|
898
|
stop_timer ( &dhcp->timer );
|
893
|
899
|
dhcp->state = DHCPREQUEST;
|
894
|
900
|
dhcp_send_request ( dhcp );
|
|
@@ -896,9 +902,10 @@ static int dhcp_deliver_raw ( struct xfer_interface *xfer,
|
896
|
902
|
break;
|
897
|
903
|
case DHCPREQUEST:
|
898
|
904
|
/* DHCP finished; register options and exit */
|
899
|
|
- if ( dhcp->proxy_options )
|
|
905
|
+ if ( dhcp->proxy_options && ( ! ignore_proxy ) ) {
|
900
|
906
|
dhcp->register_options ( dhcp->netdev,
|
901
|
907
|
dhcp->proxy_options );
|
|
908
|
+ }
|
902
|
909
|
dhcp->register_options ( dhcp->netdev, dhcp->options );
|
903
|
910
|
dhcp_finished ( dhcp, 0 );
|
904
|
911
|
break;
|
|
@@ -906,6 +913,7 @@ static int dhcp_deliver_raw ( struct xfer_interface *xfer,
|
906
|
913
|
assert ( 0 );
|
907
|
914
|
}
|
908
|
915
|
|
|
916
|
+ out:
|
909
|
917
|
return 0;
|
910
|
918
|
|
911
|
919
|
out_discard:
|