summaryrefslogtreecommitdiff
path: root/nuttx/net/uip/uip_igmpjoin.c
diff options
context:
space:
mode:
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 */