Skip to content

Commit

Permalink
Interface: fix drop_packet_type missing attribute (#8)
Browse files Browse the repository at this point in the history
Fix the following error:

```
Exception in thread Thread-4:
Traceback (most recent call last):
  File "/usr/lib/python3.7/threading.py", line 917, in _bootstrap_inner
    self.run()
  File "/usr/lib/python3.7/threading.py", line 1166, in run
    self.function(*self.args, **self.kwargs)
  File "/usr/local/lib/python3.7/dist-packages/pimdm/InterfacePIM.py", line 152, in send_hello
    self.send(packet.bytes())
  File "/usr/local/lib/python3.7/dist-packages/pimdm/InterfacePIM6.py", line 86, in send
    super().send(data=data, group_ip=group_ip)
  File "/usr/local/lib/python3.7/dist-packages/pimdm/InterfacePIM.py", line 113, in send
    if self.drop_packet_type is not None:
AttributeError: 'InterfacePim6' object has no attribute 'drop_packet_type'
```
  • Loading branch information
leoplo authored Jan 25, 2022
1 parent f7e53bf commit ab6ca07
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 2 additions & 0 deletions pimdm/Interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ def __init__(self, interface_name, recv_socket, send_socket, vif_index):
self._recv_socket = recv_socket
self.interface_enabled = False

self.drop_packet_type = None

def _enable(self):
"""
Enable this interface
Expand Down
2 changes: 0 additions & 2 deletions pimdm/InterfacePIM.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,6 @@ def __init__(self, interface_name: str, vif_index:int, state_refresh_capable:boo
# don't receive outgoing packets
s.setsockopt(socket.IPPROTO_IP, socket.IP_MULTICAST_LOOP, 0)

self.drop_packet_type = None

super().__init__(interface_name, s, s, vif_index)
super()._enable()
self.force_send_hello()
Expand Down

0 comments on commit ab6ca07

Please sign in to comment.