summaryrefslogtreecommitdiffstats
path: root/sys/netinet
diff options
context:
space:
mode:
Diffstat (limited to 'sys/netinet')
-rw-r--r--sys/netinet/ip_divert.c1
-rw-r--r--sys/netinet/ip_output.c9
-rw-r--r--sys/netinet/raw_ip.c8
3 files changed, 16 insertions, 2 deletions
diff --git a/sys/netinet/ip_divert.c b/sys/netinet/ip_divert.c
index dc000cb..dd0445d 100644
--- a/sys/netinet/ip_divert.c
+++ b/sys/netinet/ip_divert.c
@@ -322,6 +322,7 @@ div_output(struct socket *so, struct mbuf *m, struct sockaddr_in *sin,
*/
m->m_pkthdr.rcvif = NULL;
m->m_nextpkt = NULL;
+ M_SETFIB(m, so->so_fibnum);
if (control)
m_freem(control); /* XXX */
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);
}
diff --git a/sys/netinet/raw_ip.c b/sys/netinet/raw_ip.c
index dfe902e..a84db95 100644
--- a/sys/netinet/raw_ip.c
+++ b/sys/netinet/raw_ip.c
@@ -450,8 +450,14 @@ rip_ctloutput(struct socket *so, struct sockopt *sopt)
struct inpcb *inp = sotoinpcb(so);
int error, optval;
- if (sopt->sopt_level != IPPROTO_IP)
+ 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);
+ }
error = 0;
switch (sopt->sopt_dir) {
OpenPOWER on IntegriCloud