diff -urN 2.4.19pre3/net/ipv4/fib_semantics.c fib/net/ipv4/fib_semantics.c --- 2.4.19pre3/net/ipv4/fib_semantics.c Mon Feb 25 22:05:09 2002 +++ fib/net/ipv4/fib_semantics.c Wed Mar 13 15:53:31 2002 @@ -35,6 +35,7 @@ #include #include #include +#include #include #include @@ -45,6 +46,8 @@ #define FSprintk(a...) +static spinlock_t fib_nh_lock = SPIN_LOCK_UNLOCKED; + static struct fib_info *fib_info_list; static rwlock_t fib_info_lock = RW_LOCK_UNLOCKED; int fib_info_cnt; @@ -855,6 +858,8 @@ if (force) scope = -1; + spin_lock_bh(&fib_nh_lock); + for_fib_info() { if (local && fi->fib_prefsrc == local) { fi->fib_flags |= RTNH_F_DEAD; @@ -881,6 +886,7 @@ } } } endfor_fib_info(); + spin_unlock_bh(&fib_nh_lock); return ret; } @@ -898,6 +904,7 @@ if (!(dev->flags&IFF_UP)) return 0; + spin_lock_bh(&fib_nh_lock); for_fib_info() { int alive = 0; @@ -920,6 +927,7 @@ ret++; } } endfor_fib_info(); + spin_unlock_bh(&fib_nh_lock); return ret; } @@ -933,6 +941,7 @@ struct fib_info *fi = res->fi; int w; + spin_lock_bh(&fib_nh_lock); if (fi->fib_power <= 0) { int power = 0; change_nexthops(fi) { @@ -944,6 +953,7 @@ fi->fib_power = power; #if 1 if (power <= 0) { + spin_unlock_bh(&fib_nh_lock); printk(KERN_CRIT "impossible 777\n"); return; } @@ -963,10 +973,13 @@ nh->nh_power--; fi->fib_power--; res->nh_sel = nhsel; + spin_unlock_bh(&fib_nh_lock); return; } } } endfor_nexthops(fi); + + spin_unlock_bh(&fib_nh_lock); #if 1 printk(KERN_CRIT "impossible 888\n");