diff options
Diffstat (limited to 'fw/src/fw.c')
| -rw-r--r-- | fw/src/fw.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/fw/src/fw.c b/fw/src/fw.c index b7beb9a..4dc6d79 100644 --- a/fw/src/fw.c +++ b/fw/src/fw.c @@ -252,7 +252,7 @@ int etheropen(char*, uchar*); void ethersetaddr(uchar*, uchar*, int); int etherisarp(uchar*, int); int etherisip(uchar*, int); -int etherwriteip(uchar*, int, uchar*); +int etherwriteip(uchar*, int, uchar*, int, uchar*); enum { Ehdrlen = 14 }; @@ -1011,13 +1011,14 @@ etherin(void *a) static void etherout(void *a) { - uchar *buf; + uchar *buf, *frame; Wire *w; Pkt p; int n; w = a; buf = emalloc(Maxpkt); + frame = emalloc(Ehdrlen + Maxpkt); /* not the proc stack */ for(;;){ if((n = read(w->dfd, buf, Maxpkt)) <= 0){ fprint(2, "fw: %s: read the stack: %r\n", w->side); @@ -1025,7 +1026,7 @@ etherout(void *a) threadexitsall("stack"); } if(permitted(buf, n, Vout, &p)) - etherwriteip(buf, n, ethermask); + etherwriteip(frame, Ehdrlen + Maxpkt, buf, n, ethermask); } } |
