Reputation: 677
I have 2 questions regarding the security of twisted's UDP Multicast.
class UDPProtocol(twisted.internet.protocol.DatagramProtocol):
def startProtocol(self):
self.transport.joinGroup('224.0.0.1')
def datagramReceived(self, data, (host, port)):
if host == '192.126.1.65':
print "UDPWebscriptProtocol: received %r from %s:%d" % (data, host, port)
And this is how I listen:
reactor.listenMulticast(10222, UDPProtocol(), listenMultiple = True, interface = '224.0.0.1')
Notice the specification of interface in listenMulticast.
In general, how secure is this code?
Upvotes: 2
Views: 579
Reputation: 310866
The listen interface is the one you listen at. Joining the group tells the kernel and all routers that you want to receive this group, so e.g. your router will pass messages from that group instead of dropping them as it would by default.
I don't understand. Do you mean you check the source IP address of incoming datagrams? I don't see how you can check somebody else's host interface. If the allowed source addresses are private the only possible spoofing comes from inside that private subnet.
Upvotes: 1