Index: sys/netpfil/ipfw/ip_fw2.c =================================================================== --- sys/netpfil/ipfw/ip_fw2.c (revision 320065) +++ sys/netpfil/ipfw/ip_fw2.c (working copy) @@ -467,6 +467,19 @@ verify_path(struct in_addr src, struct ifnet *ifp, #endif /* __FreeBSD__ */ } +/* + * Return 1 if an internet address is configured on one of our interfaces. + */ +static int +ipfw_localip(struct in_addr addr) +{ + + if (addr.s_addr == INADDR_BROADCAST || + addr.s_addr == INADDR_ANY) + return (0); + return (in_localip(addr)); +} + #ifdef INET6 /* * ipv6 specific rules here... @@ -1602,10 +1615,7 @@ do { \ case O_IP_SRC_ME: if (is_ipv4) { - struct ifnet *tif; - - INADDR_TO_IFP(src_ip, tif); - match = (tif != NULL); + match = ipfw_localip(src_ip); break; } #ifdef INET6 @@ -1641,10 +1651,7 @@ do { \ case O_IP_DST_ME: if (is_ipv4) { - struct ifnet *tif; - - INADDR_TO_IFP(dst_ip, tif); - match = (tif != NULL); + match = ipfw_localip(dst_ip); break; } #ifdef INET6