ip: fix assert panic on fragmented icmp echo request (see eriks icmp-frag patch)

This commit is contained in:
cinap_lenrek 2012-08-02 02:02:10 +02:00
parent 4971432577
commit 1159f1e54f
3 changed files with 2 additions and 3 deletions

View file

@ -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;

View file

@ -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]++;

View file

@ -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();