devip: ignore icmp advise about laggard fragments
icmp has to advise protocols about the first fragment only. all other fragments should be ignored.
This commit is contained in:
parent
88e054ffdf
commit
4885c75526
2 changed files with 12 additions and 9 deletions
|
@ -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);
|
||||
|
|
|
@ -725,11 +725,12 @@ icmpiput6(Proto *icmp, Ipifc *ifc, Block *bp)
|
|||
bp->rp -= IP6HDR;
|
||||
}
|
||||
}
|
||||
|
||||
pr = Fsrcvpcolx(icmp->f, p->proto);
|
||||
if(pr != nil && pr->advise != nil) {
|
||||
(*pr->advise)(pr, bp, msg);
|
||||
return;
|
||||
if(p->proto != FH){
|
||||
pr = Fsrcvpcolx(icmp->f, p->proto);
|
||||
if(pr != nil && pr->advise != nil) {
|
||||
(*pr->advise)(pr, bp, msg);
|
||||
return;
|
||||
}
|
||||
}
|
||||
bp->rp -= IPICMPSZ;
|
||||
goticmpkt6(icmp, bp, 0);
|
||||
|
|
Loading…
Reference in a new issue