1
0
mirror of https://git.FreeBSD.org/src.git synced 2025-01-13 14:40:22 +00:00

try rtinit() only when the route is not installed.

this allows, e.g., duplicated attempts of 'ifconfig lo0 ::1'
like for IPv4.

Obtained from:	KAME
MFC after:	1 week
This commit is contained in:
Hajimu UMEMOTO 2004-01-10 08:59:21 +00:00
parent e29ef13f6c
commit 803434325e
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=124337

View File

@ -1527,12 +1527,15 @@ in6_ifinit(ifp, ia, sin6, newhost)
/*
* Special case:
* If the destination address is specified for a point-to-point
* If a new destination address is specified for a point-to-point
* interface, install a route to the destination as an interface
* direct route.
* XXX: the logic below rejects assigning multiple addresses on a p2p
* interface that share a same destination.
*/
plen = in6_mask2len(&ia->ia_prefixmask.sin6_addr, NULL); /* XXX */
if (plen == 128 && ia->ia_dstaddr.sin6_family == AF_INET6) {
if (!(ia->ia_flags & IFA_ROUTE) && plen == 128 &&
ia->ia_dstaddr.sin6_family == AF_INET6) {
if ((error = rtinit(&(ia->ia_ifa), (int)RTM_ADD,
RTF_UP | RTF_HOST)) != 0)
return (error);