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:
|
case EchoRequest:
|
||||||
if (iplen < n)
|
if (iplen < n)
|
||||||
bp = trimblock(bp, 0, iplen);
|
bp = trimblock(bp, 0, iplen);
|
||||||
r = mkechoreply(bp);
|
r = mkechoreply(concatblock(bp));
|
||||||
ipriv->out[EchoReply]++;
|
ipriv->out[EchoReply]++;
|
||||||
ipoput4(icmp->f, r, 0, MAXTTL, DFLTTOS, nil);
|
ipoput4(icmp->f, r, 0, MAXTTL, DFLTTOS, nil);
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -734,7 +734,7 @@ icmpiput6(Proto *icmp, Ipifc *ipifc, Block *bp)
|
||||||
|
|
||||||
switch(p->type) {
|
switch(p->type) {
|
||||||
case EchoRequestV6:
|
case EchoRequestV6:
|
||||||
r = mkechoreply6(bp, ipifc);
|
r = mkechoreply6(concatblock(bp), ipifc);
|
||||||
if(r == nil)
|
if(r == nil)
|
||||||
goto raise;
|
goto raise;
|
||||||
ipriv->out[EchoReply]++;
|
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[0] = 0;
|
||||||
eh->cksum[1] = 0;
|
eh->cksum[1] = 0;
|
||||||
hnputs(eh->cksum, ipcsum(&eh->vihl));
|
hnputs(eh->cksum, ipcsum(&eh->vihl));
|
||||||
assert(bp->next == nil);
|
|
||||||
ifc->m->bwrite(ifc, bp, V4, gate);
|
ifc->m->bwrite(ifc, bp, V4, gate);
|
||||||
runlock(ifc);
|
runlock(ifc);
|
||||||
poperror();
|
poperror();
|
||||||
|
|
Loading…
Reference in a new issue