/*
- * Copyright (c) 2004-2011 Apple Inc. All rights reserved.
+ * Copyright (c) 2004-2012 Apple Inc. All rights reserved.
*
* @APPLE_OSREFERENCE_LICENSE_HEADER_START@
*
/* leave room for ethernet header */
size = length + sizeof(struct ether_header);
if (size > (int)MHLEN) {
- /* XXX doesn't handle large payloads */
- printf("bond: packet_buffer_allocate size %d > max %u\n", size, MHLEN);
- return (NULL);
+ if (size > (int)MCLBYTES) {
+ printf("bond: packet_buffer_allocate size %d > max %u\n",
+ size, MCLBYTES);
+ return (NULL);
+ }
+ m = m_getcl(M_WAITOK, MT_DATA, M_PKTHDR);
+ } else {
+ m = m_gethdr(M_WAITOK, MT_DATA);
}
- m = m_gethdr(M_WAITOK, MT_DATA);
if (m == NULL) {
return (NULL);
}
uint32_t h;
ifbond_ref ifb;
struct ifnet * port_ifp = NULL;
+ int err;
+ struct flowadv adv = { FADV_SUCCESS };
if (m == 0) {
return (0);
}
bond_bpf_output(ifp, m, bpf_func);
- return (ifnet_output_raw(port_ifp, PF_BOND, m));
+ err = dlil_output(port_ifp, PF_BOND, m, NULL, NULL, 1, &adv);
+
+ if (err == 0) {
+ if (adv.code == FADV_FLOW_CONTROLLED) {
+ err = EQFULL;
+ } else if (adv.code == FADV_SUSPENDED) {
+ err = EQSUSPENDED;
+ }
+ }
+
+ return (err);
done:
bond_unlock();
bond_set_promisc(__unused struct ifnet *ifp)
{
int error = 0;
- /*
- * The benefit of doing this currently does not warrant
- * the added code complexity. Do nothing and return.
- */
return (error);
}