summaryrefslogtreecommitdiff
path: root/nuttx/net/uip/uip_igmpjoin.c
diff options
context:
space:
mode:
authorpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2010-07-11 18:10:22 +0000
committerpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2010-07-11 18:10:22 +0000
commite58cb9f47ccff39c084944ea3e5c1154325b6ef1 (patch)
tree7d8c91af166541c11753f1b8b3ef847edf7c48a8 /nuttx/net/uip/uip_igmpjoin.c
parent701cde95d29fbb7dd75e42b0cd37fc3434c6fd88 (diff)
downloadpx4-nuttx-e58cb9f47ccff39c084944ea3e5c1154325b6ef1.tar.gz
px4-nuttx-e58cb9f47ccff39c084944ea3e5c1154325b6ef1.tar.bz2
px4-nuttx-e58cb9f47ccff39c084944ea3e5c1154325b6ef1.zip
Add IGMP user interface
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@2786 42af7a65-404d-4744-a932-0658087f49c3
Diffstat (limited to 'nuttx/net/uip/uip_igmpjoin.c')
-rwxr-xr-xnuttx/net/uip/uip_igmpjoin.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/nuttx/net/uip/uip_igmpjoin.c b/nuttx/net/uip/uip_igmpjoin.c
index b644cad10..cf37ea1c0 100755
--- a/nuttx/net/uip/uip_igmpjoin.c
+++ b/nuttx/net/uip/uip_igmpjoin.c
@@ -120,19 +120,21 @@
*
****************************************************************************/
-void igmp_joingroup(struct uip_driver_s *dev, uip_ipaddr_t *grpaddr)
+int igmp_joingroup(struct uip_driver_s *dev, FAR const struct in_addr *grpaddr)
{
struct igmp_group_s *group;
+ DEBUGASSERT(dev && grpaddr);
+
/* Check if a this address is already in the group */
- group = uip_grpfind(dev, grpaddr);
+ group = uip_grpfind(dev, &grpaddr->s_addr);
if (!group)
{
/* No... allocate a new entry */
nvdbg("Join to new group\n");
- group = uip_grpalloc(dev, grpaddr);
+ group = uip_grpalloc(dev, &grpaddr->s_addr);
IGMP_STATINCR(uip_stat.igmp.joins);
/* Send the Membership Report */
@@ -146,8 +148,10 @@ void igmp_joingroup(struct uip_driver_s *dev, uip_ipaddr_t *grpaddr)
/* Add the group (MAC) address to the ether drivers MAC filter list */
- uip_addmcastmac(dev, grpaddr);
+ uip_addmcastmac(dev, &grpaddr->s_addr);
+ return OK;
}
+ return -EEXIST;
}
#endif /* CONFIG_NET_IGMP */