Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F160268616
D35689.id107651.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D35689.id107651.diff
View Options
Index: /usr/src/sys/netinet/ip_carp.c
===================================================================
--- /usr/src/sys/netinet/ip_carp.c
+++ /usr/src/sys/netinet/ip_carp.c
@@ -287,8 +287,8 @@
} while (0)
#define IFNET_FOREACH_IFA(ifp, ifa) \
- CK_STAILQ_FOREACH((ifa), &(ifp)->if_addrhead, ifa_link) \
- if ((ifa)->ifa_carp != NULL)
+ CK_STAILQ_FOREACH((ifa), &(ifp)->if_addrhead, ifa_link)
+// if ((ifa)->ifa_carp != NULL)
#define CARP_FOREACH_IFA(sc, ifa) \
CARP_LOCK_ASSERT(sc); \
@@ -669,23 +669,28 @@
error = 0;
match = NULL;
IFNET_FOREACH_IFA(ifp, ifa) {
- if (match == NULL && ifa->ifa_carp != NULL &&
+ if ((ifa)->ifa_carp != NULL &&
+ match == NULL && ifa->ifa_carp != NULL &&
ifa->ifa_addr->sa_family == af &&
ifa->ifa_carp->sc_vhid == ch->carp_vhid)
match = ifa;
- if (ch->carp_vhid == 0 && carp_source_is_self(m, ifa, af))
+ if (carp_source_is_self(m, ifa, af))
error = ELOOP;
}
+ if (match && error == ELOOP) error = EEXIST;
ifa = error ? NULL : match;
if (ifa != NULL)
ifa_ref(ifa);
if (ifa == NULL) {
- if (error == ELOOP) {
+ switch (error) {
+ case ELOOP:
CARP_DEBUG("dropping looped packet on interface %s\n",
ifp->if_xname);
CARPSTATS_INC(carps_badif); /* ??? */
- } else {
+ break;
+ case EEXIST: break; // silently discard
+ default:
CARPSTATS_INC(carps_badvhid);
}
m_freem(m);
@@ -1218,7 +1223,8 @@
NET_EPOCH_ASSERT();
IFNET_FOREACH_IFA(ifp, ifa)
- if (ifa->ifa_addr->sa_family == AF_INET6 &&
+ if ((ifa)->ifa_carp != NULL &&
+ ifa->ifa_addr->sa_family == AF_INET6 &&
IN6_ARE_ADDR_EQUAL(taddr, IFA_IN6(ifa))) {
struct carp_softc *sc = ifa->ifa_carp;
struct m_tag *mtag;
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Tue, Jun 23, 6:19 PM (12 h, 38 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
34255898
Default Alt Text
D35689.id107651.diff (1 KB)
Attached To
Mode
D35689: Fix CARP echo back for ESX vSwitch
Attached
Detach File
Event Timeline
Log In to Comment