Lines 168-173
struct vxlan_softc {
Link Here
|
168 |
union vxlan_sockaddr vxl_src_addr; |
168 |
union vxlan_sockaddr vxl_src_addr; |
169 |
union vxlan_sockaddr vxl_dst_addr; |
169 |
union vxlan_sockaddr vxl_dst_addr; |
170 |
uint32_t vxl_flags; |
170 |
uint32_t vxl_flags; |
|
|
171 |
u_int vxl_fibnum; |
171 |
#define VXLAN_FLAG_INIT 0x0001 |
172 |
#define VXLAN_FLAG_INIT 0x0001 |
172 |
#define VXLAN_FLAG_TEARDOWN 0x0002 |
173 |
#define VXLAN_FLAG_TEARDOWN 0x0002 |
173 |
#define VXLAN_FLAG_LEARN 0x0004 |
174 |
#define VXLAN_FLAG_LEARN 0x0004 |
Lines 2378-2383
vxlan_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data)
Link Here
|
2378 |
VXLAN_WUNLOCK(sc); |
2379 |
VXLAN_WUNLOCK(sc); |
2379 |
break; |
2380 |
break; |
2380 |
|
2381 |
|
|
|
2382 |
case SIOCGTUNFIB: |
2383 |
error = 0; |
2384 |
ifr->ifr_fib = sc->vxl_fibnum; |
2385 |
break; |
2386 |
|
2387 |
case SIOCSTUNFIB: |
2388 |
if ((error = priv_check(curthread, PRIV_NET_VXLAN)) != 0) |
2389 |
break; |
2390 |
|
2391 |
if (ifr->ifr_fib >= rt_numfibs) |
2392 |
error = EINVAL; |
2393 |
else |
2394 |
sc->vxl_fibnum = ifr->ifr_fib; |
2395 |
break; |
2396 |
|
2381 |
default: |
2397 |
default: |
2382 |
error = ether_ioctl(ifp, cmd, data); |
2398 |
error = ether_ioctl(ifp, cmd, data); |
2383 |
break; |
2399 |
break; |
Lines 2533-2539
vxlan_encap4(struct vxlan_softc *sc, const union vxlan_sockaddr *fvxlsa,
Link Here
|
2533 |
sin->sin_family = AF_INET; |
2549 |
sin->sin_family = AF_INET; |
2534 |
sin->sin_len = sizeof(*sin); |
2550 |
sin->sin_len = sizeof(*sin); |
2535 |
sin->sin_addr = ip->ip_dst; |
2551 |
sin->sin_addr = ip->ip_dst; |
2536 |
ro->ro_nh = fib4_lookup(RT_DEFAULT_FIB, ip->ip_dst, 0, NHR_NONE, |
2552 |
ro->ro_nh = fib4_lookup(M_GETFIB(m), ip->ip_dst, 0, NHR_NONE, |
2537 |
0); |
2553 |
0); |
2538 |
if (ro->ro_nh == NULL) { |
2554 |
if (ro->ro_nh == NULL) { |
2539 |
m_freem(m); |
2555 |
m_freem(m); |
Lines 2645-2651
vxlan_encap6(struct vxlan_softc *sc, const union vxlan_sockaddr *fvxlsa,
Link Here
|
2645 |
sin6->sin6_family = AF_INET6; |
2661 |
sin6->sin6_family = AF_INET6; |
2646 |
sin6->sin6_len = sizeof(*sin6); |
2662 |
sin6->sin6_len = sizeof(*sin6); |
2647 |
sin6->sin6_addr = ip6->ip6_dst; |
2663 |
sin6->sin6_addr = ip6->ip6_dst; |
2648 |
ro->ro_nh = fib6_lookup(RT_DEFAULT_FIB, &ip6->ip6_dst, 0, |
2664 |
ro->ro_nh = fib6_lookup(M_GETFIB(m), &ip6->ip6_dst, 0, |
2649 |
NHR_NONE, 0); |
2665 |
NHR_NONE, 0); |
2650 |
if (ro->ro_nh == NULL) { |
2666 |
if (ro->ro_nh == NULL) { |
2651 |
m_freem(m); |
2667 |
m_freem(m); |
Lines 2738-2743
vxlan_transmit(struct ifnet *ifp, struct mbuf *m)
Link Here
|
2738 |
if (vxlan_sockaddr_in_multicast(&vxlsa) != 0) |
2754 |
if (vxlan_sockaddr_in_multicast(&vxlsa) != 0) |
2739 |
mcifp = vxlan_multicast_if_ref(sc, ipv4); |
2755 |
mcifp = vxlan_multicast_if_ref(sc, ipv4); |
2740 |
|
2756 |
|
|
|
2757 |
M_SETFIB(m, sc->vxl_fibnum); |
2758 |
|
2741 |
VXLAN_ACQUIRE(sc); |
2759 |
VXLAN_ACQUIRE(sc); |
2742 |
VXLAN_RUNLOCK(sc, &tracker); |
2760 |
VXLAN_RUNLOCK(sc, &tracker); |
2743 |
|
2761 |
|
Lines 3174-3179
vxlan_clone_create(struct if_clone *ifc, int unit, caddr_t params)
Link Here
|
3174 |
|
3192 |
|
3175 |
sc = malloc(sizeof(struct vxlan_softc), M_VXLAN, M_WAITOK | M_ZERO); |
3193 |
sc = malloc(sizeof(struct vxlan_softc), M_VXLAN, M_WAITOK | M_ZERO); |
3176 |
sc->vxl_unit = unit; |
3194 |
sc->vxl_unit = unit; |
|
|
3195 |
sc->vxl_fibnum = curthread->td_proc->p_fibnum; |
3177 |
vxlan_set_default_config(sc); |
3196 |
vxlan_set_default_config(sc); |
3178 |
error = vxlan_stats_alloc(sc); |
3197 |
error = vxlan_stats_alloc(sc); |
3179 |
if (error != 0) |
3198 |
if (error != 0) |