On Thursday 07 April 2011 15:06, Kilarski, Tomasz wrote:
> I am using buildroot + busybox 1.17.1 as PXE server. I needed to make some 
> fixes to make it working.
> Not sure if these bugs still present in the latest busybox release, if so it 
> would be valuable to apply fixes.
> Unfortunately I have very limited time to fully contribute in busybox, so 
> that is why I am sending my modifications to you.

You don't have time to run diff so that changes are properly formatted?
 
> Fixes in tftp.c are straightforward (sizeof instead of strlem was used,

Which is not a bug. sizeof("literal string") == strlen("literal string") + 1.
It doesn't work for you? Are you sure?


> moreover it was not possible to start it from inetd) 

-       peer_lsa = xzalloc(LSA_LEN_SIZE + our_lsa->len);
+<----->
+       /* Tftpd executed from Inetd must avoid writing to stderr, because
+     * stdio is redirected and in result bb_error_mesage is sent
+     * over network socket - use syslog instead */
+    openlog(applet_name, LOG_PID | LOG_NDELAY, LOG_DAEMON);
+       logmode = LOGMODE_SYSLOG;
+
+    peer_lsa = xzalloc(LSA_LEN_SIZE + our_lsa->len);


You are right that errors mustn't go to stderr *in inetd mode*.
However, usage with udpsvd, which is documented:

$ tftpd --help
BusyBox v1.19.0.git (2011-04-11 02:57:24 CEST) multi-call binary.

Usage: tftpd [-cr] [-u USER] [DIR]

Transfer a file on tftp client's request

tftpd should be used as an inetd service.
tftpd's line for inetd.conf:
        69 dgram udp nowait root tftpd tftpd /files/to/serve
It also can be ran from udpsvd:
        udpsvd -vE 0.0.0.0 69 tftpd /files/to/serve
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

doesn't have such limitation.

Your fix is unacceptable - it makes udpsvd users' lifes harder.
Not to mention that its formatting is far from ideal.


> Fixes in dhpc.c - maybe it is specific to my test environment (without it I 
> was not able to get IP from DHCP server) however it increases consistency 
> with the protocol.
> Part of the discover message is a timestamp, it has to be referenced in all 
> following communication (the original code was using 0).

Fixed in git already.

-- 
vda
_______________________________________________
busybox mailing list
[email protected]
http://lists.busybox.net/mailman/listinfo/busybox

Reply via email to