summaryrefslogtreecommitdiff
path: root/sys/src/9/ip/devip.c
AgeCommit message (Collapse)Author
2019-09-21devip: fix permission checkingcinap_lenrek
permission checking had the "other" and "owner" bits swapped plus incoming connections where always owned by "network" instead of the owner of the listening connection. also, ipwstat() was not effective as the uid strings where not parsed. this fixes the permission checks for data/ctl/err file and makes incoming connections inherit the owner from the listening connection. we also allow ipwstat() to change ownership to the commonuser() or anyone if we are eve. we might have to add additional restrictions for none at a later point...
2019-05-11devip: remove unused c->car qlock, avoid potential deadlock in ↵cinap_lenrek
ipifcregisterproxy() remove references to the unused Conv.car qlock. ipifcregisterproxy() is called with the proxy ifc wlock'd, which means we cannot acquire the rwlock of the interfaces that will proxy for us because it is allowed to rlock() multiple ifc's in any order. to get arround this, we use canrlock() and skip the interface when we cannot acquire the lock. the ifc should get wlock'd only when we are about to modify the ifc or its lifc chain. that is when adding or removing addresses. wlock is not required when we addresses to the selfcache, which has its own qlock.
2019-04-14devip: reject bad numeric ports (such as 9fs -> 9)cinap_lenrek
2018-07-09devip: don't pad the tag for routing commands (fixes removing routes with < ↵cinap_lenrek
4 character tags)
2018-04-10devip: properly initialize the connection ignoreadvice and tos flagscinap_lenrek
2018-04-08devip: implement source specific routingcinap_lenrek
2018-03-18devip: more v6 improvementscinap_lenrek
ipv4local() and ipv6local() now take remote address argument, returning the closest local address to the source. this implements the standartized source address selection rules instead of just returning the first local v4 or v6 address. the source address selection was broken for esp, rudp an udp, blindly assuming ifc->lifc->local being a valid v4 address. use ipv6local() instead. the v6 routing code used to lookup source address route to decide to drop the packet instead of checking the interface on the destination route. factor out the route hint from Conv and put it in Routehint structure. avoiding stack bloat in v4 routing. implement the same trick for v6 avoiding second route lookup in ipoput6. fix memory leak in icmpv6 router solicitation handling. remove old unfinished handling of multiple v6 routers. should implement source specific routes instead. avoid duplication, use common convipvers() function. use isv4() instead of memcmp v4prefix.
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
2018-02-25devip: fix crash on negative dev id on attachcinap_lenrek
2016-11-07ip: always pass a single block to Medium.bwrite(), avoid concatblock() calls ↵cinap_lenrek
in Dev.bwrite() the convention for Dev.bwrite() is that it accepts a *single* block, and not a block chain. so we never have concatblock here. to keep stuff consistent, we also guarantee thet Medium.bwrite() will get a *single* block passed as well, as the callers are few in number.
2016-10-23devip: simplify ipbwrite() by using retun value of qbwrite()cinap_lenrek
2016-03-28devip: applying changes for bug: multicasts_and_udp_bufferscinap_lenrek
/n/bugs/open/multicasts_and_udp_buffers http://bugs.9front.org/open/multicasts_and_udp_buffers/readme michal@Lnet.pl I have ported my small MPEG-TS analisis tool to Plan9. To allow this application working I had to fix a bug in the kernel IPv4 code and increase UDP input buffer. Bug is related to listening for IPv4 multicast traffic. There is no problem if you listen for only one group or multiple groups with different UDP ports. This works: Write to UDP ctl: anounce PORT addmulti INTERFACE_ADDR MULTICAST_ADDR headers and you can read packets from data file. You need to set headers option because otherwise every UDP packet for MULTICAST_ADDR!PORT is treat as separate connection. This is a bug and should be fixed too, but I didn't tried it. There is a problem when you need to receive packets for multiple multicast groups. Usually the same destination port is used by multiple streams and above sequence of commands fails for second group because the port is the same. Simple and probably non-intrusive fix is adding "|| ipismulticast(addr)" to if statement at /sys/src/9/ip/devip.c:861 line: if(ipforme(c->p->f, addr) || ipismulticast(addr)) This fixes the problem and now you can use the following sequence to listen for multiple multicast groups even if they all have the same destination port: announce MULTICAST_ADDR!PORT addmulti INTERFACE_ADDR MULTICAST_ADDR headers After that my application started working but signals packet drops at >2 Mb/s input rate. The same is reported by kernel netlog. Increase capacity of UDP connection input queue fixes this problem /sys/src/9/ip/udp.c:153 c->rq = qopen(512*1024, Qmsg, 0, 0); -- Michał Derkacz
2014-09-21devip: sanity check Nchan in Fsproto()cinap_lenrek
devip can only handle Maskconv+1 conversations per protocol depending on how many bits it uses in the qid to encode the conversation number. we check this when the protocol gets registered. if we do not do this, the kernel will mysteriously panic when the conversaion numbers collide which took some time to debug.
2014-09-21devip: print protocol name in garbage collection notificationcinap_lenrek
2013-05-05devip: dont raise error() out of Fsprotocone()cinap_lenrek
Fsprotoclone() is not supposed to raise error, but return nil. ipopen() seemed to assume otherwise as it setup error label before calling Fsprotoclone(). fix ipopen(), make Fsprotoclone() return nil instead of raising error.
2013-05-05devip: handle malloc errors, fix queue leakscinap_lenrek
Fsprotocone(): qopen() and qbypass() can fail and return nil, so make sure the connection was not partially created by checking if read and write queues have been setup by the protocol create hanler. on error, free any resources of the partial connection and error out. netlogopen(): check malloc() error.
2011-08-17change definition of Chan.create to return a chan like opencinap_lenrek
2011-07-08devip: dont panic when ports get exhaustedcinap_lenrek
2011-03-30Import sources from 2011-03-30 iso image - libTaru Karttunen
2011-03-30Import sources from 2011-03-30 iso imageTaru Karttunen