There is no authentication of packet data. Bad captive portals
etc. can send garbage bad enough to overflow the mtu and cause the
client to crash.
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
self._buffer = b''
self._on_packet = on_packet
self._desc = desc
+ self._mtu = mtu
self._log('__init__')
def _log(self, msg, **kwargs):
def _maybe_packet(self, packet):
self._log('maybepacket', d=packet)
- if len(packet):
+ if len(packet) and len(packet) <= self._mtu:
self._on_packet(packet)
def flush(self):