net/mld: Fix a few compilation problems that cropped up in a different network configuration. Fix a logic error in setting the 'Other Querier Present' timer. Various cosmetic improvements.

This commit is contained in:
Gregory Nutt 2018-11-07 18:21:21 -06:00
parent 68e45d0453
commit 9c3e65f15f
9 changed files with 28 additions and 21 deletions

View file

@ -593,7 +593,8 @@ bool net_ipv6addr_maskcmp(const net_ipv6addr_t addr1,
*
* An IPv6 multicast address is an identifier for a group of interfaces
* (typically on different nodes). An interface may belong to any number
* of multicast groups. Multicast addresses have the following format:
* of multicast groups. Multicast addresses have the following format
* (in host order):
*
* | 8 | 4 | 4 | 112 bits |
* +------ -+----+----+---------------------------------------------+

View file

@ -106,7 +106,7 @@ struct net_stats_s
struct igmp_stats_s igmp; /* IGMP statistics */
#endif
#ifdef CONFIG_NET_IGMP
#ifdef CONFIG_NET_MLD
struct mld_stats_s mld; /* MLD statistics */
#endif

View file

@ -215,7 +215,9 @@ int icmpv6_neighbor(const net_ipv6addr_t ipaddr)
if (net_ipv6addr_cmp(ipaddr, g_ipv6_unspecaddr) ||
net_is_addr_mcast(ipaddr))
{
/* We don't need to send the Neighbor Solicitation */
/* We don't need to send the Neighbor Solicitation. But for the case
* of the Multicast address, a routing able entry will be required.
*/
return OK;
}

View file

@ -41,6 +41,7 @@
#include <debug.h>
#include <nuttx/net/netstats.h>
#include <nuttx/net/netdev.h>
#include <nuttx/net/mld.h>
#include "devif/devif.h"

View file

@ -44,6 +44,7 @@
#include <nuttx/wdog.h>
#include <nuttx/net/netconfig.h>
#include <nuttx/net/netstats.h>
#include <nuttx/net/netdev.h>
#include <nuttx/net/ip.h>
#include <nuttx/net/mld.h>
@ -241,22 +242,22 @@ static void mld_check_querier(FAR struct net_driver_s *dev,
/* Switch to non-Querier mode */
CLR_MLD_QUERIER(group->flags);
}
}
/* Are we past the start up phase (where the timer is used for a
* different purpose)?
/* Check if the member is a Non-Querier AND that we are past the start up
* phase (where the timer is used for a different purpose)?
*/
if (!IS_MLD_STARTUP(group->flags))
if (!IS_MLD_QUERIER(group->flags) && !IS_MLD_STARTUP(group->flags))
{
/* Yes.. cancel the poll timer and start the 'Other Querier
/* Yes.. cancel the poll timer and [re-]start the 'Other Querier
* Present' Timeout.
*/
mld_start_polltimer(group, MSEC2TICK(MLD_OQUERY_MSEC));
}
}
}
}
/****************************************************************************
* Public Functions

View file

@ -42,6 +42,7 @@
#include <nuttx/wdog.h>
#include <nuttx/net/netstats.h>
#include <nuttx/net/netdev.h>
#include <nuttx/net/ip.h>
#include <nuttx/net/mld.h>

View file

@ -1,5 +1,5 @@
/****************************************************************************
* net/neighbor/neighbor.c
* net/neighbor/neighbor_lookup.c
*
* Copyright (C) 2007-2009, 2015 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>

View file

@ -508,9 +508,10 @@ static uint16_t sendto_eventhandler(FAR struct net_driver_s *dev,
if (dev->d_sndlen <= 0 && (flags & UDP_NEWDATA) == 0 &&
(flags & UDP_POLL) != 0 && !sq_empty(&conn->write_q))
{
/* Check if the destination IP address is in the ARP or Neighbor
* table. If not, then the send won't actually make it out... it
* will be replaced with an ARP request or Neighbor Solicitation.
/* Check if the destination IP address is in the ARP, Neighbor
* table, or routing table. If not, then the send won't actually
* make it out... it will be replaced with an ARP request or
* Neighbor Solicitation.
*/
if (sendto_addrcheck(conn, dev))