if (ifp->if_init)
ifp->if_init(ifp->if_softc); /* before arpwhohas */
- //
- // See if another station has *our* IP address.
- // i.e.: There is an address conflict! If a
- // conflict exists, a message is sent to the
- // console.
- //
- if (IA_SIN(ifa)->sin_addr.s_addr != 0)
- {
- /* don't bother for 0.0.0.0 */
- ac->ac_ipaddr = IA_SIN(ifa)->sin_addr;
- arpwhohas(ac, &IA_SIN(ifa)->sin_addr);
- }
-
arp_ifinit(IFP2AC(ifp), ifa);
/*
-u_long
-ether_attach_inet(struct ifnet *ifp)
+int
+ether_attach_inet(struct ifnet *ifp, u_long *dl_tag)
{
struct dlil_proto_reg_str reg;
struct dlil_demux_desc desc;
struct dlil_demux_desc desc2;
- u_long ip_dl_tag=0;
u_short en_native=ETHERTYPE_IP;
u_short arp_native=ETHERTYPE_ARP;
int stat;
int i;
- stat = dlil_find_dltag(ifp->if_family, ifp->if_unit, PF_INET, &ip_dl_tag);
+ stat = dlil_find_dltag(ifp->if_family, ifp->if_unit, PF_INET, dl_tag);
if (stat == 0)
- return ip_dl_tag;
+ return (stat);
TAILQ_INIT(®.demux_desc_head);
desc.type = DLIL_DESC_RAW;
desc2.native_type = (char *) &arp_native;
TAILQ_INSERT_TAIL(®.demux_desc_head, &desc2, next);
- stat = dlil_attach_protocol(®, &ip_dl_tag);
+ stat = dlil_attach_protocol(®, dl_tag);
if (stat) {
printf("WARNING: ether_attach_inet can't attach ip to interface\n");
return stat;
}
- return ip_dl_tag;
+ return (0);
}
-int ether_detach_inet(struct ifnet *ifp)
+int ether_detach_inet(struct ifnet *ifp, u_long dl_tag)
{
- u_long ip_dl_tag = 0;
int stat;
- stat = dlil_find_dltag(ifp->if_family, ifp->if_unit, PF_INET, &ip_dl_tag);
+ stat = dlil_find_dltag(ifp->if_family, ifp->if_unit, PF_INET, &dl_tag);
if (stat == 0) {
- stat = dlil_detach_protocol(ip_dl_tag);
+ stat = dlil_detach_protocol(dl_tag);
if (stat) {
printf("WARNING: ether_detach_inet can't detach ip from interface\n");
}