From 4702536695c0c1d715e917ea611db47ec2b3f474 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Mon, 24 Mar 2014 09:34:17 -0600 Subject: [PATCH] =?UTF-8?q?net/:=20IGMP-related=20bugfixes=20from=20Manuel?= =?UTF-8?q?=20St=C3=BChn?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ChangeLog | 2 ++ net/netdev_ioctl.c | 4 ++-- net/uip/uip_input.c | 15 +++++++++++---- 3 files changed, 15 insertions(+), 6 deletions(-) diff --git a/ChangeLog b/ChangeLog index bfeb48fa80..12847c9d79 100644 --- a/ChangeLog +++ b/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/net/netdev_ioctl.c b/net/netdev_ioctl.c index a8394edb29..c37c04611c 100644 --- a/net/netdev_ioctl.c +++ b/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/net/uip/uip_input.c b/net/uip/uip_input.c index 3dffcf0622..9411e3cc41 100644 --- a/net/uip/uip_input.c +++ b/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 * * 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_STATISTICS - uip_stat.ip.drop++; +#ifdef CONFIG_NET_IGMP + uip_ipaddr_t destip = uip_ip4addr_conv(pbuf->destipaddr); + if (uip_grpfind(dev, &destip) == NULL) #endif - goto drop; + { +#ifdef CONFIG_NET_STATISTICS + uip_stat.ip.drop++; +#endif + 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