Relax restriction on direct tx to child ports

Lagg(4) restricts the type of packet that may be sent directly to a child
port, to avoid undesired output from accidental misconfiguration.
Previously only ETHERTYPE_PAE was permitted.

BPF writes to a lagg(4) child port are presumably intentional, so just
allow them, while still blocking other packets that should take the
aggregation path.

PR:		kern/138620
Approved by:	thompsa@
This commit is contained in:
Ed Maste 2012-05-03 01:41:12 +00:00
parent 9d64a0ce19
commit 6107adc3f5
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=234936

View file

@ -764,28 +764,18 @@ lagg_port_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data)
return (EINVAL);
}
/*
* For direct output to child ports.
*/
static int
lagg_port_output(struct ifnet *ifp, struct mbuf *m,
struct sockaddr *dst, struct route *ro)
{
struct lagg_port *lp = ifp->if_lagg;
struct ether_header *eh;
short type = 0;
switch (dst->sa_family) {
case pseudo_AF_HDRCMPLT:
case AF_UNSPEC:
eh = (struct ether_header *)dst->sa_data;
type = eh->ether_type;
break;
}
/*
* Only allow ethernet types required to initiate or maintain the link,
* aggregated frames take a different path.
*/
switch (ntohs(type)) {
case ETHERTYPE_PAE: /* EAPOL PAE/802.1x */
return ((*lp->lp_output)(ifp, m, dst, ro));
}