summaryrefslogtreecommitdiffstats
path: root/sys/contrib/pf
diff options
context:
space:
mode:
authormlaier <mlaier@FreeBSD.org>2007-11-21 16:08:06 +0000
committermlaier <mlaier@FreeBSD.org>2007-11-21 16:08:06 +0000
commita944d25e86e59d66a75ce7a73391be1eb074193b (patch)
tree3bc24b9e516a524e44fd532032d2718b5de8847f /sys/contrib/pf
parent46c3db4ab11e691b20ee497fb8b26b5f4d48fb16 (diff)
downloadFreeBSD-src-a944d25e86e59d66a75ce7a73391be1eb074193b.zip
FreeBSD-src-a944d25e86e59d66a75ce7a73391be1eb074193b.tar.gz
Bring back pf_if.c revs 1.8 and 1.6 also lost during last import:
- Use correct time for tzero when compiled in - Don't use bogus interface addresses on ptp-interfaces with :0 MFC after: 3 days
Diffstat (limited to 'sys/contrib/pf')
-rw-r--r--sys/contrib/pf/net/pf_if.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/sys/contrib/pf/net/pf_if.c b/sys/contrib/pf/net/pf_if.c
index eb7f37c..f62b497 100644
--- a/sys/contrib/pf/net/pf_if.c
+++ b/sys/contrib/pf/net/pf_if.c
@@ -213,7 +213,18 @@ pfi_kif_get(const char *kif_name)
bzero(kif, sizeof(*kif));
strlcpy(kif->pfik_name, kif_name, sizeof(kif->pfik_name));
+#ifdef __FreeBSD__
+ /*
+ * It seems that the value of time_second is in unintialzied state
+ * when pf sets interface statistics clear time in boot phase if pf
+ * was statically linked to kernel. Instead of setting the bogus
+ * time value have pfi_get_ifaces handle this case. In
+ * pfi_get_ifaces it uses boottime.tv_sec if it sees the time is 0.
+ */
+ kif->pfik_tzero = time_second > 1 ? time_second : 0;
+#else
kif->pfik_tzero = time_second;
+#endif
TAILQ_INIT(&kif->pfik_dynaddrs);
RB_INSERT(pfi_ifhead, &pfi_ifs, kif);
@@ -570,6 +581,18 @@ pfi_instance_add(struct ifnet *ifp, int net, int flags)
af = ia->ifa_addr->sa_family;
if (af != AF_INET && af != AF_INET6)
continue;
+#ifdef __FreeBSD__
+ /*
+ * XXX: For point-to-point interfaces, (ifname:0) and IPv4,
+ * jump over addresses without a proper route to work
+ * around a problem with ppp not fully removing the
+ * address used during IPCP.
+ */
+ if ((ifp->if_flags & IFF_POINTOPOINT) &&
+ !(ia->ifa_flags & IFA_ROUTE) &&
+ (flags & PFI_AFLAG_NOALIAS) && (af == AF_INET))
+ continue;
+#endif
if ((flags & PFI_AFLAG_BROADCAST) && af == AF_INET6)
continue;
if ((flags & PFI_AFLAG_BROADCAST) &&
OpenPOWER on IntegriCloud