From d577d18a00085621ed1e31e461c4f186fa8631f4 Mon Sep 17 00:00:00 2001 From: Qing Li Date: Tue, 2 Feb 2010 20:38:30 +0000 Subject: [PATCH] Some of the existing ppp and vpn related scripts create and set the IP addresses of the tunnel end points to the same value. In these cases the loopback route is not installed for the local end. Verified by: avg MFC after: 5 days --- sys/netinet/in.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/sys/netinet/in.c b/sys/netinet/in.c index 4743c01a70a8..b1c51a21f409 100644 --- a/sys/netinet/in.c +++ b/sys/netinet/in.c @@ -921,6 +921,12 @@ in_ifinit(struct ifnet *ifp, struct in_ifaddr *ia, struct sockaddr_in *sin, if (ia->ia_addr.sin_addr.s_addr == INADDR_ANY) return (0); + if (ifp->if_flags & IFF_POINTOPOINT) { + if (ia->ia_dstaddr.sin_addr.s_addr == ia->ia_addr.sin_addr.s_addr) + return (0); + } + + /* * add a loopback route to self */