From: Quentin Young Date: Tue, 11 Feb 2020 19:48:16 +0000 (-0500) Subject: ospfd, pimd: add missing var, skip mroute sock X-Git-Url: https://git.puffer.fish/?a=commitdiff_plain;h=ae340b3d4f39035928d5612e0c244579fe185c41;p=matthieu%2Ffrr.git ospfd, pimd: add missing var, skip mroute sock Signed-off-by: Quentin Young --- diff --git a/ospfd/ospf_main.c b/ospfd/ospf_main.c index ec6326df43..5a0f4d67d6 100644 --- a/ospfd/ospf_main.c +++ b/ospfd/ospf_main.c @@ -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); diff --git a/pimd/pim_mroute.c b/pimd/pim_mroute.c index 466bea1135..e254180fe3 100644 --- a/pimd/pim_mroute.c +++ b/pimd/pim_mroute.c @@ -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; }