Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F148990558
D29121.id85310.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
2 KB
Referenced Files
None
Subscribers
None
D29121.id85310.diff
View Options
Index: sys/netinet6/in6.c
===================================================================
--- sys/netinet6/in6.c
+++ sys/netinet6/in6.c
@@ -1294,13 +1294,27 @@
return (error);
}
+static bool
+ifa_is_p2p(struct in6_ifaddr *ia)
+{
+ int plen;
+
+ plen = in6_mask2len(&ia->ia_prefixmask.sin6_addr, NULL); /* XXX */
+
+ if ((plen == 128) && (ia->ia_dstaddr.sin6_family == AF_INET6) &&
+ !IN6_ARE_ADDR_EQUAL(&ia->ia_addr.sin6_addr, &ia->ia_dstaddr.sin6_addr))
+ return (true);
+
+ return (false);
+}
+
void
in6_purgeaddr(struct ifaddr *ifa)
{
struct ifnet *ifp = ifa->ifa_ifp;
struct in6_ifaddr *ia = (struct in6_ifaddr *) ifa;
struct in6_multi_mship *imm;
- int plen, error;
+ int error;
if (ifa->ifa_carp)
(*carp_detach_p)(ifa, false);
@@ -1328,10 +1342,7 @@
free(imm, M_IP6MADDR);
}
/* Check if we need to remove p2p route */
- plen = in6_mask2len(&ia->ia_prefixmask.sin6_addr, NULL); /* XXX */
- if (ia->ia_dstaddr.sin6_family != AF_INET6)
- plen = 0;
- if ((ia->ia_flags & IFA_ROUTE) && plen == 128) {
+ if ((ia->ia_flags & IFA_ROUTE) && ifa_is_p2p(ia)) {
error = in6_handle_dstaddr_rtrequest(RTM_DELETE, ia);
if (error != 0)
log(LOG_INFO, "%s: err=%d, destination address delete "
@@ -1434,7 +1445,7 @@
in6_notify_ifa(struct ifnet *ifp, struct in6_ifaddr *ia,
struct in6_aliasreq *ifra, int hostIsNew)
{
- int error = 0, plen, ifacount = 0;
+ int error = 0, ifacount = 0;
struct ifaddr *ifa;
struct sockaddr_in6 *pdst;
char ip6buf[INET6_ADDRSTRLEN];
@@ -1487,14 +1498,7 @@
* XXX: the logic below rejects assigning multiple addresses on a p2p
* interface that share the same destination.
*/
- plen = in6_mask2len(&ia->ia_prefixmask.sin6_addr, NULL); /* XXX */
- if (!(ia->ia_flags & IFA_ROUTE) && plen == 128 &&
- ia->ia_dstaddr.sin6_family == AF_INET6) {
- /*
- * Handle the case for ::1 .
- */
- if (ifp->if_flags & IFF_LOOPBACK)
- ia->ia_flags |= IFA_RTSELF;
+ if (!(ia->ia_flags & IFA_ROUTE) && ifa_is_p2p(ia)) {
error = in6_handle_dstaddr_rtrequest(RTM_ADD, ia);
if (error)
goto done;
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sun, Mar 22, 2:29 PM (36 m, 13 s)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
30124871
Default Alt Text
D29121.id85310.diff (2 KB)
Attached To
Mode
D29121: Fix 'in6_purgeaddr: err=65, destination address delete failed' message.
Attached
Detach File
Event Timeline
Log In to Comment