From 1e71fba852bba2203fb7f6f4640d380c73303801 Mon Sep 17 00:00:00 2001 From: breakwa11 Date: Wed, 10 Jun 2015 14:21:22 +0800 Subject: [PATCH] drop UDP message if frag != 0 --- shadowsocks/tcprelay.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/shadowsocks/tcprelay.py b/shadowsocks/tcprelay.py index 8d54c10..18aa1f5 100644 --- a/shadowsocks/tcprelay.py +++ b/shadowsocks/tcprelay.py @@ -194,8 +194,12 @@ class TCPRelayHandler(object): #logging.debug("_write_to_sock %s %s %s" % (self._remote_sock, sock, self._remote_udp)) if self._remote_sock == sock and self._remote_udp: try: - #TODO - data = data[3:] + frag = common.ord(data[2]) + if frag != 0: + logging.warn('drop a message since frag is %d' % (frag,)) + return False + else: + data = data[3:] header_result = parse_header(data) if header_result is None: return False