ubusd/libubus-io: fix socket descriptor passing
authorPetr Štetiar <ynezz@true.cz>
Fri, 27 Dec 2019 13:48:32 +0000 (14:48 +0100)
committerPetr Štetiar <ynezz@true.cz>
Fri, 27 Dec 2019 14:11:41 +0000 (15:11 +0100)
commit041c9d1c052bb4936fd03240f7d0dd64aedda972
tree2ead372ff8f53fcfb23b0797efb653187d645b31
parent8f2292478c5776dd7533a68f0a963b64d5dd92e3
ubusd/libubus-io: fix socket descriptor passing

In commit 5d7ca8309d0a ("ubusd/libubus-io: fix variable sized struct
position warning") the position of cmsghdr struct has been changed in
order to fix clang-9 compiler warning, but it has introduced regression
in at least `logread` which hanged indefinitely.

So this patch reworks the socket descriptor passing in a way recommended
in the `cmsg(3)` manual page.

Ref: http://lists.infradead.org/pipermail/openwrt-devel/2019-December/020840.html
Fixes: 5d7ca8309d0a ("ubusd/libubus-io: fix variable sized struct position warning")
Reported-by: Hannu Nyman <hannu.nyman@welho.com>
Signed-off-by: Petr Štetiar <ynezz@true.cz>
libubus-io.c
ubusd.c
ubusd_main.c