• Kristof Provost's avatar
    if_ovpn: deal with short packets · 6ba6c05c
    Kristof Provost authored
    If we receive a UDP packet (directed towards an active OpenVPN socket)
    which is too short to contain an OpenVPN header ('struct
    ovpn_wire_header') we wound up making m_copydata() read outside the
    mbuf, and panicking the machine.
    Explicitly check that the packet is long enough to copy the data we're
    interested in. If it's not we will pass the packet to userspace, just
    like we'd do for an unknown peer.
    Extend a test case to provoke this situation.
    Sponsored by:	Rubicon Communications, LLC ("Netgate")