diff options
author | Hans Dedecker <dedeckeh@gmail.com> | 2016-12-28 10:57:30 +0100 |
---|---|---|
committer | Hans Dedecker <dedeckeh@gmail.com> | 2016-12-28 23:53:32 +0100 |
commit | 700f5abbeff4e3dcc0f6b12d4883315e2cfb9b74 (patch) | |
tree | c4c3bdc47b6ffe7d725d9fcfb51fd32ef6d22508 /src/dhcpv6-ia.c | |
parent | 4c89614ccf5d72ee0c0824e5050a8814748a32c3 (diff) |
dhcpv4: fix DHCPv4 hostname handling
Fix hostname not being reported as "-" in the DHCP statefile in case
no hostname is reported by the DHCPv4 client
(https://:wqgithub.com/openwrt/odhcpd/issues/94)
Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
Diffstat (limited to 'src/dhcpv6-ia.c')
-rw-r--r-- | src/dhcpv6-ia.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/dhcpv6-ia.c b/src/dhcpv6-ia.c index a7146a7..b0a0ada 100644 --- a/src/dhcpv6-ia.c +++ b/src/dhcpv6-ia.c @@ -1,5 +1,6 @@ /** * Copyright (C) 2013 Steven Barth <steven@midlink.org> + * Copyright (C) 2016 Hans Dedecker <dedeckeh@gmail.com> * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License v2 as published by @@ -324,7 +325,7 @@ void dhcpv6_write_statefile(void) struct in_addr addr = {htonl(c->addr)}; inet_ntop(AF_INET, &addr, ipbuf, sizeof(ipbuf) - 1); - if (c->hostname[0]) { + if (c->hostname) { fputs(ipbuf, fp); char b[256]; |