git: f36292f010fc - main - bridge: define VLANTAGOF correctly
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Thu, 10 Apr 2025 18:53:36 UTC
The branch main has been updated by kp:
URL: https://cgit.FreeBSD.org/src/commit/?id=f36292f010fcc6391605182f2973fdc12a3bd15f
commit f36292f010fcc6391605182f2973fdc12a3bd15f
Author: Lexi Winter <lexi@hemlock.eden.le-fay.org>
AuthorDate: 2025-04-04 15:05:01 +0000
Commit: Kristof Provost <kp@FreeBSD.org>
CommitDate: 2025-04-10 16:51:50 +0000
bridge: define VLANTAGOF correctly
to avoid strange precedence errors, enclose the macro body in
parentheses. this fixes constructs like: if (VLANTAGOF(m) == i)
Reviewed by: kp
---
sys/net/if_bridge.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/sys/net/if_bridge.c b/sys/net/if_bridge.c
index fdfec024ef07..0dd261e6529b 100644
--- a/sys/net/if_bridge.c
+++ b/sys/net/if_bridge.c
@@ -424,7 +424,7 @@ static void bridge_linkcheck(struct bridge_softc *sc);
* to indicate untagged frames.
*/
#define VLANTAGOF(_m) \
- (_m->m_flags & M_VLANTAG) ? EVL_VLANOFTAG(_m->m_pkthdr.ether_vtag) : DOT1Q_VID_NULL
+ ((_m->m_flags & M_VLANTAG) ? EVL_VLANOFTAG(_m->m_pkthdr.ether_vtag) : DOT1Q_VID_NULL)
static struct bstp_cb_ops bridge_ops = {
.bcb_state = bridge_state_change,