Skip to contentSkip to conversation

net: igmp: increase size of mr_ifc_count

PATCH Guenter Roeck 1 participant 1 message Aug 11, 2021

Subsystems (2)
lore
Share & tools
lore

Guenter Roeck

author Tested-by
#0 lore raw
Quoted 8 lines · Eric Dumazet

From: Eric Dumazet <[email protected]>

Some arches support cmpxchg() on 4-byte and 8-byte only. Increase mr_ifc_count width to 32bit to fix this problem.

Fixes 4a2b285e7e10 ("net: igmp: fix data-race in igmp_ifc_timer_expire()")

This patch fixes the build problems I had observed.

Thanks,
Guenter

Quoted 34 lines
---
 include/linux/inetdevice.h | 2 +-
 net/ipv4/igmp.c            | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
include/linux/inetdevice.h +1 -1
index 53aa0343bf694cb817e00ff597b52ce046e29d2c..aaf4f1b4c277c4ad38e1f0742bb480d3bb003287 100644
@@ -41,7 +41,7 @@ struct in_device {
 	unsigned long		mr_qri;		/* Query Response Interval */
 	unsigned char		mr_qrv;		/* Query Robustness Variable */
 	unsigned char		mr_gq_running;
-	unsigned char		mr_ifc_count;
+	u32			mr_ifc_count;
 	struct timer_list	mr_gq_timer;	/* general query timer */
 	struct timer_list	mr_ifc_timer;	/* interface change timer */
 
net/ipv4/igmp.c +1 -1
index a51360087b19845a28408c827032e08dabf99838..00576bae183d30518e376ad3846d4fe6025aaea7 100644
@@ -803,7 +803,7 @@ static void igmp_gq_timer_expire(struct timer_list *t)
 static void igmp_ifc_timer_expire(struct timer_list *t)
 {
 	struct in_device *in_dev = from_timer(in_dev, t, mr_ifc_timer);
-	u8 mr_ifc_count;
+	u32 mr_ifc_count;
 
 	igmpv3_send_cr(in_dev);
 restart:
Signature · 1 line
2.32.0.605.g8dce9f2422-goog