summaryrefslogtreecommitdiff
path: root/src/usr.bin/nc/netcat.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/usr.bin/nc/netcat.c')
-rw-r--r--src/usr.bin/nc/netcat.c28
1 files changed, 14 insertions, 14 deletions
diff --git a/src/usr.bin/nc/netcat.c b/src/usr.bin/nc/netcat.c
index df68805bd9..e471182b2a 100644
--- a/src/usr.bin/nc/netcat.c
+++ b/src/usr.bin/nc/netcat.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: netcat.c,v 1.97 2010/04/20 07:28:28 nicm Exp $ */ 1/* $OpenBSD: netcat.c,v 1.98 2010/07/03 04:44:51 guenther Exp $ */
2/* 2/*
3 * Copyright (c) 2001 Eric Jackson <ericj@monkey.org> 3 * Copyright (c) 2001 Eric Jackson <ericj@monkey.org>
4 * 4 *
@@ -84,7 +84,7 @@ int Iflag; /* TCP receive buffer size */
84int Oflag; /* TCP send buffer size */ 84int Oflag; /* TCP send buffer size */
85int Sflag; /* TCP MD5 signature option */ 85int Sflag; /* TCP MD5 signature option */
86int Tflag = -1; /* IP Type of Service */ 86int Tflag = -1; /* IP Type of Service */
87u_int rdomain; 87u_int rtableid;
88 88
89int timeout = -1; 89int timeout = -1;
90int family = AF_UNSPEC; 90int family = AF_UNSPEC;
@@ -189,10 +189,10 @@ main(int argc, char *argv[])
189 uflag = 1; 189 uflag = 1;
190 break; 190 break;
191 case 'V': 191 case 'V':
192 rdomain = (unsigned int)strtonum(optarg, 0, 192 rtableid = (unsigned int)strtonum(optarg, 0,
193 RT_TABLEID_MAX, &errstr); 193 RT_TABLEID_MAX, &errstr);
194 if (errstr) 194 if (errstr)
195 errx(1, "rdomain %s: %s", errstr, optarg); 195 errx(1, "rtable %s: %s", errstr, optarg);
196 break; 196 break;
197 case 'v': 197 case 'v':
198 vflag = 1; 198 vflag = 1;
@@ -507,10 +507,10 @@ remote_connect(const char *host, const char *port, struct addrinfo hints)
507 res0->ai_protocol)) < 0) 507 res0->ai_protocol)) < 0)
508 continue; 508 continue;
509 509
510 if (rdomain) { 510 if (rtableid) {
511 if (setsockopt(s, IPPROTO_IP, SO_RDOMAIN, &rdomain, 511 if (setsockopt(s, IPPROTO_IP, SO_RTABLE, &rtableid,
512 sizeof(rdomain)) == -1) 512 sizeof(rtableid)) == -1)
513 err(1, "setsockopt SO_RDOMAIN"); 513 err(1, "setsockopt SO_RTABLE");
514 } 514 }
515 515
516 /* Bind to a local port or source address if specified. */ 516 /* Bind to a local port or source address if specified. */
@@ -581,10 +581,10 @@ local_listen(char *host, char *port, struct addrinfo hints)
581 res0->ai_protocol)) < 0) 581 res0->ai_protocol)) < 0)
582 continue; 582 continue;
583 583
584 if (rdomain) { 584 if (rtableid) {
585 if (setsockopt(s, IPPROTO_IP, SO_RDOMAIN, &rdomain, 585 if (setsockopt(s, IPPROTO_IP, SO_RTABLE, &rtableid,
586 sizeof(rdomain)) == -1) 586 sizeof(rtableid)) == -1)
587 err(1, "setsockopt SO_RDOMAIN"); 587 err(1, "setsockopt SO_RTABLE");
588 } 588 }
589 589
590 ret = setsockopt(s, SOL_SOCKET, SO_REUSEPORT, &x, sizeof(x)); 590 ret = setsockopt(s, SOL_SOCKET, SO_REUSEPORT, &x, sizeof(x));
@@ -871,7 +871,7 @@ help(void)
871 \t-t Answer TELNET negotiation\n\ 871 \t-t Answer TELNET negotiation\n\
872 \t-U Use UNIX domain socket\n\ 872 \t-U Use UNIX domain socket\n\
873 \t-u UDP mode\n\ 873 \t-u UDP mode\n\
874 \t-V rdomain Specify alternate routing domain\n\ 874 \t-V rtable Specify alternate routing table\n\
875 \t-v Verbose\n\ 875 \t-v Verbose\n\
876 \t-w secs\t Timeout for connects and final net reads\n\ 876 \t-w secs\t Timeout for connects and final net reads\n\
877 \t-X proto Proxy protocol: \"4\", \"5\" (SOCKS) or \"connect\"\n\ 877 \t-X proto Proxy protocol: \"4\", \"5\" (SOCKS) or \"connect\"\n\
@@ -887,7 +887,7 @@ usage(int ret)
887 fprintf(stderr, 887 fprintf(stderr,
888 "usage: nc [-46DdhklnrStUuvz] [-I length] [-i interval] [-O length]\n" 888 "usage: nc [-46DdhklnrStUuvz] [-I length] [-i interval] [-O length]\n"
889 "\t [-P proxy_username] [-p source_port] [-s source_ip_address] [-T ToS]\n" 889 "\t [-P proxy_username] [-p source_port] [-s source_ip_address] [-T ToS]\n"
890 "\t [-V rdomain] [-w timeout] [-X proxy_protocol]\n" 890 "\t [-V rtable] [-w timeout] [-X proxy_protocol]\n"
891 "\t [-x proxy_address[:port]] [hostname] [port]\n"); 891 "\t [-x proxy_address[:port]] [hostname] [port]\n");
892 if (ret) 892 if (ret)
893 exit(1); 893 exit(1);