summaryrefslogtreecommitdiffhomepage
path: root/pkg/tcpip/network/ipv4
diff options
context:
space:
mode:
authorMikael Magnusson <mikma@users.sourceforge.net>2020-03-17 20:03:27 +0100
committerMikael Magnusson <mikma@users.sourceforge.net>2020-03-17 20:06:04 +0100
commit844171a88b8115ad6fd3654745ac326becd31582 (patch)
treed13cf92f401d322a0727cb3bfbbd91bc62aaf959 /pkg/tcpip/network/ipv4
parenta076433fcb984031fcdc7e00cf1af20a961ce478 (diff)
WIP Time Exceeded
Diffstat (limited to 'pkg/tcpip/network/ipv4')
-rw-r--r--pkg/tcpip/network/ipv4/ipv4.go3
1 files changed, 2 insertions, 1 deletions
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)