i have sshd up and running on port 22: # netstat -napt | grep LISTEN.*sshd tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 3807/sshd tcp6 0 0 :::22 :::* LISTEN 3807/sshd when i launch oftpd with port 22: # oftpd -p 22 ftp /usr/portage/distfiles/ it forks and runs fine (no warnings), but it ends up on the wrong port: # netstat -napt | grep oft tcp6 0 0 :::5632 :::* LISTEN 4632/oftpd further, if launch a 2nd instance, it gives a broken message: # oftpd -N -p 22 ftp /usr/portage/distfiles/ error_init: 98 error binding address; %s clearly that %s should be an actual message ...
Created attachment 277303 [details] emerge --info oftpd
Hello, this is an upstream problem or introduced by gentoo patches? Michael
i have no idea. i'd have to ask the Gentoo maintainer :p.
Created attachment 336598 [details, diff] Patch to use correct port The port chosen (4632) is the requested port (22), byte-swapped. It fails on the second invocation because it is already listening on the [incorrect] port. This should only happen on little-endian machines. The attached patch modifies ftp_listener.c to use htons on the requested port number.
+*oftpd-0.3.7-r8 (23 Jan 2013) + + 23 Jan 2013; Michael Weber <xmw@gentoo.org> -oftpd-0.3.7-r3.ebuild, + +oftpd-0.3.7-r8.ebuild, -files/oftpd-0.3.7-family.patch, + +files/oftpd-0.3.7-htons.patch, +files/oftpd-0.3.7-unistd.patch, + -files/conf.d.oftpd, -files/init.d.oftpd: + Revbump to add htons patch by tallungulate@gmail.com (bug 371963), fix + unistd, EAPI-4, drop old. +