diff options
author | Patrick Grimm <stargieg@gmail.com> | 2015-06-15 03:38:09 +0200 |
---|---|---|
committer | Patrick Grimm <stargieg@gmail.com> | 2015-06-15 03:38:09 +0200 |
commit | 9117bc46f629c515bc686c22a652c9074562b891 (patch) | |
tree | e98e1f09b6f9753916f0aace5de04460f8379489 | |
parent | 513951e56d71fded79b2e299e253f9b2154b9483 (diff) |
dhcpv4: return pointer
Signed-off-by: Patrick Grimm <patrick@lunatiki.de>
-rw-r--r-- | src/ubus.c | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -372,7 +372,7 @@ bool ubus_has_prefix(const char *name, const char *ifname) return false; } -struct in_addr ubus_get_address4(const char *name) +struct in_addr* ubus_get_address4(const char *name) { struct blob_attr *c, *cur; unsigned rem; @@ -397,7 +397,7 @@ struct in_addr ubus_get_address4(const char *name) blobmsg_for_each_attr(d, cur, drem) { struct blob_attr *addr[ADDR_ATTR_MAX]; blobmsg_parse(addr_attrs, ADDR_ATTR_MAX, addr, blobmsg_data(d), blobmsg_data_len(d)); - struct in_addr addr4; + struct in_addr *addr4; if (inet_pton(AF_INET, blobmsg_get_string(addr[ADDR_ATTR_ADDRESS]), &addr4) == 1) return addr4; } @@ -407,7 +407,7 @@ struct in_addr ubus_get_address4(const char *name) return NULL; } -struct in_addr ubus_get_mask4(const char *name) +struct in_addr* ubus_get_mask4(const char *name) { struct blob_attr *c, *cur; unsigned rem; @@ -432,7 +432,7 @@ struct in_addr ubus_get_mask4(const char *name) blobmsg_for_each_attr(d, cur, drem) { struct blob_attr *addr[ADDR_ATTR_MAX]; blobmsg_parse(addr_attrs, ADDR_ATTR_MAX, addr, blobmsg_data(d), blobmsg_data_len(d)); - struct in_addr addr4; + struct in_addr *addr4; if (inet_pton(AF_INET, blobmsg_get_string(addr[ADDR_ATTR_MASK]), &addr4) == 1) return addr4; } |