From 5d9f0ed3264201bf367edd7cb02366ed0b483d9a Mon Sep 17 00:00:00 2001 From: cinap_lenrek Date: Sat, 11 Jan 2014 16:07:35 +0100 Subject: netif: fix wrong qid in 3rd level stats/ifstats files (thanks burnzez) the stats and ifstats files in the 3rd level of a netif are not per connection, but for the interface. this made fstat fail for /net/ether0/N/*stats where N > 0 as the NETID() bits in the qid didnt compare. --- sys/src/9/port/netif.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/src/9/port/netif.c b/sys/src/9/port/netif.c index e775fe847..9df9e40a4 100644 --- a/sys/src/9/port/netif.c +++ b/sys/src/9/port/netif.c @@ -132,7 +132,7 @@ netifgen(Chan *c, char*, Dirtab *vp, int, int i, Dir *dp) devdir(c, q, "ctl", 0, o, perm, dp); break; case 2: - q.path = NETQID(NETID(c->qid.path), Nstatqid); + q.path = Nstatqid; devdir(c, q, "stats", 0, eve, 0444, dp); break; case 3: @@ -140,7 +140,7 @@ netifgen(Chan *c, char*, Dirtab *vp, int, int i, Dir *dp) devdir(c, q, "type", 0, eve, 0444, dp); break; case 4: - q.path = NETQID(NETID(c->qid.path), Nifstatqid); + q.path = Nifstatqid; devdir(c, q, "ifstats", 0, eve, 0444, dp); break; default: -- cgit v1.2.3