FreeBSD Bugzilla – Attachment 211517 Details for
Bug 244004
vxlan(4) does not support setting of tunnelfib
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch for vxlan tunnelfib support
vxlan_tunnelfib.patch (text/plain), 2.07 KB, created by
Luiz Amaral
on 2020-02-09 18:57:50 UTC
(
hide
)
Description:
Patch for vxlan tunnelfib support
Filename:
MIME Type:
Creator:
Luiz Amaral
Created:
2020-02-09 18:57:50 UTC
Size:
2.07 KB
patch
obsolete
>diff --git a/sbin/ifconfig/ifconfig.8 b/sbin/ifconfig/ifconfig.8 >index 2cf6c34ae..75616771d 100644 >--- a/sbin/ifconfig/ifconfig.8 >+++ b/sbin/ifconfig/ifconfig.8 >@@ -408,9 +408,10 @@ Specify tunnel FIB. > A FIB > .Ar fib_number > is assigned to all packets encapsulated by tunnel interface, e.g., >-.Xr gif 4 >+.Xr gif 4 , >+.Xr gre 4 > and >-.Xr gre 4 . >+.Xr vxlan 4 . > .It Cm maclabel Ar label > If Mandatory Access Control support is enabled in the kernel, > set the MAC label to >diff --git a/sys/net/if_vxlan.c b/sys/net/if_vxlan.c >index 5e35baae2..83347e141 100644 >--- a/sys/net/if_vxlan.c >+++ b/sys/net/if_vxlan.c >@@ -60,6 +60,7 @@ __FBSDID("$FreeBSD$"); > #include <net/if_types.h> > #include <net/if_vxlan.h> > #include <net/netisr.h> >+#include <net/route.h> > > #include <netinet/in.h> > #include <netinet/in_systm.h> >@@ -146,6 +147,7 @@ struct vxlan_softc { > union vxlan_sockaddr vxl_src_addr; > union vxlan_sockaddr vxl_dst_addr; > uint32_t vxl_flags; >+ u_int vxl_fibnum; > #define VXLAN_FLAG_INIT 0x0001 > #define VXLAN_FLAG_TEARDOWN 0x0002 > #define VXLAN_FLAG_LEARN 0x0004 >@@ -2267,6 +2269,20 @@ vxlan_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data) > error = ifmedia_ioctl(ifp, ifr, &sc->vxl_media, cmd); > break; > >+ case SIOCGTUNFIB: >+ error = 0; >+ ifr->ifr_fib = sc->vxl_fibnum; >+ break; >+ >+ case SIOCSTUNFIB: >+ if ((error = priv_check(curthread, PRIV_NET_VXLAN)) != 0) >+ break; >+ if (ifr->ifr_fib >= rt_numfibs) >+ error = EINVAL; >+ else >+ sc->vxl_fibnum = ifr->ifr_fib; >+ break; >+ > default: > error = ether_ioctl(ifp, cmd, data); > break; >@@ -2478,6 +2494,8 @@ vxlan_transmit(struct ifnet *ifp, struct mbuf *m) > if (vxlan_sockaddr_in_multicast(&vxlsa) != 0) > mcifp = vxlan_multicast_if_ref(sc, ipv4); > >+ M_SETFIB(m, sc->vxl_fibnum); >+ > VXLAN_ACQUIRE(sc); > VXLAN_RUNLOCK(sc, &tracker); > >@@ -2714,6 +2732,7 @@ vxlan_clone_create(struct if_clone *ifc, int unit, caddr_t params) > > sc = malloc(sizeof(struct vxlan_softc), M_VXLAN, M_WAITOK | M_ZERO); > sc->vxl_unit = unit; >+ sc->vxl_fibnum = curthread->td_proc->p_fibnum; > vxlan_set_default_config(sc); > > if (params != 0) {
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 244004
:
211511
|
211517
|
228139
|
228140