/[lwip]/lwip/src/core/ipv4/ip.c
ViewVC logotype

Diff of /lwip/src/core/ipv4/ip.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.11 by likewise, Thu Jan 30 10:18:40 2003 UTC revision 1.12 by davidhaas, Thu Feb 6 22:18:56 2003 UTC
# Line 371  ip_input(struct pbuf *p, struct netif *i Line 371  ip_input(struct pbuf *p, struct netif *i
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;
# Line 523  ip_output_if(struct pbuf *p, struct ip_a Line 524  ip_output_if(struct pbuf *p, struct ip_a
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        
# Line 578  ip_debug_print(struct pbuf *p) Line 580  ip_debug_print(struct pbuf *p)
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))));

Legend:
Removed from v.1.11  
changed lines
  Added in v.1.12

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26