summaryrefslogtreecommitdiff
path: root/nuttx/net/uip/uip_igmpleave.c
diff options
context:
space:
mode:
authorpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2010-07-10 19:47:37 +0000
committerpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2010-07-10 19:47:37 +0000
commit4f007a4360e1bf2879e39de021e81cb013c50466 (patch)
tree502477ef2ef13ee5af457368fd5a6b473067b228 /nuttx/net/uip/uip_igmpleave.c
parentc4680a4704fd377f4c89e0b8f6149f3aec8b39fb (diff)
downloadpx4-nuttx-4f007a4360e1bf2879e39de021e81cb013c50466.tar.gz
px4-nuttx-4f007a4360e1bf2879e39de021e81cb013c50466.tar.bz2
px4-nuttx-4f007a4360e1bf2879e39de021e81cb013c50466.zip
Add IGMP timer logic
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@2782 42af7a65-404d-4744-a932-0658087f49c3
Diffstat (limited to 'nuttx/net/uip/uip_igmpleave.c')
-rwxr-xr-xnuttx/net/uip/uip_igmpleave.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/nuttx/net/uip/uip_igmpleave.c b/nuttx/net/uip/uip_igmpleave.c
index 22775ede8..a220662fd 100755
--- a/nuttx/net/uip/uip_igmpleave.c
+++ b/nuttx/net/uip/uip_igmpleave.c
@@ -130,15 +130,25 @@
void igmp_leavegroup(struct uip_driver_s *dev, uip_ipaddr_t *grpaddr)
{
struct igmp_group_s *group;
+ irqstate_t flags;
/* Find the entry corresponding to the address leaving the group */
group = uip_grpfind(dev, grpaddr);
if (group)
{
- /* Cancel the timer */
+ /* Cancel the timer and discard any queued Membership Reports. Canceling
+ * the timer will prevent any new Membership Reports from being sent;
+ * clearing the flags will discard any pending Membership Reports that
+ * could interfere with the Leave Group.
+ */
+ flags = irqsave();
wd_cancel(group->wdog);
+ CLR_SCHEDMSG(group->flags);
+ CLR_WAITMSG(group->flags);
+ irqrestore(flags);
+
IGMP_STATINCR(uip_stat.igmp.leaves);
/* Send a leave if the flag is set according to the state diagram */