From 7c532f362e0999cb8cea0edb4562ae71c1ebe1f1 Mon Sep 17 00:00:00 2001 From: jca <> Date: Wed, 12 Mar 2014 10:19:40 +0000 Subject: 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@ --- src/usr.bin/nc/netcat.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'src') 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 @@ -/* $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 * @@ -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"); -- cgit v1.2.3-55-g6feb