Skip to content

Commit

Permalink
drop UDP message if frag != 0
Browse files Browse the repository at this point in the history
  • Loading branch information
breakwa11 committed Jun 10, 2015
1 parent 62dca9d commit f167499
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions shadowsocks/tcprelay.py
Original file line number Diff line number Diff line change
Expand Up @@ -194,8 +194,12 @@ def _write_to_sock(self, data, sock):
#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
Expand Down

0 comments on commit f167499

Please sign in to comment.