summaryrefslogtreecommitdiff
path: root/sys/src/9/port/devbridge.c
AgeCommit message (Collapse)Author
2022-09-17devip: do tcp mss clamping when forwarding packetscinap_lenrek
when forwarding packets (gating), unconditionally check tcp-syn packets for the mss-size option and reduce it to fit the mtu of the outgoing interface. this is done by exporting a new tcpmssclamp() function from ip/tcp.c that takes an ip packet and its buffer size and the effective mtu of the interface and adjusts the mss value of tcp syn options. this function is now also used by devbridge, enforcing a tcp mss below the tunnel mtu.
2022-02-27devbridge: fix vlan range parsingcinap_lenrek
2022-02-26devbridge: improve locking, unbind ports automatically on read error and more...cinap_lenrek
Use an RWlock so readers can work in parallel in the common case (no cache updates). When a reader needs to update the cache to add a new learned source mac address, it will drop the rlock and aquire the wlock to do the update. When we get a read error, we now unbind the port to avoid further packets being forwarded to it. This is usefull for hotplug ethernet devices like usb ones or tunnels. Simplify the unbind, getting rid of the refcount, by having only the reader proc call freeport(). Avoid holding the bridge lock while opening and closing ethernet/tunnel device files during bind and unbind. Dont use smalloc() (especially when holding locks). Allocate bridges dynamically, so we do not waste the memory when we do not need them. Reject non-hostowner from allocating new bridges. Use consistent naming: port -> port Use consistent comment style: // -> /* */
2022-02-16devbridge: implement experimental vlan supportcinap_lenrek
2018-11-17devbridge: fix runt packets going through the bridge (thanks cinap)mischief
linux will send small, unpadded arp packets which may arrive over wifi, so allow small packets into the bridge and pad any packets that are too small when going out.
2018-02-25kernel: properly handle bad attach specifierscinap_lenrek
- only accept decimal for numeric device id's - exclude negative device id's - device id's out of range yield Enodev
2017-12-18devbridge: disable write blocking on ethernetscinap_lenrek
2017-12-17devbridge: fix mss clampingcinap_lenrek
- use protocol constants from ip/ip.h and ip/ipv6.h - support mss clamping for ipv6 - fix padding bug on 64 bit machines (can't use sizeof(Tcphdr))
2016-11-08devbridge: simplify etherwrite() as we dont deal with block listscinap_lenrek
2016-11-07devbridge: various bugfixes and improvements from charles forsythcinap_lenrek
2015-08-03kernel: dont rely on atoi() parsing hex for netif/devbridgecinap_lenrek
2012-10-01devproc buffer overflow, strncpycinap_lenrek
in devproc status read handler the p->status, p->text and p->user could overflow the local statbuf buffer as they where copied into it with code like: memmove(statbuf+someoff, p->text, strlen(p->text)). now using readstr() which will truncate if the string is too long. make strncpy() usage consistent, make sure results are always null terminated.
2011-12-12devbridge: fixcinap_lenrek
2011-12-12kernel: fix more malloc/smalloc errorscinap_lenrek
2011-03-30Import sources from 2011-03-30 iso image - libTaru Karttunen
2011-03-30Import sources from 2011-03-30 iso imageTaru Karttunen