3.1.10 Verifying Inbound TURN Messages

A TURN message received by either the protocol client or TURN server MUST begin with a properly formed transport specific header, as specific in section 2.1. The TURN message header MUST immediately follow the transport specific header, as specified in section 2.2.2. The Magic Cookie attribute, encoded as specified in section 2.2.2.8, MUST be the first attribute after the TURN message header. If any of these conditions are not met, the message is considered an improperly formed message and MUST be ignored. If the message transport is TCP, the connection SHOULD be disconnected.