Squashed commit of the following:
net/mld: The MLD logic now compiles and is much less toxic. It still is not a proper MLD implementation: (1) It is basically a port of IGMP, tweaked to work with IPv6 and ICMPv6 MLD messages, (2) it needs a proper analysis and comparison with RFC 3810, and (3) it is completely untested. For this reason, it will remain EXPERIMENTAL for some time.
net/mld: Add some missing macros, more fixes related to IPv6 vs IPv4 types,
net/mld: More compilation cleaning. Most fixups for IPv6 vs IPv4 types.
net/mld: Hook crudely converted .c files into build system and resolve a few of the many, many compilation/design problems.
net/mld: Add support for MLD statistics.
net/mld: Hook in MLD poll and packet transmission logic.
net/mld: Change references to IPv4 definitions to IPv6 definitions; Remove mld_input() since MLD piggybacks on ICMPv6 input. Add functions to catch MLD messages dispatched by ICMPv6 input logic.
net/mld: As a starting point, copy all net/igmp/*.c files to net/mld/. and change all occurrences of igmp (or IGMP) to mld (or MLD).
net/mld: More compilation cleaning. Most fixups for IPv6 vs IPv4 types.
net/mld: Hook crudely converted .c files into build system and resolve a few of the many, many compilation/design problems.
net/mld: Add support for MLD statistics.
net/mld: Hook in MLD poll and packet transmission logic.
net/mld: Change references to IPv4 definitions to IPv6 definitions; Remove mld_input() since MLD piggybacks on ICMPv6 input. Add functions to catch MLD messages dispatched by ICMPv6 input logic.
net/mld: As a starting point, copy all net/igmp/*.c files to net/mld/. and change all occurrences of igmp (or IGMP) to mld (or MLD).
2018-11-01 22:18:40 +01:00
|
|
|
/****************************************************************************
|
|
|
|
* net/mld/mld_query.c
|
|
|
|
*
|
|
|
|
* Copyright (C) 2018 Gregory Nutt. All rights reserved.
|
|
|
|
* Author: Gregory Nutt <gnutt@nuttx.org>
|
|
|
|
*
|
|
|
|
* Redistribution and use in source and binary forms, with or without
|
|
|
|
* modification, are permitted provided that the following conditions
|
|
|
|
* are met:
|
|
|
|
*
|
|
|
|
* 1. Redistributions of source code must retain the above copyright
|
|
|
|
* notice, this list of conditions and the following disclaimer.
|
|
|
|
* 2. Redistributions in binary form must reproduce the above copyright
|
|
|
|
* notice, this list of conditions and the following disclaimer in the
|
|
|
|
* documentation and/or other materials provided with the distribution.
|
|
|
|
* 3. Neither the name of CITEL Technologies Ltd nor the names of its contributors
|
|
|
|
* may be used to endorse or promote products derived from this software
|
|
|
|
* without specific prior written permission.
|
|
|
|
*
|
|
|
|
* THIS SOFTWARE IS PROVIDED BY CITEL TECHNOLOGIES AND CONTRIBUTORS ``AS IS''
|
|
|
|
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
|
|
|
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
|
|
|
* ARE DISCLAIMED. IN NO EVENT SHALL CITEL TECHNOLOGIES OR CONTRIBUTORS BE LIABLE
|
|
|
|
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
|
|
|
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
|
|
|
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
|
|
|
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
|
|
|
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
|
|
|
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
|
|
|
* SUCH DAMAGE.
|
|
|
|
*
|
|
|
|
****************************************************************************/
|
|
|
|
|
|
|
|
/****************************************************************************
|
|
|
|
* Included Files
|
|
|
|
****************************************************************************/
|
|
|
|
|
|
|
|
#include <nuttx/config.h>
|
|
|
|
|
2018-11-04 21:07:27 +01:00
|
|
|
#include <stdbool.h>
|
Squashed commit of the following:
net/mld: The MLD logic now compiles and is much less toxic. It still is not a proper MLD implementation: (1) It is basically a port of IGMP, tweaked to work with IPv6 and ICMPv6 MLD messages, (2) it needs a proper analysis and comparison with RFC 3810, and (3) it is completely untested. For this reason, it will remain EXPERIMENTAL for some time.
net/mld: Add some missing macros, more fixes related to IPv6 vs IPv4 types,
net/mld: More compilation cleaning. Most fixups for IPv6 vs IPv4 types.
net/mld: Hook crudely converted .c files into build system and resolve a few of the many, many compilation/design problems.
net/mld: Add support for MLD statistics.
net/mld: Hook in MLD poll and packet transmission logic.
net/mld: Change references to IPv4 definitions to IPv6 definitions; Remove mld_input() since MLD piggybacks on ICMPv6 input. Add functions to catch MLD messages dispatched by ICMPv6 input logic.
net/mld: As a starting point, copy all net/igmp/*.c files to net/mld/. and change all occurrences of igmp (or IGMP) to mld (or MLD).
net/mld: More compilation cleaning. Most fixups for IPv6 vs IPv4 types.
net/mld: Hook crudely converted .c files into build system and resolve a few of the many, many compilation/design problems.
net/mld: Add support for MLD statistics.
net/mld: Hook in MLD poll and packet transmission logic.
net/mld: Change references to IPv4 definitions to IPv6 definitions; Remove mld_input() since MLD piggybacks on ICMPv6 input. Add functions to catch MLD messages dispatched by ICMPv6 input logic.
net/mld: As a starting point, copy all net/igmp/*.c files to net/mld/. and change all occurrences of igmp (or IGMP) to mld (or MLD).
2018-11-01 22:18:40 +01:00
|
|
|
#include <assert.h>
|
|
|
|
#include <debug.h>
|
|
|
|
|
|
|
|
#include <nuttx/wdog.h>
|
|
|
|
#include <nuttx/net/netconfig.h>
|
|
|
|
#include <nuttx/net/netstats.h>
|
2018-11-08 01:21:21 +01:00
|
|
|
#include <nuttx/net/netdev.h>
|
Squashed commit of the following:
net/mld: The MLD logic now compiles and is much less toxic. It still is not a proper MLD implementation: (1) It is basically a port of IGMP, tweaked to work with IPv6 and ICMPv6 MLD messages, (2) it needs a proper analysis and comparison with RFC 3810, and (3) it is completely untested. For this reason, it will remain EXPERIMENTAL for some time.
net/mld: Add some missing macros, more fixes related to IPv6 vs IPv4 types,
net/mld: More compilation cleaning. Most fixups for IPv6 vs IPv4 types.
net/mld: Hook crudely converted .c files into build system and resolve a few of the many, many compilation/design problems.
net/mld: Add support for MLD statistics.
net/mld: Hook in MLD poll and packet transmission logic.
net/mld: Change references to IPv4 definitions to IPv6 definitions; Remove mld_input() since MLD piggybacks on ICMPv6 input. Add functions to catch MLD messages dispatched by ICMPv6 input logic.
net/mld: As a starting point, copy all net/igmp/*.c files to net/mld/. and change all occurrences of igmp (or IGMP) to mld (or MLD).
net/mld: More compilation cleaning. Most fixups for IPv6 vs IPv4 types.
net/mld: Hook crudely converted .c files into build system and resolve a few of the many, many compilation/design problems.
net/mld: Add support for MLD statistics.
net/mld: Hook in MLD poll and packet transmission logic.
net/mld: Change references to IPv4 definitions to IPv6 definitions; Remove mld_input() since MLD piggybacks on ICMPv6 input. Add functions to catch MLD messages dispatched by ICMPv6 input logic.
net/mld: As a starting point, copy all net/igmp/*.c files to net/mld/. and change all occurrences of igmp (or IGMP) to mld (or MLD).
2018-11-01 22:18:40 +01:00
|
|
|
#include <nuttx/net/ip.h>
|
|
|
|
#include <nuttx/net/mld.h>
|
|
|
|
|
|
|
|
#include "devif/devif.h"
|
|
|
|
#include "inet/inet.h"
|
|
|
|
#include "mld/mld.h"
|
|
|
|
#include "utils/utils.h"
|
|
|
|
|
|
|
|
/****************************************************************************
|
|
|
|
* Pre-processor Definitions
|
|
|
|
****************************************************************************/
|
|
|
|
|
|
|
|
#define IPv6BUF ((FAR struct ipv6_hdr_s *)&dev->d_buf[NET_LL_HDRLEN(dev)])
|
|
|
|
|
2018-11-03 20:45:33 +01:00
|
|
|
/****************************************************************************
|
|
|
|
* Private Functions
|
|
|
|
****************************************************************************/
|
|
|
|
|
2018-11-04 21:07:27 +01:00
|
|
|
/****************************************************************************
|
|
|
|
* Name: mld_setup_v1compat
|
|
|
|
*
|
|
|
|
* Description:
|
|
|
|
* If this is for MLDv1 query, then select MLDv1 compatibility mode and
|
|
|
|
* start (or re-start) the compatibility timer. We need to make this
|
|
|
|
* check BEFORE sending the report.
|
|
|
|
*
|
|
|
|
****************************************************************************/
|
|
|
|
|
|
|
|
static void mld_setup_v1compat(FAR struct mld_group_s *group,
|
|
|
|
FAR const struct mld_mcast_listen_query_s *query,
|
|
|
|
bool mldv1)
|
|
|
|
{
|
|
|
|
unsigned int respmsec;
|
|
|
|
|
|
|
|
if (mldv1)
|
|
|
|
{
|
|
|
|
#if 0 /* REVISIT */
|
|
|
|
/* Get the QQI from the query. Since this is MLDv1, we know that
|
|
|
|
* the value is not encoded.
|
|
|
|
*/
|
|
|
|
|
|
|
|
respmsec = MSEC_PER_SEC * MLD_QQI_VALUE(query->qqic);
|
|
|
|
#else
|
|
|
|
/* REVISIT: I am confused. Per RFC 3810:
|
|
|
|
* "The Older Version Querier Present Timeout is the time-out for
|
|
|
|
* transitioning a host back to MLDv2 Host Compatibility Mode. When
|
|
|
|
* an MLDv1 query is received, MLDv2 hosts set their Older Version
|
|
|
|
* Querier Present Timer to [Older Version Querier Present Timeout].
|
|
|
|
*
|
|
|
|
* "This value MUST be ([Robustness Variable] times (the [Query
|
|
|
|
* Interval] in the last Query received)) plus ([Query Response
|
|
|
|
* Interval])."
|
|
|
|
*
|
|
|
|
* I am not sure how to do that since the MLDv1 version has no QQI
|
|
|
|
* field. That is an MLDv2 extension.
|
|
|
|
*/
|
|
|
|
|
|
|
|
respmsec = MLD_QUERY_MSEC;
|
|
|
|
#endif
|
|
|
|
|
|
|
|
/* Select MLDv1 compatibility mode (might already be selected) */
|
|
|
|
|
|
|
|
SET_MLD_V1COMPAT(group->flags);
|
|
|
|
|
|
|
|
/* Whenever a host changes its compatibility mode, it cancels all its
|
|
|
|
* pending responses and retransmission timers.
|
|
|
|
*/
|
|
|
|
|
|
|
|
wd_cancel(group->polldog);
|
|
|
|
|
|
|
|
/* REVISIT: We cannot cancel a pending message if there is a waiter.
|
|
|
|
* Some additional logic would be required to avoid a hang.
|
|
|
|
*/
|
|
|
|
|
|
|
|
if (!IS_MLD_WAITMSG(group->flags))
|
|
|
|
{
|
|
|
|
CLR_MLD_SCHEDMSG(group->flags);
|
|
|
|
}
|
|
|
|
|
|
|
|
/* And start the MLDv1 compatibility timer. If the timer is already
|
|
|
|
* running, this will reset the timer.
|
|
|
|
*/
|
|
|
|
|
|
|
|
mld_start_v1timer(group,
|
|
|
|
MSEC2TICK(MLD_V1PRESENT_MSEC((clock_t)respmsec)));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-11-03 20:45:33 +01:00
|
|
|
/****************************************************************************
|
|
|
|
* Name: mld_mrc2mrd
|
|
|
|
*
|
|
|
|
* Description:
|
|
|
|
* Convert the MLD Maximum Response Code (MRC) to the Maximum Response
|
|
|
|
* Delay (MRD) in units of system clock ticks.
|
|
|
|
*
|
|
|
|
****************************************************************************/
|
|
|
|
|
2018-11-04 17:57:21 +01:00
|
|
|
#if 0 /* Not used */
|
2018-11-03 20:45:33 +01:00
|
|
|
static clock_t mld_mrc2mrd(uint16_t mrc)
|
|
|
|
{
|
|
|
|
uint32_t mrd; /* Units of milliseconds */
|
|
|
|
|
|
|
|
/* If bit 15 is not set (i.e., mrc < 32768), then no conversion is required. */
|
|
|
|
|
|
|
|
if (mrc < 32768)
|
|
|
|
{
|
|
|
|
mrd = mrc;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
/* Conversion required */
|
|
|
|
|
|
|
|
mrd = MLD_MRD_VALUE(mrc);
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Return the MRD in units of clock ticks */
|
|
|
|
|
|
|
|
return MSEC2TICK((clock_t)mrd);
|
|
|
|
}
|
2018-11-04 17:57:21 +01:00
|
|
|
#endif
|
2018-11-03 20:45:33 +01:00
|
|
|
|
|
|
|
/****************************************************************************
|
|
|
|
* Name: mld_cmpaddr
|
|
|
|
*
|
|
|
|
* Description:
|
|
|
|
* Perform a numerical comparison of the IPv6 Source Address and the IPv6
|
|
|
|
* address of the link. Return true if the source address is less than
|
|
|
|
* the link address.
|
|
|
|
*
|
|
|
|
****************************************************************************/
|
|
|
|
|
|
|
|
static bool mld_cmpaddr(FAR struct net_driver_s *dev,
|
|
|
|
const net_ipv6addr_t srcaddr)
|
|
|
|
{
|
|
|
|
int i;
|
|
|
|
|
|
|
|
for (i = 0; i < 8; i++)
|
|
|
|
{
|
|
|
|
if (srcaddr[i] < dev->d_ipv6addr[i])
|
|
|
|
{
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
/****************************************************************************
|
|
|
|
* Name: mld_check_querier
|
|
|
|
*
|
|
|
|
* Description:
|
2018-11-04 17:57:21 +01:00
|
|
|
* Check if we are still the querier for this group (assuming that we are
|
2018-11-04 21:07:27 +01:00
|
|
|
* currently the querier). This compares the IPv6 Source Address of the
|
2018-11-04 17:57:21 +01:00
|
|
|
* query against and the IPv6 address of the link. Ff the source address
|
|
|
|
* is numerically less than the link address, when we are no longer the
|
|
|
|
* querier.
|
2018-11-03 20:45:33 +01:00
|
|
|
*
|
|
|
|
****************************************************************************/
|
|
|
|
|
|
|
|
static void mld_check_querier(FAR struct net_driver_s *dev,
|
|
|
|
FAR struct ipv6_hdr_s *ipv6,
|
2018-11-04 17:57:21 +01:00
|
|
|
FAR struct mld_group_s *group)
|
2018-11-03 20:45:33 +01:00
|
|
|
{
|
|
|
|
/* Check if this member is a Querier */
|
|
|
|
|
2018-11-04 17:57:21 +01:00
|
|
|
if (IS_MLD_QUERIER(group->flags))
|
2018-11-03 20:45:33 +01:00
|
|
|
{
|
|
|
|
/* This is a querier, check if the IPv6 source address is numerically
|
|
|
|
* less than the IPv6 address assigned to this link.
|
|
|
|
*/
|
|
|
|
|
|
|
|
if (mld_cmpaddr(dev, ipv6->srcipaddr))
|
|
|
|
{
|
2018-11-07 17:39:51 +01:00
|
|
|
/* Switch to non-Querier mode */
|
|
|
|
|
|
|
|
CLR_MLD_QUERIER(group->flags);
|
2018-11-08 01:21:21 +01:00
|
|
|
}
|
|
|
|
}
|
2018-11-07 17:39:51 +01:00
|
|
|
|
2018-11-08 01:21:21 +01:00
|
|
|
/* 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)?
|
|
|
|
*/
|
2018-11-03 20:45:33 +01:00
|
|
|
|
2018-11-08 01:21:21 +01:00
|
|
|
if (!IS_MLD_QUERIER(group->flags) && !IS_MLD_STARTUP(group->flags))
|
|
|
|
{
|
|
|
|
/* Yes.. cancel the poll timer and [re-]start the 'Other Querier
|
|
|
|
* Present' Timeout.
|
|
|
|
*/
|
2018-11-04 17:57:21 +01:00
|
|
|
|
2018-11-08 01:21:21 +01:00
|
|
|
mld_start_polltimer(group, MSEC2TICK(MLD_OQUERY_MSEC));
|
2018-11-03 20:45:33 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
Squashed commit of the following:
net/mld: The MLD logic now compiles and is much less toxic. It still is not a proper MLD implementation: (1) It is basically a port of IGMP, tweaked to work with IPv6 and ICMPv6 MLD messages, (2) it needs a proper analysis and comparison with RFC 3810, and (3) it is completely untested. For this reason, it will remain EXPERIMENTAL for some time.
net/mld: Add some missing macros, more fixes related to IPv6 vs IPv4 types,
net/mld: More compilation cleaning. Most fixups for IPv6 vs IPv4 types.
net/mld: Hook crudely converted .c files into build system and resolve a few of the many, many compilation/design problems.
net/mld: Add support for MLD statistics.
net/mld: Hook in MLD poll and packet transmission logic.
net/mld: Change references to IPv4 definitions to IPv6 definitions; Remove mld_input() since MLD piggybacks on ICMPv6 input. Add functions to catch MLD messages dispatched by ICMPv6 input logic.
net/mld: As a starting point, copy all net/igmp/*.c files to net/mld/. and change all occurrences of igmp (or IGMP) to mld (or MLD).
net/mld: More compilation cleaning. Most fixups for IPv6 vs IPv4 types.
net/mld: Hook crudely converted .c files into build system and resolve a few of the many, many compilation/design problems.
net/mld: Add support for MLD statistics.
net/mld: Hook in MLD poll and packet transmission logic.
net/mld: Change references to IPv4 definitions to IPv6 definitions; Remove mld_input() since MLD piggybacks on ICMPv6 input. Add functions to catch MLD messages dispatched by ICMPv6 input logic.
net/mld: As a starting point, copy all net/igmp/*.c files to net/mld/. and change all occurrences of igmp (or IGMP) to mld (or MLD).
2018-11-01 22:18:40 +01:00
|
|
|
/****************************************************************************
|
|
|
|
* Public Functions
|
|
|
|
****************************************************************************/
|
|
|
|
|
|
|
|
/****************************************************************************
|
|
|
|
* Name: mld_query
|
|
|
|
*
|
|
|
|
* Description:
|
2018-11-03 20:45:33 +01:00
|
|
|
* Called from icmpv6_input() when a Multicast Listener Query is received.
|
|
|
|
*
|
|
|
|
* A router may assume one of two roles: Querier or Non-Querier. There is
|
|
|
|
* normally only one Querier per link. All routers start up as a Querier
|
|
|
|
* on each of their attached links. If a router hears a Query message
|
|
|
|
* whose IPv6 Source Address is numerically less than its own selected
|
|
|
|
* address for that link, it MUST become a Non-Querier on that link. If a
|
|
|
|
* delay passes without receiving, from a particular attached link, any
|
|
|
|
* Queries from a router with an address less than its own, a router
|
|
|
|
* resumes the role of Querier on that link.
|
|
|
|
*
|
|
|
|
* A Querier for a link periodically sends a General Query on that link,
|
|
|
|
* to solicit reports of all multicast addresses of interest on that link.
|
|
|
|
* On startup, a router SHOULD send multiple General Queries spaced closely
|
|
|
|
* together Interval] on all attached links in order to quickly and
|
|
|
|
* reliably discover the presence of multicast listeners on those links.
|
Squashed commit of the following:
net/mld: The MLD logic now compiles and is much less toxic. It still is not a proper MLD implementation: (1) It is basically a port of IGMP, tweaked to work with IPv6 and ICMPv6 MLD messages, (2) it needs a proper analysis and comparison with RFC 3810, and (3) it is completely untested. For this reason, it will remain EXPERIMENTAL for some time.
net/mld: Add some missing macros, more fixes related to IPv6 vs IPv4 types,
net/mld: More compilation cleaning. Most fixups for IPv6 vs IPv4 types.
net/mld: Hook crudely converted .c files into build system and resolve a few of the many, many compilation/design problems.
net/mld: Add support for MLD statistics.
net/mld: Hook in MLD poll and packet transmission logic.
net/mld: Change references to IPv4 definitions to IPv6 definitions; Remove mld_input() since MLD piggybacks on ICMPv6 input. Add functions to catch MLD messages dispatched by ICMPv6 input logic.
net/mld: As a starting point, copy all net/igmp/*.c files to net/mld/. and change all occurrences of igmp (or IGMP) to mld (or MLD).
net/mld: More compilation cleaning. Most fixups for IPv6 vs IPv4 types.
net/mld: Hook crudely converted .c files into build system and resolve a few of the many, many compilation/design problems.
net/mld: Add support for MLD statistics.
net/mld: Hook in MLD poll and packet transmission logic.
net/mld: Change references to IPv4 definitions to IPv6 definitions; Remove mld_input() since MLD piggybacks on ICMPv6 input. Add functions to catch MLD messages dispatched by ICMPv6 input logic.
net/mld: As a starting point, copy all net/igmp/*.c files to net/mld/. and change all occurrences of igmp (or IGMP) to mld (or MLD).
2018-11-01 22:18:40 +01:00
|
|
|
*
|
|
|
|
****************************************************************************/
|
|
|
|
|
|
|
|
int mld_query(FAR struct net_driver_s *dev,
|
|
|
|
FAR const struct mld_mcast_listen_query_s *query)
|
|
|
|
{
|
|
|
|
FAR struct ipv6_hdr_s *ipv6 = IPv6BUF;
|
|
|
|
FAR struct mld_group_s *group;
|
2018-11-04 21:07:27 +01:00
|
|
|
unsigned int mldsize;
|
|
|
|
bool mldv1 = false;
|
Squashed commit of the following:
net/mld: The MLD logic now compiles and is much less toxic. It still is not a proper MLD implementation: (1) It is basically a port of IGMP, tweaked to work with IPv6 and ICMPv6 MLD messages, (2) it needs a proper analysis and comparison with RFC 3810, and (3) it is completely untested. For this reason, it will remain EXPERIMENTAL for some time.
net/mld: Add some missing macros, more fixes related to IPv6 vs IPv4 types,
net/mld: More compilation cleaning. Most fixups for IPv6 vs IPv4 types.
net/mld: Hook crudely converted .c files into build system and resolve a few of the many, many compilation/design problems.
net/mld: Add support for MLD statistics.
net/mld: Hook in MLD poll and packet transmission logic.
net/mld: Change references to IPv4 definitions to IPv6 definitions; Remove mld_input() since MLD piggybacks on ICMPv6 input. Add functions to catch MLD messages dispatched by ICMPv6 input logic.
net/mld: As a starting point, copy all net/igmp/*.c files to net/mld/. and change all occurrences of igmp (or IGMP) to mld (or MLD).
net/mld: More compilation cleaning. Most fixups for IPv6 vs IPv4 types.
net/mld: Hook crudely converted .c files into build system and resolve a few of the many, many compilation/design problems.
net/mld: Add support for MLD statistics.
net/mld: Hook in MLD poll and packet transmission logic.
net/mld: Change references to IPv4 definitions to IPv6 definitions; Remove mld_input() since MLD piggybacks on ICMPv6 input. Add functions to catch MLD messages dispatched by ICMPv6 input logic.
net/mld: As a starting point, copy all net/igmp/*.c files to net/mld/. and change all occurrences of igmp (or IGMP) to mld (or MLD).
2018-11-01 22:18:40 +01:00
|
|
|
|
2018-11-06 01:39:55 +01:00
|
|
|
mldinfo("Multicast Listener Query\n");
|
Squashed commit of the following:
net/mld: The MLD logic now compiles and is much less toxic. It still is not a proper MLD implementation: (1) It is basically a port of IGMP, tweaked to work with IPv6 and ICMPv6 MLD messages, (2) it needs a proper analysis and comparison with RFC 3810, and (3) it is completely untested. For this reason, it will remain EXPERIMENTAL for some time.
net/mld: Add some missing macros, more fixes related to IPv6 vs IPv4 types,
net/mld: More compilation cleaning. Most fixups for IPv6 vs IPv4 types.
net/mld: Hook crudely converted .c files into build system and resolve a few of the many, many compilation/design problems.
net/mld: Add support for MLD statistics.
net/mld: Hook in MLD poll and packet transmission logic.
net/mld: Change references to IPv4 definitions to IPv6 definitions; Remove mld_input() since MLD piggybacks on ICMPv6 input. Add functions to catch MLD messages dispatched by ICMPv6 input logic.
net/mld: As a starting point, copy all net/igmp/*.c files to net/mld/. and change all occurrences of igmp (or IGMP) to mld (or MLD).
net/mld: More compilation cleaning. Most fixups for IPv6 vs IPv4 types.
net/mld: Hook crudely converted .c files into build system and resolve a few of the many, many compilation/design problems.
net/mld: Add support for MLD statistics.
net/mld: Hook in MLD poll and packet transmission logic.
net/mld: Change references to IPv4 definitions to IPv6 definitions; Remove mld_input() since MLD piggybacks on ICMPv6 input. Add functions to catch MLD messages dispatched by ICMPv6 input logic.
net/mld: As a starting point, copy all net/igmp/*.c files to net/mld/. and change all occurrences of igmp (or IGMP) to mld (or MLD).
2018-11-01 22:18:40 +01:00
|
|
|
|
2018-11-04 17:57:21 +01:00
|
|
|
#if 0 /* Not used */
|
|
|
|
/* Max Response Delay. The Max Response Code field specifies the maximum
|
|
|
|
* allowed time before sending a responding report in units of 1/10 second.
|
|
|
|
*/
|
Squashed commit of the following:
net/mld: The MLD logic now compiles and is much less toxic. It still is not a proper MLD implementation: (1) It is basically a port of IGMP, tweaked to work with IPv6 and ICMPv6 MLD messages, (2) it needs a proper analysis and comparison with RFC 3810, and (3) it is completely untested. For this reason, it will remain EXPERIMENTAL for some time.
net/mld: Add some missing macros, more fixes related to IPv6 vs IPv4 types,
net/mld: More compilation cleaning. Most fixups for IPv6 vs IPv4 types.
net/mld: Hook crudely converted .c files into build system and resolve a few of the many, many compilation/design problems.
net/mld: Add support for MLD statistics.
net/mld: Hook in MLD poll and packet transmission logic.
net/mld: Change references to IPv4 definitions to IPv6 definitions; Remove mld_input() since MLD piggybacks on ICMPv6 input. Add functions to catch MLD messages dispatched by ICMPv6 input logic.
net/mld: As a starting point, copy all net/igmp/*.c files to net/mld/. and change all occurrences of igmp (or IGMP) to mld (or MLD).
net/mld: More compilation cleaning. Most fixups for IPv6 vs IPv4 types.
net/mld: Hook crudely converted .c files into build system and resolve a few of the many, many compilation/design problems.
net/mld: Add support for MLD statistics.
net/mld: Hook in MLD poll and packet transmission logic.
net/mld: Change references to IPv4 definitions to IPv6 definitions; Remove mld_input() since MLD piggybacks on ICMPv6 input. Add functions to catch MLD messages dispatched by ICMPv6 input logic.
net/mld: As a starting point, copy all net/igmp/*.c files to net/mld/. and change all occurrences of igmp (or IGMP) to mld (or MLD).
2018-11-01 22:18:40 +01:00
|
|
|
|
2018-11-04 17:57:21 +01:00
|
|
|
mrc = NTOHS(query->mrc);
|
|
|
|
#endif
|
|
|
|
|
2018-11-04 21:07:27 +01:00
|
|
|
/* The MLD version of a Multicast Listener Query message is determined
|
|
|
|
* as follows:
|
|
|
|
*
|
|
|
|
* MLDv1 Query: length = 24 octets
|
|
|
|
* MLDv2 Query: length >= 28 octets
|
|
|
|
*
|
|
|
|
* Query messages that do not match any of the above conditions (e.g., a
|
|
|
|
* Query of length 26 octets) MUST be silently ignored.
|
|
|
|
*/
|
|
|
|
|
2018-11-05 15:56:07 +01:00
|
|
|
mldsize = (unsigned int)ipv6->len[0] << 8 | ipv6->len[1];
|
2018-11-04 21:07:27 +01:00
|
|
|
if (mldsize == sizeof(struct mld_mcast_listen_report_v1_s))
|
|
|
|
{
|
|
|
|
mldv1 = true;
|
|
|
|
}
|
|
|
|
else if (mldsize < SIZEOF_MLD_MCAST_LISTEN_QUERY_S(0))
|
|
|
|
{
|
2018-11-06 01:39:55 +01:00
|
|
|
mldinfo("WARNING: Invalid size for MLD query: %u\n", mldsize);
|
2018-11-04 21:07:27 +01:00
|
|
|
|
|
|
|
dev->d_len = 0;
|
|
|
|
return -EINVAL;
|
|
|
|
}
|
|
|
|
|
2018-11-04 17:57:21 +01:00
|
|
|
/* There are three variants of the Query message (RFC 3810):
|
|
|
|
*
|
|
|
|
* 1. A "General Query" is sent by the Querier to learn which
|
|
|
|
* multicast addresses have listeners on an attached link. In a
|
|
|
|
* General Query, both the Multicast Address field and the Number
|
|
|
|
* of Sources (N) field are zero.
|
|
|
|
* 2. A "Multicast Address Specific Query" is sent by the Querier to
|
|
|
|
* learn if a particular multicast address has any listeners on an
|
|
|
|
* attached link. In a Multicast Address Specific Query, the
|
|
|
|
* Multicast Address field contains the multicast address of
|
|
|
|
* interest, while the Number of Sources (N) field is set to zero.
|
|
|
|
* 3. A "Multicast Address and Source Specific Query" is sent by the
|
|
|
|
* Querier to learn if any of the sources from the specified list for
|
|
|
|
* the particular multicast address has any listeners on an attached
|
|
|
|
* link or not. In a Multicast Address and Source Specific Query the
|
|
|
|
* Multicast Address field contains the multicast address of
|
|
|
|
* interest, while the Source Address [i] field(s) contain(s) the
|
|
|
|
* source address(es) of interest.
|
|
|
|
*
|
|
|
|
* Another possibility is a Unicast query that is sent specifically
|
|
|
|
* to our local IP address.
|
Squashed commit of the following:
net/mld: The MLD logic now compiles and is much less toxic. It still is not a proper MLD implementation: (1) It is basically a port of IGMP, tweaked to work with IPv6 and ICMPv6 MLD messages, (2) it needs a proper analysis and comparison with RFC 3810, and (3) it is completely untested. For this reason, it will remain EXPERIMENTAL for some time.
net/mld: Add some missing macros, more fixes related to IPv6 vs IPv4 types,
net/mld: More compilation cleaning. Most fixups for IPv6 vs IPv4 types.
net/mld: Hook crudely converted .c files into build system and resolve a few of the many, many compilation/design problems.
net/mld: Add support for MLD statistics.
net/mld: Hook in MLD poll and packet transmission logic.
net/mld: Change references to IPv4 definitions to IPv6 definitions; Remove mld_input() since MLD piggybacks on ICMPv6 input. Add functions to catch MLD messages dispatched by ICMPv6 input logic.
net/mld: As a starting point, copy all net/igmp/*.c files to net/mld/. and change all occurrences of igmp (or IGMP) to mld (or MLD).
net/mld: More compilation cleaning. Most fixups for IPv6 vs IPv4 types.
net/mld: Hook crudely converted .c files into build system and resolve a few of the many, many compilation/design problems.
net/mld: Add support for MLD statistics.
net/mld: Hook in MLD poll and packet transmission logic.
net/mld: Change references to IPv4 definitions to IPv6 definitions; Remove mld_input() since MLD piggybacks on ICMPv6 input. Add functions to catch MLD messages dispatched by ICMPv6 input logic.
net/mld: As a starting point, copy all net/igmp/*.c files to net/mld/. and change all occurrences of igmp (or IGMP) to mld (or MLD).
2018-11-01 22:18:40 +01:00
|
|
|
*/
|
|
|
|
|
2018-11-04 17:57:21 +01:00
|
|
|
/* Check the destination address. This varies with the type of message
|
|
|
|
* being sent:
|
|
|
|
*
|
|
|
|
* MESSAGE DESTINATION ADDRESS
|
|
|
|
* General Query Message: The link-local, all nodes multicast address
|
|
|
|
* MAS Query Messages: The group multicast address
|
|
|
|
*/
|
Squashed commit of the following:
net/mld: The MLD logic now compiles and is much less toxic. It still is not a proper MLD implementation: (1) It is basically a port of IGMP, tweaked to work with IPv6 and ICMPv6 MLD messages, (2) it needs a proper analysis and comparison with RFC 3810, and (3) it is completely untested. For this reason, it will remain EXPERIMENTAL for some time.
net/mld: Add some missing macros, more fixes related to IPv6 vs IPv4 types,
net/mld: More compilation cleaning. Most fixups for IPv6 vs IPv4 types.
net/mld: Hook crudely converted .c files into build system and resolve a few of the many, many compilation/design problems.
net/mld: Add support for MLD statistics.
net/mld: Hook in MLD poll and packet transmission logic.
net/mld: Change references to IPv4 definitions to IPv6 definitions; Remove mld_input() since MLD piggybacks on ICMPv6 input. Add functions to catch MLD messages dispatched by ICMPv6 input logic.
net/mld: As a starting point, copy all net/igmp/*.c files to net/mld/. and change all occurrences of igmp (or IGMP) to mld (or MLD).
net/mld: More compilation cleaning. Most fixups for IPv6 vs IPv4 types.
net/mld: Hook crudely converted .c files into build system and resolve a few of the many, many compilation/design problems.
net/mld: Add support for MLD statistics.
net/mld: Hook in MLD poll and packet transmission logic.
net/mld: Change references to IPv4 definitions to IPv6 definitions; Remove mld_input() since MLD piggybacks on ICMPv6 input. Add functions to catch MLD messages dispatched by ICMPv6 input logic.
net/mld: As a starting point, copy all net/igmp/*.c files to net/mld/. and change all occurrences of igmp (or IGMP) to mld (or MLD).
2018-11-01 22:18:40 +01:00
|
|
|
|
2018-11-04 17:57:21 +01:00
|
|
|
/* Check for a General Query */
|
Squashed commit of the following:
net/mld: The MLD logic now compiles and is much less toxic. It still is not a proper MLD implementation: (1) It is basically a port of IGMP, tweaked to work with IPv6 and ICMPv6 MLD messages, (2) it needs a proper analysis and comparison with RFC 3810, and (3) it is completely untested. For this reason, it will remain EXPERIMENTAL for some time.
net/mld: Add some missing macros, more fixes related to IPv6 vs IPv4 types,
net/mld: More compilation cleaning. Most fixups for IPv6 vs IPv4 types.
net/mld: Hook crudely converted .c files into build system and resolve a few of the many, many compilation/design problems.
net/mld: Add support for MLD statistics.
net/mld: Hook in MLD poll and packet transmission logic.
net/mld: Change references to IPv4 definitions to IPv6 definitions; Remove mld_input() since MLD piggybacks on ICMPv6 input. Add functions to catch MLD messages dispatched by ICMPv6 input logic.
net/mld: As a starting point, copy all net/igmp/*.c files to net/mld/. and change all occurrences of igmp (or IGMP) to mld (or MLD).
net/mld: More compilation cleaning. Most fixups for IPv6 vs IPv4 types.
net/mld: Hook crudely converted .c files into build system and resolve a few of the many, many compilation/design problems.
net/mld: Add support for MLD statistics.
net/mld: Hook in MLD poll and packet transmission logic.
net/mld: Change references to IPv4 definitions to IPv6 definitions; Remove mld_input() since MLD piggybacks on ICMPv6 input. Add functions to catch MLD messages dispatched by ICMPv6 input logic.
net/mld: As a starting point, copy all net/igmp/*.c files to net/mld/. and change all occurrences of igmp (or IGMP) to mld (or MLD).
2018-11-01 22:18:40 +01:00
|
|
|
|
2018-11-04 17:57:21 +01:00
|
|
|
if (net_ipv6addr_cmp(ipv6->destipaddr, g_ipv6_allnodes) &&
|
|
|
|
net_ipv6addr_cmp(query->grpaddr, g_ipv6_unspecaddr) &&
|
|
|
|
query->nsources == 0)
|
Squashed commit of the following:
net/mld: The MLD logic now compiles and is much less toxic. It still is not a proper MLD implementation: (1) It is basically a port of IGMP, tweaked to work with IPv6 and ICMPv6 MLD messages, (2) it needs a proper analysis and comparison with RFC 3810, and (3) it is completely untested. For this reason, it will remain EXPERIMENTAL for some time.
net/mld: Add some missing macros, more fixes related to IPv6 vs IPv4 types,
net/mld: More compilation cleaning. Most fixups for IPv6 vs IPv4 types.
net/mld: Hook crudely converted .c files into build system and resolve a few of the many, many compilation/design problems.
net/mld: Add support for MLD statistics.
net/mld: Hook in MLD poll and packet transmission logic.
net/mld: Change references to IPv4 definitions to IPv6 definitions; Remove mld_input() since MLD piggybacks on ICMPv6 input. Add functions to catch MLD messages dispatched by ICMPv6 input logic.
net/mld: As a starting point, copy all net/igmp/*.c files to net/mld/. and change all occurrences of igmp (or IGMP) to mld (or MLD).
net/mld: More compilation cleaning. Most fixups for IPv6 vs IPv4 types.
net/mld: Hook crudely converted .c files into build system and resolve a few of the many, many compilation/design problems.
net/mld: Add support for MLD statistics.
net/mld: Hook in MLD poll and packet transmission logic.
net/mld: Change references to IPv4 definitions to IPv6 definitions; Remove mld_input() since MLD piggybacks on ICMPv6 input. Add functions to catch MLD messages dispatched by ICMPv6 input logic.
net/mld: As a starting point, copy all net/igmp/*.c files to net/mld/. and change all occurrences of igmp (or IGMP) to mld (or MLD).
2018-11-01 22:18:40 +01:00
|
|
|
{
|
2018-11-04 17:57:21 +01:00
|
|
|
FAR struct mld_group_s *member;
|
|
|
|
bool rptsent = false;
|
|
|
|
|
|
|
|
/* This is the general query */
|
|
|
|
|
2018-11-06 01:39:55 +01:00
|
|
|
mldinfo("General multicast query\n");
|
2018-11-06 17:42:53 +01:00
|
|
|
MLD_STATINCR(g_netstats.mld.gm_query_received);
|
2018-11-04 17:57:21 +01:00
|
|
|
|
|
|
|
/* Two passes through the member list. On the first, just check if we
|
|
|
|
* are still the querier for the qroup.
|
Squashed commit of the following:
net/mld: The MLD logic now compiles and is much less toxic. It still is not a proper MLD implementation: (1) It is basically a port of IGMP, tweaked to work with IPv6 and ICMPv6 MLD messages, (2) it needs a proper analysis and comparison with RFC 3810, and (3) it is completely untested. For this reason, it will remain EXPERIMENTAL for some time.
net/mld: Add some missing macros, more fixes related to IPv6 vs IPv4 types,
net/mld: More compilation cleaning. Most fixups for IPv6 vs IPv4 types.
net/mld: Hook crudely converted .c files into build system and resolve a few of the many, many compilation/design problems.
net/mld: Add support for MLD statistics.
net/mld: Hook in MLD poll and packet transmission logic.
net/mld: Change references to IPv4 definitions to IPv6 definitions; Remove mld_input() since MLD piggybacks on ICMPv6 input. Add functions to catch MLD messages dispatched by ICMPv6 input logic.
net/mld: As a starting point, copy all net/igmp/*.c files to net/mld/. and change all occurrences of igmp (or IGMP) to mld (or MLD).
net/mld: More compilation cleaning. Most fixups for IPv6 vs IPv4 types.
net/mld: Hook crudely converted .c files into build system and resolve a few of the many, many compilation/design problems.
net/mld: Add support for MLD statistics.
net/mld: Hook in MLD poll and packet transmission logic.
net/mld: Change references to IPv4 definitions to IPv6 definitions; Remove mld_input() since MLD piggybacks on ICMPv6 input. Add functions to catch MLD messages dispatched by ICMPv6 input logic.
net/mld: As a starting point, copy all net/igmp/*.c files to net/mld/. and change all occurrences of igmp (or IGMP) to mld (or MLD).
2018-11-01 22:18:40 +01:00
|
|
|
*/
|
|
|
|
|
2018-11-04 17:57:21 +01:00
|
|
|
for (member = (FAR struct mld_group_s *)dev->d_mld_grplist.head;
|
|
|
|
member;
|
|
|
|
member = member->next)
|
Squashed commit of the following:
net/mld: The MLD logic now compiles and is much less toxic. It still is not a proper MLD implementation: (1) It is basically a port of IGMP, tweaked to work with IPv6 and ICMPv6 MLD messages, (2) it needs a proper analysis and comparison with RFC 3810, and (3) it is completely untested. For this reason, it will remain EXPERIMENTAL for some time.
net/mld: Add some missing macros, more fixes related to IPv6 vs IPv4 types,
net/mld: More compilation cleaning. Most fixups for IPv6 vs IPv4 types.
net/mld: Hook crudely converted .c files into build system and resolve a few of the many, many compilation/design problems.
net/mld: Add support for MLD statistics.
net/mld: Hook in MLD poll and packet transmission logic.
net/mld: Change references to IPv4 definitions to IPv6 definitions; Remove mld_input() since MLD piggybacks on ICMPv6 input. Add functions to catch MLD messages dispatched by ICMPv6 input logic.
net/mld: As a starting point, copy all net/igmp/*.c files to net/mld/. and change all occurrences of igmp (or IGMP) to mld (or MLD).
net/mld: More compilation cleaning. Most fixups for IPv6 vs IPv4 types.
net/mld: Hook crudely converted .c files into build system and resolve a few of the many, many compilation/design problems.
net/mld: Add support for MLD statistics.
net/mld: Hook in MLD poll and packet transmission logic.
net/mld: Change references to IPv4 definitions to IPv6 definitions; Remove mld_input() since MLD piggybacks on ICMPv6 input. Add functions to catch MLD messages dispatched by ICMPv6 input logic.
net/mld: As a starting point, copy all net/igmp/*.c files to net/mld/. and change all occurrences of igmp (or IGMP) to mld (or MLD).
2018-11-01 22:18:40 +01:00
|
|
|
{
|
2018-11-04 17:57:21 +01:00
|
|
|
/* Skip over the all systems group entry */
|
Squashed commit of the following:
net/mld: The MLD logic now compiles and is much less toxic. It still is not a proper MLD implementation: (1) It is basically a port of IGMP, tweaked to work with IPv6 and ICMPv6 MLD messages, (2) it needs a proper analysis and comparison with RFC 3810, and (3) it is completely untested. For this reason, it will remain EXPERIMENTAL for some time.
net/mld: Add some missing macros, more fixes related to IPv6 vs IPv4 types,
net/mld: More compilation cleaning. Most fixups for IPv6 vs IPv4 types.
net/mld: Hook crudely converted .c files into build system and resolve a few of the many, many compilation/design problems.
net/mld: Add support for MLD statistics.
net/mld: Hook in MLD poll and packet transmission logic.
net/mld: Change references to IPv4 definitions to IPv6 definitions; Remove mld_input() since MLD piggybacks on ICMPv6 input. Add functions to catch MLD messages dispatched by ICMPv6 input logic.
net/mld: As a starting point, copy all net/igmp/*.c files to net/mld/. and change all occurrences of igmp (or IGMP) to mld (or MLD).
net/mld: More compilation cleaning. Most fixups for IPv6 vs IPv4 types.
net/mld: Hook crudely converted .c files into build system and resolve a few of the many, many compilation/design problems.
net/mld: Add support for MLD statistics.
net/mld: Hook in MLD poll and packet transmission logic.
net/mld: Change references to IPv4 definitions to IPv6 definitions; Remove mld_input() since MLD piggybacks on ICMPv6 input. Add functions to catch MLD messages dispatched by ICMPv6 input logic.
net/mld: As a starting point, copy all net/igmp/*.c files to net/mld/. and change all occurrences of igmp (or IGMP) to mld (or MLD).
2018-11-01 22:18:40 +01:00
|
|
|
|
2018-11-04 17:57:21 +01:00
|
|
|
if (!net_ipv6addr_cmp(member->grpaddr, g_ipv6_allnodes))
|
|
|
|
{
|
|
|
|
/* Check if we are still the querier for this group */
|
Squashed commit of the following:
net/mld: The MLD logic now compiles and is much less toxic. It still is not a proper MLD implementation: (1) It is basically a port of IGMP, tweaked to work with IPv6 and ICMPv6 MLD messages, (2) it needs a proper analysis and comparison with RFC 3810, and (3) it is completely untested. For this reason, it will remain EXPERIMENTAL for some time.
net/mld: Add some missing macros, more fixes related to IPv6 vs IPv4 types,
net/mld: More compilation cleaning. Most fixups for IPv6 vs IPv4 types.
net/mld: Hook crudely converted .c files into build system and resolve a few of the many, many compilation/design problems.
net/mld: Add support for MLD statistics.
net/mld: Hook in MLD poll and packet transmission logic.
net/mld: Change references to IPv4 definitions to IPv6 definitions; Remove mld_input() since MLD piggybacks on ICMPv6 input. Add functions to catch MLD messages dispatched by ICMPv6 input logic.
net/mld: As a starting point, copy all net/igmp/*.c files to net/mld/. and change all occurrences of igmp (or IGMP) to mld (or MLD).
net/mld: More compilation cleaning. Most fixups for IPv6 vs IPv4 types.
net/mld: Hook crudely converted .c files into build system and resolve a few of the many, many compilation/design problems.
net/mld: Add support for MLD statistics.
net/mld: Hook in MLD poll and packet transmission logic.
net/mld: Change references to IPv4 definitions to IPv6 definitions; Remove mld_input() since MLD piggybacks on ICMPv6 input. Add functions to catch MLD messages dispatched by ICMPv6 input logic.
net/mld: As a starting point, copy all net/igmp/*.c files to net/mld/. and change all occurrences of igmp (or IGMP) to mld (or MLD).
2018-11-01 22:18:40 +01:00
|
|
|
|
2018-11-04 17:57:21 +01:00
|
|
|
mld_check_querier(dev, ipv6, member);
|
2018-11-04 21:07:27 +01:00
|
|
|
|
2018-11-06 22:08:16 +01:00
|
|
|
/* Warn if we received a MLDv2 query in MLDv1 compatibility
|
|
|
|
* mode.
|
|
|
|
*/
|
2018-11-04 21:07:27 +01:00
|
|
|
|
2018-11-06 22:08:16 +01:00
|
|
|
if (!mldv1 && IS_MLD_V1COMPAT(member->flags))
|
|
|
|
{
|
|
|
|
mldinfo("WARNING: MLDv2 query received in MLDv1 "
|
|
|
|
"compatibility mode\n");
|
|
|
|
}
|
2018-11-06 21:46:03 +01:00
|
|
|
|
|
|
|
#ifdef CONFIG_NET_MLD_ROUTER
|
2018-11-06 22:08:16 +01:00
|
|
|
/* Save the number of members that reported in the previous
|
|
|
|
* query cycle; reset the number of members that have
|
|
|
|
* reported in the new query cycle.
|
|
|
|
*/
|
2018-11-06 21:46:03 +01:00
|
|
|
|
2018-11-06 22:08:16 +01:00
|
|
|
member->lstmbrs = member->members;
|
|
|
|
member->members = 0;
|
2018-11-06 21:46:03 +01:00
|
|
|
#endif
|
2018-11-04 17:57:21 +01:00
|
|
|
}
|
|
|
|
}
|
Squashed commit of the following:
net/mld: The MLD logic now compiles and is much less toxic. It still is not a proper MLD implementation: (1) It is basically a port of IGMP, tweaked to work with IPv6 and ICMPv6 MLD messages, (2) it needs a proper analysis and comparison with RFC 3810, and (3) it is completely untested. For this reason, it will remain EXPERIMENTAL for some time.
net/mld: Add some missing macros, more fixes related to IPv6 vs IPv4 types,
net/mld: More compilation cleaning. Most fixups for IPv6 vs IPv4 types.
net/mld: Hook crudely converted .c files into build system and resolve a few of the many, many compilation/design problems.
net/mld: Add support for MLD statistics.
net/mld: Hook in MLD poll and packet transmission logic.
net/mld: Change references to IPv4 definitions to IPv6 definitions; Remove mld_input() since MLD piggybacks on ICMPv6 input. Add functions to catch MLD messages dispatched by ICMPv6 input logic.
net/mld: As a starting point, copy all net/igmp/*.c files to net/mld/. and change all occurrences of igmp (or IGMP) to mld (or MLD).
net/mld: More compilation cleaning. Most fixups for IPv6 vs IPv4 types.
net/mld: Hook crudely converted .c files into build system and resolve a few of the many, many compilation/design problems.
net/mld: Add support for MLD statistics.
net/mld: Hook in MLD poll and packet transmission logic.
net/mld: Change references to IPv4 definitions to IPv6 definitions; Remove mld_input() since MLD piggybacks on ICMPv6 input. Add functions to catch MLD messages dispatched by ICMPv6 input logic.
net/mld: As a starting point, copy all net/igmp/*.c files to net/mld/. and change all occurrences of igmp (or IGMP) to mld (or MLD).
2018-11-01 22:18:40 +01:00
|
|
|
|
2018-11-04 17:57:21 +01:00
|
|
|
/* On the second time through, we send the Report in response to the
|
|
|
|
* query. This has to be done twice because because there is only
|
|
|
|
* a single packet buffer that is used for both incoming and outgoing
|
|
|
|
* packets. When the report is sent, it will clobber the incoming
|
|
|
|
* query. Any attempt to send an additional Report would also clobber
|
|
|
|
* a preceding report
|
|
|
|
*/
|
Squashed commit of the following:
net/mld: The MLD logic now compiles and is much less toxic. It still is not a proper MLD implementation: (1) It is basically a port of IGMP, tweaked to work with IPv6 and ICMPv6 MLD messages, (2) it needs a proper analysis and comparison with RFC 3810, and (3) it is completely untested. For this reason, it will remain EXPERIMENTAL for some time.
net/mld: Add some missing macros, more fixes related to IPv6 vs IPv4 types,
net/mld: More compilation cleaning. Most fixups for IPv6 vs IPv4 types.
net/mld: Hook crudely converted .c files into build system and resolve a few of the many, many compilation/design problems.
net/mld: Add support for MLD statistics.
net/mld: Hook in MLD poll and packet transmission logic.
net/mld: Change references to IPv4 definitions to IPv6 definitions; Remove mld_input() since MLD piggybacks on ICMPv6 input. Add functions to catch MLD messages dispatched by ICMPv6 input logic.
net/mld: As a starting point, copy all net/igmp/*.c files to net/mld/. and change all occurrences of igmp (or IGMP) to mld (or MLD).
net/mld: More compilation cleaning. Most fixups for IPv6 vs IPv4 types.
net/mld: Hook crudely converted .c files into build system and resolve a few of the many, many compilation/design problems.
net/mld: Add support for MLD statistics.
net/mld: Hook in MLD poll and packet transmission logic.
net/mld: Change references to IPv4 definitions to IPv6 definitions; Remove mld_input() since MLD piggybacks on ICMPv6 input. Add functions to catch MLD messages dispatched by ICMPv6 input logic.
net/mld: As a starting point, copy all net/igmp/*.c files to net/mld/. and change all occurrences of igmp (or IGMP) to mld (or MLD).
2018-11-01 22:18:40 +01:00
|
|
|
|
2018-11-04 17:57:21 +01:00
|
|
|
for (member = (FAR struct mld_group_s *)dev->d_mld_grplist.head;
|
|
|
|
member;
|
|
|
|
member = member->next)
|
|
|
|
{
|
|
|
|
/* Skip over the all systems group entry */
|
2018-11-03 20:45:33 +01:00
|
|
|
|
2018-11-04 17:57:21 +01:00
|
|
|
if (!net_ipv6addr_cmp(member->grpaddr, g_ipv6_allnodes))
|
|
|
|
{
|
2018-11-04 21:07:27 +01:00
|
|
|
/* Check MLDv1 compatibility mode */
|
|
|
|
|
|
|
|
mld_setup_v1compat(member, query, mldv1);
|
|
|
|
|
2018-11-11 14:31:59 +01:00
|
|
|
/* Have we already sent a report from this loop? */
|
2018-11-04 17:57:21 +01:00
|
|
|
|
2018-11-11 14:31:59 +01:00
|
|
|
if (rptsent)
|
|
|
|
{
|
|
|
|
/* Yes.. Just mark that a report as pending. The pending
|
|
|
|
* flag will checked on the next driver poll.
|
|
|
|
*/
|
|
|
|
|
|
|
|
SET_MLD_RPTPEND(member->flags);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
/* No.. Send one report now. */
|
|
|
|
|
|
|
|
mld_send(dev, member, mld_report_msgtype(member));
|
|
|
|
rptsent = true;
|
|
|
|
CLR_MLD_RPTPEND(member->flags);
|
|
|
|
}
|
Squashed commit of the following:
net/mld: The MLD logic now compiles and is much less toxic. It still is not a proper MLD implementation: (1) It is basically a port of IGMP, tweaked to work with IPv6 and ICMPv6 MLD messages, (2) it needs a proper analysis and comparison with RFC 3810, and (3) it is completely untested. For this reason, it will remain EXPERIMENTAL for some time.
net/mld: Add some missing macros, more fixes related to IPv6 vs IPv4 types,
net/mld: More compilation cleaning. Most fixups for IPv6 vs IPv4 types.
net/mld: Hook crudely converted .c files into build system and resolve a few of the many, many compilation/design problems.
net/mld: Add support for MLD statistics.
net/mld: Hook in MLD poll and packet transmission logic.
net/mld: Change references to IPv4 definitions to IPv6 definitions; Remove mld_input() since MLD piggybacks on ICMPv6 input. Add functions to catch MLD messages dispatched by ICMPv6 input logic.
net/mld: As a starting point, copy all net/igmp/*.c files to net/mld/. and change all occurrences of igmp (or IGMP) to mld (or MLD).
net/mld: More compilation cleaning. Most fixups for IPv6 vs IPv4 types.
net/mld: Hook crudely converted .c files into build system and resolve a few of the many, many compilation/design problems.
net/mld: Add support for MLD statistics.
net/mld: Hook in MLD poll and packet transmission logic.
net/mld: Change references to IPv4 definitions to IPv6 definitions; Remove mld_input() since MLD piggybacks on ICMPv6 input. Add functions to catch MLD messages dispatched by ICMPv6 input logic.
net/mld: As a starting point, copy all net/igmp/*.c files to net/mld/. and change all occurrences of igmp (or IGMP) to mld (or MLD).
2018-11-01 22:18:40 +01:00
|
|
|
}
|
|
|
|
}
|
2018-11-04 17:57:21 +01:00
|
|
|
|
|
|
|
/* Need to set d_len to zero if nothing is being sent */
|
|
|
|
|
|
|
|
if (!rptsent)
|
Squashed commit of the following:
net/mld: The MLD logic now compiles and is much less toxic. It still is not a proper MLD implementation: (1) It is basically a port of IGMP, tweaked to work with IPv6 and ICMPv6 MLD messages, (2) it needs a proper analysis and comparison with RFC 3810, and (3) it is completely untested. For this reason, it will remain EXPERIMENTAL for some time.
net/mld: Add some missing macros, more fixes related to IPv6 vs IPv4 types,
net/mld: More compilation cleaning. Most fixups for IPv6 vs IPv4 types.
net/mld: Hook crudely converted .c files into build system and resolve a few of the many, many compilation/design problems.
net/mld: Add support for MLD statistics.
net/mld: Hook in MLD poll and packet transmission logic.
net/mld: Change references to IPv4 definitions to IPv6 definitions; Remove mld_input() since MLD piggybacks on ICMPv6 input. Add functions to catch MLD messages dispatched by ICMPv6 input logic.
net/mld: As a starting point, copy all net/igmp/*.c files to net/mld/. and change all occurrences of igmp (or IGMP) to mld (or MLD).
net/mld: More compilation cleaning. Most fixups for IPv6 vs IPv4 types.
net/mld: Hook crudely converted .c files into build system and resolve a few of the many, many compilation/design problems.
net/mld: Add support for MLD statistics.
net/mld: Hook in MLD poll and packet transmission logic.
net/mld: Change references to IPv4 definitions to IPv6 definitions; Remove mld_input() since MLD piggybacks on ICMPv6 input. Add functions to catch MLD messages dispatched by ICMPv6 input logic.
net/mld: As a starting point, copy all net/igmp/*.c files to net/mld/. and change all occurrences of igmp (or IGMP) to mld (or MLD).
2018-11-01 22:18:40 +01:00
|
|
|
{
|
2018-11-04 17:57:21 +01:00
|
|
|
dev->d_len = 0;
|
|
|
|
}
|
Squashed commit of the following:
net/mld: The MLD logic now compiles and is much less toxic. It still is not a proper MLD implementation: (1) It is basically a port of IGMP, tweaked to work with IPv6 and ICMPv6 MLD messages, (2) it needs a proper analysis and comparison with RFC 3810, and (3) it is completely untested. For this reason, it will remain EXPERIMENTAL for some time.
net/mld: Add some missing macros, more fixes related to IPv6 vs IPv4 types,
net/mld: More compilation cleaning. Most fixups for IPv6 vs IPv4 types.
net/mld: Hook crudely converted .c files into build system and resolve a few of the many, many compilation/design problems.
net/mld: Add support for MLD statistics.
net/mld: Hook in MLD poll and packet transmission logic.
net/mld: Change references to IPv4 definitions to IPv6 definitions; Remove mld_input() since MLD piggybacks on ICMPv6 input. Add functions to catch MLD messages dispatched by ICMPv6 input logic.
net/mld: As a starting point, copy all net/igmp/*.c files to net/mld/. and change all occurrences of igmp (or IGMP) to mld (or MLD).
net/mld: More compilation cleaning. Most fixups for IPv6 vs IPv4 types.
net/mld: Hook crudely converted .c files into build system and resolve a few of the many, many compilation/design problems.
net/mld: Add support for MLD statistics.
net/mld: Hook in MLD poll and packet transmission logic.
net/mld: Change references to IPv4 definitions to IPv6 definitions; Remove mld_input() since MLD piggybacks on ICMPv6 input. Add functions to catch MLD messages dispatched by ICMPv6 input logic.
net/mld: As a starting point, copy all net/igmp/*.c files to net/mld/. and change all occurrences of igmp (or IGMP) to mld (or MLD).
2018-11-01 22:18:40 +01:00
|
|
|
|
2018-11-04 17:57:21 +01:00
|
|
|
return OK;
|
|
|
|
}
|
|
|
|
|
2018-11-10 18:29:02 +01:00
|
|
|
/* All of other Queries are sent with the group address set. Find the
|
|
|
|
* group instance associated with this group address. For the purpose of
|
2018-11-07 17:39:51 +01:00
|
|
|
* sending reports, we only care about the query if we are a member of the
|
|
|
|
* group.
|
2018-11-04 17:57:21 +01:00
|
|
|
*/
|
Squashed commit of the following:
net/mld: The MLD logic now compiles and is much less toxic. It still is not a proper MLD implementation: (1) It is basically a port of IGMP, tweaked to work with IPv6 and ICMPv6 MLD messages, (2) it needs a proper analysis and comparison with RFC 3810, and (3) it is completely untested. For this reason, it will remain EXPERIMENTAL for some time.
net/mld: Add some missing macros, more fixes related to IPv6 vs IPv4 types,
net/mld: More compilation cleaning. Most fixups for IPv6 vs IPv4 types.
net/mld: Hook crudely converted .c files into build system and resolve a few of the many, many compilation/design problems.
net/mld: Add support for MLD statistics.
net/mld: Hook in MLD poll and packet transmission logic.
net/mld: Change references to IPv4 definitions to IPv6 definitions; Remove mld_input() since MLD piggybacks on ICMPv6 input. Add functions to catch MLD messages dispatched by ICMPv6 input logic.
net/mld: As a starting point, copy all net/igmp/*.c files to net/mld/. and change all occurrences of igmp (or IGMP) to mld (or MLD).
net/mld: More compilation cleaning. Most fixups for IPv6 vs IPv4 types.
net/mld: Hook crudely converted .c files into build system and resolve a few of the many, many compilation/design problems.
net/mld: Add support for MLD statistics.
net/mld: Hook in MLD poll and packet transmission logic.
net/mld: Change references to IPv4 definitions to IPv6 definitions; Remove mld_input() since MLD piggybacks on ICMPv6 input. Add functions to catch MLD messages dispatched by ICMPv6 input logic.
net/mld: As a starting point, copy all net/igmp/*.c files to net/mld/. and change all occurrences of igmp (or IGMP) to mld (or MLD).
2018-11-01 22:18:40 +01:00
|
|
|
|
2018-11-04 17:57:21 +01:00
|
|
|
group = mld_grpfind(dev, query->grpaddr);
|
2018-11-10 18:29:02 +01:00
|
|
|
if (group == NULL)
|
2018-11-04 17:57:21 +01:00
|
|
|
{
|
2018-11-06 01:39:55 +01:00
|
|
|
mldinfo("We are not a member of this group\n");
|
2018-11-04 17:57:21 +01:00
|
|
|
|
|
|
|
dev->d_len = 0;
|
|
|
|
return -ENOENT;
|
|
|
|
}
|
Squashed commit of the following:
net/mld: The MLD logic now compiles and is much less toxic. It still is not a proper MLD implementation: (1) It is basically a port of IGMP, tweaked to work with IPv6 and ICMPv6 MLD messages, (2) it needs a proper analysis and comparison with RFC 3810, and (3) it is completely untested. For this reason, it will remain EXPERIMENTAL for some time.
net/mld: Add some missing macros, more fixes related to IPv6 vs IPv4 types,
net/mld: More compilation cleaning. Most fixups for IPv6 vs IPv4 types.
net/mld: Hook crudely converted .c files into build system and resolve a few of the many, many compilation/design problems.
net/mld: Add support for MLD statistics.
net/mld: Hook in MLD poll and packet transmission logic.
net/mld: Change references to IPv4 definitions to IPv6 definitions; Remove mld_input() since MLD piggybacks on ICMPv6 input. Add functions to catch MLD messages dispatched by ICMPv6 input logic.
net/mld: As a starting point, copy all net/igmp/*.c files to net/mld/. and change all occurrences of igmp (or IGMP) to mld (or MLD).
net/mld: More compilation cleaning. Most fixups for IPv6 vs IPv4 types.
net/mld: Hook crudely converted .c files into build system and resolve a few of the many, many compilation/design problems.
net/mld: Add support for MLD statistics.
net/mld: Hook in MLD poll and packet transmission logic.
net/mld: Change references to IPv4 definitions to IPv6 definitions; Remove mld_input() since MLD piggybacks on ICMPv6 input. Add functions to catch MLD messages dispatched by ICMPv6 input logic.
net/mld: As a starting point, copy all net/igmp/*.c files to net/mld/. and change all occurrences of igmp (or IGMP) to mld (or MLD).
2018-11-01 22:18:40 +01:00
|
|
|
|
2018-11-04 17:57:21 +01:00
|
|
|
/* Check if we are still the querier for this group */
|
2018-11-03 20:45:33 +01:00
|
|
|
|
2018-11-04 17:57:21 +01:00
|
|
|
mld_check_querier(dev, ipv6, group);
|
|
|
|
|
2018-11-06 21:46:03 +01:00
|
|
|
#ifdef CONFIG_NET_MLD_ROUTER
|
|
|
|
/* Save the number of members that reported in the previous query cycle;
|
|
|
|
* reset the number of members that have reported in the new query cycle.
|
|
|
|
*/
|
|
|
|
|
|
|
|
group->lstmbrs = group->members;
|
|
|
|
group->members = 0;
|
|
|
|
#endif
|
|
|
|
|
2018-11-04 21:07:27 +01:00
|
|
|
/* Warn if we received a MLDv2 query in MLDv1 compatibility mode. */
|
|
|
|
|
|
|
|
if (!mldv1 && IS_MLD_V1COMPAT(group->flags))
|
|
|
|
{
|
2018-11-06 01:39:55 +01:00
|
|
|
mldinfo("WARNING: MLDv2 query received in MLDv1 compatibility mode\n");
|
2018-11-04 21:07:27 +01:00
|
|
|
}
|
|
|
|
|
2018-11-10 18:29:02 +01:00
|
|
|
/* Check for Multicast Address Specific (MAS) Query or a Multicast Address
|
|
|
|
* and Source Specific (MASS) Query. MAS and MASS queries are sent with
|
|
|
|
* an IP destination address equal to the multicast address of interest.
|
|
|
|
*/
|
2018-11-04 17:57:21 +01:00
|
|
|
|
2018-11-10 18:29:02 +01:00
|
|
|
if (net_ipv6addr_cmp(ipv6->destipaddr, group->grpaddr))
|
2018-11-04 17:57:21 +01:00
|
|
|
{
|
|
|
|
if (query->nsources == 0)
|
|
|
|
{
|
2018-11-06 01:39:55 +01:00
|
|
|
mldinfo("Multicast Address Specific Query\n");
|
2018-11-04 17:57:21 +01:00
|
|
|
MLD_STATINCR(g_netstats.mld.mas_query_received);
|
Squashed commit of the following:
net/mld: The MLD logic now compiles and is much less toxic. It still is not a proper MLD implementation: (1) It is basically a port of IGMP, tweaked to work with IPv6 and ICMPv6 MLD messages, (2) it needs a proper analysis and comparison with RFC 3810, and (3) it is completely untested. For this reason, it will remain EXPERIMENTAL for some time.
net/mld: Add some missing macros, more fixes related to IPv6 vs IPv4 types,
net/mld: More compilation cleaning. Most fixups for IPv6 vs IPv4 types.
net/mld: Hook crudely converted .c files into build system and resolve a few of the many, many compilation/design problems.
net/mld: Add support for MLD statistics.
net/mld: Hook in MLD poll and packet transmission logic.
net/mld: Change references to IPv4 definitions to IPv6 definitions; Remove mld_input() since MLD piggybacks on ICMPv6 input. Add functions to catch MLD messages dispatched by ICMPv6 input logic.
net/mld: As a starting point, copy all net/igmp/*.c files to net/mld/. and change all occurrences of igmp (or IGMP) to mld (or MLD).
net/mld: More compilation cleaning. Most fixups for IPv6 vs IPv4 types.
net/mld: Hook crudely converted .c files into build system and resolve a few of the many, many compilation/design problems.
net/mld: Add support for MLD statistics.
net/mld: Hook in MLD poll and packet transmission logic.
net/mld: Change references to IPv4 definitions to IPv6 definitions; Remove mld_input() since MLD piggybacks on ICMPv6 input. Add functions to catch MLD messages dispatched by ICMPv6 input logic.
net/mld: As a starting point, copy all net/igmp/*.c files to net/mld/. and change all occurrences of igmp (or IGMP) to mld (or MLD).
2018-11-01 22:18:40 +01:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2018-11-06 01:39:55 +01:00
|
|
|
mldinfo("Multicast Address and Source Specific Query\n");
|
2018-11-06 17:42:53 +01:00
|
|
|
MLD_STATINCR(g_netstats.mld.mass_query_received);
|
2018-11-04 17:57:21 +01:00
|
|
|
}
|
2018-11-03 20:45:33 +01:00
|
|
|
|
2018-11-04 21:07:27 +01:00
|
|
|
/* Check MLDv1 compatibility mode */
|
|
|
|
|
|
|
|
mld_setup_v1compat(group, query, mldv1);
|
|
|
|
|
2018-11-04 17:57:21 +01:00
|
|
|
/* Send the report */
|
2018-11-03 20:45:33 +01:00
|
|
|
|
2018-11-04 21:07:27 +01:00
|
|
|
mld_send(dev, group, mld_report_msgtype(group));
|
Squashed commit of the following:
net/mld: The MLD logic now compiles and is much less toxic. It still is not a proper MLD implementation: (1) It is basically a port of IGMP, tweaked to work with IPv6 and ICMPv6 MLD messages, (2) it needs a proper analysis and comparison with RFC 3810, and (3) it is completely untested. For this reason, it will remain EXPERIMENTAL for some time.
net/mld: Add some missing macros, more fixes related to IPv6 vs IPv4 types,
net/mld: More compilation cleaning. Most fixups for IPv6 vs IPv4 types.
net/mld: Hook crudely converted .c files into build system and resolve a few of the many, many compilation/design problems.
net/mld: Add support for MLD statistics.
net/mld: Hook in MLD poll and packet transmission logic.
net/mld: Change references to IPv4 definitions to IPv6 definitions; Remove mld_input() since MLD piggybacks on ICMPv6 input. Add functions to catch MLD messages dispatched by ICMPv6 input logic.
net/mld: As a starting point, copy all net/igmp/*.c files to net/mld/. and change all occurrences of igmp (or IGMP) to mld (or MLD).
net/mld: More compilation cleaning. Most fixups for IPv6 vs IPv4 types.
net/mld: Hook crudely converted .c files into build system and resolve a few of the many, many compilation/design problems.
net/mld: Add support for MLD statistics.
net/mld: Hook in MLD poll and packet transmission logic.
net/mld: Change references to IPv4 definitions to IPv6 definitions; Remove mld_input() since MLD piggybacks on ICMPv6 input. Add functions to catch MLD messages dispatched by ICMPv6 input logic.
net/mld: As a starting point, copy all net/igmp/*.c files to net/mld/. and change all occurrences of igmp (or IGMP) to mld (or MLD).
2018-11-01 22:18:40 +01:00
|
|
|
}
|
|
|
|
|
2018-11-04 17:57:21 +01:00
|
|
|
/* Not sent to all systems. Check for Unicast General Query */
|
Squashed commit of the following:
net/mld: The MLD logic now compiles and is much less toxic. It still is not a proper MLD implementation: (1) It is basically a port of IGMP, tweaked to work with IPv6 and ICMPv6 MLD messages, (2) it needs a proper analysis and comparison with RFC 3810, and (3) it is completely untested. For this reason, it will remain EXPERIMENTAL for some time.
net/mld: Add some missing macros, more fixes related to IPv6 vs IPv4 types,
net/mld: More compilation cleaning. Most fixups for IPv6 vs IPv4 types.
net/mld: Hook crudely converted .c files into build system and resolve a few of the many, many compilation/design problems.
net/mld: Add support for MLD statistics.
net/mld: Hook in MLD poll and packet transmission logic.
net/mld: Change references to IPv4 definitions to IPv6 definitions; Remove mld_input() since MLD piggybacks on ICMPv6 input. Add functions to catch MLD messages dispatched by ICMPv6 input logic.
net/mld: As a starting point, copy all net/igmp/*.c files to net/mld/. and change all occurrences of igmp (or IGMP) to mld (or MLD).
net/mld: More compilation cleaning. Most fixups for IPv6 vs IPv4 types.
net/mld: Hook crudely converted .c files into build system and resolve a few of the many, many compilation/design problems.
net/mld: Add support for MLD statistics.
net/mld: Hook in MLD poll and packet transmission logic.
net/mld: Change references to IPv4 definitions to IPv6 definitions; Remove mld_input() since MLD piggybacks on ICMPv6 input. Add functions to catch MLD messages dispatched by ICMPv6 input logic.
net/mld: As a starting point, copy all net/igmp/*.c files to net/mld/. and change all occurrences of igmp (or IGMP) to mld (or MLD).
2018-11-01 22:18:40 +01:00
|
|
|
|
2018-11-04 17:57:21 +01:00
|
|
|
else if (net_ipv6addr_cmp(ipv6->destipaddr, dev->d_ipv6addr))
|
Squashed commit of the following:
net/mld: The MLD logic now compiles and is much less toxic. It still is not a proper MLD implementation: (1) It is basically a port of IGMP, tweaked to work with IPv6 and ICMPv6 MLD messages, (2) it needs a proper analysis and comparison with RFC 3810, and (3) it is completely untested. For this reason, it will remain EXPERIMENTAL for some time.
net/mld: Add some missing macros, more fixes related to IPv6 vs IPv4 types,
net/mld: More compilation cleaning. Most fixups for IPv6 vs IPv4 types.
net/mld: Hook crudely converted .c files into build system and resolve a few of the many, many compilation/design problems.
net/mld: Add support for MLD statistics.
net/mld: Hook in MLD poll and packet transmission logic.
net/mld: Change references to IPv4 definitions to IPv6 definitions; Remove mld_input() since MLD piggybacks on ICMPv6 input. Add functions to catch MLD messages dispatched by ICMPv6 input logic.
net/mld: As a starting point, copy all net/igmp/*.c files to net/mld/. and change all occurrences of igmp (or IGMP) to mld (or MLD).
net/mld: More compilation cleaning. Most fixups for IPv6 vs IPv4 types.
net/mld: Hook crudely converted .c files into build system and resolve a few of the many, many compilation/design problems.
net/mld: Add support for MLD statistics.
net/mld: Hook in MLD poll and packet transmission logic.
net/mld: Change references to IPv4 definitions to IPv6 definitions; Remove mld_input() since MLD piggybacks on ICMPv6 input. Add functions to catch MLD messages dispatched by ICMPv6 input logic.
net/mld: As a starting point, copy all net/igmp/*.c files to net/mld/. and change all occurrences of igmp (or IGMP) to mld (or MLD).
2018-11-01 22:18:40 +01:00
|
|
|
{
|
2018-11-06 01:39:55 +01:00
|
|
|
mldinfo("Unicast query\n");
|
Squashed commit of the following:
net/mld: The MLD logic now compiles and is much less toxic. It still is not a proper MLD implementation: (1) It is basically a port of IGMP, tweaked to work with IPv6 and ICMPv6 MLD messages, (2) it needs a proper analysis and comparison with RFC 3810, and (3) it is completely untested. For this reason, it will remain EXPERIMENTAL for some time.
net/mld: Add some missing macros, more fixes related to IPv6 vs IPv4 types,
net/mld: More compilation cleaning. Most fixups for IPv6 vs IPv4 types.
net/mld: Hook crudely converted .c files into build system and resolve a few of the many, many compilation/design problems.
net/mld: Add support for MLD statistics.
net/mld: Hook in MLD poll and packet transmission logic.
net/mld: Change references to IPv4 definitions to IPv6 definitions; Remove mld_input() since MLD piggybacks on ICMPv6 input. Add functions to catch MLD messages dispatched by ICMPv6 input logic.
net/mld: As a starting point, copy all net/igmp/*.c files to net/mld/. and change all occurrences of igmp (or IGMP) to mld (or MLD).
net/mld: More compilation cleaning. Most fixups for IPv6 vs IPv4 types.
net/mld: Hook crudely converted .c files into build system and resolve a few of the many, many compilation/design problems.
net/mld: Add support for MLD statistics.
net/mld: Hook in MLD poll and packet transmission logic.
net/mld: Change references to IPv4 definitions to IPv6 definitions; Remove mld_input() since MLD piggybacks on ICMPv6 input. Add functions to catch MLD messages dispatched by ICMPv6 input logic.
net/mld: As a starting point, copy all net/igmp/*.c files to net/mld/. and change all occurrences of igmp (or IGMP) to mld (or MLD).
2018-11-01 22:18:40 +01:00
|
|
|
MLD_STATINCR(g_netstats.mld.ucast_query_received);
|
|
|
|
|
2018-11-04 21:07:27 +01:00
|
|
|
/* Check MLDv1 compatibility mode */
|
|
|
|
|
|
|
|
mld_setup_v1compat(group, query, mldv1);
|
|
|
|
|
2018-11-04 17:57:21 +01:00
|
|
|
/* Send the report */
|
|
|
|
|
2018-11-04 21:07:27 +01:00
|
|
|
mld_send(dev, group, mld_report_msgtype(group));
|
2018-11-04 17:57:21 +01:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2018-11-06 01:39:55 +01:00
|
|
|
mldinfo("WARNING: Unhandled query\n");
|
2018-11-04 17:57:21 +01:00
|
|
|
MLD_STATINCR(g_netstats.mld.bad_query_received);
|
|
|
|
|
|
|
|
/* Need to set d_len to zero to indication that nothing is being sent */
|
|
|
|
|
|
|
|
dev->d_len = 0;
|
Squashed commit of the following:
net/mld: The MLD logic now compiles and is much less toxic. It still is not a proper MLD implementation: (1) It is basically a port of IGMP, tweaked to work with IPv6 and ICMPv6 MLD messages, (2) it needs a proper analysis and comparison with RFC 3810, and (3) it is completely untested. For this reason, it will remain EXPERIMENTAL for some time.
net/mld: Add some missing macros, more fixes related to IPv6 vs IPv4 types,
net/mld: More compilation cleaning. Most fixups for IPv6 vs IPv4 types.
net/mld: Hook crudely converted .c files into build system and resolve a few of the many, many compilation/design problems.
net/mld: Add support for MLD statistics.
net/mld: Hook in MLD poll and packet transmission logic.
net/mld: Change references to IPv4 definitions to IPv6 definitions; Remove mld_input() since MLD piggybacks on ICMPv6 input. Add functions to catch MLD messages dispatched by ICMPv6 input logic.
net/mld: As a starting point, copy all net/igmp/*.c files to net/mld/. and change all occurrences of igmp (or IGMP) to mld (or MLD).
net/mld: More compilation cleaning. Most fixups for IPv6 vs IPv4 types.
net/mld: Hook crudely converted .c files into build system and resolve a few of the many, many compilation/design problems.
net/mld: Add support for MLD statistics.
net/mld: Hook in MLD poll and packet transmission logic.
net/mld: Change references to IPv4 definitions to IPv6 definitions; Remove mld_input() since MLD piggybacks on ICMPv6 input. Add functions to catch MLD messages dispatched by ICMPv6 input logic.
net/mld: As a starting point, copy all net/igmp/*.c files to net/mld/. and change all occurrences of igmp (or IGMP) to mld (or MLD).
2018-11-01 22:18:40 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
return OK;
|
|
|
|
}
|