summaryrefslogtreecommitdiff
path: root/nuttx/net/uip/uip_igmppoll.c
diff options
context:
space:
mode:
Diffstat (limited to 'nuttx/net/uip/uip_igmppoll.c')
-rwxr-xr-xnuttx/net/uip/uip_igmppoll.c22
1 files changed, 18 insertions, 4 deletions
diff --git a/nuttx/net/uip/uip_igmppoll.c b/nuttx/net/uip/uip_igmppoll.c
index 7ba4b50a0..5d74732fa 100755
--- a/nuttx/net/uip/uip_igmppoll.c
+++ b/nuttx/net/uip/uip_igmppoll.c
@@ -1,7 +1,5 @@
/****************************************************************************
- * net/uip/uip-igmp.h
- * The definitions in this header file are intended only for internal use
- * by the NuttX port of the uIP stack.
+ * net/uip/uip_igmppoll.c
*
* Copyright (C) 2010 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <spudmonkey@racsa.co.cr>
@@ -85,7 +83,9 @@ static inline void uip_schedsend(FAR struct uip_driver_s *dev, FAR struct igmp_g
{
uip_ipaddr_t *dest;
- /* IGMP header + IP header + 8 bytes of data */
+ /* Check what kind of messsage we need to send. There are only two
+ * possibilities:
+ */
if (group->msgid == IGMPv2_MEMBERSHIP_REPORT)
{
@@ -104,7 +104,21 @@ static inline void uip_schedsend(FAR struct uip_driver_s *dev, FAR struct igmp_g
uiphdr_ipaddr_copy(IGMPBUF->grpaddr, &group->grpaddr);
}
+ /* Send the message */
+
uip_igmpsend(dev, dest);
+
+ /* Indicate that the message has been sent */
+
+ CLR_SCHEDMSG(group->flags);
+ group->msgid = 0;
+
+ /* If there is a thread waiting fore the message to be sent, wake it up */
+
+ if (IS_WAITMSG(group->flags))
+ {
+ sem_post(&group->sem);
+ }
}
/****************************************************************************