diff options
author | cinap_lenrek <cinap_lenrek@felloff.net> | 2017-12-15 22:22:29 +0100 |
---|---|---|
committer | cinap_lenrek <cinap_lenrek@felloff.net> | 2017-12-15 22:22:29 +0100 |
commit | 9fd8894fec87ccd326997b84a2be431af8764cce (patch) | |
tree | df8bdfa139b48cefa908f208d44b1ecb326150f5 /sys/src/cmd/nusb/ether | |
parent | 4ad70e6055093123f0611269ca7e8e201257e5db (diff) |
ether: allow spoofing of source mac address for bridges; used by vmx
to implement layer 2 bridges in userspace, we disable to auto filling
of the source mac address when bridge mode is enabled on the
connection.
Diffstat (limited to 'sys/src/cmd/nusb/ether')
-rw-r--r-- | sys/src/cmd/nusb/ether/ether.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/sys/src/cmd/nusb/ether/ether.c b/sys/src/cmd/nusb/ether/ether.c index 5a94387ae..52481899e 100644 --- a/sys/src/cmd/nusb/ether/ether.c +++ b/sys/src/cmd/nusb/ether/ether.c @@ -306,6 +306,11 @@ writeconndata(Req *r) /* copy in the ethernet packet */ memmove(b->wp, p, r->ifcall.count); + + /* fill source mac address if not bridged */ + if(!conn[NUM(r->fid->qid.path)].bridge) + memmove(b->wp+6, macaddr, 6); + b->wp += r->ifcall.count; etheriq(b, 0); |