summaryrefslogtreecommitdiff
path: root/sys/src/9/ip/icmp.c
diff options
context:
space:
mode:
authorcinap_lenrek <cinap_lenrek@felloff.net>2019-03-07 01:25:11 +0100
committercinap_lenrek <cinap_lenrek@felloff.net>2019-03-07 01:25:11 +0100
commit4885c75526f91ff9eb245b32a63512e2e67b3038 (patch)
tree72245162aa01144cbcdb797c977d50f66db345d5 /sys/src/9/ip/icmp.c
parent88e054ffdfed8fd229b00d4f6311aefdb769cf0d (diff)
devip: ignore icmp advise about laggard fragments
icmp has to advise protocols about the first fragment only. all other fragments should be ignored.
Diffstat (limited to 'sys/src/9/ip/icmp.c')
-rw-r--r--sys/src/9/ip/icmp.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/sys/src/9/ip/icmp.c b/sys/src/9/ip/icmp.c
index 51f041b38..90c289f4b 100644
--- a/sys/src/9/ip/icmp.c
+++ b/sys/src/9/ip/icmp.c
@@ -401,10 +401,12 @@ icmpiput(Proto *icmp, Ipifc*, Block *bp)
goto raise;
}
p = (Icmp *)bp->rp;
- pr = Fsrcvpcolx(icmp->f, p->proto);
- if(pr != nil && pr->advise != nil) {
- (*pr->advise)(pr, bp, msg);
- return;
+ if((nhgets(p->frag) & ~(IP_DF|IP_MF)) == 0){
+ pr = Fsrcvpcolx(icmp->f, p->proto);
+ if(pr != nil && pr->advise != nil) {
+ (*pr->advise)(pr, bp, msg);
+ return;
+ }
}
bp->rp -= ICMP_IPSIZE+ICMP_HDRSIZE;
goticmpkt(icmp, bp);