Permalink
Browse files

No, it's already the bind address, make it the bind address

  • Loading branch information...
1 parent 8a0bda6 commit a4bd5c717143efba2d8ee7c07084a8043ccc67c2 @mcfletch committed Jul 4, 2012
Showing with 5 additions and 8 deletions.
  1. +5 −8 zeroconf/mcastsocket.py
View
13 zeroconf/mcastsocket.py
@@ -58,20 +58,17 @@
import socket,logging
log = logging.getLogger( __name__ )
-def create_socket( address, TTL=1, loop=True, reuse=True, bind_address='' ):
+def create_socket( address, TTL=1, loop=True, reuse=True ):
"""Create our multicast socket for mDNS usage
Creates a multicast UDP socket with ttl, loop and reuse parameters configured.
- * address -- IP address family address ('ip',port) on which to broadcast,
- The socket will *bind* on bind_address but will only broadcast
- on the interface specified.
-
- Controls the IP_MULTICAST_IF option.
+ * address -- IP address family address ('ip',port) on which to bind/broadcast,
+ The socket will *bind* on bind_address. The IP_MULTICAST_IF
+ option will also be set to the ip specified.
* TTL -- multicast TTL to set on the socket
* loop -- whether to reflect our sent messages to our listening port
* reuse -- whether to set up socket reuse parameters before binding
- * bind_address -- local address (IP) on which to bind/listen
returns socket.socket instance configured as specified
"""
@@ -85,7 +82,7 @@ def create_socket( address, TTL=1, loop=True, reuse=True, bind_address='' ):
# because the 224.* isn't getting mapped (routed) to the address of the interface...
# to debug that case, see if {{{ip route add 224.0.0.0/4 dev br0}}} (or whatever your
# interface is) makes the route suddenly start working...
- sock.bind((bind_address,address[1]))
+ sock.bind(address)
except Exception, err:
# Some versions of linux raise an exception even though
# the SO_REUSE* options have been set, so ignore it

0 comments on commit a4bd5c7

Please sign in to comment.