M ip/devip.c => ip/devip.c +0 -13
@@ 14,7 14,6 @@ enum
Qbootp,
Qndb,
Qiproute,
- Qiprouter,
Qipselftab,
Qlog,
@@ 158,10 157,6 @@ ip1gen(Chan *c, int i, Dir *dp)
prot = 0444;
q = (Qid){QID(0, 0, Qipselftab), 0};
break;
- case Qiprouter:
- p = "iprouter";
- q = (Qid){QID(0, 0, Qiprouter), 0};
- break;
case Qlog:
p = "log";
q = (Qid){QID(0, 0, Qlog), 0};
@@ 203,7 198,6 @@ ipgen(Chan *c, Dirtab*, int, int s, Dir *dp)
case Qndb:
case Qlog:
case Qiproute:
- case Qiprouter:
case Qipselftab:
return ip1gen(c, TYPE(c->qid), dp);
case Qprotodir:
@@ 364,9 358,6 @@ ipopen(Chan* c, int omode)
case Qlog:
netlogopen(f);
break;
- case Qiprouter:
- iprouteropen(f);
- break;
case Qiproute:
memmove(c->tag, "none", sizeof(c->tag));
break;
@@ 527,10 518,6 @@ ipclose(Chan* c)
if(c->flag & COPEN)
netlogclose(f);
break;
- case Qiprouter:
- if(c->flag & COPEN)
- iprouterclose(f);
- break;
case Qdata:
case Qctl:
case Qerr:
M ip/ip.c => ip/ip.c +5 -1
@@ 214,6 214,7 @@ ipoput(Fs *f, Block *bp, int gating, int ttl, int tos)
}
if(eh->frag[0] & (IP_DF>>8)){
+ ip->istats.ipFragFails++;
ip->istats.ipOutDiscards++;
netlog(f, Logip, "%V: eh->frag[0] & (IP_DF>>8)\n", eh->dst);
goto raise;
@@ 221,6 222,7 @@ ipoput(Fs *f, Block *bp, int gating, int ttl, int tos)
seglen = (medialen - IPHDR) & ~7;
if(seglen < 8){
+ ip->istats.ipFragFails++;
ip->istats.ipOutDiscards++;
netlog(f, Logip, "%V seglen < 8\n", eh->dst);
goto raise;
@@ 262,6 264,7 @@ ipoput(Fs *f, Block *bp, int gating, int ttl, int tos)
while(chunk) {
if(!xp) {
ip->istats.ipOutDiscards++;
+ ip->istats.ipFragFails++;
freeblist(nb);
netlog(f, Logip, "!xp: chunk %d\n", chunk);
goto raise;
@@ 283,6 286,7 @@ ipoput(Fs *f, Block *bp, int gating, int ttl, int tos)
ifc->m->bwrite(ifc, nb, V4, gate);
ip->istats.ipFragCreates++;
}
+ ip->istats.ipFragOKs++;
raise:
runlock(ifc);
poperror();
@@ 377,7 381,7 @@ ipiput(Fs *f, uchar *ia, Block *bp)
/* route */
if(notforme) {
if(!ip->iprouting){
- useriprouter(f, ia, bp);
+ freeb(bp);
return;
}
M ip/ip.h => ip/ip.h +0 -18
@@ 232,15 232,6 @@ struct Proto
};
/*
- * Stream for sending packets to user level
- */
-struct IProuter {
- QLock;
- int opens;
- Queue *q;
-};
-
-/*
* one per IP protocol stack
*/
struct Fs
@@ 257,7 248,6 @@ struct Fs
IP *ip;
Ipselftab *self;
Arp *arp;
- IProuter iprouter;
Route *v4root[1<<Lroot]; /* v4 routing forest */
Route *v6root[1<<Lroot]; /* v6 routing forest */
@@ 508,14 498,6 @@ extern char* bootp(Ipifc*);
extern int bootpread(char*, ulong, int);
/*
- * iprouter.c
- */
-void useriprouter(Fs*, uchar*, Block*);
-void iprouteropen(Fs*);
-void iprouterclose(Fs*);
-long iprouterread(Fs*, void*, int);
-
-/*
* resolving inferno/plan9 differences
*/
Chan* commonfdtochan(int, int, int, int);