TUN-6699: Add metric for packet too big dropped

This commit is contained in:
João Oliveirinha
2022-08-25 11:05:01 +01:00
committed by Igor Postelnik
parent af6bf5c4e5
commit e131125558
3 changed files with 10 additions and 3 deletions

View File

@@ -46,8 +46,7 @@ func (dm *DatagramMuxer) mtu() int {
func (dm *DatagramMuxer) SendToSession(session *packet.Session) error {
if len(session.Payload) > dm.mtu() {
// TODO: TUN-5302 return ICMP packet too big message
// drop packet for now, eventually reply with ICMP for PMTUD
packetTooBigDropped.Inc()
return fmt.Errorf("origin UDP payload has %d bytes, which exceeds transport MTU %d", len(session.Payload), dm.mtu())
}
payloadWithMetadata, err := suffixSessionID(session.ID, session.Payload)