• Philip Withnall's avatar
    agent: Drop valid but unmatched STUN packets · b98b98ad
    Philip Withnall authored
    Rather than passing them through to the application. Invalid STUN
    packets are still passed through, but it causes unnecessary noise and
    corruption for higher-level applications to receive STUN packets they
    weren’t expecting.
    
    This is permitted by RFC 5389, §7.3.0:
        If any errors are detected, the message is silently discarded.
        In the case when STUN is being multiplexed with another protocol,
        an error may indicate that this is not really a STUN message; in
        this case, the agent should try to parse the message as a different
        protocol.
    where I interpret ‘error’ to mean ‘validation error’ rather than (e.g.)
    ‘unrecognised attribute’ or ‘unmatched response’ where the STUN packet
    is otherwise perfectly formed.
    b98b98ad
agent.c 174 KB