]> git.puffer.fish Git - matthieu/frr.git/commitdiff
ospfd, pimd: add missing var, skip mroute sock
authorQuentin Young <qlyoung@cumulusnetworks.com>
Tue, 11 Feb 2020 19:48:16 +0000 (14:48 -0500)
committerQuentin Young <qlyoung@nvidia.com>
Mon, 15 Nov 2021 19:59:46 +0000 (14:59 -0500)
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
ospfd/ospf_main.c
pimd/pim_mroute.c

index ec6326df43092351a02cabfcc291041daaebe61a..5a0f4d67d665ae00c3b39a780ffa9ae7b98f61a9 100644 (file)
@@ -365,6 +365,18 @@ done:
        /* OSPF errors init */
        ospf_error_init();
 
+       /*
+        * Need to initialize the default ospf structure, so the interface mode
+        * commands can be duly processed if they are received before 'router
+        * ospf',  when ospfd is restarted
+        */
+       bool created = false;
+       if (instance && !ospf_get_instance(instance, &created)) {
+               flog_err(EC_OSPF_INIT_FAIL, "OSPF instance init failed: %s",
+                        strerror(errno));
+               exit(1);
+       }
+
        frr_config_fork();
        frr_run(master);
 
index 466bea1135ce9cd73d59d1bbf0fd7a15e939b9dc..e254180fe3099f39bd188d39c89005e4fb91fce8 100644 (file)
@@ -743,6 +743,7 @@ int pim_mroute_socket_enable(struct pim_instance *pim)
 
        frr_with_privs(&pimd_privs) {
 
+#ifndef FUZZING
                fd = socket(AF_INET, SOCK_RAW, IPPROTO_IGMP);
 
                if (fd < 0) {
@@ -751,6 +752,9 @@ int pim_mroute_socket_enable(struct pim_instance *pim)
                                  safe_strerror(errno));
                        return -2;
                }
+#else
+               fd = 69;
+#endif
 
 #ifdef SO_BINDTODEVICE
                if (pim->vrf->vrf_id != VRF_DEFAULT
@@ -766,6 +770,7 @@ int pim_mroute_socket_enable(struct pim_instance *pim)
        }
 
        pim->mroute_socket = fd;
+#ifndef FUZZING
        if (pim_mroute_set(pim, 1)) {
                zlog_warn(
                        "Could not enable mroute on socket fd=%d: errno=%d: %s",
@@ -778,6 +783,7 @@ int pim_mroute_socket_enable(struct pim_instance *pim)
        pim->mroute_socket_creation = pim_time_monotonic_sec();
 
        mroute_read_on(pim);
+#endif
 
        return 0;
 }