Changeset View
Changeset View
Standalone View
Standalone View
usr.sbin/rtsold/rtsol.c
Show First 20 Lines • Show All 73 Lines • ▼ Show 20 Lines | |||||
static void call_script(const char *const *, struct script_msg_head_t *); | static void call_script(const char *const *, struct script_msg_head_t *); | ||||
static size_t dname_labeldec(char *, size_t, const char *); | static size_t dname_labeldec(char *, size_t, const char *); | ||||
static struct ra_opt *find_raopt(struct rainfo *, int, void *, size_t); | static struct ra_opt *find_raopt(struct rainfo *, int, void *, size_t); | ||||
static int ra_opt_rdnss_dispatch(struct ifinfo *, struct rainfo *, | static int ra_opt_rdnss_dispatch(struct ifinfo *, struct rainfo *, | ||||
struct script_msg_head_t *, struct script_msg_head_t *); | struct script_msg_head_t *, struct script_msg_head_t *); | ||||
static char *make_rsid(const char *, const char *, struct rainfo *); | static char *make_rsid(const char *, const char *, struct rainfo *); | ||||
#define _ARGS_MANAGED managedconf_script, ifi->ifname | |||||
#define _ARGS_OTHER otherconf_script, ifi->ifname | #define _ARGS_OTHER otherconf_script, ifi->ifname | ||||
#define _ARGS_RESADD resolvconf_script, "-a", rsid | #define _ARGS_RESADD resolvconf_script, "-a", rsid | ||||
#define _ARGS_RESDEL resolvconf_script, "-d", rsid | #define _ARGS_RESDEL resolvconf_script, "-d", rsid | ||||
#define CALL_SCRIPT(name, sm_head) do { \ | #define CALL_SCRIPT(name, sm_head) do { \ | ||||
const char *const sarg[] = { _ARGS_##name, NULL }; \ | const char *const sarg[] = { _ARGS_##name, NULL }; \ | ||||
call_script(sarg, sm_head); \ | call_script(sarg, sm_head); \ | ||||
} while (0) | } while (0) | ||||
▲ Show 20 Lines • Show All 201 Lines • ▼ Show 20 Lines | rtsol_input(int sock) | ||||
nd_ra = (struct nd_router_advert *)icp; | nd_ra = (struct nd_router_advert *)icp; | ||||
/* | /* | ||||
* Process the "O bit." | * Process the "O bit." | ||||
* If the value of OtherConfigFlag changes from FALSE to TRUE, the | * If the value of OtherConfigFlag changes from FALSE to TRUE, the | ||||
* host should invoke the stateful autoconfiguration protocol, | * host should invoke the stateful autoconfiguration protocol, | ||||
* requesting information. | * requesting information. | ||||
* [RFC 2462 Section 5.5.3] | * [RFC 2462 Section 5.5.3] | ||||
*/ | */ | ||||
markj: Typo, "redundant." | |||||
if (((nd_ra->nd_ra_flags_reserved) & ND_RA_FLAG_OTHER) && | if (((nd_ra->nd_ra_flags_reserved) & ND_RA_FLAG_OTHER) && | ||||
!ifi->otherconfig) { | !ifi->otherconfig) { | ||||
warnmsg(LOG_DEBUG, __func__, | warnmsg(LOG_DEBUG, __func__, | ||||
"OtherConfigFlag on %s is turned on", ifi->ifname); | "OtherConfigFlag on %s is turned on", ifi->ifname); | ||||
ifi->otherconfig = 1; | ifi->otherconfig = 1; | ||||
CALL_SCRIPT(OTHER, NULL); | CALL_SCRIPT(OTHER, NULL); | ||||
} | |||||
/* | |||||
bzAuthorUnsubmitted Done Inline ActionsThis needs to move before the "O bit" handling and check before calling the script needs to move as well into the other block with the other variable. bz: This needs to move before the "O bit" handling and check before calling the script needs to… | |||||
* Process the "M bit." | |||||
Done Inline ActionsThere should be a newline before the comment. markj: There should be a newline before the comment. | |||||
* If the value of ManagedConfigFlag changes from FALSE to TRUE, the | |||||
* host should invoke the stateful autoconfiguration protocol, | |||||
* requesting information unless the "O bit" was set as well in | |||||
* which case the "M bit" is redundadant. | |||||
* [RFc4861 Section 4.2] | |||||
markjUnsubmitted Done Inline ActionsTypo, RFc markj: Typo, RFc | |||||
* XXX ??? [draft-ietf-v6ops-dhcpv6-slaac-problem-07] | |||||
*/ | |||||
if (((nd_ra->nd_ra_flags_reserved) & ND_RA_FLAG_MANAGED) && | |||||
!ifi->managedconfig) { | |||||
warnmsg(LOG_DEBUG, __func__, | |||||
"ManagedConfigFlag on %s is turned on", ifi->ifname); | |||||
ifi->managedconfig = 1; | |||||
if (!ifi->otherconfig) | |||||
CALL_SCRIPT(MANAGED, NULL); | |||||
} | } | ||||
clock_gettime(CLOCK_MONOTONIC_FAST, &now); | clock_gettime(CLOCK_MONOTONIC_FAST, &now); | ||||
newent_rai = 0; | newent_rai = 0; | ||||
rai = find_rainfo(ifi, &from); | rai = find_rainfo(ifi, &from); | ||||
if (rai == NULL) { | if (rai == NULL) { | ||||
ELM_MALLOC(rai, exit(1)); | ELM_MALLOC(rai, exit(1)); | ||||
rai->rai_ifinfo = ifi; | rai->rai_ifinfo = ifi; | ||||
TAILQ_INIT(&rai->rai_ra_opt); | TAILQ_INIT(&rai->rai_ra_opt); | ||||
▲ Show 20 Lines • Show All 451 Lines • Show Last 20 Lines |
Typo, "redundant."