summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGregory Nutt <gnutt@nuttx.org>2014-03-24 09:34:17 -0600
committerGregory Nutt <gnutt@nuttx.org>2014-03-24 09:34:17 -0600
commit9c43f66fc25286196f9ce520489b80c891e9199a (patch)
tree6ac1e3f065bc629bdaf09febdec5d6efe687ede1
parent9c5218976bd64888b9aeaabd5ca2e91af9b93bd0 (diff)
downloadnuttx-9c43f66fc25286196f9ce520489b80c891e9199a.tar.gz
nuttx-9c43f66fc25286196f9ce520489b80c891e9199a.tar.bz2
nuttx-9c43f66fc25286196f9ce520489b80c891e9199a.zip
net/: IGMP-related bugfixes from Manuel Stühn
-rw-r--r--nuttx/ChangeLog2
-rw-r--r--nuttx/net/netdev_ioctl.c4
-rw-r--r--nuttx/net/uip/uip_input.c13
3 files changed, 14 insertions, 5 deletions
diff --git a/nuttx/ChangeLog b/nuttx/ChangeLog
index bfeb48fa8..12847c9d7 100644
--- a/nuttx/ChangeLog
+++ b/nuttx/ChangeLog
@@ -7025,3 +7025,5 @@
NSH console (2014-3-22).
* arch/arm/src/stm32/stm32_eth.c: Add IGMP hashing support. From
Manuel Stühn (2014-3-24).
+ * net/netdev_ioctl.c and uip/uip_input.c: IGMP-related bug fixes
+ from Manuel Stühn (2014-3-24).
diff --git a/nuttx/net/netdev_ioctl.c b/nuttx/net/netdev_ioctl.c
index a8394edb2..c37c04611 100644
--- a/nuttx/net/netdev_ioctl.c
+++ b/nuttx/net/netdev_ioctl.c
@@ -472,7 +472,7 @@ static FAR struct uip_driver_s *netdev_imsfdev(FAR struct ip_msfilter *imsf)
* psock Socket structure
* dev Ethernet driver device structure
* cmd The ioctl command
- * imsf The argument of the ioctl cmd
+ * imsf The argument of the ioctl cmd
*
* Return:
* >=0 on success (positive non-zero values are cmd-specific)
@@ -495,7 +495,7 @@ static int netdev_imsfioctl(FAR struct socket *psock, int cmd,
{
case SIOCSIPMSFILTER: /* Set source filter content */
{
- dev = netdev_imsfdev(req);
+ dev = netdev_imsfdev(imsf);
if (dev)
{
if (imsf->imsf_fmode == MCAST_INCLUDE)
diff --git a/nuttx/net/uip/uip_input.c b/nuttx/net/uip/uip_input.c
index 3dffcf062..9411e3cc4 100644
--- a/nuttx/net/uip/uip_input.c
+++ b/nuttx/net/uip/uip_input.c
@@ -2,7 +2,7 @@
* netuip/uip_input.c
* The uIP TCP/IP stack code.
*
- * Copyright (C) 2007-2009, 2013 Gregory Nutt. All rights reserved.
+ * Copyright (C) 2007-2009, 2013-2014 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* Adapted for NuttX from logic in uIP which also has a BSD-like license:
@@ -453,11 +453,18 @@ int uip_input(struct uip_driver_s *dev)
#ifndef CONFIG_NET_IPv6
if (!uip_ipaddr_cmp(uip_ip4addr_conv(pbuf->destipaddr), dev->d_ipaddr))
{
+#ifdef CONFIG_NET_IGMP
+ uip_ipaddr_t destip = uip_ip4addr_conv(pbuf->destipaddr);
+ if (uip_grpfind(dev, &destip) == NULL)
+#endif
+ {
#ifdef CONFIG_NET_STATISTICS
- uip_stat.ip.drop++;
+ uip_stat.ip.drop++;
#endif
- goto drop;
+ goto drop;
+ }
}
+
#else /* CONFIG_NET_IPv6 */
/* For IPv6, packet reception is a little trickier as we need to
* make sure that we listen to certain multicast addresses (all