3
0
mirror of https://github.com/jlu5/PyLink.git synced 2024-11-23 19:19:31 +01:00

protocols: catch S2S messages if they're being routed the wrong way (#405)

This commit is contained in:
James Lu 2017-02-17 21:36:48 -08:00
parent 2f968aca80
commit f1fddefeac
2 changed files with 8 additions and 0 deletions

View File

@ -846,6 +846,10 @@ class P10Protocol(IRCS2SProtocol):
return
else: # Send a hook with the hook arguments given by the handler function.
if self.irc.isInternalClient(sender) or self.irc.isInternalServer(sender):
log.warning("(%s) Received command %s being routed the wrong way!", self.irc.name, command)
return
parsed_args = func(sender, command, args)
if parsed_args is not None:
return [sender, command, parsed_args]

View File

@ -330,6 +330,10 @@ class TS6BaseProtocol(IRCS2SProtocol):
command = args[0]
args = args[1:]
if self.irc.isInternalClient(numeric) or self.irc.isInternalServer(numeric):
log.warning("(%s) Received command %s being routed the wrong way!", self.irc.name, command)
return
if command == 'ENCAP':
# Special case for encapsulated commands (ENCAP), in forms like this:
# <- :00A ENCAP * SU 42XAAAAAC :GLolol