View | Details | Raw Unified | Return to bug 220078 | Differences between
and this patch

Collapse All | Expand All

(-)sys/netpfil/ipfw/ip_fw2.c (-8 / +15 lines)
Lines 467-472 verify_path(struct in_addr src, struct ifnet *ifp, Link Here
467
#endif /* __FreeBSD__ */
467
#endif /* __FreeBSD__ */
468
}
468
}
469
469
470
/*
471
 * Return 1 if an internet address is configured on one of our interfaces.
472
 */
473
static int
474
ipfw_localip(struct in_addr addr)
475
{
476
477
	if (addr.s_addr == INADDR_BROADCAST ||
478
	    addr.s_addr == INADDR_ANY)
479
		return (0);
480
	return (in_localip(addr));
481
}
482
470
#ifdef INET6
483
#ifdef INET6
471
/*
484
/*
472
 * ipv6 specific rules here...
485
 * ipv6 specific rules here...
Lines 1602-1611 do { \ Link Here
1602
1615
1603
			case O_IP_SRC_ME:
1616
			case O_IP_SRC_ME:
1604
				if (is_ipv4) {
1617
				if (is_ipv4) {
1605
					struct ifnet *tif;
1618
					match = ipfw_localip(src_ip);
1606
1607
					INADDR_TO_IFP(src_ip, tif);
1608
					match = (tif != NULL);
1609
					break;
1619
					break;
1610
				}
1620
				}
1611
#ifdef INET6
1621
#ifdef INET6
Lines 1641-1650 do { \ Link Here
1641
1651
1642
			case O_IP_DST_ME:
1652
			case O_IP_DST_ME:
1643
				if (is_ipv4) {
1653
				if (is_ipv4) {
1644
					struct ifnet *tif;
1654
					match = ipfw_localip(dst_ip);
1645
1646
					INADDR_TO_IFP(dst_ip, tif);
1647
					match = (tif != NULL);
1648
					break;
1655
					break;
1649
				}
1656
				}
1650
#ifdef INET6
1657
#ifdef INET6

Return to bug 220078