]> git.puffer.fish Git - mirror/frr.git/commitdiff
pimd: Fix wrong setsockopt() call 13389/head
authoranlan_cs <vic.lan@pica8.com>
Wed, 26 Apr 2023 09:59:58 +0000 (17:59 +0800)
committeranlan_cs <vic.lan@pica8.com>
Thu, 27 Apr 2023 01:15:00 +0000 (09:15 +0800)
`setsockopt()` should be only called once with `MRT_TABLE`
in "enable" case, otherwise it will fail.  In current code,
`mroute_socket` of "pim instance" with VRF can't be correctly
closed.

Skip it in the "disable" case to let `mroute_socket` safely
closed.

Signed-off-by: anlan_cs <vic.lan@pica8.com>
pimd/pim_mroute.c

index 4d5da31827659383bff8df8f5e42e09624d43f34..b64fcdeb87237a14aadcda71c5c9544f13ae3543 100644 (file)
@@ -46,7 +46,7 @@ int pim_mroute_set(struct pim_instance *pim, int enable)
        /*
         * We need to create the VRF table for the pim mroute_socket
         */
-       if (pim->vrf->vrf_id != VRF_DEFAULT) {
+       if (enable && pim->vrf->vrf_id != VRF_DEFAULT) {
                frr_with_privs (&pimd_privs) {
 
                        data = pim->vrf->data.l.table_id;