ip: fix assert panic on fragmented icmp echo request (see eriks icmp-frag patch)
This commit is contained in:
parent
4971432577
commit
1159f1e54f
3 changed files with 2 additions and 3 deletions
|
@ -366,7 +366,7 @@ icmpiput(Proto *icmp, Ipifc*, Block *bp)
|
|||
case EchoRequest:
|
||||
if (iplen < n)
|
||||
bp = trimblock(bp, 0, iplen);
|
||||
r = mkechoreply(bp);
|
||||
r = mkechoreply(concatblock(bp));
|
||||
ipriv->out[EchoReply]++;
|
||||
ipoput4(icmp->f, r, 0, MAXTTL, DFLTTOS, nil);
|
||||
break;
|
||||
|
|
|
@ -734,7 +734,7 @@ icmpiput6(Proto *icmp, Ipifc *ipifc, Block *bp)
|
|||
|
||||
switch(p->type) {
|
||||
case EchoRequestV6:
|
||||
r = mkechoreply6(bp, ipifc);
|
||||
r = mkechoreply6(concatblock(bp), ipifc);
|
||||
if(r == nil)
|
||||
goto raise;
|
||||
ipriv->out[EchoReply]++;
|
||||
|
|
|
@ -208,7 +208,6 @@ ipoput4(Fs *f, Block *bp, int gating, int ttl, int tos, Conv *c)
|
|||
eh->cksum[0] = 0;
|
||||
eh->cksum[1] = 0;
|
||||
hnputs(eh->cksum, ipcsum(&eh->vihl));
|
||||
assert(bp->next == nil);
|
||||
ifc->m->bwrite(ifc, bp, V4, gate);
|
||||
runlock(ifc);
|
||||
poperror();
|
||||
|
|
Loading…
Reference in a new issue