merge
This commit is contained in:
commit
c7b2ca5716
3 changed files with 6 additions and 5 deletions
|
@ -401,7 +401,7 @@ icmpiput(Proto *icmp, Ipifc*, Block *bp)
|
||||||
goto raise;
|
goto raise;
|
||||||
}
|
}
|
||||||
p = (Icmp *)bp->rp;
|
p = (Icmp *)bp->rp;
|
||||||
if((nhgets(p->frag) & ~(IP_DF|IP_MF)) == 0){
|
if((nhgets(p->frag) & IP_FO) == 0){
|
||||||
pr = Fsrcvpcolx(icmp->f, p->proto);
|
pr = Fsrcvpcolx(icmp->f, p->proto);
|
||||||
if(pr != nil && pr->advise != nil) {
|
if(pr != nil && pr->advise != nil) {
|
||||||
(*pr->advise)(pr, bp, msg);
|
(*pr->advise)(pr, bp, msg);
|
||||||
|
|
|
@ -333,7 +333,7 @@ ipiput4(Fs *f, Ipifc *ifc, Block *bp)
|
||||||
/* reassemble if the interface expects it */
|
/* reassemble if the interface expects it */
|
||||||
if(nifc->reassemble){
|
if(nifc->reassemble){
|
||||||
frag = nhgets(h->frag);
|
frag = nhgets(h->frag);
|
||||||
if(frag & ~IP_DF) {
|
if(frag & (IP_MF|IP_FO)) {
|
||||||
bp = ip4reassemble(ip, frag, bp);
|
bp = ip4reassemble(ip, frag, bp);
|
||||||
if(bp == nil)
|
if(bp == nil)
|
||||||
return;
|
return;
|
||||||
|
@ -360,7 +360,7 @@ ipiput4(Fs *f, Ipifc *ifc, Block *bp)
|
||||||
}
|
}
|
||||||
|
|
||||||
frag = nhgets(h->frag);
|
frag = nhgets(h->frag);
|
||||||
if(frag & ~IP_DF) {
|
if(frag & (IP_MF|IP_FO)) {
|
||||||
bp = ip4reassemble(ip, frag, bp);
|
bp = ip4reassemble(ip, frag, bp);
|
||||||
if(bp == nil)
|
if(bp == nil)
|
||||||
return;
|
return;
|
||||||
|
@ -436,7 +436,7 @@ ip4reassemble(IP *ip, int offset, Block *bp)
|
||||||
* and get rid of any fragments that might go
|
* and get rid of any fragments that might go
|
||||||
* with it.
|
* with it.
|
||||||
*/
|
*/
|
||||||
if((offset & ~IP_DF) == 0) {
|
if((offset & (IP_MF|IP_FO)) == 0) {
|
||||||
if(f != nil) {
|
if(f != nil) {
|
||||||
ip->stats[ReasmFails]++;
|
ip->stats[ReasmFails]++;
|
||||||
ipfragfree4(ip, f);
|
ipfragfree4(ip, f);
|
||||||
|
@ -451,7 +451,7 @@ ip4reassemble(IP *ip, int offset, Block *bp)
|
||||||
}
|
}
|
||||||
|
|
||||||
fp = (Ipfrag*)bp->base;
|
fp = (Ipfrag*)bp->base;
|
||||||
fp->foff = (offset & 0x1fff)<<3;
|
fp->foff = (offset & IP_FO)<<3;
|
||||||
fp->flen = fragsize;
|
fp->flen = fragsize;
|
||||||
|
|
||||||
/* First fragment allocates a reassembly queue */
|
/* First fragment allocates a reassembly queue */
|
||||||
|
|
|
@ -57,6 +57,7 @@ enum
|
||||||
IP_HLEN4= 5, /* v4: Header length in words */
|
IP_HLEN4= 5, /* v4: Header length in words */
|
||||||
IP_DF= 0x4000, /* v4: Don't fragment */
|
IP_DF= 0x4000, /* v4: Don't fragment */
|
||||||
IP_MF= 0x2000, /* v4: More fragments */
|
IP_MF= 0x2000, /* v4: More fragments */
|
||||||
|
IP_FO= 0x1fff, /* v4: Fragment offset */
|
||||||
IP4HDR= IP_HLEN4<<2, /* sizeof(Ip4hdr) */
|
IP4HDR= IP_HLEN4<<2, /* sizeof(Ip4hdr) */
|
||||||
IP_MAX= 64*1024, /* Max. Internet packet size, v4 & v6 */
|
IP_MAX= 64*1024, /* Max. Internet packet size, v4 & v6 */
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue