enum NDiscState {
NDISC_STATE_IDLE,
NDISC_STATE_SOLICITATION_SENT,
- NDISC_STATE_ADVERTISMENT_LISTEN,
+ NDISC_STATE_ADVERTISEMENT_LISTEN,
_NDISC_STATE_MAX,
_NDISC_STATE_INVALID = -1,
};
if (r != -EADDRNOTAVAIL)
return r;
- /* if router advertisment prefix valid timeout is zero, the timeout
+ /* if router advertisement prefix valid timeout is zero, the timeout
callback will be called immediately to clean up the prefix */
r = ndisc_prefix_new(nd, &prefix);
return 0;
}
-static int ndisc_router_advertisment_recv(sd_event_source *s, int fd, uint32_t revents, void *userdata) {
+static int ndisc_router_advertisement_recv(sd_event_source *s, int fd, uint32_t revents, void *userdata) {
_cleanup_free_ struct nd_router_advert *ra = NULL;
sd_ndisc *nd = userdata;
union {
nd->timeout = sd_event_source_unref(nd->timeout);
- nd->state = NDISC_STATE_ADVERTISMENT_LISTEN;
+ nd->state = NDISC_STATE_ADVERTISEMENT_LISTEN;
stateful = ra->nd_ra_flags_reserved & (ND_RA_FLAG_MANAGED | ND_RA_FLAG_OTHER);
pref = (ra->nd_ra_flags_reserved & ND_RA_FLAG_PREF) >> 3;
if (nd->nd_sent >= NDISC_MAX_ROUTER_SOLICITATIONS) {
if (nd->callback)
nd->callback(nd, SD_NDISC_EVENT_TIMEOUT, nd->userdata);
- nd->state = NDISC_STATE_ADVERTISMENT_LISTEN;
+ nd->state = NDISC_STATE_ADVERTISEMENT_LISTEN;
} else {
r = icmp6_send_router_solicitation(nd->fd, &nd->mac_addr);
if (r < 0)
nd->fd = r;
- r = sd_event_add_io(nd->event, &nd->recv, nd->fd, EPOLLIN, ndisc_router_advertisment_recv, nd);
+ r = sd_event_add_io(nd->event, &nd->recv, nd->fd, EPOLLIN, ndisc_router_advertisement_recv, nd);
if (r < 0)
goto fail;