[ds6-devel] nc6/src parser.c,1.25,1.26

chris@deepspace6.net chris@deepspace6.net
Wed Jan 1 15:55:21 2003


Update of /cvs/nc6/src

Modified Files:
	parser.c 
Log Message:
Changed -d option to --no-reuseaddr.  I figured it was an oft unused option
that could be relegated to 'long option only' status.  Any complaints?


Index: parser.c
===================================================================
RCS file: /cvs/nc6/src/parser.c,v
retrieving revision 1.25
retrieving revision 1.26
diff -u -d -r1.25 -r1.26
--- parser.c	1 Jan 2003 10:05:32 -0000	1.25
+++ parser.c	1 Jan 2003 15:55:19 -0000	1.26
@@ -80,7 +80,9 @@
 	{"half-close",          FALSE, NULL,  0 },
 #define OPT_DISABLE_NAGLE	14
 	{"disable-nagle",       FALSE, NULL,  0 },
-#define OPT_MAX			15
+#define OPT_NO_REUSEADDR	15
+	{"no-reuseaddr",        FALSE, NULL,  'd' },
+#define OPT_MAX			16
 	{0, 0, 0, 0}
 };
 
@@ -139,6 +141,9 @@
 			case OPT_DISABLE_NAGLE:
 				set_flag(DISABLE_NAGLE);
 				break;
+			case OPT_NO_REUSEADDR:
+				set_flag(DONT_REUSE_ADDR);
+				break;
 			default:
 				fatal("getopt returned unexpected "
 				      "long offset index %d\n", option_index);
@@ -155,9 +160,6 @@
 			attrs->proto = PROTO_IPv6;
 			set_flag(STRICT_IPV6);
 			break;
-		case 'd':	
-			set_flag(DONT_REUSE_ADDR);
-			break;
 		case 'h':	
 			print_usage(stdout);
 			exit(EXIT_SUCCESS);
@@ -290,7 +292,8 @@
 		return LISTEN_MODE;
 	} else {
 		if (is_flag_set(DONT_REUSE_ADDR)) {
-			warn("-d option can be used only in listen mode");
+			warn("--no-reuseaddr option "
+			     "can be used only in listen mode");
 			print_usage(stderr);
 			exit(EXIT_FAILURE);
 		}
@@ -320,7 +323,6 @@
 	fprintf(fp,	
 "  -4                Use only IPv4\n"
 "  -6                Use only IPv6\n"
-"  -d                Disable SO_REUSEADDR socket option (only in listen mode)\n"
 "  -h, --help        Display help\n"
 "  -l, --listen      Listen mode, for inbound connects\n"
 "  -n                Numeric-only IP addresses, no DNS\n" 
@@ -343,6 +345,8 @@
 "      --half-close  Handle network half-closes correctly\n"
 "      --disable-nagle\n"
 "                    Disable nagle algorithm for TCP connections\n"
+"      --no-reuseaddr\n"
+"                    Disable SO_REUSEADDR socket option (only in listen mode)\n"
 "\n");
 }
 



More information about the ds6-devel mailing list