Index: sys/netinet/if_ether.c =================================================================== RCS file: /cvs/src/sys/netinet/if_ether.c,v retrieving revision 1.55 diff -u -r1.55 if_ether.c --- sys/netinet/if_ether.c 7 Dec 2004 20:38:46 -0000 1.55 +++ sys/netinet/if_ether.c 30 Dec 2004 03:37:27 -0000 @@ -350,7 +350,7 @@ bcopy((caddr_t)enaddr, (caddr_t)ea->arp_sha, sizeof(ea->arp_sha)); bcopy((caddr_t)sip, (caddr_t)ea->arp_spa, sizeof(ea->arp_spa)); bcopy((caddr_t)tip, (caddr_t)ea->arp_tpa, sizeof(ea->arp_tpa)); - sa.sa_family = AF_UNSPEC; + sa.sa_family = pseudo_AF_HDRCMPLT; sa.sa_len = sizeof(sa); (*ifp->if_output)(ifp, m, &sa, (struct rtentry *)0); } @@ -436,6 +436,11 @@ arprequest(&ac->ac_if, &(SIN(rt->rt_ifa->ifa_addr)->sin_addr.s_addr), &(SIN(dst)->sin_addr.s_addr), +#if NCARP > 0 + (rt->rt_ifp->if_type == IFT_CARP) ? + ((struct arpcom *) rt->rt_ifp->if_softc + )->ac_enaddr : +#endif ac->ac_enaddr); else { rt->rt_flags |= RTF_REJECT; @@ -555,14 +560,6 @@ m->m_pkthdr.rcvif->if_bridge == ia->ia_ifp->if_bridge) bridge_ia = ia; #endif - -#if NCARP > 0 - if (ac->ac_if.if_carp && ac->ac_if.if_type != IFT_CARP) { - if (carp_iamatch(ac->ac_if.if_carp, ia, - &isaddr, &enaddr)) - break; - } -#endif } #if NBRIDGE > 0 @@ -698,7 +695,7 @@ bcopy(ea->arp_tha, eh->ether_dhost, sizeof(eh->ether_dhost)); bcopy(enaddr, eh->ether_shost, sizeof(eh->ether_shost)); eh->ether_type = htons(ETHERTYPE_ARP); - sa.sa_family = AF_UNSPEC; + sa.sa_family = pseudo_AF_HDRCMPLT; sa.sa_len = sizeof(sa); (*ac->ac_if.if_output)(&ac->ac_if, m, &sa, (struct rtentry *)0); return; @@ -910,7 +907,7 @@ sizeof(ea->arp_sha)); bcopy((caddr_t)ac->ac_enaddr, (caddr_t)ea->arp_tha, sizeof(ea->arp_tha)); - sa.sa_family = AF_UNSPEC; + sa.sa_family = pseudo_AF_HDRCMPLT; sa.sa_len = sizeof(sa); ifp->if_output(ifp, m, &sa, (struct rtentry *)0); } Index: sys/netinet/ip_carp.c =================================================================== RCS file: /cvs/src/sys/netinet/ip_carp.c,v retrieving revision 1.88 diff -u -r1.88 ip_carp.c --- sys/netinet/ip_carp.c 22 Dec 2004 06:04:33 -0000 1.88 +++ sys/netinet/ip_carp.c 30 Dec 2004 03:37:41 -0000 @@ -729,7 +729,7 @@ ifp->if_softc = sc; snprintf(ifp->if_xname, sizeof ifp->if_xname, "%s%d", ifc->ifc_name, unit); - ifp->if_flags = IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST | IFF_NOARP; + ifp->if_flags = IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST; ifp->if_ioctl = carp_ioctl; ifp->if_start = carp_start; ifp->if_output = carp_output; @@ -2023,9 +2023,27 @@ struct rtentry *rt) { struct ifnet *ifp0 = ((struct carp_softc *)ifp->if_softc)->sc_carpdev; - if (ifp0) + if (ifp0) { + struct m_tag *mtag; + + /* Tag packet for carp_fix_lladdr if not already tagged */ + mtag = m_tag_find(m, PACKET_TAG_CARP, NULL); + if (mtag == NULL) { + mtag = m_tag_get(PACKET_TAG_CARP, + sizeof(struct ifnet *), M_NOWAIT); + if (mtag == NULL) { + m_freem(m); + ((struct carp_softc *)ifp->if_softc + )->sc_if.if_oerrors++; + carpstats.carps_onomem++; + return (ENOMEM); + } + bcopy(&ifp, (caddr_t)(mtag + 1), + sizeof(struct ifnet *)); + m_tag_prepend(m, mtag); + } return (ifp0->if_output(ifp, m, sa, rt)); - else + } else return (EINVAL); } Index: usr.sbin/arp/arp.c =================================================================== RCS file: /cvs/src/usr.sbin/arp/arp.c,v retrieving revision 1.30 diff -u -r1.30 arp.c --- usr.sbin/arp/arp.c 27 Jun 2003 22:11:39 -0000 1.30 +++ usr.sbin/arp/arp.c 30 Dec 2004 03:37:50 -0000 @@ -303,7 +303,7 @@ !(rtm->rtm_flags & RTF_GATEWAY)) { switch (sdl->sdl_type) { case IFT_ETHER: case IFT_FDDI: case IFT_ISO88023: - case IFT_ISO88024: case IFT_ISO88025: + case IFT_ISO88024: case IFT_ISO88025: case IFT_CARP: goto overwrite; } } @@ -384,7 +384,7 @@ !(rtm->rtm_flags & RTF_GATEWAY)) { switch (sdl->sdl_type) { case IFT_ETHER: case IFT_FDDI: case IFT_ISO88023: - case IFT_ISO88024: case IFT_ISO88025: + case IFT_ISO88024: case IFT_ISO88025: case IFT_CARP: goto delete; } }