// SPDX-License-Identifier: GPL-2.0-only /* Copyright (C) 2010: YOSHIFUJI Hideaki <[email protected]> * Copyright (C) 2015: Linus Lüssing <[email protected]> * * Based on the MLD support added to br_multicast.c by YOSHIFUJI Hideaki. */ #include <linux/skbuff.h> #include <net/ipv6.h> #include <net/mld.h> #include <net/addrconf.h> #include <net/ip6_checksum.h> static int ipv6_mc_check_ip6hdr(struct sk_buff *skb) { … } static int ipv6_mc_check_exthdrs(struct sk_buff *skb) { … } static int ipv6_mc_check_mld_reportv2(struct sk_buff *skb) { … } static int ipv6_mc_check_mld_query(struct sk_buff *skb) { … } static int ipv6_mc_check_mld_msg(struct sk_buff *skb) { … } static inline __sum16 ipv6_mc_validate_checksum(struct sk_buff *skb) { … } static int ipv6_mc_check_icmpv6(struct sk_buff *skb) { … } /** * ipv6_mc_check_mld - checks whether this is a sane MLD packet * @skb: the skb to validate * * Checks whether an IPv6 packet is a valid MLD packet. If so sets * skb transport header accordingly and returns zero. * * -EINVAL: A broken packet was detected, i.e. it violates some internet * standard * -ENOMSG: IP header validation succeeded but it is not an ICMPv6 packet * with a hop-by-hop option. * -ENODATA: IP+ICMPv6 header with hop-by-hop option validation succeeded * but it is not an MLD packet. * -ENOMEM: A memory allocation failure happened. * * Caller needs to set the skb network header and free any returned skb if it * differs from the provided skb. */ int ipv6_mc_check_mld(struct sk_buff *skb) { … } EXPORT_SYMBOL(…);