summaryrefslogtreecommitdiffstats
path: root/sys/netinet6/in6_gif.c
diff options
context:
space:
mode:
authorbz <bz@FreeBSD.org>2012-02-17 02:39:58 +0000
committerbz <bz@FreeBSD.org>2012-02-17 02:39:58 +0000
commitdcdb23291fec1365e927195511d5dfb273901a5d (patch)
treec7ee398c979933c1e0e6d10495989fe027210cec /sys/netinet6/in6_gif.c
parentf73705f023ce445780ef6da3c298f9aca1ef8acb (diff)
downloadFreeBSD-src-dcdb23291fec1365e927195511d5dfb273901a5d.zip
FreeBSD-src-dcdb23291fec1365e927195511d5dfb273901a5d.tar.gz
Merge multi-FIB IPv6 support from projects/multi-fibv6/head/:
Extend the so far IPv4-only support for multiple routing tables (FIBs) introduced in r178888 to IPv6 providing feature parity. This includes an extended rtalloc(9) KPI for IPv6, the necessary adjustments to the network stack, and user land support as in netstat. Sponsored by: Cisco Systems, Inc. Reviewed by: melifaro (basically) MFC after: 10 days
Diffstat (limited to 'sys/netinet6/in6_gif.c')
-rw-r--r--sys/netinet6/in6_gif.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/sys/netinet6/in6_gif.c b/sys/netinet6/in6_gif.c
index 961fc77..c329e11 100644
--- a/sys/netinet6/in6_gif.c
+++ b/sys/netinet6/in6_gif.c
@@ -228,6 +228,8 @@ in6_gif_output(struct ifnet *ifp,
ip6->ip6_flow &= ~htonl(0xff << 20);
ip6->ip6_flow |= htonl((u_int32_t)otos << 20);
+ M_SETFIB(m, sc->gif_fibnum);
+
if (dst->sin6_family != sin6_dst->sin6_family ||
!IN6_ARE_ADDR_EQUAL(&dst->sin6_addr, &sin6_dst->sin6_addr)) {
/* cache route doesn't match */
@@ -245,7 +247,7 @@ in6_gif_output(struct ifnet *ifp,
}
if (sc->gif_ro6.ro_rt == NULL) {
- rtalloc((struct route *)&sc->gif_ro6);
+ in6_rtalloc(&sc->gif_ro6, sc->gif_fibnum);
if (sc->gif_ro6.ro_rt == NULL) {
m_freem(m);
return ENETUNREACH;
@@ -404,7 +406,8 @@ gif_validate6(const struct ip6_hdr *ip6, struct gif_softc *sc,
sin6.sin6_addr = ip6->ip6_src;
sin6.sin6_scope_id = 0; /* XXX */
- rt = rtalloc1((struct sockaddr *)&sin6, 0, 0UL);
+ rt = in6_rtalloc1((struct sockaddr *)&sin6, 0, 0UL,
+ sc->gif_fibnum);
if (!rt || rt->rt_ifp != ifp) {
#if 0
char ip6buf[INET6_ADDRSTRLEN];
OpenPOWER on IntegriCloud