/[lwip]/lwip/src/arch/unix/netif/tapif.c
ViewVC logotype

Diff of /lwip/src/arch/unix/netif/tapif.c

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

revision 1.9 by likewise, Mon Jan 13 13:22:10 2003 UTC revision 1.10 by jani, Fri Jan 17 14:18:55 2003 UTC
# Line 149  low_level_output(struct netif *netif, st Line 149  low_level_output(struct netif *netif, st
149    struct tapif *tapif;    struct tapif *tapif;
150    
151    tapif = netif->state;    tapif = netif->state;
152      #if 0  
153        if(((double)rand()/(double)RAND_MAX) < 0.2) {
154        printf("drop output\n");
155        return ERR_OK;
156        }
157    #endif
158    /* initiate transfer(); */    /* initiate transfer(); */
159        
160    bufptr = &buf[0];    bufptr = &buf[0];
# Line 189  low_level_input(struct tapif *tapif) Line 194  low_level_input(struct tapif *tapif)
194    /* Obtain the size of the packet and put it into the "len"    /* Obtain the size of the packet and put it into the "len"
195       variable. */       variable. */
196    len = read(tapif->fd, buf, sizeof(buf));    len = read(tapif->fd, buf, sizeof(buf));
197    #if 0
198    /*  if(((double)rand()/(double)RAND_MAX) < 0.1) {      if(((double)rand()/(double)RAND_MAX) < 0.2) {
199      printf("drop\n");      printf("drop\n");
200      return NULL;      return NULL;
201      }*/      }
202    #endif
203        
204    /* We allocate a pbuf chain of pbufs from the pool. */    /* We allocate a pbuf chain of pbufs from the pool. */
205    p = pbuf_alloc(PBUF_RAW, len, PBUF_POOL);    p = pbuf_alloc(PBUF_RAW, len, PBUF_POOL);

Legend:
Removed from v.1.9  
changed lines
  Added in v.1.10

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