patch-2.3.15 linux/net/ipv6/ip6_fw.c
Next file: linux/net/ipv6/ip6_input.c
Previous file: linux/net/ipv6/ip6_flowlabel.c
Back to the patch index
Back to the overall index
- Lines: 48
- Date:
Mon Aug 23 10:01:02 1999
- Orig file:
v2.3.14/linux/net/ipv6/ip6_fw.c
- Orig date:
Mon Jul 5 20:03:14 1999
diff -u --recursive --new-file v2.3.14/linux/net/ipv6/ip6_fw.c linux/net/ipv6/ip6_fw.c
@@ -5,7 +5,7 @@
* Authors:
* Pedro Roque <roque@di.fc.ul.pt>
*
- * $Id: ip6_fw.c,v 1.12 1999/06/09 08:29:32 davem Exp $
+ * $Id: ip6_fw.c,v 1.14 1999/08/20 11:06:20 davem Exp $
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
@@ -60,31 +60,34 @@
0, RTN_ROOT|RTN_TL_ROOT, 0
};
+rwlock_t ip6_fw_lock = RW_LOCK_UNLOCKED;
+
+
static void ip6_rule_add(struct ip6_fw_rule *rl)
{
struct ip6_fw_rule *next;
- start_bh_atomic();
+ write_lock_bh(&ip6_fw_lock);
ip6_fw_rule_cnt++;
next = &ip6_fw_rule_list;
rl->next = next;
rl->prev = next->prev;
rl->prev->next = rl;
next->prev = rl;
- end_bh_atomic();
+ write_unlock_bh(&ip6_fw_lock);
}
static void ip6_rule_del(struct ip6_fw_rule *rl)
{
struct ip6_fw_rule *next, *prev;
- start_bh_atomic();
+ write_lock_bh(&ip6_fw_lock);
ip6_fw_rule_cnt--;
next = rl->next;
prev = rl->prev;
next->prev = prev;
prev->next = next;
- end_bh_atomic();
+ write_unlock_bh(&ip6_fw_lock);
}
static __inline__ struct ip6_fw_rule * ip6_fwrule_alloc(void)
FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)