net: contiki: Add NULL check to neighbor polling
The function is getting called with NULL bufs, so uip_len cannot be called on them. The stack further down handles NULL buffers correctly. Jira: ZEP-474 Change-Id: I85fb045ec76bea2a83c64d0f72eabba4e661f5f4 Signed-off-by: Jaakko Hannikainen <jaakko.hannikainen@intel.com>
This commit is contained in:
parent
66f8e892de
commit
2652c0e5a9
1 changed files with 2 additions and 2 deletions
|
@ -273,7 +273,7 @@ uip_ds6_neighbor_periodic(struct net_buf *buf)
|
|||
case NBR_INCOMPLETE:
|
||||
if(nbr->nscount >= UIP_ND6_MAX_MULTICAST_SOLICIT) {
|
||||
uip_ds6_nbr_rm(nbr);
|
||||
} else if(stimer_expired(&nbr->sendns) && (uip_len(buf) == 0)) {
|
||||
} else if(stimer_expired(&nbr->sendns) && (!buf || uip_len(buf) == 0)) {
|
||||
nbr->nscount++;
|
||||
PRINTF("NBR_INCOMPLETE: NS %u\n", nbr->nscount);
|
||||
uip_nd6_ns_output(buf, NULL, NULL, &nbr->ipaddr);
|
||||
|
@ -298,7 +298,7 @@ uip_ds6_neighbor_periodic(struct net_buf *buf)
|
|||
}
|
||||
}
|
||||
uip_ds6_nbr_rm(nbr);
|
||||
} else if(stimer_expired(&nbr->sendns) && (uip_len(buf) == 0)) {
|
||||
} else if(stimer_expired(&nbr->sendns) && (!buf || uip_len(buf) == 0)) {
|
||||
nbr->nscount++;
|
||||
PRINTF("PROBE: NS %u\n", nbr->nscount);
|
||||
uip_nd6_ns_output(buf, NULL, &nbr->ipaddr, &nbr->ipaddr);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue