commit fe6b9f1b95c3ea1a82407d20e7e84160219facb8
parent fdf56b7881c09578fadbf483e96912ccdfa1ff37
Author: Jesus Galan Lopez (yiyus) <yiyu.jgl@gmail.com>
Date: Sat, 12 Jun 2010 23:32:19 +0200
small changes, more debug info, still the same problems...
Diffstat:
4 files changed, 14 insertions(+), 6 deletions(-)
diff --git a/src/9vx/a/chan.c b/src/9vx/a/chan.c
@@ -28,7 +28,7 @@ struct Elemlist
{
char *aname; /* original name */
char *name; /* copy of name, so '/' can be overwritten */
- int nelems;
+ uint nelems;
char **elems;
int *off;
int mustbedir;
diff --git a/src/9vx/a/pgrp.c b/src/9vx/a/pgrp.c
@@ -180,7 +180,7 @@ dupfgrp(Fgrp *f)
lock(&f->ref.lk);
/* Make new fd list shorter if possible, preserving quantization */
new->nfd = f->maxfd+1;
- i = new->nfd%DELTAFD;
+ i = (uint)new->nfd%DELTAFD;
if(i != 0)
new->nfd += DELTAFD - i;
new->fd = malloc(new->nfd*sizeof(Chan*));
diff --git a/src/9vx/ethertap.c b/src/9vx/ethertap.c
@@ -38,7 +38,6 @@ typedef struct Ctlr Ctlr;
struct Ctlr {
int fd;
int txerrs;
- int promisc;
uchar ea[Eaddrlen];
};
@@ -100,7 +99,6 @@ tappkt(Ctlr *c)
n = read(c->fd, b->rp, BALLOC(b));
if(n <= 0)
panic("fd %d read %d", c->fd, n);
- if(c->promisc == 0)
if(memcmp(b->rp + 0, anyea, 6) == 0
|| memcmp(b->rp + 0, c->ea, 6) == 0)
break;
diff --git a/src/9vx/etherve.c b/src/9vx/etherve.c
@@ -94,8 +94,18 @@ vepkt(Ctlr *c)
return nil;
b->wp = b->rp+hdr.caplen; // XXX ?
-
- iprint("Got packet %d (len %d)\n", ++fn, hdr.caplen);
+ b->flag |= Btcpck|Budpck|Bpktck;
+
+ iprint("+++++++++++ packet %d (len %d):\n", ++fn, hdr.caplen);
+ // iprint("wp-20: %s\n\n", b->wp-20);
+ int i=0; uchar* p;
+ for(p=b->rp; p<b->wp; p++){
+ if (i%16 == 0) iprint("%.4ux", i);
+ if (i%8 == 0) iprint(" ");
+ iprint("%2.2ux ", *p);
+ if (++i%16 == 0) iprint("\n");
+ }
+ iprint("\n-------------\n");
return b;