summaryrefslogtreecommitdiffstats
path: root/contrib/netcat
diff options
context:
space:
mode:
authorbz <bz@FreeBSD.org>2012-02-17 02:39:58 +0000
committerbz <bz@FreeBSD.org>2012-02-17 02:39:58 +0000
commitdcdb23291fec1365e927195511d5dfb273901a5d (patch)
treec7ee398c979933c1e0e6d10495989fe027210cec /contrib/netcat
parentf73705f023ce445780ef6da3c298f9aca1ef8acb (diff)
downloadFreeBSD-src-dcdb23291fec1365e927195511d5dfb273901a5d.zip
FreeBSD-src-dcdb23291fec1365e927195511d5dfb273901a5d.tar.gz
Merge multi-FIB IPv6 support from projects/multi-fibv6/head/:
Extend the so far IPv4-only support for multiple routing tables (FIBs) introduced in r178888 to IPv6 providing feature parity. This includes an extended rtalloc(9) KPI for IPv6, the necessary adjustments to the network stack, and user land support as in netstat. Sponsored by: Cisco Systems, Inc. Reviewed by: melifaro (basically) MFC after: 10 days
Diffstat (limited to 'contrib/netcat')
-rw-r--r--contrib/netcat/netcat.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/contrib/netcat/netcat.c b/contrib/netcat/netcat.c
index 9b9017d..bee0fa6 100644
--- a/contrib/netcat/netcat.c
+++ b/contrib/netcat/netcat.c
@@ -605,8 +605,10 @@ remote_connect(const char *host, const char *port, struct addrinfo hints)
#endif
if (rtableid) {
- if (setfib(rtableid) == -1)
- err(1, "setfib");
+ if (setsockopt(s, SOL_SOCKET, SO_SETFIB, &rtableid,
+ sizeof(rtableid)) == -1)
+ err(1, "setsockopt(.., SO_SETFIB, %u, ..)",
+ rtableid);
}
/* Bind to a local port or source address if specified. */
@@ -678,8 +680,11 @@ local_listen(char *host, char *port, struct addrinfo hints)
continue;
if (rtableid) {
- if (setfib(rtableid) == -1)
- err(1, "setfib");
+ ret = setsockopt(s, SOL_SOCKET, SO_SETFIB, &rtableid,
+ sizeof(rtableid));
+ if (ret == -1)
+ err(1, "setsockopt(.., SO_SETFIB, %u, ..)",
+ rtableid);
}
ret = setsockopt(s, SOL_SOCKET, SO_REUSEPORT, &x, sizeof(x));
OpenPOWER on IntegriCloud