MFC r196152

A piece of code was added to install a host route when an IPv6 interface
address is configured with a /128 prefix. This is no longer necessary due
to r192011. In fact that code conflicts with r192011. This patch removes
the host route installation when detecting the /128 prefix, and instead
let the code added by r192011 to install the loopback route for that IPv6
interface address.

Approved by:	re
This commit is contained in:
Qing Li 2009-08-12 20:48:50 +00:00
parent e9200ba65b
commit 747a32aaea
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/stable/8/; revision=196154

View File

@ -1750,21 +1750,12 @@ in6_ifinit(struct ifnet *ifp, struct in6_ifaddr *ia,
* interface that share the same destination.
*/
plen = in6_mask2len(&ia->ia_prefixmask.sin6_addr, NULL); /* XXX */
if (!(ia->ia_flags & IFA_ROUTE) && plen == 128) {
struct sockaddr *dstaddr;
if (!(ia->ia_flags & IFA_ROUTE) && plen == 128 &&
ia->ia_dstaddr.sin6_family == AF_INET6) {
int rtflags = RTF_UP | RTF_HOST;
/*
* use the interface address if configuring an
* interface address with a /128 prefix len
*/
if (ia->ia_dstaddr.sin6_family == AF_INET6)
dstaddr = (struct sockaddr *)&ia->ia_dstaddr;
else
dstaddr = (struct sockaddr *)&ia->ia_addr;
error = rtrequest(RTM_ADD,
(struct sockaddr *)dstaddr,
(struct sockaddr *)&ia->ia_dstaddr,
(struct sockaddr *)&ia->ia_addr,
(struct sockaddr *)&ia->ia_prefixmask,
ia->ia_flags | rtflags, NULL);