From d7501edd91bcaed87673aaeb1b488f6680bf6431 Mon Sep 17 00:00:00 2001 From: David du Colombier <0intro@gmail.com> Date: Sun, 3 Oct 1999 00:00:00 +0000 Subject: [PATCH] Plan 9 from Bell Labs 1999-10-03 --- ip/ip.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/ip/ip.c b/ip/ip.c index 778ec984f75e21dd36ab70c0ba72fd0d8087ca5d..97a49d72aa9ffc38c526ed1abccfc4a6730f762e 100644 --- a/ip/ip.c +++ b/ip/ip.c @@ -180,7 +180,16 @@ ipoput(Fs *f, Block *bp, int gating, int ttl, int tos) else gate = r->v4.gate; - if(!gating){ + if(gating){ + switch(eh->ttl){ + case 0: + case 1: + goto free; + default: + eh->ttl--; + break; + } + } else { eh->vihl = IP_VER|IP_HLEN; eh->ttl = ttl; eh->tos = tos;