static void set_interface_defaults(struct interface *iface)
{
- iface->managed = 1;
+ iface->ra_managed = RA_MANAGED_MFLAG;
iface->learn_routes = 1;
iface->dhcpv4_leasetime = 43200;
iface->ra_maxinterval = 600;
iface->default_router = blobmsg_get_u32(c);
if ((c = tb[IFACE_ATTR_RA_MANAGEMENT]))
- iface->managed = blobmsg_get_u32(c);
+ iface->ra_managed = blobmsg_get_u32(c);
if ((c = tb[IFACE_ATTR_RA_REACHABLETIME])) {
uint32_t ra_reachabletime = blobmsg_get_u32(c);
#include <libubox/usock.h>
#define ADDR_ENTRY_VALID_IA_ADDR(iface, i, m, addrs) \
- ((iface)->managed == RELAYD_MANAGED_NO_AFLAG || (i) == (m) || \
+ ((iface)->ra_managed == RA_MANAGED_NO_AFLAG || (i) == (m) || \
(addrs)[(i)].prefix > 64)
static void free_dhcpv6_assignment(struct dhcpv6_assignment *c);
&iface->ia_assignments, struct dhcpv6_assignment, head);
list_for_each_entry(c, &iface->ia_assignments, head)
- if (c != border && !iface->managed && (c->flags & OAF_BOUND))
+ if (c != border && iface->ra_managed == RA_MANAGED_NO_MFLAG
+ && (c->flags & OAF_BOUND))
apply_lease(iface, c, false);
}
// RA
int learn_routes;
int default_router;
- int managed;
+ int ra_managed;
int route_preference;
int ra_maxinterval;
int ra_mininterval;
extern struct list_head interfaces;
-#define RELAYD_MANAGED_MFLAG 1
-#define RELAYD_MANAGED_NO_AFLAG 2
+#define RA_MANAGED_NO_MFLAG 0
+#define RA_MANAGED_MFLAG 1
+#define RA_MANAGED_NO_AFLAG 2
// Exported main functions
if (iface->dhcpv6)
adv.h.nd_ra_flags_reserved = ND_RA_FLAG_OTHER;
- if (iface->managed >= RELAYD_MANAGED_MFLAG)
+ if (iface->ra_managed >= RA_MANAGED_MFLAG)
adv.h.nd_ra_flags_reserved |= ND_RA_FLAG_MANAGED;
if (iface->route_preference < 0)
p->nd_opt_pi_flags_reserved = 0;
if (!iface->ra_not_onlink)
p->nd_opt_pi_flags_reserved |= ND_OPT_PI_FLAG_ONLINK;
- if (iface->managed < RELAYD_MANAGED_NO_AFLAG && addr->prefix <= 64)
+ if (iface->ra_managed < RA_MANAGED_NO_AFLAG && addr->prefix <= 64)
p->nd_opt_pi_flags_reserved |= ND_OPT_PI_FLAG_AUTO;
if (iface->ra_advrouter)
p->nd_opt_pi_flags_reserved |= ND_OPT_PI_FLAG_RADDR;