diff options
author | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2010-07-10 17:02:52 +0000 |
---|---|---|
committer | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2010-07-10 17:02:52 +0000 |
commit | c4680a4704fd377f4c89e0b8f6149f3aec8b39fb (patch) | |
tree | 60fc2d19e0d4f1f306ac20f144da5fa493e96e31 /nuttx/net/uip/uip_igmppoll.c | |
parent | a87d861c4e0a60e1dc163f58c1b51eec13ababf3 (diff) | |
download | px4-nuttx-c4680a4704fd377f4c89e0b8f6149f3aec8b39fb.tar.gz px4-nuttx-c4680a4704fd377f4c89e0b8f6149f3aec8b39fb.tar.bz2 px4-nuttx-c4680a4704fd377f4c89e0b8f6149f3aec8b39fb.zip |
More IGMP logic
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@2781 42af7a65-404d-4744-a932-0658087f49c3
Diffstat (limited to 'nuttx/net/uip/uip_igmppoll.c')
-rwxr-xr-x | nuttx/net/uip/uip_igmppoll.c | 22 |
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);
+ }
}
/****************************************************************************
|