diff options
author | Jeremie Courreges-Anglas <jca@cvs.openbsd.org> | 2014-03-12 10:19:41 +0000 |
---|---|---|
committer | Jeremie Courreges-Anglas <jca@cvs.openbsd.org> | 2014-03-12 10:19:41 +0000 |
commit | 7774084009eb746d3175c4d1c06eb4b8db52dddb (patch) | |
tree | bb13c0366453bbbdc37313aafcac1151bb5ed667 | |
parent | 49be2c2332a2f99efcb21726a665bfff702e15e6 (diff) |
Unbreak nc -6 -l. Don't retrieve and thus later set the routing table
unless -V is passed (intent of the previous commit), and use SOL_SOCKET
instead of IPPROTO_IP to set the rtable in local_listen(). ok sthen@
-rw-r--r-- | usr.bin/nc/netcat.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/usr.bin/nc/netcat.c b/usr.bin/nc/netcat.c index 2211508c834..c120016912b 100644 --- a/usr.bin/nc/netcat.c +++ b/usr.bin/nc/netcat.c @@ -1,4 +1,4 @@ -/* $OpenBSD: netcat.c,v 1.117 2013/10/26 21:33:29 sthen Exp $ */ +/* $OpenBSD: netcat.c,v 1.118 2014/03/12 10:19:40 jca Exp $ */ /* * Copyright (c) 2001 Eric Jackson <ericj@monkey.org> * @@ -133,7 +133,6 @@ main(int argc, char *argv[]) host = NULL; uport = NULL; sv = NULL; - rtableid = getrtable(); while ((ch = getopt(argc, argv, "46DdFhI:i:klNnO:P:p:rSs:tT:UuV:vw:X:x:z")) != -1) { @@ -698,7 +697,7 @@ local_listen(char *host, char *port, struct addrinfo hints) res0->ai_protocol)) < 0) continue; - if (rtableid >= 0 && (setsockopt(s, IPPROTO_IP, SO_RTABLE, + if (rtableid >= 0 && (setsockopt(s, SOL_SOCKET, SO_RTABLE, &rtableid, sizeof(rtableid)) == -1)) err(1, "setsockopt SO_RTABLE"); |