-/* $OpenBSD: if_ethersubr.c,v 1.196 2015/05/11 08:41:43 mpi Exp $ */
+/* $OpenBSD: if_ethersubr.c,v 1.197 2015/05/13 08:16:01 mpi Exp $ */
/* $NetBSD: if_ethersubr.c,v 1.19 1996/05/07 02:40:30 thorpej Exp $ */
/*
#include <sys/syslog.h>
#include <sys/timeout.h>
-#include <crypto/siphash.h> /* required by if_trunk.h */
-
#include <net/if.h>
#include <net/netisr.h>
#include <net/route.h>
#include <net/if_pppoe.h>
#endif
-#include "trunk.h"
-#if NTRUNK > 0
-#include <net/if_trunk.h>
-#endif
-
#ifdef INET6
#include <netinet6/in6_var.h>
#include <netinet6/nd6.h>
}
#endif
-#if NTRUNK > 0
- /* restrict transmission on trunk members to bpf only */
- if (ifp->if_type == IFT_IEEE8023ADLAG &&
- (m_tag_find(m, PACKET_TAG_DLT, NULL) == NULL))
- senderr(EBUSY);
-#endif
-
esrc = ac->ac_enaddr;
#if NCARP > 0
-/* $OpenBSD: if_trunk.c,v 1.96 2015/05/11 08:41:43 mpi Exp $ */
+/* $OpenBSD: if_trunk.c,v 1.97 2015/05/13 08:16:01 mpi Exp $ */
/*
* Copyright (c) 2005, 2006, 2007 Reyk Floeter <reyk@openbsd.org>
void trunk_port_state(void *);
void trunk_port_ifdetach(void *);
int trunk_port_ioctl(struct ifnet *, u_long, caddr_t);
+int trunk_port_output(struct ifnet *, struct mbuf *, struct sockaddr *,
+ struct rtentry *);
struct trunk_port *trunk_port_get(struct trunk_softc *, struct ifnet *);
int trunk_port_checkstacking(struct trunk_softc *);
void trunk_port2req(struct trunk_port *, struct trunk_reqport *);
void trunk_ether_purgemulti(struct trunk_softc *);
int trunk_ether_cmdmulti(struct trunk_port *, u_long);
int trunk_ioctl_allports(struct trunk_softc *, u_long, caddr_t);
+int trunk_input(struct mbuf *, void *);
void trunk_start(struct ifnet *);
void trunk_init(struct ifnet *);
void trunk_stop(struct ifnet *);
tp->tp_watchdog = ifp->if_watchdog;
ifp->if_watchdog = trunk_port_watchdog;
+ tp->tp_output = ifp->if_output;
+ ifp->if_output = trunk_port_output;
+
tp->tp_if = ifp;
tp->tp_trunk = tr;
ifp->if_watchdog = tp->tp_watchdog;
ifp->if_ioctl = tp->tp_ioctl;
+ ifp->if_output = tp->tp_output;
ifp->if_tp = NULL;
hook_disestablish(ifp->if_linkstatehooks, tp->lh_cookie);
return (error);
}
+int
+trunk_port_output(struct ifnet *ifp, struct mbuf *m, struct sockaddr *dst,
+ struct rtentry *rt)
+{
+ /* restrict transmission on trunk members to bpf only */
+ if (ifp->if_type == IFT_IEEE8023ADLAG &&
+ (m_tag_find(m, PACKET_TAG_DLT, NULL) == NULL)) {
+ m_freem(m);
+ return (EBUSY);
+ }
+
+ return (ether_output(ifp, m, dst, rt));
+}
+
void
trunk_port_ifdetach(void *arg)
{
-/* $OpenBSD: if_trunk.h,v 1.20 2015/05/11 08:41:43 mpi Exp $ */
+/* $OpenBSD: if_trunk.h,v 1.21 2015/05/13 08:16:01 mpi Exp $ */
/*
* Copyright (c) 2005, 2006, 2007 Reyk Floeter <reyk@openbsd.org>
/* Redirected callbacks */
void (*tp_watchdog)(struct ifnet *);
int (*tp_ioctl)(struct ifnet *, u_long, caddr_t);
+ int (*tp_output)(struct ifnet *, struct mbuf *, struct sockaddr *,
+ struct rtentry *);
SLIST_ENTRY(trunk_port) tp_entries;
};