diff options
author | Hans Dedecker <dedeckeh@gmail.com> | 2019-05-17 21:29:25 +0200 |
---|---|---|
committer | Hans Dedecker <dedeckeh@gmail.com> | 2019-05-17 21:29:25 +0200 |
commit | d11180932b2fb8784aaad0830c032e42b8bb64ac (patch) | |
tree | 0f0cc379a264e7bb2c903067785f0d16069ab19a /src/router.c | |
parent | 41a74cba1bec349d1e1c5be4442e7fddb2d4adf7 (diff) |
router: make RA flags configurable (FS#2019)
Replace the config option ra_management by the config options ra_flags
and ra_slaac. The latter allows to configure the autonomous-address
config flag used for stateless address configuration while the former
allows to configure the RA flags in the form of a list.
The list can hold the following values :
managed-config
other-config
home-agent
none
Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
Diffstat (limited to 'src/router.c')
-rw-r--r-- | src/router.c | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/src/router.c b/src/router.c index 63571a3..5032428 100644 --- a/src/router.c +++ b/src/router.c @@ -436,12 +436,7 @@ static int send_router_advert(struct interface *iface, const struct in6_addr *fr if (hlim > 0) adv.h.nd_ra_curhoplimit = hlim; - if (iface->dhcpv6 != MODE_DISABLED) { - adv.h.nd_ra_flags_reserved = ND_RA_FLAG_OTHER; - - if (iface->ra_managed >= RA_MANAGED_MFLAG) - adv.h.nd_ra_flags_reserved |= ND_RA_FLAG_MANAGED; - } + adv.h.nd_ra_flags_reserved = iface->ra_flags; if (iface->route_preference < 0) adv.h.nd_ra_flags_reserved |= ND_RA_PREF_LOW; @@ -558,7 +553,7 @@ static int send_router_advert(struct interface *iface, const struct in6_addr *fr 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->ra_managed < RA_MANAGED_NO_AFLAG && addr->prefix <= 64) + if (iface->ra_slaac && 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; |