summaryrefslogtreecommitdiff
path: root/sys/src/9/ip
diff options
context:
space:
mode:
authorcinap_lenrek <cinap_lenrek@felloff.net>2023-05-19 23:36:32 +0000
committercinap_lenrek <cinap_lenrek@felloff.net>2023-05-19 23:36:32 +0000
commita9cdbcd5016319901ea112096f042ac9017cdce4 (patch)
treea4efd3b15e6da83bf1b126a4f4b801fc05d37fba /sys/src/9/ip
parent9ebe38c9602310d6c8404e1d8104a744c09f0215 (diff)
devip: rlock ifc before accessing interface parameters in ipifcstate()
Diffstat (limited to 'sys/src/9/ip')
-rw-r--r--sys/src/9/ip/ipifc.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/sys/src/9/ip/ipifc.c b/sys/src/9/ip/ipifc.c
index 2c401bc98..b6f615084 100644
--- a/sys/src/9/ip/ipifc.c
+++ b/sys/src/9/ip/ipifc.c
@@ -258,6 +258,7 @@ ipifcstate(Conv *c, char *state, int n)
int m;
ifc = (Ipifc*)c->ptcl;
+ rlock(ifc);
m = snprint(state, n, sfixedformat,
ifc->dev, ifc->maxtu, ifc->sendra6, ifc->recvra6,
ifc->rp.mflag, ifc->rp.oflag, ifc->rp.maxraint,
@@ -266,7 +267,6 @@ ipifcstate(Conv *c, char *state, int n)
ifc->in, ifc->out, ifc->inerr, ifc->outerr,
ifc->speed, ifc->delay);
- rlock(ifc);
for(lifc = ifc->lifc; lifc != nil && n > m; lifc = lifc->next)
m += snprint(state+m, n - m, slineformat, lifc->local,
lifc->mask, lifc->remote, lifc->validlt, lifc->preflt);