haibbo / improxy

IGMP/MLD Proxy which supports IGMPv3 and MLDv2 completely
27 stars 14 forks source link

imp_get_mfcc_ttls() and iface index #5

Open ghost opened 6 years ago

ghost commented 6 years ago

Function imp_get_mfcc_ttls() checks that

p_if->if_index < length

where length is MAXVIFS (32 for linux).

But interface index may be greater than this value. SOHO routers may have 40 interfaces (e.g. Realtek-based routers with real and virtual wifi interfaces, wds etc). As a result, eth1 (wan) and br0 (lan) have indexes greater than 32 and improxy doesn't call imp_membership_db_mfc_add() because imp_get_mfcc_ttls returns 0.

I don't quite understand this limitation. I removed it for my device. But as a generic solution, maybe you should check the number of interfaces for which you call k_add_ip6_mif or k_add_ip4_vif.