diff options
author | anlan_cs <vic.lan@pica8.com> | 2023-04-26 11:59:58 +0200 |
---|---|---|
committer | anlan_cs <vic.lan@pica8.com> | 2023-04-27 03:15:00 +0200 |
commit | ad855cdf34a9940322547e570f2428d50c4feac7 (patch) | |
tree | 84ab51adc5a8bc194e17617d7f3db8cb4f729e29 /pimd | |
parent | Merge pull request #13368 from Keelan10/nhrpd-memory-leak (diff) | |
download | frr-ad855cdf34a9940322547e570f2428d50c4feac7.tar.xz frr-ad855cdf34a9940322547e570f2428d50c4feac7.zip |
pimd: Fix wrong setsockopt() call
`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>
Diffstat (limited to 'pimd')
-rw-r--r-- | pimd/pim_mroute.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/pimd/pim_mroute.c b/pimd/pim_mroute.c index 4d5da3182..b64fcdeb8 100644 --- a/pimd/pim_mroute.c +++ b/pimd/pim_mroute.c @@ -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; |