Page MenuHomeFreeBSD

D38410.id116644.diff
No OneTemporary

D38410.id116644.diff

diff --git a/sys/net/if_bridge.c b/sys/net/if_bridge.c
--- a/sys/net/if_bridge.c
+++ b/sys/net/if_bridge.c
@@ -2551,32 +2551,28 @@
return (m);
}
-#if (defined(INET) || defined(INET6))
-# define OR_CARP_CHECK_WE_ARE_DST(iface) \
- || ((iface)->if_carp \
- && (*carp_forus_p)((iface), eh->ether_dhost))
-# define OR_CARP_CHECK_WE_ARE_SRC(iface) \
- || ((iface)->if_carp \
- && (*carp_forus_p)((iface), eh->ether_shost))
+#if defined(INET) || defined(INET6)
+#define CARP_CHECK_WE_ARE_DST(iface) \
+ ((iface)->if_carp && (*carp_forus_p)((iface), eh->ether_dhost))
+#define CARP_CHECK_WE_ARE_SRC(iface) \
+ ((iface)->if_carp && (*carp_forus_p)((iface), eh->ether_shost))
#else
-# define OR_CARP_CHECK_WE_ARE_DST(iface)
-# define OR_CARP_CHECK_WE_ARE_SRC(iface)
+#define CARP_CHECK_WE_ARE_DST(iface) false
+#define CARP_CHECK_WE_ARE_SRC(iface) false
#endif
#ifdef INET6
-# define OR_PFIL_HOOKED_INET6 \
- || PFIL_HOOKED_IN(V_inet6_pfil_head)
+#define PFIL_HOOKED_INET6 PFIL_HOOKED_IN(V_inet6_pfil_head)
#else
-# define OR_PFIL_HOOKED_INET6
+#define PFIL_HOOKED_INET6 false
#endif
-#define GRAB_OUR_PACKETS(iface) \
- if ((iface)->if_type == IFT_GIF) \
- continue; \
- /* It is destined for us. */ \
- if (memcmp(IF_LLADDR((iface)), eh->ether_dhost, ETHER_ADDR_LEN) == 0 \
- OR_CARP_CHECK_WE_ARE_DST((iface)) \
- ) { \
+#define GRAB_OUR_PACKETS(iface) \
+ if ((iface)->if_type == IFT_GIF) \
+ continue; \
+ /* It is destined for us. */ \
+ if (memcmp(IF_LLADDR(iface), eh->ether_dhost, ETHER_ADDR_LEN) == 0 || \
+ CARP_CHECK_WE_ARE_DST(iface)) { \
if (bif->bif_flags & IFBIF_LEARNING) { \
error = bridge_rtupdate(sc, eh->ether_shost, \
vlan, bif, 0, IFBAF_DYNAMIC); \
@@ -2595,8 +2591,8 @@
if_inc_counter(bifp, IFCOUNTER_IPACKETS, 1); \
if_inc_counter(bifp, IFCOUNTER_IBYTES, m->m_pkthdr.len); \
/* Filter on the physical interface. */ \
- if (V_pfil_local_phys && (PFIL_HOOKED_IN(V_inet_pfil_head) \
- OR_PFIL_HOOKED_INET6)) { \
+ if (V_pfil_local_phys && (PFIL_HOOKED_IN(V_inet_pfil_head) || \
+ PFIL_HOOKED_INET6)) { \
if (bridge_pfil(&m, NULL, ifp, \
PFIL_IN) != 0 || m == NULL) { \
return (NULL); \
@@ -2608,9 +2604,8 @@
} \
\
/* We just received a packet that we sent out. */ \
- if (memcmp(IF_LLADDR((iface)), eh->ether_shost, ETHER_ADDR_LEN) == 0 \
- OR_CARP_CHECK_WE_ARE_SRC((iface)) \
- ) { \
+ if (memcmp(IF_LLADDR(iface), eh->ether_shost, ETHER_ADDR_LEN) == 0 || \
+ CARP_CHECK_WE_ARE_SRC(iface)) { \
m_freem(m); \
return (NULL); \
}

File Metadata

Mime Type
text/plain
Expires
Tue, Oct 6, 3:58 PM (7 h, 18 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
40304700
Default Alt Text
D38410.id116644.diff (2 KB)

Event Timeline