Add const qualifier to the dst parameter of the ifnet if_output method.
This commit is contained in:
parent
7eab214452
commit
b4bc270e8f
@ -99,7 +99,7 @@ static int icprobe(device_t);
|
||||
static int icattach(device_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 *, const struct sockaddr *,
|
||||
struct route *);
|
||||
|
||||
static int icintr(device_t, int, char *);
|
||||
@ -351,7 +351,7 @@ icintr(device_t dev, int event, char *ptr)
|
||||
* icoutput()
|
||||
*/
|
||||
static int
|
||||
icoutput(struct ifnet *ifp, struct mbuf *m, struct sockaddr *dst,
|
||||
icoutput(struct ifnet *ifp, struct mbuf *m, const struct sockaddr *dst,
|
||||
struct route *ro)
|
||||
{
|
||||
struct ic_softc *sc = ifp->if_softc;
|
||||
|
@ -4587,7 +4587,7 @@ lmc_ifnet_start(struct ifnet *ifp)
|
||||
/* Called from a syscall (user context; no spinlocks). */
|
||||
static int
|
||||
lmc_raw_output(struct ifnet *ifp, struct mbuf *m,
|
||||
struct sockaddr *dst, struct route *ro)
|
||||
const struct sockaddr *dst, struct route *ro)
|
||||
{
|
||||
softc_t *sc = IFP2SC(ifp);
|
||||
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 void lmc_ifnet_start(struct ifnet *);
|
||||
static int lmc_raw_output(struct ifnet *, struct mbuf *,
|
||||
struct sockaddr *, struct route *);
|
||||
const struct sockaddr *, struct route *);
|
||||
# ifdef __OpenBSD__
|
||||
static int ifmedia_change(struct ifnet *);
|
||||
static void ifmedia_status(struct ifnet *, struct ifmediareq *);
|
||||
|
@ -173,7 +173,7 @@ static u_char *ctxmith;
|
||||
/* Functions for the lp# interface */
|
||||
static int lpinittables(void);
|
||||
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 *, const struct sockaddr *,
|
||||
struct route *);
|
||||
static void lpstop(struct lp_data *);
|
||||
static void lp_intr(void *);
|
||||
@ -682,7 +682,7 @@ lpoutbyte(u_char byte, int spin, device_t ppbus)
|
||||
}
|
||||
|
||||
static int
|
||||
lpoutput(struct ifnet *ifp, struct mbuf *m, struct sockaddr *dst,
|
||||
lpoutput(struct ifnet *ifp, struct mbuf *m, const struct sockaddr *dst,
|
||||
struct route *ro)
|
||||
{
|
||||
struct lp_data *sc = ifp->if_softc;
|
||||
|
@ -121,7 +121,8 @@ static void usie_if_sync_cb(void *, int);
|
||||
static void usie_if_status_cb(void *, int);
|
||||
|
||||
static void usie_if_start(struct ifnet *);
|
||||
static int usie_if_output(struct ifnet *, struct mbuf *, struct sockaddr *, struct route *);
|
||||
static int usie_if_output(struct ifnet *, struct mbuf *,
|
||||
const struct sockaddr *, struct route *);
|
||||
static void usie_if_init(void *);
|
||||
static void usie_if_stop(struct usie_softc *);
|
||||
static int usie_if_ioctl(struct ifnet *, u_long, caddr_t);
|
||||
@ -1181,7 +1182,7 @@ usie_if_start(struct ifnet *ifp)
|
||||
}
|
||||
|
||||
static int
|
||||
usie_if_output(struct ifnet *ifp, struct mbuf *m, struct sockaddr *dst,
|
||||
usie_if_output(struct ifnet *ifp, struct mbuf *m, const struct sockaddr *dst,
|
||||
struct route *ro)
|
||||
{
|
||||
int err;
|
||||
|
@ -467,8 +467,8 @@ static void uhso_if_init(void *);
|
||||
static void uhso_if_start(struct ifnet *);
|
||||
static void uhso_if_stop(struct uhso_softc *);
|
||||
static int uhso_if_ioctl(struct ifnet *, u_long, caddr_t);
|
||||
static int uhso_if_output(struct ifnet *, struct mbuf *, struct sockaddr *,
|
||||
struct route *);
|
||||
static int uhso_if_output(struct ifnet *, struct mbuf *,
|
||||
const struct sockaddr *, struct route *);
|
||||
static void uhso_if_rxflush(void *);
|
||||
|
||||
static device_probe_t uhso_probe;
|
||||
@ -1881,7 +1881,7 @@ uhso_if_init(void *priv)
|
||||
}
|
||||
|
||||
static int
|
||||
uhso_if_output(struct ifnet *ifp, struct mbuf *m0, struct sockaddr *dst,
|
||||
uhso_if_output(struct ifnet *ifp, struct mbuf *m0, const struct sockaddr *dst,
|
||||
struct route *ro)
|
||||
{
|
||||
int error;
|
||||
|
@ -375,8 +375,8 @@ extern void ether_demux(struct ifnet *, struct mbuf *);
|
||||
extern void ether_ifattach(struct ifnet *, const u_int8_t *);
|
||||
extern void ether_ifdetach(struct ifnet *);
|
||||
extern int ether_ioctl(struct ifnet *, u_long, caddr_t);
|
||||
extern int ether_output(struct ifnet *,
|
||||
struct mbuf *, struct sockaddr *, struct route *);
|
||||
extern int ether_output(struct ifnet *, struct mbuf *,
|
||||
const struct sockaddr *, struct route *);
|
||||
extern int ether_output_frame(struct ifnet *, struct mbuf *);
|
||||
extern char *ether_sprintf(const u_int8_t *);
|
||||
void ether_vlan_mtap(struct bpf_if *, struct mbuf *,
|
||||
|
@ -134,7 +134,7 @@ int (*carp_master_p)(struct ifaddr *);
|
||||
#if defined(INET) || defined(INET6)
|
||||
int (*carp_forus_p)(struct ifnet *ifp, u_char *dhost);
|
||||
int (*carp_output_p)(struct ifnet *ifp, struct mbuf *m,
|
||||
struct sockaddr *sa);
|
||||
const struct sockaddr *sa);
|
||||
int (*carp_ioctl_p)(struct ifreq *, u_long, struct thread *);
|
||||
int (*carp_attach_p)(struct ifaddr *, int);
|
||||
void (*carp_detach_p)(struct ifaddr *);
|
||||
|
@ -133,7 +133,7 @@ void arc_storelladdr(struct ifnet *, u_int8_t);
|
||||
int arc_isphds(u_int8_t);
|
||||
void arc_input(struct ifnet *, struct mbuf *);
|
||||
int arc_output(struct ifnet *, struct mbuf *,
|
||||
struct sockaddr *, struct route *);
|
||||
const struct sockaddr *, struct route *);
|
||||
int arc_ioctl(struct ifnet *, u_long, caddr_t);
|
||||
|
||||
void arc_frag_init(struct ifnet *);
|
||||
|
@ -92,8 +92,8 @@ u_int8_t arcbroadcastaddr = 0;
|
||||
#define ARC_LLADDR(ifp) (*(u_int8_t *)IF_LLADDR(ifp))
|
||||
|
||||
#define senderr(e) { error = (e); goto bad;}
|
||||
#define SIN(s) ((struct sockaddr_in *)s)
|
||||
#define SIPX(s) ((struct sockaddr_ipx *)s)
|
||||
#define SIN(s) ((const struct sockaddr_in *)(s))
|
||||
#define SIPX(s) ((const struct sockaddr_ipx *)(s))
|
||||
|
||||
/*
|
||||
* ARCnet output routine.
|
||||
@ -101,7 +101,7 @@ u_int8_t arcbroadcastaddr = 0;
|
||||
* Assumes that ifp is actually pointer to arccom structure.
|
||||
*/
|
||||
int
|
||||
arc_output(struct ifnet *ifp, struct mbuf *m, struct sockaddr *dst,
|
||||
arc_output(struct ifnet *ifp, struct mbuf *m, const struct sockaddr *dst,
|
||||
struct route *ro)
|
||||
{
|
||||
struct arc_header *ah;
|
||||
@ -186,8 +186,11 @@ arc_output(struct ifnet *ifp, struct mbuf *m, struct sockaddr *dst,
|
||||
#endif
|
||||
|
||||
case AF_UNSPEC:
|
||||
{
|
||||
const struct arc_header *ah;
|
||||
|
||||
loop_copy = -1;
|
||||
ah = (struct arc_header *)dst->sa_data;
|
||||
ah = (const struct arc_header *)dst->sa_data;
|
||||
adst = ah->arc_dhost;
|
||||
atype = ah->arc_type;
|
||||
|
||||
@ -207,7 +210,7 @@ arc_output(struct ifnet *ifp, struct mbuf *m, struct sockaddr *dst,
|
||||
#endif
|
||||
}
|
||||
break;
|
||||
|
||||
}
|
||||
default:
|
||||
if_printf(ifp, "can't handle af%d\n", dst->sa_family);
|
||||
senderr(EAFNOSUPPORT);
|
||||
|
@ -292,7 +292,7 @@ void atm_ifattach(struct ifnet *);
|
||||
void atm_ifdetach(struct ifnet *);
|
||||
void atm_input(struct ifnet *, struct atm_pseudohdr *,
|
||||
struct mbuf *, void *);
|
||||
int atm_output(struct ifnet *, struct mbuf *, struct sockaddr *,
|
||||
int atm_output(struct ifnet *, struct mbuf *, const struct sockaddr *,
|
||||
struct route *);
|
||||
struct atmio_vcctable *atm_getvccs(struct atmio_vcc **, u_int, u_int,
|
||||
struct mtx *, int);
|
||||
|
@ -121,7 +121,7 @@ static MALLOC_DEFINE(M_IFATM, "ifatm", "atm interface internals");
|
||||
* ro->ro_rt must also be NULL.
|
||||
*/
|
||||
int
|
||||
atm_output(struct ifnet *ifp, struct mbuf *m0, struct sockaddr *dst,
|
||||
atm_output(struct ifnet *ifp, struct mbuf *m0, const struct sockaddr *dst,
|
||||
struct route *ro)
|
||||
{
|
||||
u_int16_t etype = 0; /* if using LLC/SNAP */
|
||||
@ -129,7 +129,7 @@ atm_output(struct ifnet *ifp, struct mbuf *m0, struct sockaddr *dst,
|
||||
struct atm_pseudohdr atmdst, *ad;
|
||||
struct mbuf *m = m0;
|
||||
struct atmllc *atmllc;
|
||||
struct atmllc *llc_hdr = NULL;
|
||||
const struct atmllc *llc_hdr = NULL;
|
||||
u_int32_t atm_flags;
|
||||
|
||||
#ifdef MAC
|
||||
@ -173,7 +173,7 @@ atm_output(struct ifnet *ifp, struct mbuf *m0, struct sockaddr *dst,
|
||||
* (atm pseudo header (4) + LLC/SNAP (8))
|
||||
*/
|
||||
bcopy(dst->sa_data, &atmdst, sizeof(atmdst));
|
||||
llc_hdr = (struct atmllc *)(dst->sa_data +
|
||||
llc_hdr = (const struct atmllc *)(dst->sa_data +
|
||||
sizeof(atmdst));
|
||||
break;
|
||||
|
||||
|
@ -42,7 +42,7 @@ __FBSDID("$FreeBSD$");
|
||||
#include <net/if_var.h>
|
||||
|
||||
static int
|
||||
ifdead_output(struct ifnet *ifp, struct mbuf *m, struct sockaddr *sa,
|
||||
ifdead_output(struct ifnet *ifp, struct mbuf *m, const struct sockaddr *sa,
|
||||
struct route *ro)
|
||||
{
|
||||
|
||||
|
@ -64,7 +64,7 @@ struct disc_softc {
|
||||
};
|
||||
|
||||
static int discoutput(struct ifnet *, struct mbuf *,
|
||||
struct sockaddr *, struct route *);
|
||||
const struct sockaddr *, struct route *);
|
||||
static void discrtrequest(int, struct rtentry *, struct rt_addrinfo *);
|
||||
static int discioctl(struct ifnet *, u_long, caddr_t);
|
||||
static int disc_clone_create(struct if_clone *, int, caddr_t);
|
||||
@ -155,7 +155,7 @@ static moduledata_t disc_mod = {
|
||||
DECLARE_MODULE(if_disc, disc_mod, SI_SUB_PSEUDO, SI_ORDER_ANY);
|
||||
|
||||
static int
|
||||
discoutput(struct ifnet *ifp, struct mbuf *m, struct sockaddr *dst,
|
||||
discoutput(struct ifnet *ifp, struct mbuf *m, const struct sockaddr *dst,
|
||||
struct route *ro)
|
||||
{
|
||||
u_int32_t af;
|
||||
@ -163,15 +163,14 @@ discoutput(struct ifnet *ifp, struct mbuf *m, struct sockaddr *dst,
|
||||
M_ASSERTPKTHDR(m);
|
||||
|
||||
/* 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));
|
||||
dst->sa_family = af;
|
||||
}
|
||||
else
|
||||
af = dst->sa_family;
|
||||
|
||||
if (bpf_peers_present(ifp->if_bpf)) {
|
||||
u_int af = dst->sa_family;
|
||||
if (bpf_peers_present(ifp->if_bpf))
|
||||
bpf_mtap2(ifp->if_bpf, &af, sizeof(af), m);
|
||||
}
|
||||
|
||||
m->m_pkthdr.rcvif = ifp;
|
||||
|
||||
ifp->if_opackets++;
|
||||
|
@ -102,7 +102,7 @@ static int efcount;
|
||||
|
||||
extern int (*ef_inputp)(struct ifnet*, struct ether_header *eh, struct mbuf *m);
|
||||
extern int (*ef_outputp)(struct ifnet *ifp, struct mbuf **mp,
|
||||
struct sockaddr *dst, short *tp, int *hlen);
|
||||
const struct sockaddr *dst, short *tp, int *hlen);
|
||||
|
||||
/*
|
||||
static void ef_reset (struct ifnet *);
|
||||
@ -114,7 +114,7 @@ static int ef_ioctl(struct ifnet *, u_long, caddr_t);
|
||||
static void ef_start(struct ifnet *);
|
||||
static int ef_input(struct ifnet*, struct ether_header *, struct mbuf *);
|
||||
static int ef_output(struct ifnet *ifp, struct mbuf **mp,
|
||||
struct sockaddr *dst, short *tp, int *hlen);
|
||||
const struct sockaddr *dst, short *tp, int *hlen);
|
||||
|
||||
static int ef_load(void);
|
||||
static int ef_unload(void);
|
||||
@ -386,8 +386,8 @@ ef_input(struct ifnet *ifp, struct ether_header *eh, struct mbuf *m)
|
||||
}
|
||||
|
||||
static int
|
||||
ef_output(struct ifnet *ifp, struct mbuf **mp, struct sockaddr *dst, short *tp,
|
||||
int *hlen)
|
||||
ef_output(struct ifnet *ifp, struct mbuf **mp, const struct sockaddr *dst,
|
||||
short *tp, int *hlen)
|
||||
{
|
||||
struct efnet *sc = (struct efnet*)ifp->if_softc;
|
||||
struct mbuf *m = *mp;
|
||||
|
@ -88,7 +88,7 @@ struct enc_softc {
|
||||
|
||||
static int enc_ioctl(struct ifnet *, u_long, caddr_t);
|
||||
static int enc_output(struct ifnet *ifp, struct mbuf *m,
|
||||
struct sockaddr *dst, struct route *ro);
|
||||
const struct sockaddr *dst, struct route *ro);
|
||||
static int enc_clone_create(struct if_clone *, int, caddr_t);
|
||||
static void enc_clone_destroy(struct ifnet *);
|
||||
static struct if_clone *enc_cloner;
|
||||
@ -188,7 +188,7 @@ static moduledata_t enc_mod = {
|
||||
DECLARE_MODULE(if_enc, enc_mod, SI_SUB_PROTO_IFATTACHDOMAIN, SI_ORDER_ANY);
|
||||
|
||||
static int
|
||||
enc_output(struct ifnet *ifp, struct mbuf *m, struct sockaddr *dst,
|
||||
enc_output(struct ifnet *ifp, struct mbuf *m, const struct sockaddr *dst,
|
||||
struct route *ro)
|
||||
{
|
||||
m_freem(m);
|
||||
|
@ -83,7 +83,7 @@
|
||||
|
||||
int (*ef_inputp)(struct ifnet*, struct ether_header *eh, struct mbuf *m);
|
||||
int (*ef_outputp)(struct ifnet *ifp, struct mbuf **mp,
|
||||
struct sockaddr *dst, short *tp, int *hlen);
|
||||
const struct sockaddr *dst, short *tp, int *hlen);
|
||||
|
||||
#ifdef NETATALK
|
||||
#include <netatalk/at.h>
|
||||
@ -149,7 +149,7 @@ static MALLOC_DEFINE(M_ARPCOM, "arpcom", "802.* interface internals");
|
||||
*/
|
||||
int
|
||||
ether_output(struct ifnet *ifp, struct mbuf *m,
|
||||
struct sockaddr *dst, struct route *ro)
|
||||
const struct sockaddr *dst, struct route *ro)
|
||||
{
|
||||
short type;
|
||||
int error = 0, hdrcmplt = 0;
|
||||
@ -238,8 +238,8 @@ ether_output(struct ifnet *ifp, struct mbuf *m,
|
||||
goto bad;
|
||||
} else
|
||||
type = htons(ETHERTYPE_IPX);
|
||||
bcopy((caddr_t)&(((struct sockaddr_ipx *)dst)->sipx_addr.x_host),
|
||||
(caddr_t)edst, sizeof (edst));
|
||||
bcopy(&((const struct sockaddr_ipx *)dst)->sipx_addr.x_host,
|
||||
edst, sizeof (edst));
|
||||
break;
|
||||
#endif
|
||||
#ifdef NETATALK
|
||||
@ -247,9 +247,9 @@ ether_output(struct ifnet *ifp, struct mbuf *m,
|
||||
{
|
||||
struct at_ifaddr *aa;
|
||||
|
||||
if ((aa = at_ifawithnet((struct sockaddr_at *)dst)) == NULL)
|
||||
if ((aa = at_ifawithnet((const struct sockaddr_at *)dst)) == NULL)
|
||||
senderr(EHOSTUNREACH); /* XXX */
|
||||
if (!aarpresolve(ifp, m, (struct sockaddr_at *)dst, edst)) {
|
||||
if (!aarpresolve(ifp, m, (const struct sockaddr_at *)dst, edst)) {
|
||||
ifa_free(&aa->aa_ifa);
|
||||
return (0);
|
||||
}
|
||||
@ -279,18 +279,21 @@ ether_output(struct ifnet *ifp, struct mbuf *m,
|
||||
#endif /* NETATALK */
|
||||
|
||||
case pseudo_AF_HDRCMPLT:
|
||||
{
|
||||
const struct ether_header *eh;
|
||||
|
||||
hdrcmplt = 1;
|
||||
eh = (struct ether_header *)dst->sa_data;
|
||||
eh = (const struct ether_header *)dst->sa_data;
|
||||
(void)memcpy(esrc, eh->ether_shost, sizeof (esrc));
|
||||
/* FALLTHROUGH */
|
||||
|
||||
case AF_UNSPEC:
|
||||
loop_copy = 0; /* if this is for us, don't do it */
|
||||
eh = (struct ether_header *)dst->sa_data;
|
||||
eh = (const struct ether_header *)dst->sa_data;
|
||||
(void)memcpy(edst, eh->ether_dhost, sizeof (edst));
|
||||
type = eh->ether_type;
|
||||
break;
|
||||
|
||||
}
|
||||
default:
|
||||
if_printf(ifp, "can't handle af%d\n", dst->sa_family);
|
||||
senderr(EAFNOSUPPORT);
|
||||
|
@ -84,7 +84,7 @@ struct faith_softc {
|
||||
};
|
||||
|
||||
static int faithioctl(struct ifnet *, u_long, caddr_t);
|
||||
int faithoutput(struct ifnet *, struct mbuf *, struct sockaddr *,
|
||||
static int faithoutput(struct ifnet *, struct mbuf *, const struct sockaddr *,
|
||||
struct route *);
|
||||
static void faithrtrequest(int, struct rtentry *, struct rt_addrinfo *);
|
||||
#ifdef INET6
|
||||
@ -184,12 +184,9 @@ faith_clone_destroy(ifp)
|
||||
free(sc, M_FAITH);
|
||||
}
|
||||
|
||||
int
|
||||
faithoutput(ifp, m, dst, ro)
|
||||
struct ifnet *ifp;
|
||||
struct mbuf *m;
|
||||
struct sockaddr *dst;
|
||||
struct route *ro;
|
||||
static int
|
||||
faithoutput(struct ifnet *ifp, struct mbuf *m, const struct sockaddr *dst,
|
||||
struct route *ro)
|
||||
{
|
||||
int isr;
|
||||
u_int32_t af;
|
||||
@ -200,15 +197,13 @@ faithoutput(ifp, m, dst, ro)
|
||||
if (ro != NULL)
|
||||
rt = ro->ro_rt;
|
||||
/* 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));
|
||||
dst->sa_family = af;
|
||||
}
|
||||
|
||||
if (bpf_peers_present(ifp->if_bpf)) {
|
||||
else
|
||||
af = dst->sa_family;
|
||||
|
||||
if (bpf_peers_present(ifp->if_bpf))
|
||||
bpf_mtap2(ifp->if_bpf, &af, sizeof(af), m);
|
||||
}
|
||||
|
||||
if (rt && rt->rt_flags & (RTF_REJECT|RTF_BLACKHOLE)) {
|
||||
m_freem(m);
|
||||
@ -217,7 +212,7 @@ faithoutput(ifp, m, dst, ro)
|
||||
}
|
||||
ifp->if_opackets++;
|
||||
ifp->if_obytes += m->m_pkthdr.len;
|
||||
switch (dst->sa_family) {
|
||||
switch (af) {
|
||||
#ifdef INET
|
||||
case AF_INET:
|
||||
isr = NETISR_IP;
|
||||
|
@ -96,7 +96,7 @@ static const u_char fddibroadcastaddr[FDDI_ADDR_LEN] =
|
||||
|
||||
static int fddi_resolvemulti(struct ifnet *, struct sockaddr **,
|
||||
struct sockaddr *);
|
||||
static int fddi_output(struct ifnet *, struct mbuf *, struct sockaddr *,
|
||||
static int fddi_output(struct ifnet *, struct mbuf *, const struct sockaddr *,
|
||||
struct route *);
|
||||
static void fddi_input(struct ifnet *ifp, struct mbuf *m);
|
||||
|
||||
@ -110,11 +110,8 @@ static void fddi_input(struct ifnet *ifp, struct mbuf *m);
|
||||
* Assumes that ifp is actually pointer to arpcom structure.
|
||||
*/
|
||||
static int
|
||||
fddi_output(ifp, m, dst, ro)
|
||||
struct ifnet *ifp;
|
||||
struct mbuf *m;
|
||||
struct sockaddr *dst;
|
||||
struct route *ro;
|
||||
fddi_output(struct ifnet *ifp, struct mbuf *m, const struct sockaddr *dst,
|
||||
struct route *ro)
|
||||
{
|
||||
u_int16_t type;
|
||||
int loop_copy = 0, error = 0, hdrcmplt = 0;
|
||||
@ -189,19 +186,19 @@ fddi_output(ifp, m, dst, ro)
|
||||
#ifdef IPX
|
||||
case AF_IPX:
|
||||
type = htons(ETHERTYPE_IPX);
|
||||
bcopy((caddr_t)&(((struct sockaddr_ipx *)dst)->sipx_addr.x_host),
|
||||
(caddr_t)edst, FDDI_ADDR_LEN);
|
||||
bcopy(&((const struct sockaddr_ipx *)dst)->sipx_addr.x_host,
|
||||
edst, FDDI_ADDR_LEN);
|
||||
break;
|
||||
#endif /* IPX */
|
||||
#ifdef NETATALK
|
||||
case AF_APPLETALK: {
|
||||
struct at_ifaddr *aa;
|
||||
if (!aarpresolve(ifp, m, (struct sockaddr_at *)dst, edst))
|
||||
if (!aarpresolve(ifp, m, (const struct sockaddr_at *)dst, edst))
|
||||
return (0);
|
||||
/*
|
||||
* ifaddr is the first thing in at_ifaddr
|
||||
*/
|
||||
if ((aa = at_ifawithnet( (struct sockaddr_at *)dst)) == 0)
|
||||
if ((aa = at_ifawithnet((const struct sockaddr_at *)dst)) == 0)
|
||||
goto bad;
|
||||
|
||||
/*
|
||||
@ -229,19 +226,21 @@ fddi_output(ifp, m, dst, ro)
|
||||
|
||||
case pseudo_AF_HDRCMPLT:
|
||||
{
|
||||
struct ether_header *eh;
|
||||
const struct ether_header *eh;
|
||||
|
||||
hdrcmplt = 1;
|
||||
eh = (struct ether_header *)dst->sa_data;
|
||||
bcopy((caddr_t)eh->ether_shost, (caddr_t)esrc, FDDI_ADDR_LEN);
|
||||
eh = (const struct ether_header *)dst->sa_data;
|
||||
bcopy(eh->ether_shost, esrc, FDDI_ADDR_LEN);
|
||||
/* FALLTHROUGH */
|
||||
}
|
||||
|
||||
case AF_UNSPEC:
|
||||
{
|
||||
struct ether_header *eh;
|
||||
const struct ether_header *eh;
|
||||
|
||||
loop_copy = -1;
|
||||
eh = (struct ether_header *)dst->sa_data;
|
||||
bcopy((caddr_t)eh->ether_dhost, (caddr_t)edst, FDDI_ADDR_LEN);
|
||||
eh = (const struct ether_header *)dst->sa_data;
|
||||
bcopy(eh->ether_dhost, edst, FDDI_ADDR_LEN);
|
||||
if (*edst & 1)
|
||||
m->m_flags |= (M_BCAST|M_MCAST);
|
||||
type = eh->ether_type;
|
||||
|
@ -75,7 +75,7 @@ struct fw_hwaddr firewire_broadcastaddr = {
|
||||
};
|
||||
|
||||
static int
|
||||
firewire_output(struct ifnet *ifp, struct mbuf *m, struct sockaddr *dst,
|
||||
firewire_output(struct ifnet *ifp, struct mbuf *m, const struct sockaddr *dst,
|
||||
struct route *ro)
|
||||
{
|
||||
struct fw_com *fc = IFP2FWC(ifp);
|
||||
|
@ -422,11 +422,8 @@ gif_start(struct ifnet *ifp)
|
||||
}
|
||||
|
||||
int
|
||||
gif_output(ifp, m, dst, ro)
|
||||
struct ifnet *ifp;
|
||||
struct mbuf *m;
|
||||
struct sockaddr *dst;
|
||||
struct route *ro;
|
||||
gif_output(struct ifnet *ifp, struct mbuf *m, const struct sockaddr *dst,
|
||||
struct route *ro)
|
||||
{
|
||||
struct gif_softc *sc = ifp->if_softc;
|
||||
struct m_tag *mtag;
|
||||
@ -482,11 +479,10 @@ gif_output(ifp, m, dst, ro)
|
||||
|
||||
m->m_flags &= ~(M_BCAST|M_MCAST);
|
||||
/* 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));
|
||||
dst->sa_family = af;
|
||||
}
|
||||
af = dst->sa_family;
|
||||
else
|
||||
af = dst->sa_family;
|
||||
/*
|
||||
* Now save the af in the inbound pkt csum
|
||||
* data, this is a cheat since we are using
|
||||
|
@ -112,7 +112,7 @@ struct etherip_header {
|
||||
|
||||
/* Prototypes */
|
||||
void gif_input(struct mbuf *, int, struct ifnet *);
|
||||
int gif_output(struct ifnet *, struct mbuf *, struct sockaddr *,
|
||||
int gif_output(struct ifnet *, struct mbuf *, const struct sockaddr *,
|
||||
struct route *);
|
||||
int gif_ioctl(struct ifnet *, u_long, caddr_t);
|
||||
int gif_set_tunnel(struct ifnet *, struct sockaddr *, struct sockaddr *);
|
||||
|
@ -113,8 +113,8 @@ static void gre_clone_destroy(struct ifnet *);
|
||||
static struct if_clone *gre_cloner;
|
||||
|
||||
static int gre_ioctl(struct ifnet *, u_long, caddr_t);
|
||||
static int gre_output(struct ifnet *, struct mbuf *, struct sockaddr *,
|
||||
struct route *ro);
|
||||
static int gre_output(struct ifnet *, struct mbuf *,
|
||||
const struct sockaddr *, struct route *);
|
||||
|
||||
static int gre_compute_route(struct gre_softc *sc);
|
||||
|
||||
@ -241,7 +241,7 @@ gre_clone_destroy(ifp)
|
||||
* given by sc->g_proto. See also RFC 1701 and RFC 2004
|
||||
*/
|
||||
static int
|
||||
gre_output(struct ifnet *ifp, struct mbuf *m, struct sockaddr *dst,
|
||||
gre_output(struct ifnet *ifp, struct mbuf *m, const struct sockaddr *dst,
|
||||
struct route *ro)
|
||||
{
|
||||
int error = 0;
|
||||
@ -333,20 +333,18 @@ gre_output(struct ifnet *ifp, struct mbuf *m, struct sockaddr *dst,
|
||||
ip = NULL;
|
||||
|
||||
/* 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));
|
||||
dst->sa_family = af;
|
||||
}
|
||||
|
||||
if (bpf_peers_present(ifp->if_bpf)) {
|
||||
else
|
||||
af = dst->sa_family;
|
||||
|
||||
if (bpf_peers_present(ifp->if_bpf))
|
||||
bpf_mtap2(ifp->if_bpf, &af, sizeof(af), m);
|
||||
}
|
||||
|
||||
m->m_flags &= ~(M_BCAST|M_MCAST);
|
||||
|
||||
if (sc->g_proto == IPPROTO_MOBILE) {
|
||||
if (dst->sa_family == AF_INET) {
|
||||
if (af == AF_INET) {
|
||||
struct mbuf *m0;
|
||||
int msiz;
|
||||
|
||||
@ -417,7 +415,7 @@ gre_output(struct ifnet *ifp, struct mbuf *m, struct sockaddr *dst,
|
||||
goto end;
|
||||
}
|
||||
} else if (sc->g_proto == IPPROTO_GRE) {
|
||||
switch (dst->sa_family) {
|
||||
switch (af) {
|
||||
case AF_INET:
|
||||
ip = mtod(m, struct ip *);
|
||||
gre_ip_tos = ip->ip_tos;
|
||||
|
@ -231,11 +231,8 @@ iso88025_ioctl(struct ifnet *ifp, u_long command, caddr_t data)
|
||||
* ISO88025 encapsulation
|
||||
*/
|
||||
int
|
||||
iso88025_output(ifp, m, dst, ro)
|
||||
struct ifnet *ifp;
|
||||
struct mbuf *m;
|
||||
struct sockaddr *dst;
|
||||
struct route *ro;
|
||||
iso88025_output(struct ifnet *ifp, struct mbuf *m, const struct sockaddr *dst,
|
||||
struct route *ro)
|
||||
{
|
||||
u_int16_t snap_type = 0;
|
||||
int loop_copy = 0, error = 0, rif_len = 0;
|
||||
@ -351,7 +348,7 @@ iso88025_output(ifp, m, dst, ro)
|
||||
#endif /* IPX */
|
||||
case AF_UNSPEC:
|
||||
{
|
||||
struct iso88025_sockaddr_data *sd;
|
||||
const struct iso88025_sockaddr_data *sd;
|
||||
/*
|
||||
* For AF_UNSPEC sockaddr.sa_data must contain all of the
|
||||
* mac information needed to send the packet. This allows
|
||||
@ -361,13 +358,12 @@ iso88025_output(ifp, m, dst, ro)
|
||||
* should be an iso88025_sockaddr_data structure see iso88025.h
|
||||
*/
|
||||
loop_copy = -1;
|
||||
sd = (struct iso88025_sockaddr_data *)dst->sa_data;
|
||||
sd = (const struct iso88025_sockaddr_data *)dst->sa_data;
|
||||
gen_th.ac = sd->ac;
|
||||
gen_th.fc = sd->fc;
|
||||
(void)memcpy((caddr_t)edst, (caddr_t)sd->ether_dhost,
|
||||
ISO88025_ADDR_LEN);
|
||||
(void)memcpy((caddr_t)gen_th.iso88025_shost,
|
||||
(caddr_t)sd->ether_shost, ISO88025_ADDR_LEN);
|
||||
(void)memcpy(edst, sd->ether_dhost, ISO88025_ADDR_LEN);
|
||||
(void)memcpy(gen_th.iso88025_shost, sd->ether_shost,
|
||||
ISO88025_ADDR_LEN);
|
||||
rif_len = 0;
|
||||
break;
|
||||
}
|
||||
|
@ -99,7 +99,7 @@ static void lagg_linkstate(struct lagg_softc *);
|
||||
static void lagg_port_state(struct ifnet *, int);
|
||||
static int lagg_port_ioctl(struct ifnet *, u_long, caddr_t);
|
||||
static int lagg_port_output(struct ifnet *, struct mbuf *,
|
||||
struct sockaddr *, struct route *);
|
||||
const struct sockaddr *, struct route *);
|
||||
static void lagg_port_ifdetach(void *arg __unused, struct ifnet *);
|
||||
#ifdef LAGG_PORT_STACKING
|
||||
static int lagg_port_checkstacking(struct lagg_softc *);
|
||||
@ -787,7 +787,7 @@ fallback:
|
||||
*/
|
||||
static int
|
||||
lagg_port_output(struct ifnet *ifp, struct mbuf *m,
|
||||
struct sockaddr *dst, struct route *ro)
|
||||
const struct sockaddr *dst, struct route *ro)
|
||||
{
|
||||
struct lagg_port *lp = ifp->if_lagg;
|
||||
|
||||
|
@ -245,8 +245,8 @@ struct lagg_port {
|
||||
|
||||
/* Redirected callbacks */
|
||||
int (*lp_ioctl)(struct ifnet *, u_long, caddr_t);
|
||||
int (*lp_output)(struct ifnet *, struct mbuf *, struct sockaddr *,
|
||||
struct route *);
|
||||
int (*lp_output)(struct ifnet *, struct mbuf *,
|
||||
const struct sockaddr *, struct route *);
|
||||
|
||||
SLIST_ENTRY(lagg_port) lp_entries;
|
||||
};
|
||||
|
@ -101,7 +101,7 @@
|
||||
int loioctl(struct ifnet *, u_long, caddr_t);
|
||||
static void lortrequest(int, struct rtentry *, struct rt_addrinfo *);
|
||||
int looutput(struct ifnet *ifp, struct mbuf *m,
|
||||
struct sockaddr *dst, struct route *ro);
|
||||
const struct sockaddr *dst, struct route *ro);
|
||||
static int lo_clone_create(struct if_clone *, int, caddr_t);
|
||||
static void lo_clone_destroy(struct ifnet *);
|
||||
|
||||
@ -210,7 +210,7 @@ static moduledata_t loop_mod = {
|
||||
DECLARE_MODULE(if_lo, loop_mod, SI_SUB_PROTO_IFATTACHDOMAIN, SI_ORDER_ANY);
|
||||
|
||||
int
|
||||
looutput(struct ifnet *ifp, struct mbuf *m, struct sockaddr *dst,
|
||||
looutput(struct ifnet *ifp, struct mbuf *m, const struct sockaddr *dst,
|
||||
struct route *ro)
|
||||
{
|
||||
u_int32_t af;
|
||||
@ -241,13 +241,13 @@ looutput(struct ifnet *ifp, struct mbuf *m, struct sockaddr *dst,
|
||||
ifp->if_obytes += m->m_pkthdr.len;
|
||||
|
||||
/* 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));
|
||||
dst->sa_family = af;
|
||||
}
|
||||
else
|
||||
af = dst->sa_family;
|
||||
|
||||
#if 1 /* XXX */
|
||||
switch (dst->sa_family) {
|
||||
switch (af) {
|
||||
case AF_INET:
|
||||
if (ifp->if_capenable & IFCAP_RXCSUM) {
|
||||
m->m_pkthdr.csum_data = 0xffff;
|
||||
@ -276,12 +276,12 @@ looutput(struct ifnet *ifp, struct mbuf *m, struct sockaddr *dst,
|
||||
case AF_APPLETALK:
|
||||
break;
|
||||
default:
|
||||
printf("looutput: af=%d unexpected\n", dst->sa_family);
|
||||
printf("looutput: af=%d unexpected\n", af);
|
||||
m_freem(m);
|
||||
return (EAFNOSUPPORT);
|
||||
}
|
||||
#endif
|
||||
return (if_simloop(ifp, m, dst->sa_family, 0));
|
||||
return (if_simloop(ifp, m, af, 0));
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -262,7 +262,7 @@ static const u_short interactive_ports[8] = {
|
||||
int debug = ifp->if_flags & IFF_DEBUG
|
||||
|
||||
static int sppp_output(struct ifnet *ifp, struct mbuf *m,
|
||||
struct sockaddr *dst, struct route *ro);
|
||||
const struct sockaddr *dst, struct route *ro);
|
||||
|
||||
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);
|
||||
@ -785,8 +785,8 @@ sppp_ifstart(struct ifnet *ifp)
|
||||
* Enqueue transmit packet.
|
||||
*/
|
||||
static int
|
||||
sppp_output(struct ifnet *ifp, struct mbuf *m,
|
||||
struct sockaddr *dst, struct route *ro)
|
||||
sppp_output(struct ifnet *ifp, struct mbuf *m, const struct sockaddr *dst,
|
||||
struct route *ro)
|
||||
{
|
||||
struct sppp *sp = IFP2SP(ifp);
|
||||
struct ppp_header *h;
|
||||
|
@ -140,7 +140,7 @@ SYSCTL_INT(_net_link_stf, OID_AUTO, permit_rfc1918, CTLFLAG_RW | CTLFLAG_TUN,
|
||||
* XXX: Return a pointer with 16-bit aligned. Don't cast it to
|
||||
* struct in_addr *; use bcopy() instead.
|
||||
*/
|
||||
#define GET_V4(x) ((caddr_t)(&(x)->s6_addr16[1]))
|
||||
#define GET_V4(x) (&(x)->s6_addr16[1])
|
||||
|
||||
struct stf_softc {
|
||||
struct ifnet *sc_ifp;
|
||||
@ -181,7 +181,7 @@ static char *stfnames[] = {"stf0", "stf", "6to4", NULL};
|
||||
static int stfmodevent(module_t, int, void *);
|
||||
static int stf_encapcheck(const struct mbuf *, int, int, void *);
|
||||
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 *, const struct sockaddr *,
|
||||
struct route *);
|
||||
static int isrfc1918addr(struct in_addr *);
|
||||
static int stf_checkaddr4(struct stf_softc *, struct in_addr *,
|
||||
@ -413,23 +413,19 @@ stf_getsrcifa6(ifp)
|
||||
}
|
||||
|
||||
static int
|
||||
stf_output(ifp, m, dst, ro)
|
||||
struct ifnet *ifp;
|
||||
struct mbuf *m;
|
||||
struct sockaddr *dst;
|
||||
struct route *ro;
|
||||
stf_output(struct ifnet *ifp, struct mbuf *m, const struct sockaddr *dst,
|
||||
struct route *ro)
|
||||
{
|
||||
struct stf_softc *sc;
|
||||
struct sockaddr_in6 *dst6;
|
||||
const struct sockaddr_in6 *dst6;
|
||||
struct route *cached_route;
|
||||
struct in_addr in4;
|
||||
caddr_t ptr;
|
||||
const void *ptr;
|
||||
struct sockaddr_in *dst4;
|
||||
u_int8_t tos;
|
||||
struct ip *ip;
|
||||
struct ip6_hdr *ip6;
|
||||
struct in6_ifaddr *ia6;
|
||||
u_int32_t af;
|
||||
int error;
|
||||
|
||||
#ifdef MAC
|
||||
@ -441,7 +437,7 @@ stf_output(ifp, m, dst, ro)
|
||||
#endif
|
||||
|
||||
sc = ifp->if_softc;
|
||||
dst6 = (struct sockaddr_in6 *)dst;
|
||||
dst6 = (const struct sockaddr_in6 *)dst;
|
||||
|
||||
/* just in case */
|
||||
if ((ifp->if_flags & IFF_UP) == 0) {
|
||||
@ -473,15 +469,6 @@ stf_output(ifp, m, dst, ro)
|
||||
ip6 = mtod(m, struct ip6_hdr *);
|
||||
tos = (ntohl(ip6->ip6_flow) >> 20) & 0xff;
|
||||
|
||||
/*
|
||||
* BPF writes need to be handled specially.
|
||||
* This is a null operation, nothing here checks dst->sa_family.
|
||||
*/
|
||||
if (dst->sa_family == AF_UNSPEC) {
|
||||
bcopy(dst->sa_data, &af, sizeof(af));
|
||||
dst->sa_family = af;
|
||||
}
|
||||
|
||||
/*
|
||||
* Pickup the right outer dst addr from the list of candidates.
|
||||
* ip6_dst has priority as it may be able to give us shorter IPv4 hops.
|
||||
@ -507,7 +494,7 @@ stf_output(ifp, m, dst, ro)
|
||||
* will only read from the mbuf (i.e., it won't
|
||||
* try to free it or keep a pointer a to it).
|
||||
*/
|
||||
af = AF_INET6;
|
||||
u_int af = AF_INET6;
|
||||
bpf_mtap2(ifp->if_bpf, &af, sizeof(af), m);
|
||||
}
|
||||
|
||||
|
@ -128,8 +128,8 @@ static void tuncreate(const char *name, struct cdev *dev);
|
||||
static int tunifioctl(struct ifnet *, u_long, caddr_t);
|
||||
static void tuninit(struct ifnet *);
|
||||
static int tunmodevent(module_t, int, void *);
|
||||
static int tunoutput(struct ifnet *, struct mbuf *, struct sockaddr *,
|
||||
struct route *ro);
|
||||
static int tunoutput(struct ifnet *, struct mbuf *,
|
||||
const struct sockaddr *, struct route *ro);
|
||||
static void tunstart(struct ifnet *);
|
||||
|
||||
static int tun_clone_create(struct if_clone *, int, caddr_t);
|
||||
@ -575,7 +575,7 @@ tunifioctl(struct ifnet *ifp, u_long cmd, caddr_t data)
|
||||
* tunoutput - queue packets from higher level ready to put out.
|
||||
*/
|
||||
static int
|
||||
tunoutput(struct ifnet *ifp, struct mbuf *m0, struct sockaddr *dst,
|
||||
tunoutput(struct ifnet *ifp, struct mbuf *m0, const struct sockaddr *dst,
|
||||
struct route *ro)
|
||||
{
|
||||
struct tun_softc *tp = ifp->if_softc;
|
||||
@ -609,15 +609,13 @@ tunoutput(struct ifnet *ifp, struct mbuf *m0, struct sockaddr *dst,
|
||||
}
|
||||
|
||||
/* 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));
|
||||
dst->sa_family = af;
|
||||
}
|
||||
|
||||
if (bpf_peers_present(ifp->if_bpf)) {
|
||||
else
|
||||
af = dst->sa_family;
|
||||
|
||||
if (bpf_peers_present(ifp->if_bpf))
|
||||
bpf_mtap2(ifp->if_bpf, &af, sizeof(af), m0);
|
||||
}
|
||||
|
||||
/* prepend sockaddr? this may abort if the mbuf allocation fails */
|
||||
if (cached_tun_flags & TUN_LMODE) {
|
||||
@ -644,10 +642,10 @@ tunoutput(struct ifnet *ifp, struct mbuf *m0, struct sockaddr *dst,
|
||||
ifp->if_oerrors++;
|
||||
return (ENOBUFS);
|
||||
} else
|
||||
*(u_int32_t *)m0->m_data = htonl(dst->sa_family);
|
||||
*(u_int32_t *)m0->m_data = htonl(af);
|
||||
} else {
|
||||
#ifdef INET
|
||||
if (dst->sa_family != AF_INET)
|
||||
if (af != AF_INET)
|
||||
#endif
|
||||
{
|
||||
m_freem(m0);
|
||||
|
@ -158,7 +158,7 @@ struct ifnet {
|
||||
int if_amcount; /* number of all-multicast requests */
|
||||
/* procedure handles */
|
||||
int (*if_output) /* output routine (enqueue) */
|
||||
(struct ifnet *, struct mbuf *, struct sockaddr *,
|
||||
(struct ifnet *, struct mbuf *, const struct sockaddr *,
|
||||
struct route *);
|
||||
void (*if_input) /* input routine (from h/w driver) */
|
||||
(struct ifnet *, struct mbuf *);
|
||||
|
@ -165,8 +165,8 @@ struct iso88025_addr {
|
||||
void iso88025_ifattach (struct ifnet *, const u_int8_t *, int);
|
||||
void iso88025_ifdetach (struct ifnet *, int);
|
||||
int iso88025_ioctl (struct ifnet *, u_long, caddr_t );
|
||||
int iso88025_output (struct ifnet *, struct mbuf *, struct sockaddr *,
|
||||
struct route *);
|
||||
int iso88025_output (struct ifnet *, struct mbuf *,
|
||||
const struct sockaddr *, struct route *);
|
||||
void iso88025_input (struct ifnet *, struct mbuf *);
|
||||
|
||||
#endif
|
||||
|
@ -243,7 +243,7 @@ null_transmit(struct ifnet *ifp, struct mbuf *m)
|
||||
|
||||
static int
|
||||
null_output(struct ifnet *ifp, struct mbuf *m,
|
||||
struct sockaddr *dst, struct route *ro)
|
||||
const struct sockaddr *dst, struct route *ro)
|
||||
{
|
||||
if_printf(ifp, "discard raw packet\n");
|
||||
return null_transmit(ifp, m);
|
||||
|
@ -450,7 +450,7 @@ ieee80211_raw_output(struct ieee80211vap *vap, struct ieee80211_node *ni,
|
||||
*/
|
||||
int
|
||||
ieee80211_output(struct ifnet *ifp, struct mbuf *m,
|
||||
struct sockaddr *dst, struct route *ro)
|
||||
const struct sockaddr *dst, struct route *ro)
|
||||
{
|
||||
#define senderr(e) do { error = (e); goto bad;} while (0)
|
||||
struct ieee80211_node *ni = NULL;
|
||||
|
@ -97,7 +97,7 @@ int ieee80211_mgmt_output(struct ieee80211_node *, struct mbuf *, int,
|
||||
int ieee80211_raw_xmit(struct ieee80211_node *, struct mbuf *,
|
||||
const struct ieee80211_bpf_params *);
|
||||
int ieee80211_output(struct ifnet *, struct mbuf *,
|
||||
struct sockaddr *, struct route *ro);
|
||||
const struct sockaddr *, struct route *ro);
|
||||
int ieee80211_raw_output(struct ieee80211vap *, struct ieee80211_node *,
|
||||
struct mbuf *, const struct ieee80211_bpf_params *);
|
||||
void ieee80211_send_setup(struct ieee80211_node *, struct mbuf *, int, int,
|
||||
|
@ -497,7 +497,7 @@ struct ieee80211vap {
|
||||
enum ieee80211_state, int);
|
||||
/* 802.3 output method for raw frame xmit */
|
||||
int (*iv_output)(struct ifnet *, struct mbuf *,
|
||||
struct sockaddr *, struct route *);
|
||||
const struct sockaddr *, struct route *);
|
||||
uint64_t iv_spare[6];
|
||||
};
|
||||
MALLOC_DECLARE(M_80211_VAP);
|
||||
|
@ -147,7 +147,7 @@ aarptimer(void *ignored)
|
||||
* unlocked variant returns a reference that the caller must dispose of.
|
||||
*/
|
||||
struct at_ifaddr *
|
||||
at_ifawithnet_locked(struct sockaddr_at *sat)
|
||||
at_ifawithnet_locked(const struct sockaddr_at *sat)
|
||||
{
|
||||
struct at_ifaddr *aa;
|
||||
struct sockaddr_at *sat2;
|
||||
@ -167,7 +167,7 @@ at_ifawithnet_locked(struct sockaddr_at *sat)
|
||||
}
|
||||
|
||||
struct at_ifaddr *
|
||||
at_ifawithnet(struct sockaddr_at *sat)
|
||||
at_ifawithnet(const struct sockaddr_at *sat)
|
||||
{
|
||||
struct at_ifaddr *aa;
|
||||
|
||||
@ -180,7 +180,7 @@ at_ifawithnet(struct sockaddr_at *sat)
|
||||
}
|
||||
|
||||
static void
|
||||
aarpwhohas(struct ifnet *ifp, struct sockaddr_at *sat)
|
||||
aarpwhohas(struct ifnet *ifp, const struct sockaddr_at *sat)
|
||||
{
|
||||
struct mbuf *m;
|
||||
struct ether_header *eh;
|
||||
@ -267,8 +267,8 @@ aarpwhohas(struct ifnet *ifp, struct sockaddr_at *sat)
|
||||
}
|
||||
|
||||
int
|
||||
aarpresolve(struct ifnet *ifp, struct mbuf *m, struct sockaddr_at *destsat,
|
||||
u_char *desten)
|
||||
aarpresolve(struct ifnet *ifp, struct mbuf *m,
|
||||
const struct sockaddr_at *destsat, u_char *desten)
|
||||
{
|
||||
struct at_ifaddr *aa;
|
||||
struct aarptab *aat;
|
||||
@ -567,7 +567,7 @@ aarptfree(struct aarptab *aat)
|
||||
}
|
||||
|
||||
struct aarptab *
|
||||
aarptnew(struct at_addr *addr)
|
||||
aarptnew(const struct at_addr *addr)
|
||||
{
|
||||
int n;
|
||||
int oldest = -1;
|
||||
|
@ -80,7 +80,7 @@ struct aarptab {
|
||||
#define AARPOP_PROBE 0x03
|
||||
|
||||
#ifdef _KERNEL
|
||||
struct aarptab *aarptnew(struct at_addr *);
|
||||
struct aarptab *aarptnew(const struct at_addr *);
|
||||
#endif
|
||||
|
||||
#endif /* _NETATALK_AARP_H_ */
|
||||
|
@ -721,7 +721,7 @@ at_ifinit(struct ifnet *ifp, struct at_ifaddr *aa, struct sockaddr_at *sat)
|
||||
* check whether a given address is a broadcast address for us..
|
||||
*/
|
||||
int
|
||||
at_broadcast(struct sockaddr_at *sat)
|
||||
at_broadcast(const struct sockaddr_at *sat)
|
||||
{
|
||||
struct at_ifaddr *aa;
|
||||
|
||||
|
@ -46,16 +46,16 @@ struct socket;
|
||||
void aarpintr(struct mbuf *);
|
||||
void aarpprobe(void *arg);
|
||||
int aarpresolve(struct ifnet *, struct mbuf *,
|
||||
struct sockaddr_at *, u_char *);
|
||||
const struct sockaddr_at *, u_char *);
|
||||
void aarp_clean(void);
|
||||
void at1intr(struct mbuf *);
|
||||
void at2intr(struct mbuf *);
|
||||
int at_broadcast(struct sockaddr_at *);
|
||||
int at_broadcast(const struct sockaddr_at *);
|
||||
u_short at_cksum(struct mbuf *m, int skip);
|
||||
int at_control(struct socket *so, u_long cmd, caddr_t data,
|
||||
struct ifnet *ifp, struct thread *td);
|
||||
struct at_ifaddr *at_ifawithnet(struct sockaddr_at *);
|
||||
struct at_ifaddr *at_ifawithnet_locked(struct sockaddr_at *sat);
|
||||
struct at_ifaddr *at_ifawithnet(const struct sockaddr_at *);
|
||||
struct at_ifaddr *at_ifawithnet_locked(const struct sockaddr_at *sat);
|
||||
|
||||
int at_inithead(void**, int);
|
||||
void ddp_init(void);
|
||||
|
@ -165,7 +165,7 @@ struct ng_fec_bundle {
|
||||
int fec_btype;
|
||||
int (*fec_if_output) (struct ifnet *,
|
||||
struct mbuf *,
|
||||
struct sockaddr *,
|
||||
const struct sockaddr *,
|
||||
struct route *);
|
||||
};
|
||||
|
||||
@ -198,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 int ng_fec_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data);
|
||||
static int ng_fec_output(struct ifnet *ifp, struct mbuf *m0,
|
||||
struct sockaddr *dst, struct route *ro);
|
||||
const struct sockaddr *dst, struct route *ro);
|
||||
static void ng_fec_tick(void *arg);
|
||||
static int ng_fec_addport(struct ng_fec_private *priv, char *iface);
|
||||
static int ng_fec_delport(struct ng_fec_private *priv, char *iface);
|
||||
@ -923,7 +923,7 @@ ng_fec_input(struct ifnet *ifp, struct mbuf *m0)
|
||||
|
||||
static int
|
||||
ng_fec_output(struct ifnet *ifp, struct mbuf *m,
|
||||
struct sockaddr *dst, struct route *ro)
|
||||
const struct sockaddr *dst, struct route *ro)
|
||||
{
|
||||
const priv_p priv = (priv_p) ifp->if_softc;
|
||||
struct ng_fec_bundle *b;
|
||||
|
@ -123,7 +123,7 @@ typedef struct ng_iface_private *priv_p;
|
||||
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_output(struct ifnet *ifp, struct mbuf *m0,
|
||||
struct sockaddr *dst, struct route *ro);
|
||||
const struct sockaddr *dst, struct route *ro);
|
||||
static void ng_iface_bpftap(struct ifnet *ifp,
|
||||
struct mbuf *m, sa_family_t family);
|
||||
static int ng_iface_send(struct ifnet *ifp, struct mbuf *m,
|
||||
@ -353,7 +353,7 @@ ng_iface_ioctl(struct ifnet *ifp, u_long command, caddr_t data)
|
||||
|
||||
static int
|
||||
ng_iface_output(struct ifnet *ifp, struct mbuf *m,
|
||||
struct sockaddr *dst, struct route *ro)
|
||||
const struct sockaddr *dst, struct route *ro)
|
||||
{
|
||||
struct m_tag *mtag;
|
||||
uint32_t af;
|
||||
@ -385,13 +385,13 @@ ng_iface_output(struct ifnet *ifp, struct mbuf *m,
|
||||
m_tag_prepend(m, mtag);
|
||||
|
||||
/* 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));
|
||||
dst->sa_family = af;
|
||||
}
|
||||
else
|
||||
af = dst->sa_family;
|
||||
|
||||
/* Berkeley packet filter */
|
||||
ng_iface_bpftap(ifp, m, dst->sa_family);
|
||||
ng_iface_bpftap(ifp, m, af);
|
||||
|
||||
if (ALTQ_IS_ENABLED(&ifp->if_snd)) {
|
||||
M_PREPEND(m, sizeof(sa_family_t), M_NOWAIT);
|
||||
@ -402,10 +402,10 @@ ng_iface_output(struct ifnet *ifp, struct mbuf *m,
|
||||
ifp->if_oerrors++;
|
||||
return (ENOBUFS);
|
||||
}
|
||||
*(sa_family_t *)m->m_data = dst->sa_family;
|
||||
*(sa_family_t *)m->m_data = af;
|
||||
error = (ifp->if_transmit)(ifp, m);
|
||||
} else
|
||||
error = ng_iface_send(ifp, m, dst->sa_family);
|
||||
error = ng_iface_send(ifp, m, af);
|
||||
|
||||
return (error);
|
||||
}
|
||||
|
@ -317,7 +317,7 @@ failed:
|
||||
* but this is enough for PVCs entered via the "route" command.
|
||||
*/
|
||||
int
|
||||
atmresolve(struct rtentry *rt, struct mbuf *m, struct sockaddr *dst,
|
||||
atmresolve(struct rtentry *rt, struct mbuf *m, const struct sockaddr *dst,
|
||||
struct atm_pseudohdr *desten)
|
||||
{
|
||||
struct sockaddr_dl *sdl;
|
||||
@ -329,7 +329,8 @@ atmresolve(struct rtentry *rt, struct mbuf *m, struct sockaddr *dst,
|
||||
}
|
||||
|
||||
if (rt == NULL) {
|
||||
rt = RTALLOC1(dst, 0); /* link level on table 0 XXX MRT */
|
||||
/* link level on table 0 XXX MRT */
|
||||
rt = RTALLOC1(__DECONST(struct sockaddr *, dst), 0);
|
||||
if (rt == NULL)
|
||||
goto bad; /* failed */
|
||||
RT_REMREF(rt); /* don't keep LL references */
|
||||
|
@ -43,5 +43,5 @@ struct rtentry;
|
||||
struct sockaddr;
|
||||
|
||||
void atm_rtrequest(int, struct rtentry *, struct rt_addrinfo *);
|
||||
int atmresolve(struct rtentry *, struct mbuf *, struct sockaddr *,
|
||||
int atmresolve(struct rtentry *, struct mbuf *, const struct sockaddr *,
|
||||
struct atm_pseudohdr *);
|
||||
|
@ -73,7 +73,7 @@ __FBSDID("$FreeBSD$");
|
||||
|
||||
#include <security/mac/mac_framework.h>
|
||||
|
||||
#define SIN(s) ((struct sockaddr_in *)s)
|
||||
#define SIN(s) ((const struct sockaddr_in *)(s))
|
||||
#define SDL(s) ((struct sockaddr_dl *)s)
|
||||
|
||||
SYSCTL_DECL(_net_link_ether);
|
||||
@ -215,8 +215,8 @@ arptimer(void *arg)
|
||||
* - arp header source ethernet address
|
||||
*/
|
||||
void
|
||||
arprequest(struct ifnet *ifp, struct in_addr *sip, struct in_addr *tip,
|
||||
u_char *enaddr)
|
||||
arprequest(struct ifnet *ifp, const struct in_addr *sip,
|
||||
const struct in_addr *tip, u_char *enaddr)
|
||||
{
|
||||
struct mbuf *m;
|
||||
struct arphdr *ah;
|
||||
@ -272,9 +272,9 @@ arprequest(struct ifnet *ifp, struct in_addr *sip, struct in_addr *tip,
|
||||
ah->ar_hln = ifp->if_addrlen; /* hardware address length */
|
||||
ah->ar_pln = sizeof(struct in_addr); /* protocol address length */
|
||||
ah->ar_op = htons(ARPOP_REQUEST);
|
||||
bcopy((caddr_t)enaddr, (caddr_t)ar_sha(ah), ah->ar_hln);
|
||||
bcopy((caddr_t)sip, (caddr_t)ar_spa(ah), ah->ar_pln);
|
||||
bcopy((caddr_t)tip, (caddr_t)ar_tpa(ah), ah->ar_pln);
|
||||
bcopy(enaddr, ar_sha(ah), ah->ar_hln);
|
||||
bcopy(sip, ar_spa(ah), ah->ar_pln);
|
||||
bcopy(tip, ar_tpa(ah), ah->ar_pln);
|
||||
sa.sa_family = AF_ARP;
|
||||
sa.sa_len = 2;
|
||||
m->m_flags |= M_BCAST;
|
||||
@ -298,7 +298,7 @@ arprequest(struct ifnet *ifp, struct in_addr *sip, struct in_addr *tip,
|
||||
*/
|
||||
int
|
||||
arpresolve(struct ifnet *ifp, struct rtentry *rt0, struct mbuf *m,
|
||||
struct sockaddr *dst, u_char *desten, struct llentry **lle)
|
||||
const struct sockaddr *dst, u_char *desten, struct llentry **lle)
|
||||
{
|
||||
struct llentry *la = 0;
|
||||
u_int flags = 0;
|
||||
|
@ -48,9 +48,9 @@
|
||||
(enaddr)[0] = 0x01; \
|
||||
(enaddr)[1] = 0x00; \
|
||||
(enaddr)[2] = 0x5e; \
|
||||
(enaddr)[3] = ((u_char *)ipaddr)[1] & 0x7f; \
|
||||
(enaddr)[4] = ((u_char *)ipaddr)[2]; \
|
||||
(enaddr)[5] = ((u_char *)ipaddr)[3]; \
|
||||
(enaddr)[3] = ((const u_char *)ipaddr)[1] & 0x7f; \
|
||||
(enaddr)[4] = ((const u_char *)ipaddr)[2]; \
|
||||
(enaddr)[5] = ((const u_char *)ipaddr)[3]; \
|
||||
}
|
||||
/*
|
||||
* Macro to map an IP6 multicast address to an Ethernet multicast address.
|
||||
@ -63,10 +63,10 @@
|
||||
{ \
|
||||
(enaddr)[0] = 0x33; \
|
||||
(enaddr)[1] = 0x33; \
|
||||
(enaddr)[2] = ((u_char *)ip6addr)[12]; \
|
||||
(enaddr)[3] = ((u_char *)ip6addr)[13]; \
|
||||
(enaddr)[4] = ((u_char *)ip6addr)[14]; \
|
||||
(enaddr)[5] = ((u_char *)ip6addr)[15]; \
|
||||
(enaddr)[2] = ((const u_char *)ip6addr)[12]; \
|
||||
(enaddr)[3] = ((const u_char *)ip6addr)[13]; \
|
||||
(enaddr)[4] = ((const u_char *)ip6addr)[14]; \
|
||||
(enaddr)[5] = ((const u_char *)ip6addr)[15]; \
|
||||
}
|
||||
|
||||
/*
|
||||
@ -115,11 +115,10 @@ extern u_char ether_ipmulticast_max[ETHER_ADDR_LEN];
|
||||
struct llentry;
|
||||
struct ifaddr;
|
||||
|
||||
int arpresolve(struct ifnet *ifp, struct rtentry *rt,
|
||||
struct mbuf *m, struct sockaddr *dst, u_char *desten,
|
||||
struct llentry **lle);
|
||||
void arprequest(struct ifnet *, struct in_addr *, struct in_addr *,
|
||||
u_char *);
|
||||
int arpresolve(struct ifnet *ifp, struct rtentry *rt, struct mbuf *m,
|
||||
const struct sockaddr *dst, u_char *desten, struct llentry **lle);
|
||||
void arprequest(struct ifnet *, const struct in_addr *,
|
||||
const struct in_addr *, u_char *);
|
||||
void arp_ifinit(struct ifnet *, struct ifaddr *);
|
||||
void arp_ifinit2(struct ifnet *, struct ifaddr *, u_char *);
|
||||
void arp_ifscrub(struct ifnet *, uint32_t);
|
||||
|
@ -1372,7 +1372,7 @@ carp_multicast_cleanup(struct carp_if *cif, sa_family_t sa)
|
||||
}
|
||||
|
||||
int
|
||||
carp_output(struct ifnet *ifp, struct mbuf *m, struct sockaddr *sa)
|
||||
carp_output(struct ifnet *ifp, struct mbuf *m, const struct sockaddr *sa)
|
||||
{
|
||||
struct m_tag *mtag;
|
||||
struct carp_softc *sc;
|
||||
|
@ -147,7 +147,8 @@ void carp_detach(struct ifaddr *);
|
||||
void carp_carpdev_state(struct ifnet *);
|
||||
void carp_input (struct mbuf *, int);
|
||||
int carp6_input (struct mbuf **, int *, int);
|
||||
int carp_output (struct ifnet *, struct mbuf *, struct sockaddr *);
|
||||
int carp_output (struct ifnet *, struct mbuf *,
|
||||
const struct sockaddr *);
|
||||
int carp_master(struct ifaddr *);
|
||||
int carp_iamatch(struct ifaddr *, uint8_t **);
|
||||
struct ifaddr *carp_iamatch6(struct ifnet *, struct in6_addr *);
|
||||
@ -166,7 +167,7 @@ extern int (*carp_master_p)(struct ifaddr *);
|
||||
extern int (*carp_forus_p)(struct ifnet *, u_char *);
|
||||
/* net/if_ethersubr.c */
|
||||
extern int (*carp_output_p)(struct ifnet *, struct mbuf *,
|
||||
struct sockaddr *);
|
||||
const struct sockaddr *);
|
||||
/* net/rtsock.c */
|
||||
extern int (*carp_get_vhid_p)(struct ifaddr *);
|
||||
#ifdef INET
|
||||
|
@ -622,7 +622,8 @@ passout:
|
||||
* to avoid confusing lower layers.
|
||||
*/
|
||||
m->m_flags &= ~(M_PROTOFLAGS);
|
||||
error = (*ifp->if_output)(ifp, m, (struct sockaddr *)gw, ro);
|
||||
error = (*ifp->if_output)(ifp, m,
|
||||
(const struct sockaddr *)gw, ro);
|
||||
goto done;
|
||||
}
|
||||
|
||||
@ -656,7 +657,7 @@ passout:
|
||||
m->m_flags &= ~(M_PROTOFLAGS);
|
||||
|
||||
error = (*ifp->if_output)(ifp, m,
|
||||
(struct sockaddr *)gw, ro);
|
||||
(const struct sockaddr *)gw, ro);
|
||||
} else
|
||||
m_freem(m);
|
||||
}
|
||||
|
@ -81,7 +81,7 @@ __FBSDID("$FreeBSD$");
|
||||
#define ND6_SLOWTIMER_INTERVAL (60 * 60) /* 1 hour */
|
||||
#define ND6_RECALC_REACHTM_INTERVAL (60 * 120) /* 2 hours */
|
||||
|
||||
#define SIN6(s) ((struct sockaddr_in6 *)s)
|
||||
#define SIN6(s) ((const struct sockaddr_in6 *)(s))
|
||||
|
||||
/* timer values */
|
||||
VNET_DEFINE(int, nd6_prune) = 1; /* walk list every 1 seconds */
|
||||
@ -2156,7 +2156,7 @@ nd6_need_cache(struct ifnet *ifp)
|
||||
*/
|
||||
int
|
||||
nd6_storelladdr(struct ifnet *ifp, struct mbuf *m,
|
||||
struct sockaddr *dst, u_char *desten, struct llentry **lle)
|
||||
const struct sockaddr *dst, u_char *desten, struct llentry **lle)
|
||||
{
|
||||
struct llentry *ln;
|
||||
|
||||
|
@ -417,7 +417,7 @@ int nd6_output_flush(struct ifnet *, struct ifnet *, struct mbuf *,
|
||||
struct sockaddr_in6 *, struct route *);
|
||||
int nd6_need_cache(struct ifnet *);
|
||||
int nd6_storelladdr(struct ifnet *, struct mbuf *,
|
||||
struct sockaddr *, u_char *, struct llentry **);
|
||||
const struct sockaddr *, u_char *, struct llentry **);
|
||||
|
||||
/* nd6_nbr.c */
|
||||
void nd6_na_input(struct mbuf *, int, int);
|
||||
|
@ -113,7 +113,7 @@ log_dummy(struct ifnet *ifp, u_long cmd, caddr_t addr)
|
||||
|
||||
static int
|
||||
ipfw_log_output(struct ifnet *ifp, struct mbuf *m,
|
||||
struct sockaddr *dst, struct route *ro)
|
||||
const struct sockaddr *dst, struct route *ro)
|
||||
{
|
||||
if (m != NULL)
|
||||
FREE_PKT(m);
|
||||
|
@ -82,8 +82,8 @@ __FBSDID("$FreeBSD$");
|
||||
#define DPRINTF(x)
|
||||
#endif
|
||||
|
||||
static int pflogoutput(struct ifnet *, struct mbuf *, struct sockaddr *,
|
||||
struct route *);
|
||||
static int pflogoutput(struct ifnet *, struct mbuf *,
|
||||
const struct sockaddr *, struct route *);
|
||||
static void pflogattach(int);
|
||||
static int pflogioctl(struct ifnet *, u_long, caddr_t);
|
||||
static void pflogstart(struct ifnet *);
|
||||
@ -169,7 +169,7 @@ pflogstart(struct ifnet *ifp)
|
||||
}
|
||||
|
||||
static int
|
||||
pflogoutput(struct ifnet *ifp, struct mbuf *m, struct sockaddr *dst,
|
||||
pflogoutput(struct ifnet *ifp, struct mbuf *m, const struct sockaddr *dst,
|
||||
struct route *rt)
|
||||
{
|
||||
m_freem(m);
|
||||
|
@ -255,8 +255,8 @@ static int pfsync_clone_create(struct if_clone *, int, caddr_t);
|
||||
static void pfsync_clone_destroy(struct ifnet *);
|
||||
static int pfsync_alloc_scrub_memory(struct pfsync_state_peer *,
|
||||
struct pf_state_peer *);
|
||||
static int pfsyncoutput(struct ifnet *, struct mbuf *, struct sockaddr *,
|
||||
struct route *);
|
||||
static int pfsyncoutput(struct ifnet *, struct mbuf *,
|
||||
const struct sockaddr *, struct route *);
|
||||
static int pfsyncioctl(struct ifnet *, u_long, caddr_t);
|
||||
|
||||
static int pfsync_defer(struct pf_state *, struct mbuf *);
|
||||
@ -1247,7 +1247,7 @@ pfsync_in_error(struct pfsync_pkt *pkt, struct mbuf *m, int offset, int count)
|
||||
}
|
||||
|
||||
static int
|
||||
pfsyncoutput(struct ifnet *ifp, struct mbuf *m, struct sockaddr *dst,
|
||||
pfsyncoutput(struct ifnet *ifp, struct mbuf *m, const struct sockaddr *dst,
|
||||
struct route *rt)
|
||||
{
|
||||
m_freem(m);
|
||||
|
Loading…
x
Reference in New Issue
Block a user