shithub: riscv

Download patch

ref: 5d9f0ed3264201bf367edd7cb02366ed0b483d9a
parent: 6a83facfb3f64f579847166af0321370e4062f9d
author: cinap_lenrek <[email protected]>
date: Sat Jan 11 11:07:35 EST 2014

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.

--- a/sys/src/9/port/netif.c
+++ b/sys/src/9/port/netif.c
@@ -132,7 +132,7 @@
 		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 @@
 		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: