summaryrefslogtreecommitdiffstats
path: root/sys/netinet/ip_output.c
diff options
context:
space:
mode:
authorjulian <julian@FreeBSD.org>2008-11-19 19:19:30 +0000
committerjulian <julian@FreeBSD.org>2008-11-19 19:19:30 +0000
commitcf07f793f28ff207220b29f826cd29b383f5d370 (patch)
treeb8bb39aefb08a1999c428adfd19817999a5c171b /sys/netinet/ip_output.c
parent531042bdec72ce9856b1a7463ffbe9973a8ffa1e (diff)
downloadFreeBSD-src-cf07f793f28ff207220b29f826cd29b383f5d370.zip
FreeBSD-src-cf07f793f28ff207220b29f826cd29b383f5d370.tar.gz
Fix a scope problem in the multiple routing table code that stopped the
SO_SETFIB socket option from working correctly. Obtained from: Ironport MFC after: 3 days
Diffstat (limited to 'sys/netinet/ip_output.c')
-rw-r--r--sys/netinet/ip_output.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/sys/netinet/ip_output.c b/sys/netinet/ip_output.c
index 75ef09d..aa5d3e7 100644
--- a/sys/netinet/ip_output.c
+++ b/sys/netinet/ip_output.c
@@ -134,8 +134,10 @@ ip_output(struct mbuf *m, struct mbuf *opt, struct route *ro, int flags,
bzero(ro, sizeof (*ro));
}
- if (inp != NULL)
+ if (inp != NULL) {
+ M_SETFIB(m, inp->inp_inc.inc_fibnum);
INP_LOCK_ASSERT(inp);
+ }
if (opt) {
len = 0;
@@ -824,6 +826,11 @@ ip_ctloutput(struct socket *so, struct sockopt *sopt)
error = optval = 0;
if (sopt->sopt_level != IPPROTO_IP) {
+ if ((sopt->sopt_level == SOL_SOCKET) &&
+ (sopt->sopt_name == SO_SETFIB)) {
+ inp->inp_inc.inc_fibnum = so->so_fibnum;
+ return (0);
+ }
return (EINVAL);
}
OpenPOWER on IntegriCloud