M ip/ip.c => ip/ip.c +6 -0
@@ 113,6 113,12 @@ ip_init(Fs *f)
}
void
+iprouting(Fs *f, int on)
+{
+ f->ip->iprouting = on;
+}
+
+void
ipoput(Fs *f, Block *bp, int gating, int ttl)
{
Ipifc *ifc;
M ip/ip.h => ip/ip.h +1 -2
@@ 439,7 439,6 @@ extern Medium ethermedium;
extern Medium nullmedium;
extern Medium pktmedium;
extern Medium tripmedium;
-extern Proto ipifc;
/*
* ipifc.c
@@ 469,6 468,7 @@ extern long ipselftabread(Fs*, char *a, ulong offset, int n);
/*
* ip.c
*/
+extern void iprouting(Fs*, int);
extern void closeifcconv(Ifcconv*);
extern void icmpnoconv(Fs*, Block*);
extern void initfrag(IP*, int);
@@ 508,5 508,4 @@ char* commonerror(void);
*/
extern int debug;
extern Fs fs;
-extern int iprouting; /* true if routing turned on */
extern void (*igmpreportfn)(Ipifc*, uchar*);
M ip/ipifc.c => ip/ipifc.c +8 -0
@@ 540,6 540,7 @@ static char*
ipifcctl(Conv* c, char**argv, int argc)
{
Ipifc *ifc;
+ int i;
ifc = (Ipifc*)c->ptcl;
if(strcmp(argv[0], "add") == 0)
@@ 554,6 555,13 @@ ipifcctl(Conv* c, char**argv, int argc)
return ipifcjoinmulti(ifc, argv, argc);
else if(strcmp(argv[0], "leavemulti") == 0)
return ipifcleavemulti(ifc, argv, argc);
+ else if(strcmp(argv[0], "iprouting") == 0){
+ i = 1;
+ if(argc > 1)
+ i = atoi(argv[1]);
+ iprouting(c->p->f, i);
+ return nil;
+ }
return "unsupported ctl";
}
M ip/netlog.c => ip/netlog.c +1 -1
@@ 145,7 145,7 @@ netlogread(Fs *f, void *a, ulong, long n)
else
unlock(f->alog);
- sleep(f->alog, netlogready, 0);
+ sleep(f->alog, netlogready, f);
}
qunlock(f->alog);