summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMohamed Abbas <mohamed.abbas@intel.com>2009-10-08 11:49:12 -0700
committerMarcel Holtmann <marcel@holtmann.org>2009-11-03 15:54:53 +0900
commita7dc6ca9d024e6312229726563c1d6cde4702253 (patch)
tree3f91e2910d752a282f7bc3c28b4b5034b52fc34d
parentb75d33dc08da8b85f117c004768d346616e17352 (diff)
downloadconnman-a7dc6ca9d024e6312229726563c1d6cde4702253.tar.gz
connman-a7dc6ca9d024e6312229726563c1d6cde4702253.tar.bz2
connman-a7dc6ca9d024e6312229726563c1d6cde4702253.zip
Fix issue when no broadcast address is given
-rw-r--r--src/ipv4.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/ipv4.c b/src/ipv4.c
index 4ef6b875..b98d3022 100644
--- a/src/ipv4.c
+++ b/src/ipv4.c
@@ -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);