Saturday, May 17, 2008

Chang default IGMP version in Linux

Set default IGMP version of your NICs is 2:

echo 2 > /proc/sys/net/ipv4/conf/all/force_igmp_version

Set default IGMP version of your NICs is 3:

echo 3 > /proc/sys/net/ipv4/conf/all/force_igmp_version

jiffies comparison

If you want to compare time in kernel module, you can user flowing macro to avoid jiffies overflow :
/*in kernel/linux/include/linux/jiffies.h*/
time_after(a,b)
time_before(a,b)
time_after_eq(a,b)
time_before_eq(a,b)

If you compare jiffies directly, you will get wrong result sometimes.