diff options
author | Mohamed Abbas <mohamed.abbas@intel.com> | 2009-10-08 11:49:12 -0700 |
---|---|---|
committer | Marcel Holtmann <marcel@holtmann.org> | 2009-11-03 15:54:53 +0900 |
commit | a7dc6ca9d024e6312229726563c1d6cde4702253 (patch) | |
tree | 3f91e2910d752a282f7bc3c28b4b5034b52fc34d /src/ipv4.c | |
parent | b75d33dc08da8b85f117c004768d346616e17352 (diff) | |
download | connman-a7dc6ca9d024e6312229726563c1d6cde4702253.tar.gz connman-a7dc6ca9d024e6312229726563c1d6cde4702253.tar.bz2 connman-a7dc6ca9d024e6312229726563c1d6cde4702253.zip |
Fix issue when no broadcast address is given
Diffstat (limited to 'src/ipv4.c')
-rw-r--r-- | src/ipv4.c | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -199,7 +199,10 @@ static int ipv4_probe(struct connman_element *element) memset(&ipv4, 0, sizeof(ipv4)); ipv4.address.s_addr = inet_addr(address); ipv4.netmask.s_addr = inet_addr(netmask); - ipv4.broadcast.s_addr = inet_addr(broadcast); + if (broadcast) + ipv4.broadcast.s_addr = inet_addr(broadcast); + else + ipv4.broadcast.s_addr = ipv4.address.s_addr | ~ipv4.netmask.s_addr; set_ipv4(element, &ipv4, nameserver); |