mirror of
https://git.rtems.org/rtems-libbsd/
synced 2025-06-30 04:22:00 +08:00
Disable alternative routing tables
This commit is contained in:
parent
3842b81723
commit
549488b572
@ -372,7 +372,11 @@ socreate(int dom, struct socket **aso, int type, int proto,
|
||||
so->so_cred = crhold(cred);
|
||||
if ((prp->pr_domain->dom_family == PF_INET) ||
|
||||
(prp->pr_domain->dom_family == PF_ROUTE))
|
||||
#ifndef __rtems__
|
||||
so->so_fibnum = td->td_proc->p_fibnum;
|
||||
#else /* __rtems__ */
|
||||
so->so_fibnum = BSD_DEFAULT_FIB;
|
||||
#endif /* __rtems__ */
|
||||
else
|
||||
so->so_fibnum = 0;
|
||||
so->so_proto = prp;
|
||||
|
@ -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);
|
||||
|
@ -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));
|
||||
|
@ -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
|
||||
|
@ -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;
|
||||
|
@ -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,
|
||||
|
@ -577,7 +577,6 @@ struct proc {
|
||||
#else /* __rtems__ */
|
||||
struct ucred *p_ucred; /* (c) Process owner's identity. */
|
||||
rtems_id p_pid;
|
||||
int p_fibnum; /* in this routing domain XXX MRT */
|
||||
#endif /* __rtems__ */
|
||||
};
|
||||
|
||||
|
@ -50,6 +50,9 @@ the current Git submodule commit is this
|
||||
|
||||
* Per-CPU NETISR(9) should be enabled onece the new stack is ready for SMP.
|
||||
|
||||
* Multiple routing tables are not supported. Every FIB value is set to zero
|
||||
(= BSD_DEFAULT_FIB).
|
||||
|
||||
* Sebastian Huber and Joel Sherrill discussed the need for a a basic USB
|
||||
functionality test that is known to work on qemu pc.
|
||||
|
||||
|
@ -136,6 +136,8 @@ void rtems_bsd_assert_func(const char *file, int line, const char *func, const c
|
||||
|
||||
#define BSD_MAXIMUM_SLEEP_QUEUES 32
|
||||
|
||||
#define BSD_DEFAULT_FIB 0
|
||||
|
||||
extern rtems_chain_control rtems_bsd_lock_chain;
|
||||
|
||||
extern rtems_chain_control rtems_bsd_mtx_chain;
|
||||
|
@ -217,7 +217,6 @@ rtems_bsd_threads_init(void *arg __unused)
|
||||
|
||||
FIXME_proc.p_ucred = crhold(&FIXME_ucred);
|
||||
FIXME_proc.p_pid = getpid();
|
||||
FIXME_proc.p_fibnum = 0;
|
||||
}
|
||||
|
||||
SYSINIT(rtems_bsd_threads, SI_SUB_INTRINSIC, SI_ORDER_ANY, rtems_bsd_threads_init, NULL);
|
||||
|
Loading…
x
Reference in New Issue
Block a user