mirror of
https://git.FreeBSD.org/src.git
synced 2024-11-27 08:00:11 +00:00
Change if_output to take a struct route as its fourth argument in order
to allow passing a cached struct llentry * down to L2 Reviewed by: rwatson
This commit is contained in:
parent
fe69399069
commit
279aa3d419
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=191148
@ -1046,7 +1046,7 @@ frdest_t *fdp;
|
|||||||
if (!ip->ip_sum)
|
if (!ip->ip_sum)
|
||||||
ip->ip_sum = in_cksum(m, hlen);
|
ip->ip_sum = in_cksum(m, hlen);
|
||||||
error = (*ifp->if_output)(ifp, m, (struct sockaddr *)dst,
|
error = (*ifp->if_output)(ifp, m, (struct sockaddr *)dst,
|
||||||
ro->ro_rt);
|
ro);
|
||||||
goto done;
|
goto done;
|
||||||
}
|
}
|
||||||
/*
|
/*
|
||||||
@ -1127,7 +1127,7 @@ frdest_t *fdp;
|
|||||||
m->m_act = 0;
|
m->m_act = 0;
|
||||||
if (error == 0)
|
if (error == 0)
|
||||||
error = (*ifp->if_output)(ifp, m,
|
error = (*ifp->if_output)(ifp, m,
|
||||||
(struct sockaddr *)dst, ro->ro_rt);
|
(struct sockaddr *)dst, ro);
|
||||||
else
|
else
|
||||||
FREE_MB_T(m);
|
FREE_MB_T(m);
|
||||||
}
|
}
|
||||||
|
@ -113,7 +113,7 @@ __FBSDID("$FreeBSD$");
|
|||||||
|
|
||||||
void pflogattach(int);
|
void pflogattach(int);
|
||||||
int pflogoutput(struct ifnet *, struct mbuf *, struct sockaddr *,
|
int pflogoutput(struct ifnet *, struct mbuf *, struct sockaddr *,
|
||||||
struct rtentry *);
|
struct route *);
|
||||||
int pflogioctl(struct ifnet *, u_long, caddr_t);
|
int pflogioctl(struct ifnet *, u_long, caddr_t);
|
||||||
void pflogstart(struct ifnet *);
|
void pflogstart(struct ifnet *);
|
||||||
#ifdef __FreeBSD__
|
#ifdef __FreeBSD__
|
||||||
@ -287,7 +287,7 @@ pflogstart(struct ifnet *ifp)
|
|||||||
|
|
||||||
int
|
int
|
||||||
pflogoutput(struct ifnet *ifp, struct mbuf *m, struct sockaddr *dst,
|
pflogoutput(struct ifnet *ifp, struct mbuf *m, struct sockaddr *dst,
|
||||||
struct rtentry *rt)
|
struct route *ro)
|
||||||
{
|
{
|
||||||
m_freem(m);
|
m_freem(m);
|
||||||
return (0);
|
return (0);
|
||||||
|
@ -152,7 +152,7 @@ int pfsync_insert_net_state(struct pfsync_state *, u_int8_t);
|
|||||||
void pfsync_update_net_tdb(struct pfsync_tdb *);
|
void pfsync_update_net_tdb(struct pfsync_tdb *);
|
||||||
#endif
|
#endif
|
||||||
int pfsyncoutput(struct ifnet *, struct mbuf *, struct sockaddr *,
|
int pfsyncoutput(struct ifnet *, struct mbuf *, struct sockaddr *,
|
||||||
struct rtentry *);
|
struct route *);
|
||||||
int pfsyncioctl(struct ifnet *, u_long, caddr_t);
|
int pfsyncioctl(struct ifnet *, u_long, caddr_t);
|
||||||
void pfsyncstart(struct ifnet *);
|
void pfsyncstart(struct ifnet *);
|
||||||
|
|
||||||
@ -1083,7 +1083,7 @@ pfsync_input(struct mbuf *m, ...)
|
|||||||
|
|
||||||
int
|
int
|
||||||
pfsyncoutput(struct ifnet *ifp, struct mbuf *m, struct sockaddr *dst,
|
pfsyncoutput(struct ifnet *ifp, struct mbuf *m, struct sockaddr *dst,
|
||||||
struct rtentry *rt)
|
struct route *ro)
|
||||||
{
|
{
|
||||||
m_freem(m);
|
m_freem(m);
|
||||||
return (0);
|
return (0);
|
||||||
|
@ -6245,7 +6245,7 @@ pf_route(struct mbuf **m, struct pf_rule *r, int dir, struct ifnet *oifp,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
PF_UNLOCK();
|
PF_UNLOCK();
|
||||||
error = (*ifp->if_output)(ifp, m0, sintosa(dst), ro->ro_rt);
|
error = (*ifp->if_output)(ifp, m0, sintosa(dst), ro);
|
||||||
PF_LOCK();
|
PF_LOCK();
|
||||||
goto done;
|
goto done;
|
||||||
}
|
}
|
||||||
|
@ -103,7 +103,7 @@ static int icattach(device_t);
|
|||||||
|
|
||||||
static int icioctl(struct ifnet *, u_long, caddr_t);
|
static int icioctl(struct ifnet *, u_long, caddr_t);
|
||||||
static int icoutput(struct ifnet *, struct mbuf *, struct sockaddr *,
|
static int icoutput(struct ifnet *, struct mbuf *, struct sockaddr *,
|
||||||
struct rtentry *);
|
struct route *);
|
||||||
|
|
||||||
static int icintr(device_t, int, char *);
|
static int icintr(device_t, int, char *);
|
||||||
|
|
||||||
@ -354,7 +354,7 @@ icintr(device_t dev, int event, char *ptr)
|
|||||||
*/
|
*/
|
||||||
static int
|
static int
|
||||||
icoutput(struct ifnet *ifp, struct mbuf *m, struct sockaddr *dst,
|
icoutput(struct ifnet *ifp, struct mbuf *m, struct sockaddr *dst,
|
||||||
struct rtentry *rt)
|
struct route *ro)
|
||||||
{
|
{
|
||||||
struct ic_softc *sc = ifp->if_softc;
|
struct ic_softc *sc = ifp->if_softc;
|
||||||
device_t icdev = sc->ic_dev;
|
device_t icdev = sc->ic_dev;
|
||||||
|
@ -114,6 +114,7 @@
|
|||||||
# include <net/if_types.h>
|
# include <net/if_types.h>
|
||||||
# include <net/if_media.h>
|
# include <net/if_media.h>
|
||||||
# include <net/netisr.h>
|
# include <net/netisr.h>
|
||||||
|
# include <net/route.h>
|
||||||
# include <machine/bus.h>
|
# include <machine/bus.h>
|
||||||
# include <machine/resource.h>
|
# include <machine/resource.h>
|
||||||
# include <sys/rman.h>
|
# include <sys/rman.h>
|
||||||
@ -4583,7 +4584,7 @@ lmc_ifnet_start(struct ifnet *ifp)
|
|||||||
/* Called from a syscall (user context; no spinlocks). */
|
/* Called from a syscall (user context; no spinlocks). */
|
||||||
static int
|
static int
|
||||||
lmc_raw_output(struct ifnet *ifp, struct mbuf *m,
|
lmc_raw_output(struct ifnet *ifp, struct mbuf *m,
|
||||||
struct sockaddr *dst, struct rtentry *rt)
|
struct sockaddr *dst, struct route *ro)
|
||||||
{
|
{
|
||||||
softc_t *sc = IFP2SC(ifp);
|
softc_t *sc = IFP2SC(ifp);
|
||||||
int error = 0;
|
int error = 0;
|
||||||
|
@ -1595,7 +1595,7 @@ static int lmc_raw_ioctl(struct ifnet *, u_long, caddr_t);
|
|||||||
static int lmc_ifnet_ioctl(struct ifnet *, u_long, caddr_t);
|
static int lmc_ifnet_ioctl(struct ifnet *, u_long, caddr_t);
|
||||||
static void lmc_ifnet_start(struct ifnet *);
|
static void lmc_ifnet_start(struct ifnet *);
|
||||||
static int lmc_raw_output(struct ifnet *, struct mbuf *,
|
static int lmc_raw_output(struct ifnet *, struct mbuf *,
|
||||||
struct sockaddr *, struct rtentry *);
|
struct sockaddr *, struct route *);
|
||||||
static void lmc_ifnet_watchdog(struct ifnet *);
|
static void lmc_ifnet_watchdog(struct ifnet *);
|
||||||
# ifdef __OpenBSD__
|
# ifdef __OpenBSD__
|
||||||
static int ifmedia_change(struct ifnet *);
|
static int ifmedia_change(struct ifnet *);
|
||||||
|
@ -99,6 +99,7 @@ __FBSDID("$FreeBSD$");
|
|||||||
#include <net/if.h>
|
#include <net/if.h>
|
||||||
#include <net/if_types.h>
|
#include <net/if_types.h>
|
||||||
#include <net/netisr.h>
|
#include <net/netisr.h>
|
||||||
|
#include <net/route.h>
|
||||||
|
|
||||||
#include <netinet/in.h>
|
#include <netinet/in.h>
|
||||||
#include <netinet/in_var.h>
|
#include <netinet/in_var.h>
|
||||||
@ -173,7 +174,7 @@ static u_char *ctxmith;
|
|||||||
static int lpinittables(void);
|
static int lpinittables(void);
|
||||||
static int lpioctl(struct ifnet *, u_long, caddr_t);
|
static int lpioctl(struct ifnet *, u_long, caddr_t);
|
||||||
static int lpoutput(struct ifnet *, struct mbuf *, struct sockaddr *,
|
static int lpoutput(struct ifnet *, struct mbuf *, struct sockaddr *,
|
||||||
struct rtentry *);
|
struct route *);
|
||||||
static void lpstop(struct lp_data *);
|
static void lpstop(struct lp_data *);
|
||||||
static void lp_intr(void *);
|
static void lp_intr(void *);
|
||||||
static int lp_module_handler(module_t, int, void *);
|
static int lp_module_handler(module_t, int, void *);
|
||||||
@ -678,7 +679,7 @@ lpoutbyte(u_char byte, int spin, device_t ppbus)
|
|||||||
|
|
||||||
static int
|
static int
|
||||||
lpoutput(struct ifnet *ifp, struct mbuf *m, struct sockaddr *dst,
|
lpoutput(struct ifnet *ifp, struct mbuf *m, struct sockaddr *dst,
|
||||||
struct rtentry *rt)
|
struct route *ro)
|
||||||
{
|
{
|
||||||
struct lp_data *sc = ifp->if_softc;
|
struct lp_data *sc = ifp->if_softc;
|
||||||
device_t dev = sc->sc_dev;
|
device_t dev = sc->sc_dev;
|
||||||
|
@ -365,7 +365,7 @@ struct ether_addr {
|
|||||||
|
|
||||||
struct ifnet;
|
struct ifnet;
|
||||||
struct mbuf;
|
struct mbuf;
|
||||||
struct rtentry;
|
struct route;
|
||||||
struct sockaddr;
|
struct sockaddr;
|
||||||
struct bpf_if;
|
struct bpf_if;
|
||||||
|
|
||||||
@ -376,7 +376,7 @@ extern void ether_ifattach(struct ifnet *, const u_int8_t *);
|
|||||||
extern void ether_ifdetach(struct ifnet *);
|
extern void ether_ifdetach(struct ifnet *);
|
||||||
extern int ether_ioctl(struct ifnet *, u_long, caddr_t);
|
extern int ether_ioctl(struct ifnet *, u_long, caddr_t);
|
||||||
extern int ether_output(struct ifnet *,
|
extern int ether_output(struct ifnet *,
|
||||||
struct mbuf *, struct sockaddr *, struct rtentry *);
|
struct mbuf *, struct sockaddr *, struct route *);
|
||||||
extern int ether_output_frame(struct ifnet *, struct mbuf *);
|
extern int ether_output_frame(struct ifnet *, struct mbuf *);
|
||||||
extern char *ether_sprintf(const u_int8_t *);
|
extern char *ether_sprintf(const u_int8_t *);
|
||||||
void ether_vlan_mtap(struct bpf_if *, struct mbuf *,
|
void ether_vlan_mtap(struct bpf_if *, struct mbuf *,
|
||||||
|
@ -133,7 +133,7 @@ void arc_storelladdr(struct ifnet *, u_int8_t);
|
|||||||
int arc_isphds(u_int8_t);
|
int arc_isphds(u_int8_t);
|
||||||
void arc_input(struct ifnet *, struct mbuf *);
|
void arc_input(struct ifnet *, struct mbuf *);
|
||||||
int arc_output(struct ifnet *, struct mbuf *,
|
int arc_output(struct ifnet *, struct mbuf *,
|
||||||
struct sockaddr *, struct rtentry *);
|
struct sockaddr *, struct route *);
|
||||||
int arc_ioctl(struct ifnet *, int, caddr_t);
|
int arc_ioctl(struct ifnet *, int, caddr_t);
|
||||||
|
|
||||||
void arc_frag_init(struct ifnet *);
|
void arc_frag_init(struct ifnet *);
|
||||||
|
@ -102,7 +102,7 @@ u_int8_t arcbroadcastaddr = 0;
|
|||||||
*/
|
*/
|
||||||
int
|
int
|
||||||
arc_output(struct ifnet *ifp, struct mbuf *m, struct sockaddr *dst,
|
arc_output(struct ifnet *ifp, struct mbuf *m, struct sockaddr *dst,
|
||||||
struct rtentry *rt0)
|
struct route *ro)
|
||||||
{
|
{
|
||||||
struct arc_header *ah;
|
struct arc_header *ah;
|
||||||
int error;
|
int error;
|
||||||
@ -129,7 +129,8 @@ arc_output(struct ifnet *ifp, struct mbuf *m, struct sockaddr *dst,
|
|||||||
else if (ifp->if_flags & IFF_NOARP)
|
else if (ifp->if_flags & IFF_NOARP)
|
||||||
adst = ntohl(SIN(dst)->sin_addr.s_addr) & 0xFF;
|
adst = ntohl(SIN(dst)->sin_addr.s_addr) & 0xFF;
|
||||||
else {
|
else {
|
||||||
error = arpresolve(ifp, rt0, m, dst, &adst, &lle);
|
error = arpresolve(ifp, ro ? ro->ro_rt : NULL,
|
||||||
|
m, dst, &adst, &lle);
|
||||||
if (error)
|
if (error)
|
||||||
return (error == EWOULDBLOCK ? 0 : error);
|
return (error == EWOULDBLOCK ? 0 : error);
|
||||||
}
|
}
|
||||||
|
@ -293,7 +293,7 @@ void atm_ifdetach(struct ifnet *);
|
|||||||
void atm_input(struct ifnet *, struct atm_pseudohdr *,
|
void atm_input(struct ifnet *, struct atm_pseudohdr *,
|
||||||
struct mbuf *, void *);
|
struct mbuf *, void *);
|
||||||
int atm_output(struct ifnet *, struct mbuf *, struct sockaddr *,
|
int atm_output(struct ifnet *, struct mbuf *, struct sockaddr *,
|
||||||
struct rtentry *);
|
struct route *);
|
||||||
struct atmio_vcctable *atm_getvccs(struct atmio_vcc **, u_int, u_int,
|
struct atmio_vcctable *atm_getvccs(struct atmio_vcc **, u_int, u_int,
|
||||||
struct mtx *, int);
|
struct mtx *, int);
|
||||||
|
|
||||||
|
@ -113,17 +113,17 @@ MALLOC_DEFINE(M_IFATM, "ifatm", "atm interface internals");
|
|||||||
* "ifp" = ATM interface to output to
|
* "ifp" = ATM interface to output to
|
||||||
* "m0" = the packet to output
|
* "m0" = the packet to output
|
||||||
* "dst" = the sockaddr to send to (either IP addr, or raw VPI/VCI)
|
* "dst" = the sockaddr to send to (either IP addr, or raw VPI/VCI)
|
||||||
* "rt0" = the route to use
|
* "ro" = the route to use
|
||||||
* returns: error code [0 == ok]
|
* returns: error code [0 == ok]
|
||||||
*
|
*
|
||||||
* note: special semantic: if (dst == NULL) then we assume "m" already
|
* note: special semantic: if (dst == NULL) then we assume "m" already
|
||||||
* has an atm_pseudohdr on it and just send it directly.
|
* has an atm_pseudohdr on it and just send it directly.
|
||||||
* [for native mode ATM output] if dst is null, then
|
* [for native mode ATM output] if dst is null, then
|
||||||
* rt0 must also be NULL.
|
* ro->ro_rt must also be NULL.
|
||||||
*/
|
*/
|
||||||
int
|
int
|
||||||
atm_output(struct ifnet *ifp, struct mbuf *m0, struct sockaddr *dst,
|
atm_output(struct ifnet *ifp, struct mbuf *m0, struct sockaddr *dst,
|
||||||
struct rtentry *rt0)
|
struct route *ro)
|
||||||
{
|
{
|
||||||
u_int16_t etype = 0; /* if using LLC/SNAP */
|
u_int16_t etype = 0; /* if using LLC/SNAP */
|
||||||
int error = 0, sz;
|
int error = 0, sz;
|
||||||
@ -157,7 +157,7 @@ atm_output(struct ifnet *ifp, struct mbuf *m0, struct sockaddr *dst,
|
|||||||
etype = ETHERTYPE_IPV6;
|
etype = ETHERTYPE_IPV6;
|
||||||
else
|
else
|
||||||
etype = ETHERTYPE_IP;
|
etype = ETHERTYPE_IP;
|
||||||
if (!atmresolve(rt0, m, dst, &atmdst)) {
|
if (!atmresolve(ro->ro_rt, m, dst, &atmdst)) {
|
||||||
m = NULL;
|
m = NULL;
|
||||||
/* XXX: atmresolve already free'd it */
|
/* XXX: atmresolve already free'd it */
|
||||||
senderr(EHOSTUNREACH);
|
senderr(EHOSTUNREACH);
|
||||||
|
@ -66,7 +66,7 @@ struct disc_softc {
|
|||||||
};
|
};
|
||||||
|
|
||||||
static int discoutput(struct ifnet *, struct mbuf *,
|
static int discoutput(struct ifnet *, struct mbuf *,
|
||||||
struct sockaddr *, struct rtentry *);
|
struct sockaddr *, struct route *);
|
||||||
static void discrtrequest(int, struct rtentry *, struct rt_addrinfo *);
|
static void discrtrequest(int, struct rtentry *, struct rt_addrinfo *);
|
||||||
static int discioctl(struct ifnet *, u_long, caddr_t);
|
static int discioctl(struct ifnet *, u_long, caddr_t);
|
||||||
static int disc_clone_create(struct if_clone *, int, caddr_t);
|
static int disc_clone_create(struct if_clone *, int, caddr_t);
|
||||||
@ -156,7 +156,7 @@ DECLARE_MODULE(if_disc, disc_mod, SI_SUB_PSEUDO, SI_ORDER_ANY);
|
|||||||
|
|
||||||
static int
|
static int
|
||||||
discoutput(struct ifnet *ifp, struct mbuf *m, struct sockaddr *dst,
|
discoutput(struct ifnet *ifp, struct mbuf *m, struct sockaddr *dst,
|
||||||
struct rtentry *rt)
|
struct route *ro)
|
||||||
{
|
{
|
||||||
u_int32_t af;
|
u_int32_t af;
|
||||||
|
|
||||||
|
@ -85,7 +85,7 @@ struct enc_softc {
|
|||||||
|
|
||||||
static int enc_ioctl(struct ifnet *, u_long, caddr_t);
|
static int enc_ioctl(struct ifnet *, u_long, caddr_t);
|
||||||
static int enc_output(struct ifnet *ifp, struct mbuf *m,
|
static int enc_output(struct ifnet *ifp, struct mbuf *m,
|
||||||
struct sockaddr *dst, struct rtentry *rt);
|
struct sockaddr *dst, struct route *ro);
|
||||||
static int enc_clone_create(struct if_clone *, int, caddr_t);
|
static int enc_clone_create(struct if_clone *, int, caddr_t);
|
||||||
static void enc_clone_destroy(struct ifnet *);
|
static void enc_clone_destroy(struct ifnet *);
|
||||||
|
|
||||||
@ -185,7 +185,7 @@ DECLARE_MODULE(enc, enc_mod, SI_SUB_PROTO_IFATTACHDOMAIN, SI_ORDER_ANY);
|
|||||||
|
|
||||||
static int
|
static int
|
||||||
enc_output(struct ifnet *ifp, struct mbuf *m, struct sockaddr *dst,
|
enc_output(struct ifnet *ifp, struct mbuf *m, struct sockaddr *dst,
|
||||||
struct rtentry *rt)
|
struct route *ro)
|
||||||
{
|
{
|
||||||
m_freem(m);
|
m_freem(m);
|
||||||
return (0);
|
return (0);
|
||||||
|
@ -163,17 +163,22 @@ static int ether_ipfw;
|
|||||||
*/
|
*/
|
||||||
int
|
int
|
||||||
ether_output(struct ifnet *ifp, struct mbuf *m,
|
ether_output(struct ifnet *ifp, struct mbuf *m,
|
||||||
struct sockaddr *dst, struct rtentry *rt0)
|
struct sockaddr *dst, struct route *ro)
|
||||||
{
|
{
|
||||||
short type;
|
short type;
|
||||||
int error, hdrcmplt = 0;
|
int error = 0, hdrcmplt = 0;
|
||||||
u_char esrc[ETHER_ADDR_LEN], edst[ETHER_ADDR_LEN];
|
u_char esrc[ETHER_ADDR_LEN], edst[ETHER_ADDR_LEN];
|
||||||
struct llentry *lle = NULL;
|
struct llentry *lle = NULL;
|
||||||
|
struct rtentry *rt0 = NULL;
|
||||||
struct ether_header *eh;
|
struct ether_header *eh;
|
||||||
struct pf_mtag *t;
|
struct pf_mtag *t;
|
||||||
int loop_copy = 1;
|
int loop_copy = 1;
|
||||||
int hlen; /* link layer header length */
|
int hlen; /* link layer header length */
|
||||||
|
|
||||||
|
if (ro != NULL) {
|
||||||
|
lle = ro->ro_lle;
|
||||||
|
rt0 = ro->ro_rt;
|
||||||
|
}
|
||||||
#ifdef MAC
|
#ifdef MAC
|
||||||
error = mac_ifnet_check_transmit(ifp, m);
|
error = mac_ifnet_check_transmit(ifp, m);
|
||||||
if (error)
|
if (error)
|
||||||
@ -191,7 +196,10 @@ ether_output(struct ifnet *ifp, struct mbuf *m,
|
|||||||
switch (dst->sa_family) {
|
switch (dst->sa_family) {
|
||||||
#ifdef INET
|
#ifdef INET
|
||||||
case AF_INET:
|
case AF_INET:
|
||||||
error = arpresolve(ifp, rt0, m, dst, edst, &lle);
|
if (lle != NULL && (lle->la_flags & LLE_VALID))
|
||||||
|
memcpy(edst, &lle->ll_addr.mac16, sizeof(edst));
|
||||||
|
else
|
||||||
|
error = arpresolve(ifp, rt0, m, dst, edst, &lle);
|
||||||
if (error)
|
if (error)
|
||||||
return (error == EWOULDBLOCK ? 0 : error);
|
return (error == EWOULDBLOCK ? 0 : error);
|
||||||
type = htons(ETHERTYPE_IP);
|
type = htons(ETHERTYPE_IP);
|
||||||
@ -226,7 +234,10 @@ ether_output(struct ifnet *ifp, struct mbuf *m,
|
|||||||
#endif
|
#endif
|
||||||
#ifdef INET6
|
#ifdef INET6
|
||||||
case AF_INET6:
|
case AF_INET6:
|
||||||
error = nd6_storelladdr(ifp, m, dst, (u_char *)edst, &lle);
|
if (lle != NULL && (lle->la_flags & LLE_VALID))
|
||||||
|
memcpy(edst, &lle->ll_addr.mac16, sizeof(edst));
|
||||||
|
else
|
||||||
|
error = nd6_storelladdr(ifp, m, dst, (u_char *)edst, &lle);
|
||||||
if (error)
|
if (error)
|
||||||
return error;
|
return error;
|
||||||
type = htons(ETHERTYPE_IPV6);
|
type = htons(ETHERTYPE_IPV6);
|
||||||
|
@ -88,7 +88,7 @@ struct faith_softc {
|
|||||||
|
|
||||||
static int faithioctl(struct ifnet *, u_long, caddr_t);
|
static int faithioctl(struct ifnet *, u_long, caddr_t);
|
||||||
int faithoutput(struct ifnet *, struct mbuf *, struct sockaddr *,
|
int faithoutput(struct ifnet *, struct mbuf *, struct sockaddr *,
|
||||||
struct rtentry *);
|
struct route *);
|
||||||
static void faithrtrequest(int, struct rtentry *, struct rt_addrinfo *);
|
static void faithrtrequest(int, struct rtentry *, struct rt_addrinfo *);
|
||||||
#ifdef INET6
|
#ifdef INET6
|
||||||
static int faithprefix(struct in6_addr *);
|
static int faithprefix(struct in6_addr *);
|
||||||
@ -188,17 +188,20 @@ faith_clone_destroy(ifp)
|
|||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
faithoutput(ifp, m, dst, rt)
|
faithoutput(ifp, m, dst, ro)
|
||||||
struct ifnet *ifp;
|
struct ifnet *ifp;
|
||||||
struct mbuf *m;
|
struct mbuf *m;
|
||||||
struct sockaddr *dst;
|
struct sockaddr *dst;
|
||||||
struct rtentry *rt;
|
struct route *ro;
|
||||||
{
|
{
|
||||||
int isr;
|
int isr;
|
||||||
u_int32_t af;
|
u_int32_t af;
|
||||||
|
struct rtentry *rt = NULL;
|
||||||
|
|
||||||
M_ASSERTPKTHDR(m);
|
M_ASSERTPKTHDR(m);
|
||||||
|
|
||||||
|
if (ro != NULL)
|
||||||
|
rt = ro->ro_rt;
|
||||||
/* BPF writes need to be handled specially. */
|
/* BPF writes need to be handled specially. */
|
||||||
if (dst->sa_family == AF_UNSPEC) {
|
if (dst->sa_family == AF_UNSPEC) {
|
||||||
bcopy(dst->sa_data, &af, sizeof(af));
|
bcopy(dst->sa_data, &af, sizeof(af));
|
||||||
|
@ -98,7 +98,7 @@ static const u_char fddibroadcastaddr[FDDI_ADDR_LEN] =
|
|||||||
static int fddi_resolvemulti(struct ifnet *, struct sockaddr **,
|
static int fddi_resolvemulti(struct ifnet *, struct sockaddr **,
|
||||||
struct sockaddr *);
|
struct sockaddr *);
|
||||||
static int fddi_output(struct ifnet *, struct mbuf *, struct sockaddr *,
|
static int fddi_output(struct ifnet *, struct mbuf *, struct sockaddr *,
|
||||||
struct rtentry *);
|
struct route *);
|
||||||
static void fddi_input(struct ifnet *ifp, struct mbuf *m);
|
static void fddi_input(struct ifnet *ifp, struct mbuf *m);
|
||||||
|
|
||||||
#define senderr(e) do { error = (e); goto bad; } while (0)
|
#define senderr(e) do { error = (e); goto bad; } while (0)
|
||||||
@ -111,18 +111,21 @@ static void fddi_input(struct ifnet *ifp, struct mbuf *m);
|
|||||||
* Assumes that ifp is actually pointer to arpcom structure.
|
* Assumes that ifp is actually pointer to arpcom structure.
|
||||||
*/
|
*/
|
||||||
static int
|
static int
|
||||||
fddi_output(ifp, m, dst, rt0)
|
fddi_output(ifp, m, dst, ro)
|
||||||
struct ifnet *ifp;
|
struct ifnet *ifp;
|
||||||
struct mbuf *m;
|
struct mbuf *m;
|
||||||
struct sockaddr *dst;
|
struct sockaddr *dst;
|
||||||
struct rtentry *rt0;
|
struct route *ro;
|
||||||
{
|
{
|
||||||
u_int16_t type;
|
u_int16_t type;
|
||||||
int loop_copy = 0, error = 0, hdrcmplt = 0;
|
int loop_copy = 0, error = 0, hdrcmplt = 0;
|
||||||
u_char esrc[FDDI_ADDR_LEN], edst[FDDI_ADDR_LEN];
|
u_char esrc[FDDI_ADDR_LEN], edst[FDDI_ADDR_LEN];
|
||||||
struct fddi_header *fh;
|
struct fddi_header *fh;
|
||||||
struct llentry *lle;
|
struct llentry *lle;
|
||||||
|
struct rtentry *rt0 = NULL;
|
||||||
|
|
||||||
|
if (ro != NULL)
|
||||||
|
rt0 = ro->ro_rt;
|
||||||
#ifdef MAC
|
#ifdef MAC
|
||||||
error = mac_ifnet_check_transmit(ifp, m);
|
error = mac_ifnet_check_transmit(ifp, m);
|
||||||
if (error)
|
if (error)
|
||||||
|
@ -77,7 +77,7 @@ struct fw_hwaddr firewire_broadcastaddr = {
|
|||||||
|
|
||||||
static int
|
static int
|
||||||
firewire_output(struct ifnet *ifp, struct mbuf *m, struct sockaddr *dst,
|
firewire_output(struct ifnet *ifp, struct mbuf *m, struct sockaddr *dst,
|
||||||
struct rtentry *rt0)
|
struct route *ro)
|
||||||
{
|
{
|
||||||
struct fw_com *fc = IFP2FWC(ifp);
|
struct fw_com *fc = IFP2FWC(ifp);
|
||||||
int error, type;
|
int error, type;
|
||||||
@ -138,7 +138,7 @@ firewire_output(struct ifnet *ifp, struct mbuf *m, struct sockaddr *dst,
|
|||||||
* doesn't fit into the arp model.
|
* doesn't fit into the arp model.
|
||||||
*/
|
*/
|
||||||
if (unicast) {
|
if (unicast) {
|
||||||
error = arpresolve(ifp, rt0, m, dst, (u_char *) destfw, &lle);
|
error = arpresolve(ifp, ro ? ro->ro_rt : NULL, m, dst, (u_char *) destfw, &lle);
|
||||||
if (error)
|
if (error)
|
||||||
return (error == EWOULDBLOCK ? 0 : error);
|
return (error == EWOULDBLOCK ? 0 : error);
|
||||||
}
|
}
|
||||||
|
@ -409,11 +409,11 @@ gif_start(struct ifnet *ifp)
|
|||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
gif_output(ifp, m, dst, rt)
|
gif_output(ifp, m, dst, ro)
|
||||||
struct ifnet *ifp;
|
struct ifnet *ifp;
|
||||||
struct mbuf *m;
|
struct mbuf *m;
|
||||||
struct sockaddr *dst;
|
struct sockaddr *dst;
|
||||||
struct rtentry *rt; /* added in net2 */
|
struct route *ro;
|
||||||
{
|
{
|
||||||
INIT_VNET_GIF(ifp->if_vnet);
|
INIT_VNET_GIF(ifp->if_vnet);
|
||||||
struct gif_softc *sc = ifp->if_softc;
|
struct gif_softc *sc = ifp->if_softc;
|
||||||
|
@ -106,7 +106,7 @@ struct etherip_header {
|
|||||||
/* Prototypes */
|
/* Prototypes */
|
||||||
void gif_input(struct mbuf *, int, struct ifnet *);
|
void gif_input(struct mbuf *, int, struct ifnet *);
|
||||||
int gif_output(struct ifnet *, struct mbuf *, struct sockaddr *,
|
int gif_output(struct ifnet *, struct mbuf *, struct sockaddr *,
|
||||||
struct rtentry *);
|
struct route *);
|
||||||
int gif_ioctl(struct ifnet *, u_long, caddr_t);
|
int gif_ioctl(struct ifnet *, u_long, caddr_t);
|
||||||
int gif_set_tunnel(struct ifnet *, struct sockaddr *, struct sockaddr *);
|
int gif_set_tunnel(struct ifnet *, struct sockaddr *, struct sockaddr *);
|
||||||
void gif_delete_tunnel(struct ifnet *);
|
void gif_delete_tunnel(struct ifnet *);
|
||||||
|
@ -110,7 +110,7 @@ static int gre_clone_create(struct if_clone *, int, caddr_t);
|
|||||||
static void gre_clone_destroy(struct ifnet *);
|
static void gre_clone_destroy(struct ifnet *);
|
||||||
static int gre_ioctl(struct ifnet *, u_long, caddr_t);
|
static int gre_ioctl(struct ifnet *, u_long, caddr_t);
|
||||||
static int gre_output(struct ifnet *, struct mbuf *, struct sockaddr *,
|
static int gre_output(struct ifnet *, struct mbuf *, struct sockaddr *,
|
||||||
struct rtentry *rt);
|
struct route *ro);
|
||||||
|
|
||||||
IFC_SIMPLE_DECLARE(gre, 0);
|
IFC_SIMPLE_DECLARE(gre, 0);
|
||||||
|
|
||||||
@ -240,7 +240,7 @@ gre_clone_destroy(ifp)
|
|||||||
*/
|
*/
|
||||||
static int
|
static int
|
||||||
gre_output(struct ifnet *ifp, struct mbuf *m, struct sockaddr *dst,
|
gre_output(struct ifnet *ifp, struct mbuf *m, struct sockaddr *dst,
|
||||||
struct rtentry *rt)
|
struct route *ro)
|
||||||
{
|
{
|
||||||
#ifdef INET6
|
#ifdef INET6
|
||||||
INIT_VNET_INET(ifp->if_vnet);
|
INIT_VNET_INET(ifp->if_vnet);
|
||||||
|
@ -232,11 +232,11 @@ iso88025_ioctl(struct ifnet *ifp, int command, caddr_t data)
|
|||||||
* ISO88025 encapsulation
|
* ISO88025 encapsulation
|
||||||
*/
|
*/
|
||||||
int
|
int
|
||||||
iso88025_output(ifp, m, dst, rt0)
|
iso88025_output(ifp, m, dst, ro)
|
||||||
struct ifnet *ifp;
|
struct ifnet *ifp;
|
||||||
struct mbuf *m;
|
struct mbuf *m;
|
||||||
struct sockaddr *dst;
|
struct sockaddr *dst;
|
||||||
struct rtentry *rt0;
|
struct route *ro;
|
||||||
{
|
{
|
||||||
u_int16_t snap_type = 0;
|
u_int16_t snap_type = 0;
|
||||||
int loop_copy = 0, error = 0, rif_len = 0;
|
int loop_copy = 0, error = 0, rif_len = 0;
|
||||||
@ -245,6 +245,10 @@ iso88025_output(ifp, m, dst, rt0)
|
|||||||
struct iso88025_header gen_th;
|
struct iso88025_header gen_th;
|
||||||
struct sockaddr_dl *sdl = NULL;
|
struct sockaddr_dl *sdl = NULL;
|
||||||
struct llentry *lle;
|
struct llentry *lle;
|
||||||
|
struct rtentry *rt0 = NULL;
|
||||||
|
|
||||||
|
if (ro != NULL)
|
||||||
|
rt0 = ro->ro_rt;
|
||||||
|
|
||||||
#ifdef MAC
|
#ifdef MAC
|
||||||
error = mac_ifnet_check_transmit(ifp, m);
|
error = mac_ifnet_check_transmit(ifp, m);
|
||||||
|
@ -93,7 +93,7 @@ static void lagg_linkstate(struct lagg_softc *);
|
|||||||
static void lagg_port_state(struct ifnet *, int);
|
static void lagg_port_state(struct ifnet *, int);
|
||||||
static int lagg_port_ioctl(struct ifnet *, u_long, caddr_t);
|
static int lagg_port_ioctl(struct ifnet *, u_long, caddr_t);
|
||||||
static int lagg_port_output(struct ifnet *, struct mbuf *,
|
static int lagg_port_output(struct ifnet *, struct mbuf *,
|
||||||
struct sockaddr *, struct rtentry *);
|
struct sockaddr *, struct route *);
|
||||||
static void lagg_port_ifdetach(void *arg __unused, struct ifnet *);
|
static void lagg_port_ifdetach(void *arg __unused, struct ifnet *);
|
||||||
static int lagg_port_checkstacking(struct lagg_softc *);
|
static int lagg_port_checkstacking(struct lagg_softc *);
|
||||||
static void lagg_port2req(struct lagg_port *, struct lagg_reqport *);
|
static void lagg_port2req(struct lagg_port *, struct lagg_reqport *);
|
||||||
@ -676,7 +676,7 @@ lagg_port_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data)
|
|||||||
|
|
||||||
static int
|
static int
|
||||||
lagg_port_output(struct ifnet *ifp, struct mbuf *m,
|
lagg_port_output(struct ifnet *ifp, struct mbuf *m,
|
||||||
struct sockaddr *dst, struct rtentry *rt0)
|
struct sockaddr *dst, struct route *ro)
|
||||||
{
|
{
|
||||||
struct lagg_port *lp = ifp->if_lagg;
|
struct lagg_port *lp = ifp->if_lagg;
|
||||||
struct ether_header *eh;
|
struct ether_header *eh;
|
||||||
@ -696,7 +696,7 @@ lagg_port_output(struct ifnet *ifp, struct mbuf *m,
|
|||||||
*/
|
*/
|
||||||
switch (ntohs(type)) {
|
switch (ntohs(type)) {
|
||||||
case ETHERTYPE_PAE: /* EAPOL PAE/802.1x */
|
case ETHERTYPE_PAE: /* EAPOL PAE/802.1x */
|
||||||
return ((*lp->lp_output)(ifp, m, dst, rt0));
|
return ((*lp->lp_output)(ifp, m, dst, ro));
|
||||||
}
|
}
|
||||||
|
|
||||||
/* drop any other frames */
|
/* drop any other frames */
|
||||||
|
@ -218,7 +218,7 @@ struct lagg_port {
|
|||||||
/* Redirected callbacks */
|
/* Redirected callbacks */
|
||||||
int (*lp_ioctl)(struct ifnet *, u_long, caddr_t);
|
int (*lp_ioctl)(struct ifnet *, u_long, caddr_t);
|
||||||
int (*lp_output)(struct ifnet *, struct mbuf *, struct sockaddr *,
|
int (*lp_output)(struct ifnet *, struct mbuf *, struct sockaddr *,
|
||||||
struct rtentry *);
|
struct route *);
|
||||||
|
|
||||||
SLIST_ENTRY(lagg_port) lp_entries;
|
SLIST_ENTRY(lagg_port) lp_entries;
|
||||||
};
|
};
|
||||||
|
@ -102,7 +102,7 @@
|
|||||||
int loioctl(struct ifnet *, u_long, caddr_t);
|
int loioctl(struct ifnet *, u_long, caddr_t);
|
||||||
static void lortrequest(int, struct rtentry *, struct rt_addrinfo *);
|
static void lortrequest(int, struct rtentry *, struct rt_addrinfo *);
|
||||||
int looutput(struct ifnet *ifp, struct mbuf *m,
|
int looutput(struct ifnet *ifp, struct mbuf *m,
|
||||||
struct sockaddr *dst, struct rtentry *rt);
|
struct sockaddr *dst, struct route *ro);
|
||||||
static int lo_clone_create(struct if_clone *, int, caddr_t);
|
static int lo_clone_create(struct if_clone *, int, caddr_t);
|
||||||
static void lo_clone_destroy(struct ifnet *);
|
static void lo_clone_destroy(struct ifnet *);
|
||||||
static int vnet_loif_iattach(const void *);
|
static int vnet_loif_iattach(const void *);
|
||||||
@ -205,15 +205,18 @@ DECLARE_MODULE(loop, loop_mod, SI_SUB_PROTO_IFATTACHDOMAIN, SI_ORDER_ANY);
|
|||||||
|
|
||||||
int
|
int
|
||||||
looutput(struct ifnet *ifp, struct mbuf *m, struct sockaddr *dst,
|
looutput(struct ifnet *ifp, struct mbuf *m, struct sockaddr *dst,
|
||||||
struct rtentry *rt)
|
struct route *ro)
|
||||||
{
|
{
|
||||||
u_int32_t af;
|
u_int32_t af;
|
||||||
|
struct rtentry *rt = NULL;
|
||||||
#ifdef MAC
|
#ifdef MAC
|
||||||
int error;
|
int error;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
M_ASSERTPKTHDR(m); /* check if we have the packet header */
|
M_ASSERTPKTHDR(m); /* check if we have the packet header */
|
||||||
|
|
||||||
|
if (ro != NULL)
|
||||||
|
rt = ro->ro_rt;
|
||||||
#ifdef MAC
|
#ifdef MAC
|
||||||
error = mac_ifnet_check_transmit(ifp, m);
|
error = mac_ifnet_check_transmit(ifp, m);
|
||||||
if (error) {
|
if (error) {
|
||||||
|
@ -263,7 +263,7 @@ static const u_short interactive_ports[8] = {
|
|||||||
int debug = ifp->if_flags & IFF_DEBUG
|
int debug = ifp->if_flags & IFF_DEBUG
|
||||||
|
|
||||||
static int sppp_output(struct ifnet *ifp, struct mbuf *m,
|
static int sppp_output(struct ifnet *ifp, struct mbuf *m,
|
||||||
struct sockaddr *dst, struct rtentry *rt);
|
struct sockaddr *dst, struct route *ro);
|
||||||
|
|
||||||
static void sppp_cisco_send(struct sppp *sp, int type, long par1, long par2);
|
static void sppp_cisco_send(struct sppp *sp, int type, long par1, long par2);
|
||||||
static void sppp_cisco_input(struct sppp *sp, struct mbuf *m);
|
static void sppp_cisco_input(struct sppp *sp, struct mbuf *m);
|
||||||
@ -786,7 +786,7 @@ sppp_ifstart(struct ifnet *ifp)
|
|||||||
*/
|
*/
|
||||||
static int
|
static int
|
||||||
sppp_output(struct ifnet *ifp, struct mbuf *m,
|
sppp_output(struct ifnet *ifp, struct mbuf *m,
|
||||||
struct sockaddr *dst, struct rtentry *rt)
|
struct sockaddr *dst, struct route *ro)
|
||||||
{
|
{
|
||||||
struct sppp *sp = IFP2SP(ifp);
|
struct sppp *sp = IFP2SP(ifp);
|
||||||
struct ppp_header *h;
|
struct ppp_header *h;
|
||||||
|
@ -178,7 +178,7 @@ static int stfmodevent(module_t, int, void *);
|
|||||||
static int stf_encapcheck(const struct mbuf *, int, int, void *);
|
static int stf_encapcheck(const struct mbuf *, int, int, void *);
|
||||||
static struct in6_ifaddr *stf_getsrcifa6(struct ifnet *);
|
static struct in6_ifaddr *stf_getsrcifa6(struct ifnet *);
|
||||||
static int stf_output(struct ifnet *, struct mbuf *, struct sockaddr *,
|
static int stf_output(struct ifnet *, struct mbuf *, struct sockaddr *,
|
||||||
struct rtentry *);
|
struct route *);
|
||||||
static int isrfc1918addr(struct in_addr *);
|
static int isrfc1918addr(struct in_addr *);
|
||||||
static int stf_checkaddr4(struct stf_softc *, struct in_addr *,
|
static int stf_checkaddr4(struct stf_softc *, struct in_addr *,
|
||||||
struct ifnet *);
|
struct ifnet *);
|
||||||
@ -403,11 +403,11 @@ stf_getsrcifa6(ifp)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
stf_output(ifp, m, dst, rt)
|
stf_output(ifp, m, dst, ro)
|
||||||
struct ifnet *ifp;
|
struct ifnet *ifp;
|
||||||
struct mbuf *m;
|
struct mbuf *m;
|
||||||
struct sockaddr *dst;
|
struct sockaddr *dst;
|
||||||
struct rtentry *rt;
|
struct route *ro;
|
||||||
{
|
{
|
||||||
struct stf_softc *sc;
|
struct stf_softc *sc;
|
||||||
struct sockaddr_in6 *dst6;
|
struct sockaddr_in6 *dst6;
|
||||||
|
@ -129,7 +129,7 @@ static int tunifioctl(struct ifnet *, u_long, caddr_t);
|
|||||||
static int tuninit(struct ifnet *);
|
static int tuninit(struct ifnet *);
|
||||||
static int tunmodevent(module_t, int, void *);
|
static int tunmodevent(module_t, int, void *);
|
||||||
static int tunoutput(struct ifnet *, struct mbuf *, struct sockaddr *,
|
static int tunoutput(struct ifnet *, struct mbuf *, struct sockaddr *,
|
||||||
struct rtentry *rt);
|
struct route *ro);
|
||||||
static void tunstart(struct ifnet *);
|
static void tunstart(struct ifnet *);
|
||||||
|
|
||||||
static int tun_clone_create(struct if_clone *, int, caddr_t);
|
static int tun_clone_create(struct if_clone *, int, caddr_t);
|
||||||
@ -591,7 +591,7 @@ tunoutput(
|
|||||||
struct ifnet *ifp,
|
struct ifnet *ifp,
|
||||||
struct mbuf *m0,
|
struct mbuf *m0,
|
||||||
struct sockaddr *dst,
|
struct sockaddr *dst,
|
||||||
struct rtentry *rt)
|
struct route *ro)
|
||||||
{
|
{
|
||||||
struct tun_softc *tp = ifp->if_softc;
|
struct tun_softc *tp = ifp->if_softc;
|
||||||
u_short cached_tun_flags;
|
u_short cached_tun_flags;
|
||||||
|
@ -70,6 +70,7 @@ struct socket;
|
|||||||
struct ether_header;
|
struct ether_header;
|
||||||
struct carp_if;
|
struct carp_if;
|
||||||
struct ifvlantrunk;
|
struct ifvlantrunk;
|
||||||
|
struct route;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include <sys/queue.h> /* get TAILQ macros */
|
#include <sys/queue.h> /* get TAILQ macros */
|
||||||
@ -149,7 +150,7 @@ struct ifnet {
|
|||||||
/* procedure handles */
|
/* procedure handles */
|
||||||
int (*if_output) /* output routine (enqueue) */
|
int (*if_output) /* output routine (enqueue) */
|
||||||
(struct ifnet *, struct mbuf *, struct sockaddr *,
|
(struct ifnet *, struct mbuf *, struct sockaddr *,
|
||||||
struct rtentry *);
|
struct route *);
|
||||||
void (*if_input) /* input routine (from h/w driver) */
|
void (*if_input) /* input routine (from h/w driver) */
|
||||||
(struct ifnet *, struct mbuf *);
|
(struct ifnet *, struct mbuf *);
|
||||||
void (*if_start) /* initiate output routine */
|
void (*if_start) /* initiate output routine */
|
||||||
|
@ -166,7 +166,7 @@ void iso88025_ifattach (struct ifnet *, const u_int8_t *, int);
|
|||||||
void iso88025_ifdetach (struct ifnet *, int);
|
void iso88025_ifdetach (struct ifnet *, int);
|
||||||
int iso88025_ioctl (struct ifnet *, int , caddr_t );
|
int iso88025_ioctl (struct ifnet *, int , caddr_t );
|
||||||
int iso88025_output (struct ifnet *, struct mbuf *, struct sockaddr *,
|
int iso88025_output (struct ifnet *, struct mbuf *, struct sockaddr *,
|
||||||
struct rtentry *);
|
struct route *);
|
||||||
void iso88025_input (struct ifnet *, struct mbuf *);
|
void iso88025_input (struct ifnet *, struct mbuf *);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -41,9 +41,10 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* A route consists of a destination address and a reference
|
* A route consists of a destination address, a reference
|
||||||
* to a routing entry. These are often held by protocols
|
* to a routing entry, and a reference to an llentry.
|
||||||
* in their control blocks, e.g. inpcb.
|
* These are often held by protocols in their control
|
||||||
|
* blocks, e.g. inpcb.
|
||||||
*/
|
*/
|
||||||
struct route {
|
struct route {
|
||||||
struct rtentry *ro_rt;
|
struct rtentry *ro_rt;
|
||||||
|
@ -221,7 +221,7 @@ null_update_promisc(struct ifnet *ifp)
|
|||||||
|
|
||||||
static int
|
static int
|
||||||
null_output(struct ifnet *ifp, struct mbuf *m,
|
null_output(struct ifnet *ifp, struct mbuf *m,
|
||||||
struct sockaddr *dst, struct rtentry *rt0)
|
struct sockaddr *dst, struct route *ro)
|
||||||
{
|
{
|
||||||
if_printf(ifp, "discard raw packet\n");
|
if_printf(ifp, "discard raw packet\n");
|
||||||
m_freem(m);
|
m_freem(m);
|
||||||
|
@ -294,7 +294,7 @@ ieee80211_start(struct ifnet *ifp)
|
|||||||
*/
|
*/
|
||||||
int
|
int
|
||||||
ieee80211_output(struct ifnet *ifp, struct mbuf *m,
|
ieee80211_output(struct ifnet *ifp, struct mbuf *m,
|
||||||
struct sockaddr *dst, struct rtentry *rt0)
|
struct sockaddr *dst, struct route *ro)
|
||||||
{
|
{
|
||||||
#define senderr(e) do { error = (e); goto bad;} while (0)
|
#define senderr(e) do { error = (e); goto bad;} while (0)
|
||||||
struct ieee80211_node *ni = NULL;
|
struct ieee80211_node *ni = NULL;
|
||||||
@ -320,7 +320,7 @@ ieee80211_output(struct ifnet *ifp, struct mbuf *m,
|
|||||||
* a raw 802.11 frame.
|
* a raw 802.11 frame.
|
||||||
*/
|
*/
|
||||||
if (dst->sa_family != AF_IEEE80211)
|
if (dst->sa_family != AF_IEEE80211)
|
||||||
return vap->iv_output(ifp, m, dst, rt0);
|
return vap->iv_output(ifp, m, dst, ro);
|
||||||
#ifdef MAC
|
#ifdef MAC
|
||||||
error = mac_check_ifnet_transmit(ifp, m);
|
error = mac_check_ifnet_transmit(ifp, m);
|
||||||
if (error)
|
if (error)
|
||||||
|
@ -70,7 +70,7 @@ int ieee80211_mgmt_output(struct ieee80211_node *, struct mbuf *, int,
|
|||||||
int ieee80211_raw_xmit(struct ieee80211_node *, struct mbuf *,
|
int ieee80211_raw_xmit(struct ieee80211_node *, struct mbuf *,
|
||||||
const struct ieee80211_bpf_params *);
|
const struct ieee80211_bpf_params *);
|
||||||
int ieee80211_output(struct ifnet *, struct mbuf *,
|
int ieee80211_output(struct ifnet *, struct mbuf *,
|
||||||
struct sockaddr *, struct rtentry *);
|
struct sockaddr *, struct route *ro);
|
||||||
void ieee80211_start(struct ifnet *);
|
void ieee80211_start(struct ifnet *);
|
||||||
int ieee80211_send_nulldata(struct ieee80211_node *);
|
int ieee80211_send_nulldata(struct ieee80211_node *);
|
||||||
int ieee80211_classify(struct ieee80211_node *, struct mbuf *m);
|
int ieee80211_classify(struct ieee80211_node *, struct mbuf *m);
|
||||||
|
@ -437,7 +437,7 @@ struct ieee80211vap {
|
|||||||
enum ieee80211_state, int);
|
enum ieee80211_state, int);
|
||||||
/* 802.3 output method for raw frame xmit */
|
/* 802.3 output method for raw frame xmit */
|
||||||
int (*iv_output)(struct ifnet *, struct mbuf *,
|
int (*iv_output)(struct ifnet *, struct mbuf *,
|
||||||
struct sockaddr *, struct rtentry *);
|
struct sockaddr *, struct route *);
|
||||||
};
|
};
|
||||||
MALLOC_DECLARE(M_80211_VAP);
|
MALLOC_DECLARE(M_80211_VAP);
|
||||||
|
|
||||||
|
@ -107,6 +107,7 @@
|
|||||||
#include <net/if_media.h>
|
#include <net/if_media.h>
|
||||||
#include <net/bpf.h>
|
#include <net/bpf.h>
|
||||||
#include <net/ethernet.h>
|
#include <net/ethernet.h>
|
||||||
|
#include <net/route.h>
|
||||||
|
|
||||||
#include "opt_inet.h"
|
#include "opt_inet.h"
|
||||||
#include "opt_inet6.h"
|
#include "opt_inet6.h"
|
||||||
@ -165,7 +166,7 @@ struct ng_fec_bundle {
|
|||||||
int (*fec_if_output) (struct ifnet *,
|
int (*fec_if_output) (struct ifnet *,
|
||||||
struct mbuf *,
|
struct mbuf *,
|
||||||
struct sockaddr *,
|
struct sockaddr *,
|
||||||
struct rtentry *);
|
struct route *);
|
||||||
};
|
};
|
||||||
|
|
||||||
#define FEC_BTYPE_MAC 0x01
|
#define FEC_BTYPE_MAC 0x01
|
||||||
@ -197,7 +198,7 @@ static int ng_fec_ifmedia_upd(struct ifnet *ifp);
|
|||||||
static void ng_fec_ifmedia_sts(struct ifnet *ifp, struct ifmediareq *ifmr);
|
static void ng_fec_ifmedia_sts(struct ifnet *ifp, struct ifmediareq *ifmr);
|
||||||
static int ng_fec_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data);
|
static int ng_fec_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data);
|
||||||
static int ng_fec_output(struct ifnet *ifp, struct mbuf *m0,
|
static int ng_fec_output(struct ifnet *ifp, struct mbuf *m0,
|
||||||
struct sockaddr *dst, struct rtentry *rt0);
|
struct sockaddr *dst, struct route *ro);
|
||||||
static void ng_fec_tick(void *arg);
|
static void ng_fec_tick(void *arg);
|
||||||
static int ng_fec_addport(struct ng_fec_private *priv, char *iface);
|
static int ng_fec_addport(struct ng_fec_private *priv, char *iface);
|
||||||
static int ng_fec_delport(struct ng_fec_private *priv, char *iface);
|
static int ng_fec_delport(struct ng_fec_private *priv, char *iface);
|
||||||
@ -923,7 +924,7 @@ ng_fec_input(struct ifnet *ifp, struct mbuf *m0)
|
|||||||
|
|
||||||
static int
|
static int
|
||||||
ng_fec_output(struct ifnet *ifp, struct mbuf *m,
|
ng_fec_output(struct ifnet *ifp, struct mbuf *m,
|
||||||
struct sockaddr *dst, struct rtentry *rt0)
|
struct sockaddr *dst, struct route *ro)
|
||||||
{
|
{
|
||||||
const priv_p priv = (priv_p) ifp->if_softc;
|
const priv_p priv = (priv_p) ifp->if_softc;
|
||||||
struct ng_fec_bundle *b;
|
struct ng_fec_bundle *b;
|
||||||
@ -977,7 +978,7 @@ ng_fec_output(struct ifnet *ifp, struct mbuf *m,
|
|||||||
* for us.
|
* for us.
|
||||||
*/
|
*/
|
||||||
priv->if_error = 0;
|
priv->if_error = 0;
|
||||||
error = (*b->fec_if_output)(ifp, m, dst, rt0);
|
error = (*b->fec_if_output)(ifp, m, dst, ro);
|
||||||
if (priv->if_error && !error)
|
if (priv->if_error && !error)
|
||||||
error = priv->if_error;
|
error = priv->if_error;
|
||||||
|
|
||||||
|
@ -75,6 +75,7 @@
|
|||||||
#include <net/if_types.h>
|
#include <net/if_types.h>
|
||||||
#include <net/bpf.h>
|
#include <net/bpf.h>
|
||||||
#include <net/netisr.h>
|
#include <net/netisr.h>
|
||||||
|
#include <net/route.h>
|
||||||
|
|
||||||
#include <netinet/in.h>
|
#include <netinet/in.h>
|
||||||
|
|
||||||
@ -121,7 +122,7 @@ typedef struct ng_iface_private *priv_p;
|
|||||||
static void ng_iface_start(struct ifnet *ifp);
|
static void ng_iface_start(struct ifnet *ifp);
|
||||||
static int ng_iface_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data);
|
static int ng_iface_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data);
|
||||||
static int ng_iface_output(struct ifnet *ifp, struct mbuf *m0,
|
static int ng_iface_output(struct ifnet *ifp, struct mbuf *m0,
|
||||||
struct sockaddr *dst, struct rtentry *rt0);
|
struct sockaddr *dst, struct route *ro);
|
||||||
static void ng_iface_bpftap(struct ifnet *ifp,
|
static void ng_iface_bpftap(struct ifnet *ifp,
|
||||||
struct mbuf *m, sa_family_t family);
|
struct mbuf *m, sa_family_t family);
|
||||||
static int ng_iface_send(struct ifnet *ifp, struct mbuf *m,
|
static int ng_iface_send(struct ifnet *ifp, struct mbuf *m,
|
||||||
@ -354,7 +355,7 @@ ng_iface_ioctl(struct ifnet *ifp, u_long command, caddr_t data)
|
|||||||
|
|
||||||
static int
|
static int
|
||||||
ng_iface_output(struct ifnet *ifp, struct mbuf *m,
|
ng_iface_output(struct ifnet *ifp, struct mbuf *m,
|
||||||
struct sockaddr *dst, struct rtentry *rt0)
|
struct sockaddr *dst, struct route *ro)
|
||||||
{
|
{
|
||||||
struct m_tag *mtag;
|
struct m_tag *mtag;
|
||||||
uint32_t af;
|
uint32_t af;
|
||||||
|
@ -238,7 +238,7 @@ arprequest(struct ifnet *ifp, struct in_addr *sip, struct in_addr *tip,
|
|||||||
sa.sa_family = AF_ARP;
|
sa.sa_family = AF_ARP;
|
||||||
sa.sa_len = 2;
|
sa.sa_len = 2;
|
||||||
m->m_flags |= M_BCAST;
|
m->m_flags |= M_BCAST;
|
||||||
(*ifp->if_output)(ifp, m, &sa, (struct rtentry *)0);
|
(*ifp->if_output)(ifp, m, &sa, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -753,7 +753,7 @@ in_arpinput(struct mbuf *m)
|
|||||||
m->m_pkthdr.len = m->m_len;
|
m->m_pkthdr.len = m->m_len;
|
||||||
sa.sa_family = AF_ARP;
|
sa.sa_family = AF_ARP;
|
||||||
sa.sa_len = 2;
|
sa.sa_len = 2;
|
||||||
(*ifp->if_output)(ifp, m, &sa, (struct rtentry *)0);
|
(*ifp->if_output)(ifp, m, &sa, NULL);
|
||||||
return;
|
return;
|
||||||
|
|
||||||
drop:
|
drop:
|
||||||
|
@ -207,7 +207,7 @@ static void carp_master_down(void *);
|
|||||||
static void carp_master_down_locked(struct carp_softc *);
|
static void carp_master_down_locked(struct carp_softc *);
|
||||||
static int carp_ioctl(struct ifnet *, u_long, caddr_t);
|
static int carp_ioctl(struct ifnet *, u_long, caddr_t);
|
||||||
static int carp_looutput(struct ifnet *, struct mbuf *, struct sockaddr *,
|
static int carp_looutput(struct ifnet *, struct mbuf *, struct sockaddr *,
|
||||||
struct rtentry *);
|
struct route *);
|
||||||
static void carp_start(struct ifnet *);
|
static void carp_start(struct ifnet *);
|
||||||
static void carp_setrun(struct carp_softc *, sa_family_t);
|
static void carp_setrun(struct carp_softc *, sa_family_t);
|
||||||
static void carp_set_state(struct carp_softc *, int);
|
static void carp_set_state(struct carp_softc *, int);
|
||||||
@ -2011,12 +2011,15 @@ carp_ioctl(struct ifnet *ifp, u_long cmd, caddr_t addr)
|
|||||||
*/
|
*/
|
||||||
static int
|
static int
|
||||||
carp_looutput(struct ifnet *ifp, struct mbuf *m, struct sockaddr *dst,
|
carp_looutput(struct ifnet *ifp, struct mbuf *m, struct sockaddr *dst,
|
||||||
struct rtentry *rt)
|
struct route *ro)
|
||||||
{
|
{
|
||||||
u_int32_t af;
|
u_int32_t af;
|
||||||
|
struct rtentry *rt = NULL;
|
||||||
|
|
||||||
M_ASSERTPKTHDR(m); /* check if we have the packet header */
|
M_ASSERTPKTHDR(m); /* check if we have the packet header */
|
||||||
|
|
||||||
|
if (ro != NULL)
|
||||||
|
rt = ro->ro_rt;
|
||||||
if (rt && rt->rt_flags & (RTF_REJECT|RTF_BLACKHOLE)) {
|
if (rt && rt->rt_flags & (RTF_REJECT|RTF_BLACKHOLE)) {
|
||||||
m_freem(m);
|
m_freem(m);
|
||||||
return (rt->rt_flags & RTF_BLACKHOLE ? 0 :
|
return (rt->rt_flags & RTF_BLACKHOLE ? 0 :
|
||||||
|
@ -183,7 +183,7 @@ ip_fastforward(struct mbuf *m)
|
|||||||
M_ASSERTVALID(m);
|
M_ASSERTVALID(m);
|
||||||
M_ASSERTPKTHDR(m);
|
M_ASSERTPKTHDR(m);
|
||||||
|
|
||||||
ro.ro_rt = NULL;
|
bzero(&ro, sizeof(ro));
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Step 1: check for packet drop conditions (and sanity checks)
|
* Step 1: check for packet drop conditions (and sanity checks)
|
||||||
@ -552,7 +552,7 @@ ip_fastforward(struct mbuf *m)
|
|||||||
* Send off the packet via outgoing interface
|
* Send off the packet via outgoing interface
|
||||||
*/
|
*/
|
||||||
error = (*ifp->if_output)(ifp, m,
|
error = (*ifp->if_output)(ifp, m,
|
||||||
(struct sockaddr *)dst, ro.ro_rt);
|
(struct sockaddr *)dst, &ro);
|
||||||
} else {
|
} else {
|
||||||
/*
|
/*
|
||||||
* Handle EMSGSIZE with icmp reply needfrag for TCP MTU discovery
|
* Handle EMSGSIZE with icmp reply needfrag for TCP MTU discovery
|
||||||
@ -585,7 +585,7 @@ ip_fastforward(struct mbuf *m)
|
|||||||
m->m_nextpkt = NULL;
|
m->m_nextpkt = NULL;
|
||||||
|
|
||||||
error = (*ifp->if_output)(ifp, m,
|
error = (*ifp->if_output)(ifp, m,
|
||||||
(struct sockaddr *)dst, ro.ro_rt);
|
(struct sockaddr *)dst, &ro);
|
||||||
if (error)
|
if (error)
|
||||||
break;
|
break;
|
||||||
} while ((m = m0) != NULL);
|
} while ((m = m0) != NULL);
|
||||||
|
@ -595,7 +595,7 @@ ip_output(struct mbuf *m, struct mbuf *opt, struct route *ro, int flags,
|
|||||||
*/
|
*/
|
||||||
m->m_flags &= ~(M_PROTOFLAGS);
|
m->m_flags &= ~(M_PROTOFLAGS);
|
||||||
error = (*ifp->if_output)(ifp, m,
|
error = (*ifp->if_output)(ifp, m,
|
||||||
(struct sockaddr *)dst, ro->ro_rt);
|
(struct sockaddr *)dst, ro);
|
||||||
goto done;
|
goto done;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -629,7 +629,7 @@ ip_output(struct mbuf *m, struct mbuf *opt, struct route *ro, int flags,
|
|||||||
m->m_flags &= ~(M_PROTOFLAGS);
|
m->m_flags &= ~(M_PROTOFLAGS);
|
||||||
|
|
||||||
error = (*ifp->if_output)(ifp, m,
|
error = (*ifp->if_output)(ifp, m,
|
||||||
(struct sockaddr *)dst, ro->ro_rt);
|
(struct sockaddr *)dst, ro);
|
||||||
} else
|
} else
|
||||||
m_freem(m);
|
m_freem(m);
|
||||||
}
|
}
|
||||||
|
@ -1939,7 +1939,7 @@ nd6_output_lle(struct ifnet *ifp, struct ifnet *origifp, struct mbuf *m0,
|
|||||||
|
|
||||||
int
|
int
|
||||||
nd6_output_flush(struct ifnet *ifp, struct ifnet *origifp, struct mbuf *chain,
|
nd6_output_flush(struct ifnet *ifp, struct ifnet *origifp, struct mbuf *chain,
|
||||||
struct sockaddr_in6 *dst, struct rtentry *rt)
|
struct sockaddr_in6 *dst, struct route *ro)
|
||||||
{
|
{
|
||||||
struct mbuf *m, *m_head;
|
struct mbuf *m, *m_head;
|
||||||
struct ifnet *outifp;
|
struct ifnet *outifp;
|
||||||
@ -1954,7 +1954,7 @@ nd6_output_flush(struct ifnet *ifp, struct ifnet *origifp, struct mbuf *chain,
|
|||||||
while (m_head) {
|
while (m_head) {
|
||||||
m = m_head;
|
m = m_head;
|
||||||
m_head = m_head->m_nextpkt;
|
m_head = m_head->m_nextpkt;
|
||||||
error = (*ifp->if_output)(ifp, m, (struct sockaddr *)dst, rt);
|
error = (*ifp->if_output)(ifp, m, (struct sockaddr *)dst, ro);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -395,7 +395,7 @@ int nd6_output_lle __P((struct ifnet *, struct ifnet *, struct mbuf *,
|
|||||||
struct sockaddr_in6 *, struct rtentry *, struct llentry *,
|
struct sockaddr_in6 *, struct rtentry *, struct llentry *,
|
||||||
struct mbuf **));
|
struct mbuf **));
|
||||||
int nd6_output_flush __P((struct ifnet *, struct ifnet *, struct mbuf *,
|
int nd6_output_flush __P((struct ifnet *, struct ifnet *, struct mbuf *,
|
||||||
struct sockaddr_in6 *, struct rtentry *));
|
struct sockaddr_in6 *, struct route *));
|
||||||
int nd6_need_cache __P((struct ifnet *));
|
int nd6_need_cache __P((struct ifnet *));
|
||||||
int nd6_storelladdr __P((struct ifnet *, struct mbuf *,
|
int nd6_storelladdr __P((struct ifnet *, struct mbuf *,
|
||||||
struct sockaddr *, u_char *, struct llentry **));
|
struct sockaddr *, u_char *, struct llentry **));
|
||||||
|
@ -154,7 +154,7 @@ ipx_outputfl(struct mbuf *m0, struct route *ro, int flags)
|
|||||||
ipx_watch_output(m0, ifp);
|
ipx_watch_output(m0, ifp);
|
||||||
}
|
}
|
||||||
error = (*ifp->if_output)(ifp, m0,
|
error = (*ifp->if_output)(ifp, m0,
|
||||||
(struct sockaddr *)dst, ro->ro_rt);
|
(struct sockaddr *)dst, ro);
|
||||||
goto done;
|
goto done;
|
||||||
} else {
|
} else {
|
||||||
ipxstat.ipxs_mtutoosmall++;
|
ipxstat.ipxs_mtutoosmall++;
|
||||||
|
Loading…
Reference in New Issue
Block a user