Skip to content

Commit

Permalink
Fix: clean mrule entries on interface removal
Browse files Browse the repository at this point in the history
  • Loading branch information
leoplo committed Feb 6, 2024
1 parent 9cb1b14 commit 54791bd
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion pimdm/Kernel.py
Original file line number Diff line number Diff line change
Expand Up @@ -387,6 +387,8 @@ def remove_virtual_interface(self, interface_name):
struct_vifctl = struct.pack("HBBI 4s 4s", index, 0, 0, 0, socket.inet_aton("0.0.0.0"), socket.inet_aton("0.0.0.0"))

self.delete_mrule(interface_name, 0)
if pim_globals.MULTICAST_TABLE_ID != 0:
self.delete_mrule(interface_name, pim_globals.MULTICAST_TABLE_ID)
self.socket.setsockopt(socket.IPPROTO_IP, self.MRT_DEL_VIF, struct_vifctl)

self.stop_forwarding(index)
Expand Down Expand Up @@ -621,7 +623,8 @@ def remove_virtual_interface(self, interface_name):
struct_vifctl = struct.pack("HBBHI", mif_index, 0, 0, physical_if_index, 0)
self.socket.setsockopt(socket.IPPROTO_IPV6, self.MRT6_DEL_MIF, struct_vifctl)

self.delete_mrule(interface_name, 0)
if pim_globals.MULTICAST_TABLE_ID != 0:
self.delete_mrule(interface_name, pim_globals.MULTICAST_TABLE_ID, AF_INET6)

self.stop_forwarding(mif_index)

Expand Down

0 comments on commit 54791bd

Please sign in to comment.