`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>
/*
* 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;