summaryrefslogtreecommitdiffstats
path: root/freebsd/sys/net
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2013-10-10 14:45:09 +0200
committerSebastian Huber <sebastian.huber@embedded-brains.de>2013-10-31 13:18:46 +0100
commit549488b572aa21e4e45e8d36607ac6ea20ee8751 (patch)
tree89bb7694029fa14178df3bc99b7d1adc97a53075 /freebsd/sys/net
parentDelete struct proc p_mtx lock (diff)
downloadrtems-libbsd-549488b572aa21e4e45e8d36607ac6ea20ee8751.tar.bz2
Disable alternative routing tables
Diffstat (limited to 'freebsd/sys/net')
-rw-r--r--freebsd/sys/net/if_gif.c4
-rw-r--r--freebsd/sys/net/if_gre.c4
-rw-r--r--freebsd/sys/net/if_stf.c4
-rw-r--r--freebsd/sys/net/route.c6
-rw-r--r--freebsd/sys/net/rtsock.c8
5 files changed, 26 insertions, 0 deletions
diff --git a/freebsd/sys/net/if_gif.c b/freebsd/sys/net/if_gif.c
index b6c6111c..d9144419 100644
--- a/freebsd/sys/net/if_gif.c
+++ b/freebsd/sys/net/if_gif.c
@@ -162,7 +162,11 @@ gif_clone_create(ifc, unit, params)
struct gif_softc *sc;
sc = malloc(sizeof(struct gif_softc), M_GIF, M_WAITOK | M_ZERO);
+#ifndef __rtems__
sc->gif_fibnum = curthread->td_proc->p_fibnum;
+#else /* __rtems__ */
+ sc->gif_fibnum = BSD_DEFAULT_FIB;
+#endif /* __rtems__ */
GIF2IFP(sc) = if_alloc(IFT_GIF);
if (GIF2IFP(sc) == NULL) {
free(sc, M_GIF);
diff --git a/freebsd/sys/net/if_gre.c b/freebsd/sys/net/if_gre.c
index 09e53e94..09950859 100644
--- a/freebsd/sys/net/if_gre.c
+++ b/freebsd/sys/net/if_gre.c
@@ -205,7 +205,11 @@ gre_clone_create(ifc, unit, params)
GRE2IFP(sc)->if_flags |= IFF_LINK0;
sc->encap = NULL;
sc->called = 0;
+#ifndef __rtems__
sc->gre_fibnum = curthread->td_proc->p_fibnum;
+#else /* __rtems__ */
+ sc->gre_fibnum = BSD_DEFAULT_FIB;
+#endif /* __rtems__ */
sc->wccp_ver = WCCP_V1;
sc->key = 0;
if_attach(GRE2IFP(sc));
diff --git a/freebsd/sys/net/if_stf.c b/freebsd/sys/net/if_stf.c
index 104536fd..79466119 100644
--- a/freebsd/sys/net/if_stf.c
+++ b/freebsd/sys/net/if_stf.c
@@ -231,7 +231,11 @@ stf_clone_create(struct if_clone *ifc, char *name, size_t len, caddr_t params)
return (ENOSPC);
}
ifp->if_softc = sc;
+#ifndef __rtems__
sc->sc_fibnum = curthread->td_proc->p_fibnum;
+#else /* __rtems__ */
+ sc->sc_fibnum = BSD_DEFAULT_FIB;
+#endif /* __rtems__ */
/*
* Set the name manually rather then using if_initname because
diff --git a/freebsd/sys/net/route.c b/freebsd/sys/net/route.c
index 1434b2d7..5827cc00 100644
--- a/freebsd/sys/net/route.c
+++ b/freebsd/sys/net/route.c
@@ -124,6 +124,7 @@ u_int tunnel_fib = 0;
SYSCTL_INT(_net, OID_AUTO, tunnelfib, CTLFLAG_RD, &tunnel_fib, 0, "");
#endif
+#ifndef __rtems__
/*
* handler for net.my_fibnum
*/
@@ -140,6 +141,7 @@ sysctl_my_fibnum(SYSCTL_HANDLER_ARGS)
SYSCTL_PROC(_net, OID_AUTO, my_fibnum, CTLTYPE_INT|CTLFLAG_RD,
NULL, 0, &sysctl_my_fibnum, "I", "default FIB of caller");
+#endif /* __rtems__ */
static __inline struct radix_node_head **
rt_tables_get_rnh_ptr(int table, int fam)
@@ -1397,7 +1399,11 @@ rtinit1(struct ifaddr *ifa, int cmd, int flags, int fibnum)
fibnum = 0;
if (fibnum == -1) {
if (rt_add_addr_allfibs == 0 && cmd == (int)RTM_ADD) {
+#ifndef __rtems__
startfib = endfib = curthread->td_proc->p_fibnum;
+#else /* __rtems__ */
+ startfib = endfib = BSD_DEFAULT_FIB;
+#endif /* __rtems__ */
} else {
startfib = 0;
endfib = rt_numfibs - 1;
diff --git a/freebsd/sys/net/rtsock.c b/freebsd/sys/net/rtsock.c
index 0cfc6e91..2e709f79 100644
--- a/freebsd/sys/net/rtsock.c
+++ b/freebsd/sys/net/rtsock.c
@@ -261,7 +261,11 @@ rts_attach(struct socket *so, int proto, struct thread *td)
*/
s = splnet();
so->so_pcb = (caddr_t)rp;
+#ifndef __rtems__
so->so_fibnum = td->td_proc->p_fibnum;
+#else /* __rtems__ */
+ so->so_fibnum = BSD_DEFAULT_FIB;
+#endif /* __rtems__ */
error = raw_attach(so, proto);
rp = sotorawcb(so);
if (error) {
@@ -1648,7 +1652,11 @@ sysctl_rtsock(SYSCTL_HANDLER_ARGS)
* take care of routing entries
*/
for (error = 0; error == 0 && i <= lim; i++) {
+#ifndef __rtems__
rnh = rt_tables_get_rnh(req->td->td_proc->p_fibnum, i);
+#else /* __rtems__ */
+ rnh = rt_tables_get_rnh(BSD_DEFAULT_FIB, i);
+#endif /* __rtems__ */
if (rnh != NULL) {
RADIX_NODE_HEAD_LOCK(rnh);
error = rnh->rnh_walktree(rnh,