]> git.proxmox.com Git - mirror_frr.git/blobdiff - pimd/pim_igmpv2.c
Merge pull request #13646 from donaldsharp/logically_illogical
[mirror_frr.git] / pimd / pim_igmpv2.c
index a949d2b126c03dde990047c2e403b3d1d9fb0970..944dffdc338942fe2303526fde385ac3c9e49e9b 100644 (file)
@@ -1,26 +1,14 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * PIM for Quagga
  * Copyright (C) 2016 Cumulus Networks, Inc.
  * Daniel Walton
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #include "zebra.h"
 
 #include "pimd.h"
+#include "pim_instance.h"
 #include "pim_igmp.h"
 #include "pim_igmpv2.h"
 #include "pim_igmpv3.h"
@@ -33,7 +21,7 @@
 static void on_trace(const char *label, struct interface *ifp,
                     struct in_addr from)
 {
-       if (PIM_DEBUG_IGMP_TRACE) {
+       if (PIM_DEBUG_GM_TRACE) {
                char from_str[INET_ADDRSTRLEN];
                pim_inet4_dump("<from?>", from, from_str, sizeof(from_str));
                zlog_debug("%s: from %s on %s", label, from_str, ifp->name);
@@ -67,7 +55,7 @@ void igmp_v2_send_query(struct gm_group *group, int fd, const char *ifname,
        checksum = in_cksum(query_buf, msg_size);
        *(uint16_t *)(query_buf + IGMP_CHECKSUM_OFFSET) = checksum;
 
-       if (PIM_DEBUG_IGMP_PACKETS) {
+       if (PIM_DEBUG_GM_PACKETS) {
                char dst_str[INET_ADDRSTRLEN];
                char group_str[INET_ADDRSTRLEN];
                pim_inet4_dump("<dst?>", dst_addr, dst_str, sizeof(dst_str));
@@ -120,7 +108,7 @@ int igmp_v2_recv_report(struct gm_sock *igmp, struct in_addr from,
                return 0;
 
        if (igmp_msg_len != IGMP_V12_MSG_SIZE) {
-               if (PIM_DEBUG_IGMP_PACKETS)
+               if (PIM_DEBUG_GM_PACKETS)
                        zlog_debug(
                                "Recv IGMPv2 REPORT from %s on %s: size=%d other than correct=%d",
                                from_str, ifp->name, igmp_msg_len,
@@ -139,7 +127,7 @@ int igmp_v2_recv_report(struct gm_sock *igmp, struct in_addr from,
 
        memcpy(&group_addr, igmp_msg + 4, sizeof(struct in_addr));
 
-       if (PIM_DEBUG_IGMP_PACKETS) {
+       if (PIM_DEBUG_GM_PACKETS) {
                pim_inet4_dump("<dst?>", group_addr, group_str,
                               sizeof(group_str));
                zlog_debug("Recv IGMPv2 REPORT from %s on %s for %s", from_str,
@@ -154,7 +142,7 @@ int igmp_v2_recv_report(struct gm_sock *igmp, struct in_addr from,
         * the SSM range.
         */
        if (pim_is_grp_ssm(pim_ifp->pim, group_addr)) {
-               if (PIM_DEBUG_IGMP_PACKETS) {
+               if (PIM_DEBUG_GM_PACKETS) {
                        zlog_debug(
                                "Ignoring IGMPv2 group record %pI4 from %s on %s exclude mode in SSM range",
                                &group_addr.s_addr, from_str, ifp->name);
@@ -195,7 +183,7 @@ int igmp_v2_recv_leave(struct gm_sock *igmp, struct ip *ip_hdr,
                return 0;
 
        if (igmp_msg_len != IGMP_V12_MSG_SIZE) {
-               if (PIM_DEBUG_IGMP_PACKETS)
+               if (PIM_DEBUG_GM_PACKETS)
                        zlog_debug(
                                "Recv IGMPv2 LEAVE from %s on %s: size=%d other than correct=%d",
                                from_str, ifp->name, igmp_msg_len,
@@ -212,7 +200,7 @@ int igmp_v2_recv_leave(struct gm_sock *igmp, struct ip *ip_hdr,
 
        memcpy(&group_addr, igmp_msg + 4, sizeof(struct in_addr));
 
-       if (PIM_DEBUG_IGMP_PACKETS) {
+       if (PIM_DEBUG_GM_PACKETS) {
                pim_inet4_dump("<dst?>", group_addr, group_str,
                               sizeof(group_str));
                zlog_debug("Recv IGMPv2 LEAVE from %s on %s for %s", from_str,
@@ -236,7 +224,7 @@ int igmp_v2_recv_leave(struct gm_sock *igmp, struct ip *ip_hdr,
        */
        if ((ntohl(ip_hdr->ip_dst.s_addr) != INADDR_ALLRTRS_GROUP)
            && (ip_hdr->ip_dst.s_addr != group_addr.s_addr)) {
-               if (PIM_DEBUG_IGMP_EVENTS)
+               if (PIM_DEBUG_GM_EVENTS)
                        zlog_debug(
                                "IGMPv2 Leave message is ignored since received on address other than ALL-ROUTERS or Group-address");
                return -1;