updated more nbr_add calls
This commit is contained in:
parent
444015df67
commit
4246a8fbe6
@ -644,7 +644,7 @@ tcpip_ipv6_output(void)
|
|||||||
nbr = uip_ds6_nbr_lookup(nexthop);
|
nbr = uip_ds6_nbr_lookup(nexthop);
|
||||||
if(nbr == NULL) {
|
if(nbr == NULL) {
|
||||||
#if UIP_ND6_SEND_NA
|
#if UIP_ND6_SEND_NA
|
||||||
if((nbr = uip_ds6_nbr_add(nexthop, NULL, 0, NBR_INCOMPLETE)) == NULL) {
|
if((nbr = uip_ds6_nbr_add(nexthop, NULL, 0, NBR_INCOMPLETE, NBR_TABLE_REASON_IPV6_ND, NULL)) == NULL) {
|
||||||
uip_clear_buf();
|
uip_clear_buf();
|
||||||
return;
|
return;
|
||||||
} else {
|
} else {
|
||||||
|
@ -201,9 +201,8 @@ ns_input(void)
|
|||||||
#endif /*UIP_CONF_IPV6_CHECKS */
|
#endif /*UIP_CONF_IPV6_CHECKS */
|
||||||
nbr = uip_ds6_nbr_lookup(&UIP_IP_BUF->srcipaddr);
|
nbr = uip_ds6_nbr_lookup(&UIP_IP_BUF->srcipaddr);
|
||||||
if(nbr == NULL) {
|
if(nbr == NULL) {
|
||||||
uip_lladdr_t lladdr_aligned;
|
uip_ds6_nbr_add(&UIP_IP_BUF->srcipaddr, &lladdr_aligned,
|
||||||
extract_lladdr_aligned(&lladdr_aligned);
|
0, NBR_STALE, NBR_TABLE_REASON_IPV6_ND, NULL);
|
||||||
uip_ds6_nbr_add(&UIP_IP_BUF->srcipaddr, &lladdr_aligned, 0, NBR_STALE);
|
|
||||||
} else {
|
} else {
|
||||||
uip_lladdr_t *lladdr = (uip_lladdr_t *)uip_ds6_nbr_get_ll(nbr);
|
uip_lladdr_t *lladdr = (uip_lladdr_t *)uip_ds6_nbr_get_ll(nbr);
|
||||||
if(memcmp(&nd6_opt_llao[UIP_ND6_OPT_DATA_OFFSET],
|
if(memcmp(&nd6_opt_llao[UIP_ND6_OPT_DATA_OFFSET],
|
||||||
@ -634,14 +633,17 @@ rs_input(void)
|
|||||||
extract_lladdr_aligned(&lladdr_aligned);
|
extract_lladdr_aligned(&lladdr_aligned);
|
||||||
if((nbr = uip_ds6_nbr_lookup(&UIP_IP_BUF->srcipaddr)) == NULL) {
|
if((nbr = uip_ds6_nbr_lookup(&UIP_IP_BUF->srcipaddr)) == NULL) {
|
||||||
/* we need to add the neighbor */
|
/* we need to add the neighbor */
|
||||||
uip_ds6_nbr_add(&UIP_IP_BUF->srcipaddr, &lladdr_aligned, 0, NBR_STALE);
|
uip_ds6_nbr_add(&UIP_IP_BUF->srcipaddr, &lladdr_aligned,
|
||||||
|
0, NBR_STALE, NBR_TABLE_REASON_IPV6_ND, NULL);
|
||||||
} else {
|
} else {
|
||||||
/* If LL address changed, set neighbor state to stale */
|
/* If LL address changed, set neighbor state to stale */
|
||||||
if(memcmp(&nd6_opt_llao[UIP_ND6_OPT_DATA_OFFSET],
|
if(memcmp(&nd6_opt_llao[UIP_ND6_OPT_DATA_OFFSET],
|
||||||
uip_ds6_nbr_get_ll(nbr), UIP_LLADDR_LEN) != 0) {
|
uip_ds6_nbr_get_ll(nbr), UIP_LLADDR_LEN) != 0) {
|
||||||
uip_ds6_nbr_t nbr_data = *nbr;
|
uip_ds6_nbr_t nbr_data = *nbr;
|
||||||
uip_ds6_nbr_rm(nbr);
|
uip_ds6_nbr_rm(nbr);
|
||||||
nbr = uip_ds6_nbr_add(&UIP_IP_BUF->srcipaddr, &lladdr_aligned, 0, NBR_STALE);
|
nbr = uip_ds6_nbr_add(&UIP_IP_BUF->srcipaddr, &lladdr_aligned,
|
||||||
|
nbr = uip_ds6_nbr_add(&UIP_IP_BUF->srcipaddr, 0, NBR_STALE,
|
||||||
|
NBR_TABLE_REASON_IPV6_ND, NULL);
|
||||||
nbr->reachable = nbr_data.reachable;
|
nbr->reachable = nbr_data.reachable;
|
||||||
nbr->sendns = nbr_data.sendns;
|
nbr->sendns = nbr_data.sendns;
|
||||||
nbr->nscount = nbr_data.nscount;
|
nbr->nscount = nbr_data.nscount;
|
||||||
@ -870,7 +872,8 @@ ra_input(void)
|
|||||||
if(nbr == NULL) {
|
if(nbr == NULL) {
|
||||||
uip_lladdr_t lladdr_aligned;
|
uip_lladdr_t lladdr_aligned;
|
||||||
extract_lladdr_aligned(&lladdr_aligned);
|
extract_lladdr_aligned(&lladdr_aligned);
|
||||||
nbr = uip_ds6_nbr_add(&UIP_IP_BUF->srcipaddr, &lladdr_aligned, 1, NBR_STALE);
|
nbr = uip_ds6_nbr_add(&UIP_IP_BUF->srcipaddr, &lladdr_aligned, 1,
|
||||||
|
NBR_STALE, NBR_TABLE_REASON_IPV6_ND, NULL);
|
||||||
} else {
|
} else {
|
||||||
uip_lladdr_t *lladdr = (uip_lladdr_t *)uip_ds6_nbr_get_ll(nbr);
|
uip_lladdr_t *lladdr = (uip_lladdr_t *)uip_ds6_nbr_get_ll(nbr);
|
||||||
if(nbr->state == NBR_INCOMPLETE) {
|
if(nbr->state == NBR_INCOMPLETE) {
|
||||||
|
Loading…
Reference in New Issue
Block a user