#include <sys/socketvar.h>
-#include <net/if_blue.h>
#include <net/dlil.h>
#include <net/if_vlan_var.h>
#endif /* NVLAN > 0 */
-
-extern struct ifnet_blue *blue_if;
-extern struct mbuf *splitter_input(struct mbuf *, struct ifnet *);
-
static u_long lo_dlt = 0;
static ivedonethis = 0;
static u_char etherbroadcastaddr[6] = { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff };
register struct mbuf *m = *m0;
register struct rtentry *rt;
register struct ether_header *eh;
- int off, len = m->m_pkthdr.len;
int hlen; /* link layer header lenght */
struct arpcom *ac = IFP2AC(ifp);
if ((rt->rt_flags & RTF_UP) == 0) {
rt0 = rt = rtalloc1(dst_netaddr, 1, 0UL);
if (rt0)
- rt->rt_refcnt--;
+ rtunref(rt);
else
return EHOSTUNREACH;
}
printf("nd6_storelladdr failed\n");
return(0);
}
- off = m->m_pkthdr.len - m->m_len;
*(u_short *)type = htons(ETHERTYPE_IPV6);
break;
sdl->sdl_slen = 0;
e_addr = LLADDR(sdl);
ETHER_MAP_IPV6_MULTICAST(&sin6->sin6_addr, e_addr);
+#ifndef __APPLE__
printf("ether_resolvemulti AF_INET6 Adding %x:%x:%x:%x:%x:%x\n",
e_addr[0], e_addr[1], e_addr[2], e_addr[3], e_addr[4], e_addr[5]);
+#endif
*rsreq->llsa = (struct sockaddr *)sdl;
return 0;
case SIOCSIFMTU:
/*
- * Set the interface MTU.
+ * IOKit IONetworkFamily will set the right MTU according to the driver
*/
- if (ifr->ifr_mtu > ETHERMTU) {
- error = EINVAL;
- } else {
- ifp->if_mtu = ifr->ifr_mtu;
- }
- break;
+
+ return (0);
default:
return EOPNOTSUPP;
return ip_dl_tag;
}
+
+int ether_detach_inet6(struct ifnet *ifp)
+{
+ u_long ip_dl_tag = 0;
+ int stat;
+
+ stat = dlil_find_dltag(ifp->if_family, ifp->if_unit, PF_INET6, &ip_dl_tag);
+ if (stat == 0) {
+ stat = dlil_detach_protocol(ip_dl_tag);
+ if (stat) {
+ printf("WARNING: ether_detach_inet6 can't detach ip6 from interface\n");
+ }
+ }
+ return stat;
+}
+