aboutsummaryrefslogtreecommitdiff
path: root/sys/net/if_gif.c
diff options
context:
space:
mode:
authorAndrey V. Elsukov <ae@FreeBSD.org>2015-05-12 07:37:27 +0000
committerAndrey V. Elsukov <ae@FreeBSD.org>2015-05-12 07:37:27 +0000
commiteccfe69a5c486bfc7d7877d66d98e928c2191351 (patch)
treef1c878482abb06e942d871316149ceffb7479b15 /sys/net/if_gif.c
parent0a23444a57b962959c35d5f9035105f0dc4e1bcd (diff)
downloadsrc-eccfe69a5c486bfc7d7877d66d98e928c2191351.tar.gz
src-eccfe69a5c486bfc7d7877d66d98e928c2191351.zip
Add new socket ioctls SIOC[SG]TUNFIB to set FIB number of encapsulated
packets on tunnel interfaces. Add support of these ioctls to gre(4), gif(4) and me(4) interfaces. For incoming packets M_SETFIB() should use if_fib value from ifnet structure, use proper value in gre(4) and me(4). Differential Revision: https://reviews.freebsd.org/D2462 No objection from: #network MFC after: 2 weeks Sponsored by: Yandex LLC
Notes
Notes: svn path=/head/; revision=282809
Diffstat (limited to 'sys/net/if_gif.c')
-rw-r--r--sys/net/if_gif.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/sys/net/if_gif.c b/sys/net/if_gif.c
index cbcb50f7c61b..48a842a9dd93 100644
--- a/sys/net/if_gif.c
+++ b/sys/net/if_gif.c
@@ -920,6 +920,17 @@ gif_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data)
#endif
}
break;
+ case SIOCGTUNFIB:
+ ifr->ifr_fib = sc->gif_fibnum;
+ break;
+ case SIOCSTUNFIB:
+ if ((error = priv_check(curthread, PRIV_NET_GIF)) != 0)
+ break;
+ if (ifr->ifr_fib >= rt_numfibs)
+ error = EINVAL;
+ else
+ sc->gif_fibnum = ifr->ifr_fib;
+ break;
case GIFGOPTS:
options = sc->gif_options;
error = copyout(&options, ifr->ifr_data, sizeof(options));
@@ -935,7 +946,6 @@ gif_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data)
else
sc->gif_options = options;
break;
-
default:
error = EINVAL;
break;