From 844171a88b8115ad6fd3654745ac326becd31582 Mon Sep 17 00:00:00 2001 From: Mikael Magnusson Date: Tue, 17 Mar 2020 20:03:27 +0100 Subject: WIP Time Exceeded --- pkg/tcpip/network/ipv4/ipv4.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pkg/tcpip/network/ipv4/ipv4.go b/pkg/tcpip/network/ipv4/ipv4.go index 18078c74c..cde536e7e 100644 --- a/pkg/tcpip/network/ipv4/ipv4.go +++ b/pkg/tcpip/network/ipv4/ipv4.go @@ -452,7 +452,7 @@ func (e *endpoint) SendIcmp(pkt tcpip.PacketBuffer, icmpv4type header.ICMPv4Type return nil } -func (*endpoint) UpdateTTL(pkt tcpip.PacketBuffer, n uint8) *tcpip.Error { +func (e *endpoint) UpdateTTL(pkt tcpip.PacketBuffer, n uint8) *tcpip.Error { headerView := pkt.Header.View() h := header.IPv4(headerView) if !h.IsValid(pkt.Data.Size()) { @@ -464,6 +464,7 @@ func (*endpoint) UpdateTTL(pkt tcpip.PacketBuffer, n uint8) *tcpip.Error { ttl := h.TTL() if ttl <= n { + e.SendIcmp(pkt, header.ICMPv4TimeExceeded, 0, 0) return tcpip.ErrTimeout } h.UpdateTTL(n) -- cgit v1.2.3