Skip to content

Commit

Permalink
[IPV4]: ipconfig.c: fix dhcp timeout behaviour
Browse files Browse the repository at this point in the history
I think there is a small bug in ipconfig.c in case IPCONFIG_DHCP is set
and dhcp is used.

When a DHCPOFFER is received, ip address is kept until we get DHCPACK.
If no ack is received, ic_dynamic() returns negatively, but leaves the
offered ip address in ic_myaddr.

This makes the main loop in ip_auto_config() break and uses the maybe
incomplete configuration.

Not sure if it's the best way to do, but the following trivial patch
correct this. 

Signed-off-by: Maxime Bizon <mbizon@freebox.fr>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Maxime Bizon authored and David S. Miller committed Jun 28, 2005
1 parent 2c2910a commit 7a1af5d
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion net/ipv4/ipconfig.c
Original file line number Diff line number Diff line change
Expand Up @@ -1149,8 +1149,10 @@ static int __init ic_dynamic(void)
ic_rarp_cleanup();
#endif

if (!ic_got_reply)
if (!ic_got_reply) {
ic_myaddr = INADDR_NONE;
return -1;
}

printk("IP-Config: Got %s answer from %u.%u.%u.%u, ",
((ic_got_reply & IC_RARP) ? "RARP"
Expand Down

0 comments on commit 7a1af5d

Please sign in to comment.