rem: if (M_LEADINGSPACE(buf) >= sizeof(struct ether_header)) {
add: if (M_LEADINGSPACE(buf) >= (int32) sizeof(struct ether_header)) {
context: int ether_output(struct ifnet *ifp, struct mbuf *buf, struct sockaddr *dst,		 struct rtentry *rt0){	struct ether_header *eh;	struct rtentry *rt;	struct arpcom *ac = (struct arpcom*)ifp;	uint8 edst[6];	int off;	uint16 type;	struct mbuf *mcopy = NULL;	int error = 0;		if ((ifp->if_flags & (IFF_UP | IFF_RUNNING)) != (IFF_UP | IFF_RUNNING))		senderr(ENETDOWN);	if ((rt = rt0)) {		if ((rt->rt_flags & RTF_UP) == 0) {			if ((rt0 = rt = rtalloc1(dst, 1)) != NULL)				rt->rt_refcnt--;			else				senderr(EHOSTUNREACH);		}		if (rt->rt_flags & RTF_GATEWAY) {			if (!rt->rt_gwroute)				goto lookup;			if (((rt = rt->rt_gwroute)->rt_flags & RTF_UP) == 0) {				rtfree(rt0);				rt = rt0;lookup:					rt->rt_gwroute = rtalloc1(rt->rt_gateway, 1);							if ((rt = rt->rt_gwroute) == NULL)					senderr(EHOSTUNREACH);			}		}		if (rt->rt_flags & RTF_REJECT)			if (rt->rt_expire == 0 ||			    rt->rt_expire > real_time_clock()) {			/* XXX - add test for expired here... */			printf("flags & RTF_REJECT\n");			printf("Error: %s\n", rt == rt0 ? "EHOSTDOWN" : "EHOSTUNREACH");			senderr(rt == rt0 ? EHOSTDOWN : EHOSTUNREACH);		}	}	switch (dst->sa_family) {		case AF_INET:			if (!arpresolve(ac, rt, buf, dst, edst)) {				return 0;			}			if ((buf->m_flags & M_BCAST) && (ifp->if_flags & IFF_SIMPLEX))				mcopy = m_copym(buf, 0, (int)M_COPYALL);			off = buf->m_pkthdr.len - buf->m_len;			type = ETHERTYPE_IP;			break;		case AF_UNSPEC:			eh = (struct ether_header*)dst->sa_data;			memcpy((caddr_t)edst, (caddr_t)eh->ether_dhost, sizeof(edst));			type = eh->ether_type;			break;	}	/* Hmmm, can't find a good way of getting this to work without expanding the * macro for the kernel case, so it's here expanded. I've found that using the * directly causes segafults. Bear in mind we want ALL allocation/free actions * to take place in the core to keep as small a memory footprint as possible. */#define M_LEADINGSPACE(m) \        ((m)->m_flags & M_EXT ? (m)->m_data - (m)->m_ext.ext_buf : \         (m)->m_flags & M_PKTHDR ? (m)->m_data - (m)->m_pktdat : \         (m)->m_data - (m)->m_dat)        if (M_LEADINGSPACE(buf) >= sizeof(struct ether_header)) {                buf->m_data -= sizeof(struct ether_header);                buf->m_len += sizeof(struct ether_header);        } else                 buf = m_prepend(buf, sizeof(struct ether_header));        if (buf && buf->m_flags & M_PKTHDR)                buf->m_pkthdr.len += sizeof(struct ether_header);	if (buf == NULL)		senderr(ENOMEM);	eh = mtod(buf, struct ether_header*);	type = htons(type);	memcpy(&eh->ether_type, &type, sizeof(eh->ether_type));	memcpy(&eh->ether_dhost, edst, sizeof(edst));	memcpy(&eh->ether_shost, ac->ac_enaddr, sizeof(eh->ether_shost));	IFQ_ENQUEUE(ifp->txq, buf);	return error;bad:	if (buf)		m_free(buf);	printf("ether_output: returning %d\n", error);	return error;}