svn commit: trunk/busybox: include networking

vda at busybox.net vda at busybox.net
Sat Jan 20 16:54:20 UTC 2007


Author: vda
Date: 2007-01-20 08:54:19 -0800 (Sat, 20 Jan 2007)
New Revision: 17397

Log:
fixing bugs revealed by randomconfig runs


Modified:
   trunk/busybox/include/applets.h
   trunk/busybox/networking/nc.c
   trunk/busybox/networking/tftp.c


Changeset:
Modified: trunk/busybox/include/applets.h
===================================================================
--- trunk/busybox/include/applets.h	2007-01-20 13:06:49 UTC (rev 17396)
+++ trunk/busybox/include/applets.h	2007-01-20 16:54:19 UTC (rev 17397)
@@ -287,7 +287,9 @@
 USE_TELNET(APPLET(telnet, _BB_DIR_USR_BIN, _BB_SUID_NEVER))
 USE_TELNETD(APPLET(telnetd, _BB_DIR_USR_SBIN, _BB_SUID_NEVER))
 USE_TEST(APPLET(test, _BB_DIR_USR_BIN, _BB_SUID_NEVER))
+#if ENABLE_FEATURE_TFTP_GET || ENABLE_FEATURE_TFTP_PUT
 USE_TFTP(APPLET(tftp, _BB_DIR_USR_BIN, _BB_SUID_NEVER))
+#endif
 USE_TIME(APPLET(time, _BB_DIR_USR_BIN, _BB_SUID_NEVER))
 USE_TOP(APPLET(top, _BB_DIR_USR_BIN, _BB_SUID_NEVER))
 USE_TOUCH(APPLET(touch, _BB_DIR_BIN, _BB_SUID_NEVER))

Modified: trunk/busybox/networking/nc.c
===================================================================
--- trunk/busybox/networking/nc.c	2007-01-20 13:06:49 UTC (rev 17396)
+++ trunk/busybox/networking/nc.c	2007-01-20 16:54:19 UTC (rev 17397)
@@ -23,8 +23,8 @@
 	/* sfd sits _here_ only because of "repeat" option (-l -l). */
 	int sfd = sfd; /* for gcc */
 	int cfd = 0;
+	unsigned lport = 0;
 	SKIP_NC_SERVER(const) unsigned do_listen = 0;
-	SKIP_NC_SERVER(const) unsigned lport = 0;
 	SKIP_NC_EXTRA (const) unsigned wsecs = 0;
 	SKIP_NC_EXTRA (const) unsigned delay = 0;
 	SKIP_NC_EXTRA (const int execparam = 0;)

Modified: trunk/busybox/networking/tftp.c
===================================================================
--- trunk/busybox/networking/tftp.c	2007-01-20 13:06:49 UTC (rev 17396)
+++ trunk/busybox/networking/tftp.c	2007-01-20 16:54:19 UTC (rev 17397)
@@ -22,6 +22,8 @@
 #include "busybox.h"
 
 
+#if ENABLE_FEATURE_TFTP_GET || ENABLE_FEATURE_TFTP_PUT
+
 #define TFTP_BLOCKSIZE_DEFAULT 512	/* according to RFC 1350, don't change */
 #define TFTP_TIMEOUT 5	/* seconds */
 #define TFTP_NUM_RETRIES 5 /* number of retries */
@@ -56,8 +58,8 @@
 #else
 #define USE_GETPUT(a) a
 /* masks coming from getpot32 */
-#define CMD_GET(cmd) (cmd & 1)
-#define CMD_PUT(cmd) (cmd & 2)
+#define CMD_GET(cmd) ((cmd) & 1)
+#define CMD_PUT(cmd) ((cmd) & 2)
 #endif
 /* NB: in the code below
  * CMD_GET(cmd) and CMD_GET(cmd) are mutually exclusive
@@ -508,3 +510,5 @@
 	}
 	return result;
 }
+
+#endif /* ENABLE_FEATURE_TFTP_GET || ENABLE_FEATURE_TFTP_PUT */




More information about the busybox-cvs mailing list