summaryrefslogtreecommitdiff
path: root/net/ipv6
diff options
context:
space:
mode:
authorHarald Welte <laforge@gnumonks.org>2002-04-10 07:49:35 -0700
committerDavid S. Miller <davem@nuts.ninka.net>2002-04-10 07:49:35 -0700
commit0700709d407cfbabe7e9c62e38e810092bd4d730 (patch)
tree75d5a35d4a248ce43ec5a88b19fd6eb3ca0e2ae7 /net/ipv6
parent0f230f96ab913f50095c359238ad3244aec68bb2 (diff)
IPv6 netfilter fixes:
- SMP TABLE_OFFSET fix - ordered CPUs - Set /proc entry owner - Fix ip6tables layer4 protocol header calculation - MAC match: register for FORWARD hook, add MODULE_LICENSE
Diffstat (limited to 'net/ipv6')
-rw-r--r--net/ipv6/netfilter/ip6_tables.c19
-rw-r--r--net/ipv6/netfilter/ip6t_mac.c8
2 files changed, 19 insertions, 8 deletions
diff --git a/net/ipv6/netfilter/ip6_tables.c b/net/ipv6/netfilter/ip6_tables.c
index 8b962275c4b9..4cf0325196dc 100644
--- a/net/ipv6/netfilter/ip6_tables.c
+++ b/net/ipv6/netfilter/ip6_tables.c
@@ -110,7 +110,7 @@ static LIST_HEAD(ip6t_tables);
#define ADD_COUNTER(c,b,p) do { (c).bcnt += (b); (c).pcnt += (p); } while(0)
#ifdef CONFIG_SMP
-#define TABLE_OFFSET(t,p) (SMP_ALIGN((t)->size)*cpu_number_map(p))
+#define TABLE_OFFSET(t,p) (SMP_ALIGN((t)->size)*(p))
#else
#define TABLE_OFFSET(t,p) 0
#endif
@@ -336,7 +336,8 @@ ip6t_do_table(struct sk_buff **pskb,
read_lock_bh(&table->lock);
IP_NF_ASSERT(table->valid_hooks & (1 << hook));
table_base = (void *)table->private->entries
- + TABLE_OFFSET(table->private, smp_processor_id());
+ + TABLE_OFFSET(table->private,
+ cpu_number_map(smp_processor_id()));
e = get_entry(table_base, table->private->hook_entry[hook]);
#ifdef CONFIG_NETFILTER_DEBUG
@@ -426,7 +427,7 @@ ip6t_do_table(struct sk_buff **pskb,
#endif
/* Target might have changed stuff. */
ipv6 = (*pskb)->nh.ipv6h;
- protohdr = (u_int32_t *)ipv6 + IPV6_HDR_LEN;
+ protohdr = (u_int32_t *)((void *)ipv6 + IPV6_HDR_LEN);
datalen = (*pskb)->len - IPV6_HDR_LEN;
if (verdict == IP6T_CONTINUE)
@@ -1795,9 +1796,15 @@ static int __init init(void)
}
#ifdef CONFIG_PROC_FS
- if (!proc_net_create("ip6_tables_names", 0, ip6t_get_tables)) {
- nf_unregister_sockopt(&ip6t_sockopts);
- return -ENOMEM;
+ {
+ struct proc_dir_entry *proc;
+ proc = proc_net_create("ip6_tables_names", 0,
+ ip6t_get_tables);
+ if (!proc) {
+ nf_unregister_sockopt(&ip6t_sockopts);
+ return -ENOMEM;
+ }
+ proc->owner = THIS_MODULE;
}
#endif
diff --git a/net/ipv6/netfilter/ip6t_mac.c b/net/ipv6/netfilter/ip6t_mac.c
index 6f1a5d684480..e4771d3ce81d 100644
--- a/net/ipv6/netfilter/ip6t_mac.c
+++ b/net/ipv6/netfilter/ip6t_mac.c
@@ -34,8 +34,10 @@ ip6t_mac_checkentry(const char *tablename,
unsigned int hook_mask)
{
if (hook_mask
- & ~((1 << NF_IP6_PRE_ROUTING) | (1 << NF_IP6_LOCAL_IN))) {
- printk("ip6t_mac: only valid for PRE_ROUTING or LOCAL_IN.\n");
+ & ~((1 << NF_IP6_PRE_ROUTING) | (1 << NF_IP6_LOCAL_IN)
+ | (1 << NF_IP6_FORWARD))) {
+ printk("ip6t_mac: only valid for PRE_ROUTING, LOCAL_IN or"
+ " FORWARD\n");
return 0;
}
@@ -60,3 +62,5 @@ static void __exit fini(void)
module_init(init);
module_exit(fini);
+MODULE_LICENSE("GPL");
+MODULE_DESCRIPTION("MAC address matching module for IPv6");