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;
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;
}
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;
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;
}