projects
/
platform
/
upstream
/
connman.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
79ad46f
)
Fix netmask from prefix length string conversion
author
Marcel Holtmann
<marcel@holtmann.org>
Sun, 20 Dec 2009 18:39:53 +0000
(10:39 -0800)
committer
Marcel Holtmann
<marcel@holtmann.org>
Sun, 20 Dec 2009 18:39:53 +0000
(10:39 -0800)
src/ipconfig.c
patch
|
blob
|
history
diff --git
a/src/ipconfig.c
b/src/ipconfig.c
index
a8b15fa
..
3a73ecc
100644
(file)
--- a/
src/ipconfig.c
+++ b/
src/ipconfig.c
@@
-934,13
+934,15
@@
void __connman_ipconfig_append_ipv4(struct connman_ipconfig *ipconfig,
return;
if (ipconfig->system->local != NULL) {
+ in_addr_t addr;
struct in_addr netmask;
char *mask;
connman_dbus_dict_append_basic(iter, "Address",
DBUS_TYPE_STRING, &ipconfig->system->local);
- netmask.s_addr = ~0 << (32 - ipconfig->system->prefixlen);
+ addr = 0xffffffff << (32 - ipconfig->system->prefixlen);
+ netmask.s_addr = htonl(addr);
mask = inet_ntoa(netmask);
connman_dbus_dict_append_basic(iter, "Netmask",
DBUS_TYPE_STRING, &mask);