mirror of
https://github.com/oliverschmidt/contiki.git
synced 2024-11-03 22:06:22 +00:00
Send an announcement packet only if there are more than zero announcemnets
This commit is contained in:
parent
7da12552cd
commit
c791d851bb
@ -33,7 +33,7 @@
|
|||||||
*
|
*
|
||||||
* This file is part of the Contiki operating system.
|
* 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,7 +108,10 @@ send_adv(clock_time_t interval)
|
|||||||
PRINTF("%d.%d: sending neighbor advertisement with %d announcements\n",
|
PRINTF("%d.%d: sending neighbor advertisement with %d announcements\n",
|
||||||
rimeaddr_node_addr.u8[0], rimeaddr_node_addr.u8[1], adata->num);
|
rimeaddr_node_addr.u8[0], rimeaddr_node_addr.u8[1], adata->num);
|
||||||
|
|
||||||
ipolite_send(&c.c, interval, packetbuf_datalen());
|
if(adata->num > 0) {
|
||||||
|
/* Send the packet if it contains more than one announcement. */
|
||||||
|
ipolite_send(&c.c, interval, packetbuf_datalen());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
/*---------------------------------------------------------------------------*/
|
/*---------------------------------------------------------------------------*/
|
||||||
static void
|
static void
|
||||||
|
Loading…
Reference in New Issue
Block a user