From d02dc222e61e2464bf850a629030c8a8b9b57ee8 Mon Sep 17 00:00:00 2001 From: Steven Barth Date: Mon, 2 Dec 2013 14:16:09 +0100 Subject: Initial prefix class support --- src/odhcpd.c | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src/odhcpd.c') 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; } -- cgit v1.2.3