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_send.c
|
|
|
|
*
|
2021-02-19 12:45:37 +01:00
|
|
|
* Licensed to the Apache Software Foundation (ASF) under one or more
|
|
|
|
* contributor license agreements. See the NOTICE file distributed with
|
|
|
|
* this work for additional information regarding copyright ownership. The
|
|
|
|
* ASF licenses this file to you under the Apache License, Version 2.0 (the
|
|
|
|
* "License"); you may not use this file except in compliance with the
|
|
|
|
* License. You may obtain a copy of the License at
|
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
|
|
|
*
|
2021-02-19 12:45:37 +01:00
|
|
|
* http://www.apache.org/licenses/LICENSE-2.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
|
|
|
*
|
2021-02-19 12:45:37 +01:00
|
|
|
* Unless required by applicable law or agreed to in writing, software
|
|
|
|
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
|
|
|
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
|
|
|
* License for the specific language governing permissions and limitations
|
|
|
|
* under the License.
|
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
|
|
|
*
|
|
|
|
****************************************************************************/
|
|
|
|
|
|
|
|
/****************************************************************************
|
|
|
|
* Included Files
|
|
|
|
****************************************************************************/
|
|
|
|
|
|
|
|
#include <nuttx/config.h>
|
|
|
|
|
|
|
|
#include <string.h>
|
2021-05-18 08:59:14 +02:00
|
|
|
#include <assert.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 <debug.h>
|
|
|
|
#include <arpa/inet.h>
|
|
|
|
|
|
|
|
#include <nuttx/net/netconfig.h>
|
|
|
|
#include <nuttx/net/netdev.h>
|
|
|
|
#include <nuttx/net/netstats.h>
|
|
|
|
#include <nuttx/net/ip.h>
|
2018-11-02 00:51:47 +01:00
|
|
|
#include <nuttx/net/ipv6ext.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/tcp.h>
|
|
|
|
#include <nuttx/net/mld.h>
|
|
|
|
|
|
|
|
#include "devif/devif.h"
|
|
|
|
#include "inet/inet.h"
|
|
|
|
#include "utils/utils.h"
|
|
|
|
#include "mld/mld.h"
|
|
|
|
|
|
|
|
/****************************************************************************
|
|
|
|
* Pre-processor Definitions
|
|
|
|
****************************************************************************/
|
|
|
|
|
|
|
|
/* Debug */
|
|
|
|
|
2018-11-06 01:39:55 +01:00
|
|
|
#ifdef CONFIG_NET_MLD_TXDUMP
|
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
|
|
|
# define mld_dumppkt(b,n) lib_dumpbuffer("MLD", (FAR const uint8_t*)(b), (n))
|
|
|
|
#else
|
|
|
|
# define mld_dumppkt(b,n)
|
|
|
|
#endif
|
|
|
|
|
2018-11-05 15:56:07 +01:00
|
|
|
/* IPv6 header size with extensions */
|
|
|
|
|
|
|
|
#define RASIZE sizeof(struct ipv6_router_alert_s)
|
|
|
|
#define MLD_HDRLEN (IPv6_HDRLEN + RASIZE)
|
|
|
|
|
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_send
|
|
|
|
*
|
|
|
|
* Description:
|
|
|
|
* Sends an MLD IP packet on a network interface. This function constructs
|
|
|
|
* the IP header and calculates the IP header checksum.
|
|
|
|
*
|
|
|
|
* Input Parameters:
|
2018-11-04 17:57:21 +01:00
|
|
|
* dev - The device driver structure to use in the send operation.
|
|
|
|
* group - Describes the multicast group member and identifies the
|
|
|
|
* message to be sent.
|
|
|
|
* msgtype - The type of the message to be sent (see enum mld_msgtype_e)
|
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
|
|
|
*
|
|
|
|
* Returned Value:
|
|
|
|
* None
|
|
|
|
*
|
|
|
|
* Assumptions:
|
|
|
|
* The network is locked.
|
|
|
|
*
|
|
|
|
****************************************************************************/
|
|
|
|
|
|
|
|
void mld_send(FAR struct net_driver_s *dev, FAR struct mld_group_s *group,
|
2018-11-04 17:57:21 +01:00
|
|
|
uint8_t msgtype)
|
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-02 00:51:47 +01:00
|
|
|
FAR struct ipv6_router_alert_s *ra;
|
2018-11-04 17:57:21 +01:00
|
|
|
FAR const uint16_t *destipaddr;
|
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
|
|
|
unsigned int mldsize;
|
|
|
|
|
2018-11-11 18:38:29 +01:00
|
|
|
/* Only a general query message can have a NULL group */
|
|
|
|
|
|
|
|
DEBUGASSERT(dev != NULL);
|
|
|
|
DEBUGASSERT(msgtype == MLD_SEND_GENQUERY || group != NULL);
|
|
|
|
|
2023-01-11 09:09:20 +01:00
|
|
|
/* Prepare device buffer */
|
|
|
|
|
|
|
|
if (netdev_iob_prepare(dev, false, 0) != OK)
|
|
|
|
{
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
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
|
|
|
/* Select IPv6 */
|
|
|
|
|
|
|
|
IFF_SET_IPv6(dev->d_flags);
|
|
|
|
|
2018-11-04 21:07:27 +01:00
|
|
|
/* What is the size of the ICMPv6 payload? */
|
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
|
|
|
switch (msgtype)
|
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-03 20:45:33 +01:00
|
|
|
case MLD_SEND_GENQUERY: /* Send General Query */
|
2018-11-10 18:29:02 +01:00
|
|
|
case MLD_SEND_MASQUERY: /* Send Multicast Address Specific (MAS) Query */
|
2018-11-04 21:07:27 +01:00
|
|
|
{
|
2018-11-11 18:38:29 +01:00
|
|
|
mldinfo("Send General/MAS Query, flags=%02x\n",
|
|
|
|
group != NULL ? group->flags : dev->d_mld.flags);
|
2018-11-04 21:07:27 +01:00
|
|
|
mldsize = SIZEOF_MLD_MCAST_LISTEN_QUERY_S(0);
|
|
|
|
}
|
2018-11-03 20:45:33 +01:00
|
|
|
break;
|
|
|
|
|
2018-11-04 21:07:27 +01:00
|
|
|
case MLD_SEND_V1REPORT: /* Send MLDv1 Report message */
|
|
|
|
{
|
2018-11-06 01:39:55 +01:00
|
|
|
mldinfo("Send MLDv1 Report, flags=%02x\n", group->flags);
|
2018-11-04 21:07:27 +01:00
|
|
|
mldsize = sizeof(struct mld_mcast_listen_report_v1_s);
|
|
|
|
}
|
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
|
|
|
break;
|
|
|
|
|
2018-11-04 21:07:27 +01:00
|
|
|
case MLD_SEND_V2REPORT: /* Send MLDv2 Report message */
|
|
|
|
{
|
|
|
|
unsigned int addreclen;
|
|
|
|
|
2018-11-06 01:39:55 +01:00
|
|
|
mldinfo("Send MLDv2 Report, flags=%02x\n", group->flags);
|
2018-11-04 21:07:27 +01:00
|
|
|
addreclen = SIZEOF_MLD_MCAST_ADDREC_V2_S(0, 0);
|
|
|
|
mldsize = SIZEOF_MLD_MCAST_LISTEN_REPORT_V2_S(addreclen);
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
2018-11-07 17:39:51 +01:00
|
|
|
case MLD_SEND_DONE: /* Send Done message */
|
2018-11-04 21:07:27 +01:00
|
|
|
{
|
2018-11-06 01:39:55 +01:00
|
|
|
mldinfo("Send Done message, flags=%02x\n", group->flags);
|
2018-11-07 17:39:51 +01:00
|
|
|
mldsize = sizeof(struct mld_mcast_listen_done_s);
|
2018-11-04 21:07:27 +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
|
|
|
break;
|
|
|
|
|
|
|
|
default:
|
2018-11-04 21:07:27 +01:00
|
|
|
{
|
2021-12-26 23:18:22 +01:00
|
|
|
mlderr("Bad msgtype: %02x\n", msgtype);
|
2018-11-04 21:07:27 +01:00
|
|
|
DEBUGPANIC();
|
|
|
|
}
|
2019-10-25 19:31:42 +02: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
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* The total length to send is the size of the IPv6 header, 4 bytes for the
|
|
|
|
* ROUTER ALERT, and the MLD ICMPv6 payload (and, eventually, the Ethernet
|
|
|
|
* header length)
|
|
|
|
*/
|
|
|
|
|
2018-11-05 15:56:07 +01:00
|
|
|
dev->d_len = MLD_HDRLEN + mldsize;
|
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-05 15:56:07 +01:00
|
|
|
/* The total size of the data is the size of the ICMPv6 payload PLUS the
|
|
|
|
* size of the IPv6 extension headers.
|
|
|
|
*/
|
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-05 15:56:07 +01:00
|
|
|
dev->d_sndlen = RASIZE + mldsize;
|
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
|
|
|
|
2022-11-23 12:39:40 +01:00
|
|
|
/* Update device buffer length */
|
|
|
|
|
2023-05-17 10:11:21 +02:00
|
|
|
iob_update_pktlen(dev->d_iob, dev->d_len, false);
|
2022-11-23 12:39:40 +01:00
|
|
|
|
2021-02-19 15:01:46 +01:00
|
|
|
/* Select the IPv6 destination address.
|
|
|
|
* This varies with the type of message being sent:
|
2018-11-04 17:57:21 +01:00
|
|
|
*
|
|
|
|
* MESSAGE DESTINATION ADDRESS
|
2018-11-10 18:29:02 +01:00
|
|
|
* General Query Message: The link-local, all nodes multicast address.
|
|
|
|
* MAS Query Messages: The group multicast address.
|
2018-11-10 18:41:50 +01:00
|
|
|
* V1 Report Message: The group multicast address.
|
2021-02-19 15:01:46 +01:00
|
|
|
* V2 Report Message: The link-local, all MLDv2 router multicast
|
|
|
|
* address.
|
2018-11-04 17:57:21 +01:00
|
|
|
* Done Message: The link-local, all routers multicast address.
|
|
|
|
*/
|
|
|
|
|
|
|
|
switch (msgtype)
|
|
|
|
{
|
|
|
|
case MLD_SEND_GENQUERY: /* Send General Query */
|
|
|
|
destipaddr = g_ipv6_allnodes;
|
|
|
|
break;
|
|
|
|
|
2018-11-10 18:41:50 +01:00
|
|
|
case MLD_SEND_MASQUERY: /* Send Multicast Address Specific (MAS) Query */
|
2018-11-04 21:07:27 +01:00
|
|
|
case MLD_SEND_V1REPORT: /* Send MLDv1 Report message */
|
2018-11-04 17:57:21 +01:00
|
|
|
destipaddr = group->grpaddr;
|
|
|
|
break;
|
|
|
|
|
2018-11-04 21:07:27 +01:00
|
|
|
case MLD_SEND_V2REPORT: /* Send MLDv2 Report message */
|
|
|
|
destipaddr = g_ipv6_allmldv2routers;
|
|
|
|
break;
|
|
|
|
|
2018-11-07 17:39:51 +01:00
|
|
|
case MLD_SEND_DONE: /* Send Done message */
|
2018-11-04 17:57:21 +01:00
|
|
|
destipaddr = g_ipv6_allrouters;
|
|
|
|
break;
|
2018-11-05 01:18:14 +01:00
|
|
|
|
|
|
|
default: /* Can't happen, but eliminates a warning */
|
|
|
|
return;
|
2018-11-04 17:57:21 +01:00
|
|
|
}
|
|
|
|
|
2018-11-06 01:39:55 +01:00
|
|
|
mldinfo("destipaddr: %04x:%04x:%04x:%04x:%04x:%04x:%04x:%04x\n",
|
|
|
|
destipaddr[0], destipaddr[1], destipaddr[2], destipaddr[3],
|
|
|
|
destipaddr[4], destipaddr[5], destipaddr[6], destipaddr[7]);
|
2018-11-04 17:57:21 +01:00
|
|
|
|
2022-11-29 04:23:43 +01:00
|
|
|
ipv6_build_header(IPv6BUF, dev->d_sndlen, NEXT_HOPBYBOT_EH,
|
2022-12-21 05:40:42 +01:00
|
|
|
dev->d_ipv6addr, destipaddr, MLD_TTL, 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
|
|
|
|
|
|
|
/* Add the router alert IP header option.
|
|
|
|
*
|
|
|
|
* The IPv6 router alert option (type 5) is defined in RFC 2711.
|
|
|
|
*/
|
|
|
|
|
2022-10-26 06:35:08 +02:00
|
|
|
ra = IPBUF(IPv6_HDRLEN);
|
2018-11-02 00:51:47 +01:00
|
|
|
memset(ra, 0, RASIZE);
|
|
|
|
|
2018-11-02 19:06:57 +01:00
|
|
|
ra->hbyh.nxthdr = IP_PROTO_ICMP6; /* ICMPv6 payload follows extension header */
|
|
|
|
ra->hbyh.len = 1; /* One 8-octet option follows */
|
|
|
|
ra->type = HOPBYHOP_ROUTER_ALERT; /* Router alert */
|
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
|
|
|
|
|
|
|
/* Format the MLD ICMPv6 payload into place after the IPv6 header (with
|
|
|
|
* router alert)
|
|
|
|
*/
|
|
|
|
|
2018-11-04 17:57:21 +01:00
|
|
|
switch (msgtype)
|
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-10 18:29:02 +01:00
|
|
|
case MLD_SEND_GENQUERY: /* Send General Query */
|
|
|
|
case MLD_SEND_MASQUERY: /* Send Multicast Address Specific (MAS) Query */
|
2018-11-03 20:45:33 +01:00
|
|
|
{
|
2022-10-26 06:35:08 +02:00
|
|
|
FAR struct mld_mcast_listen_query_s *query = IPBUF(MLD_HDRLEN);
|
2018-11-03 20:45:33 +01:00
|
|
|
|
2018-11-04 21:07:27 +01:00
|
|
|
/* Initialize the Query payload. In a General Query, both the
|
2018-11-03 20:45:33 +01:00
|
|
|
* Multicast Address field and the Number of Sources (N)
|
|
|
|
* field are zero.
|
2018-11-04 21:07:27 +01:00
|
|
|
*
|
|
|
|
* Careful here. In MLDv1 compatibility mode, the MRC is not
|
|
|
|
* encoded and must follow the rules for MLDv1.
|
2018-11-03 20:45:33 +01:00
|
|
|
*/
|
|
|
|
|
2018-11-06 17:42:53 +01:00
|
|
|
memset(query, 0, sizeof(struct mld_mcast_listen_query_s));
|
2018-11-03 20:45:33 +01:00
|
|
|
query->type = ICMPV6_MCAST_LISTEN_QUERY;
|
|
|
|
query->mrc = MLD_QRESP_MSEC;
|
2018-11-04 21:07:27 +01:00
|
|
|
|
2018-11-10 18:29:02 +01:00
|
|
|
/* The General Query and the MAS Query differ only in that the
|
|
|
|
* setting of the group multicast address field. This field
|
|
|
|
* is the unspecified address for General Query, but the group
|
|
|
|
* multicast address for the MAS query.
|
|
|
|
*/
|
|
|
|
|
|
|
|
if (msgtype == MLD_SEND_GENQUERY)
|
|
|
|
{
|
|
|
|
net_ipv6addr_hdrcopy(query->grpaddr, g_ipv6_unspecaddr);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
net_ipv6addr_hdrcopy(query->grpaddr, group->grpaddr);
|
|
|
|
}
|
|
|
|
|
2018-11-04 21:07:27 +01:00
|
|
|
/* Fields unique to the extended MLDv2 query */
|
|
|
|
|
2018-11-11 18:38:29 +01:00
|
|
|
if (!IS_MLD_V1COMPAT(dev->d_mld.flags))
|
2018-11-04 21:07:27 +01:00
|
|
|
{
|
|
|
|
query->flags = MLD_ROBUSTNESS;
|
|
|
|
query->qqic = MLD_QRESP_SEC;
|
|
|
|
}
|
2018-11-03 20:45:33 +01:00
|
|
|
|
|
|
|
/* Calculate the ICMPv6 checksum. */
|
|
|
|
|
|
|
|
query->chksum = 0;
|
2018-11-05 15:56:07 +01:00
|
|
|
query->chksum = ~icmpv6_chksum(dev, MLD_HDRLEN);
|
2018-11-03 20:45:33 +01:00
|
|
|
|
|
|
|
MLD_STATINCR(g_netstats.mld.query_sent);
|
2018-11-06 21:46:03 +01:00
|
|
|
|
|
|
|
#ifdef CONFIG_NET_MLD_ROUTER
|
2018-11-11 14:31:59 +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-11 18:38:29 +01:00
|
|
|
if (msgtype == MLD_SEND_GENQUERY)
|
|
|
|
{
|
|
|
|
/* Update accumulated membership for all groups. */
|
|
|
|
|
2023-01-11 12:44:41 +01:00
|
|
|
mld_new_pollcycle(dev);
|
2018-11-11 18:38:29 +01:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
/* Updated accumulated membership only for this group */
|
|
|
|
|
|
|
|
group->lstmbrs = group->members;
|
|
|
|
group->members = 0;
|
|
|
|
}
|
2018-11-06 21:46:03 +01:00
|
|
|
#endif
|
2018-11-03 20:45:33 +01:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
2018-11-04 21:07:27 +01:00
|
|
|
case MLD_SEND_V1REPORT: /* Send MLDv1 Report message */
|
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
|
|
|
{
|
2022-10-26 06:35:08 +02:00
|
|
|
FAR struct mld_mcast_listen_report_v1_s *report =
|
|
|
|
IPBUF(MLD_HDRLEN);
|
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 21:07:27 +01:00
|
|
|
/* Initialize the Report payload */
|
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
|
|
|
|
|
|
|
memset(report, 0, sizeof(struct mld_mcast_listen_report_v1_s));
|
|
|
|
net_ipv6addr_hdrcopy(report->mcastaddr, &group->grpaddr);
|
2018-11-03 20:45:33 +01:00
|
|
|
report->type = ICMPV6_MCAST_LISTEN_REPORT_V1;
|
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
|
|
|
|
|
|
|
/* Calculate the ICMPv6 checksum. */
|
|
|
|
|
|
|
|
report->chksum = 0;
|
2018-11-05 15:56:07 +01:00
|
|
|
report->chksum = ~icmpv6_chksum(dev, MLD_HDRLEN);
|
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
|
|
|
SET_MLD_LASTREPORT(group->flags); /* Remember we were the last to report */
|
2018-11-06 17:42:53 +01:00
|
|
|
MLD_STATINCR(g_netstats.mld.v1report_sent);
|
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
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
2018-11-04 21:07:27 +01:00
|
|
|
case MLD_SEND_V2REPORT: /* Send MLDv2 Report message */
|
|
|
|
{
|
2022-10-26 06:35:08 +02:00
|
|
|
FAR struct mld_mcast_listen_report_v2_s *report =
|
|
|
|
IPBUF(MLD_HDRLEN);
|
2018-11-04 21:07:27 +01:00
|
|
|
FAR struct mld_mcast_addrec_v2_s *addrec;
|
|
|
|
|
|
|
|
/* Initialize the Report payload */
|
|
|
|
|
|
|
|
memset(report, 0, mldsize);
|
|
|
|
report->type = ICMPV6_MCAST_LISTEN_REPORT_V2;
|
2018-11-05 15:56:07 +01:00
|
|
|
report->naddrec = HTONS(1);
|
2018-11-04 21:07:27 +01:00
|
|
|
|
|
|
|
addrec = report->addrec;
|
|
|
|
addrec->rectype = MODE_IS_INCLUDE;
|
|
|
|
net_ipv6addr_hdrcopy(addrec->mcast, &group->grpaddr);
|
|
|
|
|
|
|
|
/* Calculate the ICMPv6 checksum. */
|
|
|
|
|
|
|
|
report->chksum = 0;
|
2018-11-05 15:56:07 +01:00
|
|
|
report->chksum = ~icmpv6_chksum(dev, MLD_HDRLEN);
|
2018-11-04 21:07:27 +01:00
|
|
|
|
|
|
|
SET_MLD_LASTREPORT(group->flags); /* Remember we were the last to report */
|
2018-11-06 17:42:53 +01:00
|
|
|
MLD_STATINCR(g_netstats.mld.v2report_sent);
|
2018-11-04 21:07:27 +01:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
2018-11-07 17:39:51 +01:00
|
|
|
case MLD_SEND_DONE: /* Send Done message */
|
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
|
|
|
{
|
2022-10-26 06:35:08 +02:00
|
|
|
FAR struct mld_mcast_listen_done_s *done = IPBUF(MLD_HDRLEN);
|
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 21:07:27 +01:00
|
|
|
/* Initialize the Done payload */
|
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-07 17:39:51 +01:00
|
|
|
memset(done, 0, sizeof(struct mld_mcast_listen_done_s));
|
|
|
|
done->type = ICMPV6_MCAST_LISTEN_DONE;
|
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_ipv6addr_hdrcopy(done->mcastaddr, &group->grpaddr);
|
|
|
|
|
|
|
|
/* Calculate the ICMPv6 checksum. */
|
|
|
|
|
|
|
|
done->chksum = 0;
|
2018-11-05 15:56:07 +01:00
|
|
|
done->chksum = ~icmpv6_chksum(dev, MLD_HDRLEN);
|
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.done_sent);
|
|
|
|
}
|
|
|
|
break;
|
2018-11-05 01:18:14 +01:00
|
|
|
|
|
|
|
default: /* Can't happen, but eliminates a warning */
|
|
|
|
return;
|
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.icmpv6.sent);
|
|
|
|
MLD_STATINCR(g_netstats.ipv6.sent);
|
|
|
|
|
2022-11-29 04:23:43 +01:00
|
|
|
mldinfo("Outgoing ICMPv6 MLD packet length: %d\n", dev->d_len);
|
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
|
|
|
mld_dumppkt((FAR const uint8_t *)IPv6BUF, MLD_HDRLEN + mldsize);
|
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-11 14:31:59 +01:00
|
|
|
|
|
|
|
/****************************************************************************
|
|
|
|
* Name: mld_report_msgtype
|
|
|
|
*
|
|
|
|
* Description:
|
|
|
|
* Determine which type of Report to send, MLDv1 or MLDv2, depending on
|
|
|
|
* current state of compatibility mode flag.
|
|
|
|
*
|
|
|
|
****************************************************************************/
|
|
|
|
|
2018-11-11 18:38:29 +01:00
|
|
|
uint8_t mld_report_msgtype(FAR struct net_driver_s *dev)
|
2018-11-11 14:31:59 +01:00
|
|
|
{
|
2018-11-11 18:38:29 +01:00
|
|
|
if (IS_MLD_V1COMPAT(dev->d_mld.flags))
|
2018-11-11 14:31:59 +01:00
|
|
|
{
|
|
|
|
return MLD_SEND_V1REPORT;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
return MLD_SEND_V2REPORT;
|
|
|
|
}
|
|
|
|
}
|