Browse Source

respondd_client: bind socket to secified device

allows setup of multiple instances on the same node
Karsten Böddeker 6 years ago
parent
commit
fd4882eb8c
1 changed files with 1 additions and 0 deletions
  1. 1 0
      lib/respondd_client.py

+ 1 - 0
lib/respondd_client.py

@@ -39,6 +39,7 @@ class ResponddClient:
     sock.setsockopt(socket.IPPROTO_IPV6, socket.IPV6_JOIN_GROUP, group + struct.pack('I', if_idx))
 
   def start(self):
+    self._sock.setsockopt(socket.SOL_SOCKET, socket.SO_BINDTODEVICE, bytes(self._config['bridge'], 'UTF-8'))
     self._sock.bind(('::', self._config['port']))
 
     lines = lib.helper.call(['batctl', '-m', self._config['batman'], 'if'])