summaryrefslogtreecommitdiff
path: root/sys/src/cmd/nusb/ether
diff options
context:
space:
mode:
authorcinap_lenrek <cinap_lenrek@felloff.net>2017-12-15 22:22:29 +0100
committercinap_lenrek <cinap_lenrek@felloff.net>2017-12-15 22:22:29 +0100
commit9fd8894fec87ccd326997b84a2be431af8764cce (patch)
treedf8bdfa139b48cefa908f208d44b1ecb326150f5 /sys/src/cmd/nusb/ether
parent4ad70e6055093123f0611269ca7e8e201257e5db (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.c5
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);