]> git.proxmox.com Git - mirror_frr.git/blobdiff - pimd/pimd.c
Merge pull request #12798 from donaldsharp/rib_match_multicast
[mirror_frr.git] / pimd / pimd.c
index 992bb931bd600edb972412a061460fe724045c9c..db619748000ee3ddb95f2bff2402e859ae87ec77 100644 (file)
@@ -1,20 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * PIM for Quagga
  * Copyright (C) 2008  Everton da Silva Marques
- *
- * 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 "bfd.h"
 
 #include "pimd.h"
+#if PIM_IPV == 4
 #include "pim_cmd.h"
+#else
+#include "pim6_cmd.h"
+#endif
 #include "pim_str.h"
 #include "pim_oil.h"
 #include "pim_pim.h"
 CPP_NOTICE("Work needs to be done to make this work properly via the pim mroute socket\n");
 #endif /* MAXVIFS > 256 */
 
+#if PIM_IPV == 4
 const char *const PIM_ALL_SYSTEMS = MCAST_ALL_SYSTEMS;
 const char *const PIM_ALL_ROUTERS = MCAST_ALL_ROUTERS;
 const char *const PIM_ALL_PIM_ROUTERS = MCAST_ALL_PIM_ROUTERS;
 const char *const PIM_ALL_IGMP_ROUTERS = MCAST_ALL_IGMP_ROUTERS;
+#else
+const char *const PIM_ALL_SYSTEMS = "ff02::1";
+const char *const PIM_ALL_ROUTERS = "ff02::2";
+const char *const PIM_ALL_PIM_ROUTERS = "ff02::d";
+const char *const PIM_ALL_IGMP_ROUTERS = "ff02::16";
+#endif
 
 DEFINE_MTYPE_STATIC(PIMD, ROUTER, "PIM Router information");
 
 struct pim_router *router = NULL;
-struct in_addr qpim_all_pim_routers_addr;
+pim_addr qpim_all_pim_routers_addr;
 
 void pim_prefix_list_update(struct prefix_list *plist)
 {
@@ -89,6 +87,7 @@ void pim_router_init(void)
        router->debugs = 0;
        router->master = frr_init();
        router->t_periodic = PIM_DEFAULT_T_PERIODIC;
+       router->multipath = MULTIPATH_NUM;
 
        /*
          RFC 4601: 4.6.3.  Assert Metrics
@@ -103,7 +102,7 @@ void pim_router_init(void)
                PIM_ASSERT_METRIC_PREFERENCE_MAX;
        router->infinite_assert_metric.route_metric =
                PIM_ASSERT_ROUTE_METRIC_MAX;
-       router->infinite_assert_metric.ip_address.s_addr = INADDR_ANY;
+       router->infinite_assert_metric.ip_address = PIMADDR_ANY;
        router->rpf_cache_refresh_delay_msec = 50;
        router->register_suppress_time = PIM_REGISTER_SUPPRESSION_TIME_DEFAULT;
        router->packet_process = PIM_DEFAULT_PACKET_PROCESS;
@@ -120,7 +119,8 @@ void pim_router_terminate(void)
 
 void pim_init(void)
 {
-       if (!inet_aton(PIM_ALL_PIM_ROUTERS, &qpim_all_pim_routers_addr)) {
+       if (!inet_pton(PIM_AF, PIM_ALL_PIM_ROUTERS,
+                      &qpim_all_pim_routers_addr)) {
                flog_err(
                        EC_LIB_SOCKET,
                        "%s %s: could not solve %s to group address: errno=%d: %s",