summaryrefslogtreecommitdiffhomepage
path: root/src/odhcpd.c
diff options
context:
space:
mode:
authorSteven Barth <steven@midlink.org>2013-12-02 14:16:09 +0100
committerSteven Barth <steven@midlink.org>2013-12-02 14:16:09 +0100
commitd02dc222e61e2464bf850a629030c8a8b9b57ee8 (patch)
tree7f7164151f58e9b88b3e489ea30c731526f058a6 /src/odhcpd.c
parent16cee36ff3cf1895f87368709dabd3ffd5f24e4f (diff)
Initial prefix class support
Diffstat (limited to 'src/odhcpd.c')
-rw-r--r--src/odhcpd.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/odhcpd.c b/src/odhcpd.c
index 2859907..5a800b7 100644
--- a/src/odhcpd.c
+++ b/src/odhcpd.c
@@ -240,6 +240,15 @@ ssize_t odhcpd_get_interface_addresses(int ifindex,
if (ifa->ifa_flags & IFA_F_DEPRECATED)
addrs[ret].preferred = 0;
+ addrs[ret].has_class = false;
+ addrs[ret].class = 0;
+#ifdef WITH_UBUS
+ struct interface *iface = odhcpd_get_interface_by_index(ifindex);
+ if (iface) {
+ addrs[ret].has_class = true;
+ addrs[ret].class = ubus_get_class(iface->ifname, &addrs[ret].addr);
+ }
+#endif
++ret;
}