Send an announcement packet only if there are more than zero announcemnets
This commit is contained in:
parent
7da12552cd
commit
c791d851bb
1 changed files with 5 additions and 2 deletions
|
@ -33,7 +33,7 @@
|
|||
*
|
||||
* This file is part of the Contiki operating system.
|
||||
*
|
||||
* $Id: polite-announcement.c,v 1.2 2009/03/12 21:58:21 adamdunkels Exp $
|
||||
* $Id: polite-announcement.c,v 1.3 2009/03/23 16:19:03 adamdunkels Exp $
|
||||
*/
|
||||
|
||||
/**
|
||||
|
@ -108,8 +108,11 @@ send_adv(clock_time_t interval)
|
|||
PRINTF("%d.%d: sending neighbor advertisement with %d announcements\n",
|
||||
rimeaddr_node_addr.u8[0], rimeaddr_node_addr.u8[1], adata->num);
|
||||
|
||||
if(adata->num > 0) {
|
||||
/* Send the packet if it contains more than one announcement. */
|
||||
ipolite_send(&c.c, interval, packetbuf_datalen());
|
||||
}
|
||||
}
|
||||
/*---------------------------------------------------------------------------*/
|
||||
static void
|
||||
adv_packet_received(struct ipolite_conn *ipolite, rimeaddr_t *from)
|
||||
|
|
Loading…
Reference in a new issue