371 |
|
|
372 |
#if IP_REASSEMBLY |
#if IP_REASSEMBLY |
373 |
if((IPH_OFFSET(iphdr) & htons(IP_OFFMASK | IP_MF)) != 0) { |
if((IPH_OFFSET(iphdr) & htons(IP_OFFMASK | IP_MF)) != 0) { |
374 |
|
DEBUGF(IP_DEBUG, ("IP packet is a fragment (id=0x%04x tot_len=%u len=%u MF=%u offset=%u), calling ip_reass()\n", ntohs(IPH_ID(iphdr)), p->tot_len, ntohs(IPH_LEN(iphdr)), !!(IPH_OFFSET(iphdr) & htons(IP_MF)), (ntohs(IPH_OFFSET(iphdr)) & IP_OFFMASK))*8); |
375 |
p = ip_reass(p); |
p = ip_reass(p); |
376 |
if(p == NULL) { |
if(p == NULL) { |
377 |
return ERR_OK; |
return ERR_OK; |
524 |
} |
} |
525 |
|
|
526 |
#if IP_FRAG |
#if IP_FRAG |
527 |
if (p->tot_len > netif->mtu) |
/* don't fragment if interface has mtu set to 0 [loopif] */ |
528 |
|
if (netif->mtu && (p->tot_len > netif->mtu)) |
529 |
return ip_frag(p,netif,dest); |
return ip_frag(p,netif,dest); |
530 |
#endif |
#endif |
531 |
|
|
580 |
|
|
581 |
DEBUGF(IP_DEBUG, ("IP header:\n")); |
DEBUGF(IP_DEBUG, ("IP header:\n")); |
582 |
DEBUGF(IP_DEBUG, ("+-------------------------------+\n")); |
DEBUGF(IP_DEBUG, ("+-------------------------------+\n")); |
583 |
DEBUGF(IP_DEBUG, ("|%2d |%2d | %2d | %4d | (v, hl, tos, len)\n", |
DEBUGF(IP_DEBUG, ("|%2d |%2d | %2u | %4u | (v, hl, tos, len)\n", |
584 |
IPH_V(iphdr), |
IPH_V(iphdr), |
585 |
IPH_HL(iphdr), |
IPH_HL(iphdr), |
586 |
IPH_TOS(iphdr), |
IPH_TOS(iphdr), |
587 |
ntohs(IPH_LEN(iphdr)))); |
ntohs(IPH_LEN(iphdr)))); |
588 |
DEBUGF(IP_DEBUG, ("+-------------------------------+\n")); |
DEBUGF(IP_DEBUG, ("+-------------------------------+\n")); |
589 |
DEBUGF(IP_DEBUG, ("| %5d |%d%d%d| %4d | (id, flags, offset)\n", |
DEBUGF(IP_DEBUG, ("| %5u |%u%u%u| %4u | (id, flags, offset)\n", |
590 |
ntohs(IPH_ID(iphdr)), |
ntohs(IPH_ID(iphdr)), |
591 |
ntohs(IPH_OFFSET(iphdr)) >> 15 & 1, |
ntohs(IPH_OFFSET(iphdr)) >> 15 & 1, |
592 |
ntohs(IPH_OFFSET(iphdr)) >> 14 & 1, |
ntohs(IPH_OFFSET(iphdr)) >> 14 & 1, |
593 |
ntohs(IPH_OFFSET(iphdr)) >> 13 & 1, |
ntohs(IPH_OFFSET(iphdr)) >> 13 & 1, |
594 |
ntohs(IPH_OFFSET(iphdr)) & IP_OFFMASK)); |
ntohs(IPH_OFFSET(iphdr)) & IP_OFFMASK)); |
595 |
DEBUGF(IP_DEBUG, ("+-------------------------------+\n")); |
DEBUGF(IP_DEBUG, ("+-------------------------------+\n")); |
596 |
DEBUGF(IP_DEBUG, ("| %2d | %2d | 0x%04x | (ttl, proto, chksum)\n", |
DEBUGF(IP_DEBUG, ("| %2u | %2u | 0x%04x | (ttl, proto, chksum)\n", |
597 |
IPH_TTL(iphdr), |
IPH_TTL(iphdr), |
598 |
IPH_PROTO(iphdr), |
IPH_PROTO(iphdr), |
599 |
ntohs(IPH_CHKSUM(iphdr)))); |
ntohs(IPH_CHKSUM(iphdr)))); |