<feed xmlns='http://www.w3.org/2005/Atom'>
<title>luci/libs/nixio/src/io.c, branch 0.11.0</title>
<subtitle>Lua Configuration Interface (mirror)</subtitle>
<id>https://git.openwrt.org/project/luci/atom?h=0.11.0</id>
<link rel='self' href='https://git.openwrt.org/project/luci/atom?h=0.11.0'/>
<link rel='alternate' type='text/html' href='https://git.openwrt.org/project/luci/'/>
<updated>2011-12-16T02:10:37Z</updated>
<entry>
<title>[PATCH] Abstract address UNIX sockets not binding properly (by capnbry@gmail.com, #366)</title>
<updated>2011-12-16T02:10:37Z</updated>
<author>
<name>Jo-Philipp Wich</name>
</author>
<published>2011-12-16T02:10:37Z</published>
<link rel='alternate' type='text/html' href='https://git.openwrt.org/project/luci/commit/?id=ca7bc48ebc0b1f655088eaae89bd358556dc8824'/>
<id>urn:sha1:ca7bc48ebc0b1f655088eaae89bd358556dc8824</id>
<content type='text'>
In #274, I stated abstract namespace and autobound abstract namespace datagram UNIX domain sockets work perfectly with nixio. However, I may have jumped the gun on that conclusion. Turns out they work perfectly for only one 
concurrent connection.

The problem is that when binding to an abstract address socket, which begins with a NULL byte, nixio strncpy's the name into the sockaddr_un structure, which effectively copies nothing. It then binds to an address of 180 NULLs, 
which is completely legal, but obviously you run into problems when a second client tries to bind to the same address.

The rules are as follows ( http://linux.die.net/man/7/unix) for the names:

  * If the name is blank, bind() should pass that the addrlen of sizeof(sa_family_t) and Linux will autobind a name that begins with null and is followed by 5 digits.
  * If the first character of the name is non-null, the name is a pathname and is null-terminated. addrlen should be sizeof(sockaddr_un), but the length can also be the pathname len + sizeof(sa_family_t) as the value will be 
null-terminated by the kernel unix socket driver
  * If the first character is null, the address is abstract and the value should not be null-terminated and addrlen is pathname + sizeof(sa_family_t) 

The attached patch fixes bind/connect/sendto by shortening the addrlen passed to be pathname len + sizeof(sa_family_t), which generates the correct socket names for all 3 cases above.
It also fixes the address returned by recvfrom, which currently returns a blank string for any abstract address socket (as they begin with a null).

</content>
</entry>
<entry>
<title>libs/nixio: Fix recvfrom() return values for unnamed unix sockets, patch by capnbry@gmail.com (#274)</title>
<updated>2011-07-17T09:04:43Z</updated>
<author>
<name>Jo-Philipp Wich</name>
</author>
<published>2011-07-17T09:04:43Z</published>
<link rel='alternate' type='text/html' href='https://git.openwrt.org/project/luci/commit/?id=518dc0fef9961bf135b1780062b346cd66192c85'/>
<id>urn:sha1:518dc0fef9961bf135b1780062b346cd66192c85</id>
<content type='text'>
</content>
</entry>
<entry>
<title>libs/nixio: fix sendto(), implement support for unix domain sockets (#140)</title>
<updated>2011-01-13T23:26:19Z</updated>
<author>
<name>Jo-Philipp Wich</name>
</author>
<published>2011-01-13T23:26:19Z</published>
<link rel='alternate' type='text/html' href='https://git.openwrt.org/project/luci/commit/?id=716fd7a2d187fc1836574a6e7ab784bec49e3d34'/>
<id>urn:sha1:716fd7a2d187fc1836574a6e7ab784bec49e3d34</id>
<content type='text'>
</content>
</entry>
<entry>
<title>nixio: store stats and other number information as integer, which works better when lua number support is downgraded from double to float</title>
<updated>2009-10-26T04:52:07Z</updated>
<author>
<name>Felix Fietkau</name>
</author>
<published>2009-10-26T04:52:07Z</published>
<link rel='alternate' type='text/html' href='https://git.openwrt.org/project/luci/commit/?id=64d9a00a9934cd06401f4b9ec2e14950a4423a87'/>
<id>urn:sha1:64d9a00a9934cd06401f4b9ec2e14950a4423a87</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Merge nixio 0.2</title>
<updated>2009-04-21T16:26:45Z</updated>
<author>
<name>Steven Barth</name>
</author>
<published>2009-04-21T16:26:45Z</published>
<link rel='alternate' type='text/html' href='https://git.openwrt.org/project/luci/commit/?id=a2b916ab736802050b19562b7c163e3f3bb1566f'/>
<id>urn:sha1:a2b916ab736802050b19562b7c163e3f3bb1566f</id>
<content type='text'>
</content>
</entry>
<entry>
<title>nixio: FreeBSD compatibility #2</title>
<updated>2009-03-12T14:53:52Z</updated>
<author>
<name>Steven Barth</name>
</author>
<published>2009-03-12T14:53:52Z</published>
<link rel='alternate' type='text/html' href='https://git.openwrt.org/project/luci/commit/?id=04eb9de74e06b8532fcb54986442ef8a5497c0ec'/>
<id>urn:sha1:04eb9de74e06b8532fcb54986442ef8a5497c0ec</id>
<content type='text'>
</content>
</entry>
<entry>
<title>nixio: Fixes, use POSIX calls for file i/o</title>
<updated>2009-02-27T14:51:37Z</updated>
<author>
<name>Steven Barth</name>
</author>
<published>2009-02-27T14:51:37Z</published>
<link rel='alternate' type='text/html' href='https://git.openwrt.org/project/luci/commit/?id=7196b2cd848577f640d9268a0a34ab3ad8706c26'/>
<id>urn:sha1:7196b2cd848577f640d9268a0a34ab3ad8706c26</id>
<content type='text'>
httpclient: resume support, splice() support, cookie support
</content>
</entry>
<entry>
<title>NIXIO: TLS-Support, bugfixes</title>
<updated>2009-02-22T22:49:23Z</updated>
<author>
<name>Steven Barth</name>
</author>
<published>2009-02-22T22:49:23Z</published>
<link rel='alternate' type='text/html' href='https://git.openwrt.org/project/luci/commit/?id=d2b11117f26285186b711271d24733d35e0444a1'/>
<id>urn:sha1:d2b11117f26285186b711271d24733d35e0444a1</id>
<content type='text'>
</content>
</entry>
<entry>
<title>nixio next</title>
<updated>2009-02-12T19:48:06Z</updated>
<author>
<name>Steven Barth</name>
</author>
<published>2009-02-12T19:48:06Z</published>
<link rel='alternate' type='text/html' href='https://git.openwrt.org/project/luci/commit/?id=5ff898e6248b668430f5f2e7d70de243f191eb04'/>
<id>urn:sha1:5ff898e6248b668430f5f2e7d70de243f191eb04</id>
<content type='text'>
splice() still does not work correctly
</content>
</entry>
<entry>
<title>nixio + io = nix2io</title>
<updated>2009-02-10T17:35:07Z</updated>
<author>
<name>Steven Barth</name>
</author>
<published>2009-02-10T17:35:07Z</published>
<link rel='alternate' type='text/html' href='https://git.openwrt.org/project/luci/commit/?id=4327f9250e6d0f4a81ca949289d5e1444a360d4e'/>
<id>urn:sha1:4327f9250e6d0f4a81ca949289d5e1444a360d4e</id>
<content type='text'>
</content>
</entry>
</feed>
