net/: IGMP-related bugfixes from Manuel Stühn

This commit is contained in:
Gregory Nutt 2014-03-24 09:34:17 -06:00
parent 7d3d1f79bb
commit 4702536695
3 changed files with 15 additions and 6 deletions

View File

@ -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).

View File

@ -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)

View File

@ -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_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