mirror of
https://github.com/lwip-tcpip/lwip.git
synced 2024-10-05 22:29:49 +00:00
nd6_input(): allow using NA without lladdr_opt for DAD
This commit is contained in:
parent
1a53c106e1
commit
d4fad5929c
@ -155,25 +155,6 @@ nd6_input(struct pbuf *p, struct netif *inp)
|
|||||||
* link-layer changed?
|
* link-layer changed?
|
||||||
* part of DAD mechanism? */
|
* part of DAD mechanism? */
|
||||||
|
|
||||||
/* Check that link-layer address option also fits in packet. */
|
|
||||||
if (p->len < (sizeof(struct na_header) + 2)) {
|
|
||||||
/* @todo debug message */
|
|
||||||
pbuf_free(p);
|
|
||||||
ND6_STATS_INC(nd6.lenerr);
|
|
||||||
ND6_STATS_INC(nd6.drop);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
lladdr_opt = (struct lladdr_option *)((u8_t*)p->payload + sizeof(struct na_header));
|
|
||||||
|
|
||||||
if (p->len < (sizeof(struct na_header) + (lladdr_opt->length << 3))) {
|
|
||||||
/* @todo debug message */
|
|
||||||
pbuf_free(p);
|
|
||||||
ND6_STATS_INC(nd6.lenerr);
|
|
||||||
ND6_STATS_INC(nd6.drop);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Create an aligned copy. */
|
/* Create an aligned copy. */
|
||||||
ip6_addr_set(&target_address, &(na_hdr->target_address));
|
ip6_addr_set(&target_address, &(na_hdr->target_address));
|
||||||
|
|
||||||
@ -209,6 +190,25 @@ nd6_input(struct pbuf *p, struct netif *inp)
|
|||||||
}
|
}
|
||||||
#endif /* LWIP_IPV6_DUP_DETECT_ATTEMPTS */
|
#endif /* LWIP_IPV6_DUP_DETECT_ATTEMPTS */
|
||||||
|
|
||||||
|
/* Check that link-layer address option also fits in packet. */
|
||||||
|
if (p->len < (sizeof(struct na_header) + 2)) {
|
||||||
|
/* @todo debug message */
|
||||||
|
pbuf_free(p);
|
||||||
|
ND6_STATS_INC(nd6.lenerr);
|
||||||
|
ND6_STATS_INC(nd6.drop);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
lladdr_opt = (struct lladdr_option *)((u8_t*)p->payload + sizeof(struct na_header));
|
||||||
|
|
||||||
|
if (p->len < (sizeof(struct na_header) + (lladdr_opt->length << 3))) {
|
||||||
|
/* @todo debug message */
|
||||||
|
pbuf_free(p);
|
||||||
|
ND6_STATS_INC(nd6.lenerr);
|
||||||
|
ND6_STATS_INC(nd6.drop);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
/* This is an unsolicited NA, most likely there was a LLADDR change. */
|
/* This is an unsolicited NA, most likely there was a LLADDR change. */
|
||||||
i = nd6_find_neighbor_cache_entry(&target_address);
|
i = nd6_find_neighbor_cache_entry(&target_address);
|
||||||
if (i >= 0) {
|
if (i >= 0) {
|
||||||
|
Loading…
Reference in New Issue
Block a user