diff options
author | jca <> | 2014-03-12 10:19:40 +0000 |
---|---|---|
committer | jca <> | 2014-03-12 10:19:40 +0000 |
commit | 7c532f362e0999cb8cea0edb4562ae71c1ebe1f1 (patch) | |
tree | 347c2febdac37c4fbb333deee0792349381f9d63 /src | |
parent | 3b6d92e82b1421b811bcdec7f7fdfb31eeef18de (diff) | |
download | openbsd-7c532f362e0999cb8cea0edb4562ae71c1ebe1f1.tar.gz openbsd-7c532f362e0999cb8cea0edb4562ae71c1ebe1f1.tar.bz2 openbsd-7c532f362e0999cb8cea0edb4562ae71c1ebe1f1.zip |
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@
Diffstat (limited to 'src')
-rw-r--r-- | src/usr.bin/nc/netcat.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/src/usr.bin/nc/netcat.c b/src/usr.bin/nc/netcat.c index 2211508c83..c120016912 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.117 2013/10/26 21:33:29 sthen Exp $ */ | 1 | /* $OpenBSD: netcat.c,v 1.118 2014/03/12 10:19:40 jca Exp $ */ |
2 | /* | 2 | /* |
3 | * Copyright (c) 2001 Eric Jackson <ericj@monkey.org> | 3 | * Copyright (c) 2001 Eric Jackson <ericj@monkey.org> |
4 | * | 4 | * |
@@ -133,7 +133,6 @@ main(int argc, char *argv[]) | |||
133 | host = NULL; | 133 | host = NULL; |
134 | uport = NULL; | 134 | uport = NULL; |
135 | sv = NULL; | 135 | sv = NULL; |
136 | rtableid = getrtable(); | ||
137 | 136 | ||
138 | while ((ch = getopt(argc, argv, | 137 | while ((ch = getopt(argc, argv, |
139 | "46DdFhI:i:klNnO:P:p:rSs:tT:UuV:vw:X:x:z")) != -1) { | 138 | "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) | |||
698 | res0->ai_protocol)) < 0) | 697 | res0->ai_protocol)) < 0) |
699 | continue; | 698 | continue; |
700 | 699 | ||
701 | if (rtableid >= 0 && (setsockopt(s, IPPROTO_IP, SO_RTABLE, | 700 | if (rtableid >= 0 && (setsockopt(s, SOL_SOCKET, SO_RTABLE, |
702 | &rtableid, sizeof(rtableid)) == -1)) | 701 | &rtableid, sizeof(rtableid)) == -1)) |
703 | err(1, "setsockopt SO_RTABLE"); | 702 | err(1, "setsockopt SO_RTABLE"); |
704 | 703 | ||