]> git.ipfire.org Git - thirdparty/dhcpcd.git/commitdiff
Add NETWORK= to dhcpcd-.info, bug #10
authorRoy Marples <roy@marples.name>
Fri, 25 Jan 2008 19:35:45 +0000 (19:35 +0000)
committerRoy Marples <roy@marples.name>
Fri, 25 Jan 2008 19:35:45 +0000 (19:35 +0000)
info.c

diff --git a/info.c b/info.c
index 41ce1e90b0eda259a6d90cd7aeee76ddd35fe1f3..95065523a48ba4e5897fa3452b4307e2e52cbda8 100644 (file)
--- a/info.c
+++ b/info.c
@@ -123,8 +123,11 @@ bool write_info(const interface_t *iface, const dhcp_t *dhcp,
        }
 
        if (dhcp->address.s_addr) {
+               struct in_addr n;
+               n.s_addr = dhcp->address.s_addr & dhcp->netmask.s_addr;
                fprintf (f, "IPADDR='%s'\n", inet_ntoa (dhcp->address));
                fprintf (f, "NETMASK='%s'\n", inet_ntoa (dhcp->netmask));
+               fprintf (f, "NETWORK='%s'\n", inet_ntoa (n));
                fprintf (f, "BROADCAST='%s'\n", inet_ntoa (dhcp->broadcast));
        }
        if (dhcp->mtu > 0)