diff options
author | Maxime Bizon <mbizon@freebox.fr> | 2005-06-28 13:21:12 -0700 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2005-06-28 13:21:12 -0700 |
commit | 7a1af5d7bb94af16b980a53330436b9fadc12435 (patch) | |
tree | 30f61b21c9e80d22f59f76bc1224a42e6fc0fa4a /net | |
parent | 2c2910a401f1ce2ac9136171e7522e731e1a2a8c (diff) | |
download | linux-riscv-7a1af5d7bb94af16b980a53330436b9fadc12435.tar.gz linux-riscv-7a1af5d7bb94af16b980a53330436b9fadc12435.tar.bz2 linux-riscv-7a1af5d7bb94af16b980a53330436b9fadc12435.zip |
[IPV4]: ipconfig.c: fix dhcp timeout behaviour
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>
Diffstat (limited to 'net')
-rw-r--r-- | net/ipv4/ipconfig.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/net/ipv4/ipconfig.c b/net/ipv4/ipconfig.c index f2509034ce72..d2bf8e1930a3 100644 --- a/net/ipv4/ipconfig.c +++ b/net/ipv4/ipconfig.c @@ -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" |