diff options
author | cinap_lenrek <cinap_lenrek@felloff.net> | 2022-12-03 16:31:34 +0000 |
---|---|---|
committer | cinap_lenrek <cinap_lenrek@felloff.net> | 2022-12-03 16:31:34 +0000 |
commit | 9fd0f89856bfb42acc3343a98025edac6101d24c (patch) | |
tree | 94e381affbc979957444f3185d71a235b318948a /sys/src/9/port | |
parent | cf2f89c648d55fd28d29213763f276f523fb22c6 (diff) |
devbridge: simplify ethermultiwrite()
Diffstat (limited to 'sys/src/9/port')
-rw-r--r-- | sys/src/9/port/devbridge.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/sys/src/9/port/devbridge.c b/sys/src/9/port/devbridge.c index 4fcd7c392..276f0cf32 100644 --- a/sys/src/9/port/devbridge.c +++ b/sys/src/9/port/devbridge.c @@ -950,7 +950,7 @@ cachedump(Bridge *b) static void ethermultiwrite(Bridge *b, Block *bp, int portid, ushort tag) { - Port *oport; + Port *p, *oport; Etherpkt *ep; int i, mcast; ushort vid; @@ -960,23 +960,23 @@ ethermultiwrite(Bridge *b, Block *bp, int portid, ushort tag) mcast = ep->d[0] & 1; /* multicast bit of ethernet address */ oport = nil; for(i=0; i<b->nport; i++) { - if(i == portid || b->port[i] == nil || !ismember(b->port[i], vid)) + if(i == portid || (p = b->port[i]) == nil || !ismember(p, vid)) continue; /* * we need to forward multicast packets for ipv6, * so always do it. */ if(mcast) - b->port[i]->outmulti++; + p->outmulti++; else - b->port[i]->outunknown++; + p->outunknown++; /* delay one so that the last write does not copy */ if(oport != nil) { b->copy++; etherwrite(oport, copyblock(bp, BLEN(bp)), tag); } - oport = b->port[i]; + oport = p; } /* last write free block */ |