|
@@ -444,7 +444,8 @@ static void dhcp_discovery_expired ( struct dhcp_session *dhcp ) {
|
444
|
444
|
unsigned long elapsed = ( currticks() - dhcp->start );
|
445
|
445
|
|
446
|
446
|
/* If link is blocked, defer DHCP discovery (and reset timeout) */
|
447
|
|
- if ( netdev_link_blocked ( dhcp->netdev ) ) {
|
|
447
|
+ if ( netdev_link_blocked ( dhcp->netdev ) &&
|
|
448
|
+ ( dhcp->count <= DHCP_DISC_MAX_DEFERRALS ) ) {
|
448
|
449
|
DBGC ( dhcp, "DHCP %p deferring discovery\n", dhcp );
|
449
|
450
|
dhcp->start = currticks();
|
450
|
451
|
start_timer_fixed ( &dhcp->timer,
|
|
@@ -1115,7 +1116,7 @@ static int dhcp_tx ( struct dhcp_session *dhcp ) {
|
1115
|
1116
|
* session state into packet traces. Useful for extracting
|
1116
|
1117
|
* debug information from non-debug builds.
|
1117
|
1118
|
*/
|
1118
|
|
- dhcppkt.dhcphdr->secs = htons ( ( ++(dhcp->count) << 2 ) |
|
|
1119
|
+ dhcppkt.dhcphdr->secs = htons ( ( dhcp->count << 2 ) |
|
1119
|
1120
|
( dhcp->offer.s_addr ? 0x02 : 0 ) |
|
1120
|
1121
|
( dhcp->proxy_offer ? 0x01 : 0 ) );
|
1121
|
1122
|
|
|
@@ -1259,6 +1260,9 @@ static void dhcp_timer_expired ( struct retry_timer *timer, int fail ) {
|
1259
|
1260
|
return;
|
1260
|
1261
|
}
|
1261
|
1262
|
|
|
1263
|
+ /* Increment transmission counter */
|
|
1264
|
+ dhcp->count++;
|
|
1265
|
+
|
1262
|
1266
|
/* Handle timer expiry based on current state */
|
1263
|
1267
|
dhcp->state->expired ( dhcp );
|
1264
|
1268
|
}
|