summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorsven-ola <sven-ola@3484d885-4da6-438d-b19d-107d078dd756>2010-10-07 13:05:36 +0200
committersven-ola <sven-ola@3484d885-4da6-438d-b19d-107d078dd756>2010-10-07 13:05:36 +0200
commite566557c4514b4cc14171cb2581c8cc85902a430 (patch)
treeaeb3f975aba34f99c178e3c74d4b0f8138d9ed80
parentadb5c71c3b3cfd01c0e27225cf9c58b90fbd3e3a (diff)
downloadNPTv6-e566557c4514b4cc14171cb2581c8cc85902a430.tar
NPTv6-e566557c4514b4cc14171cb2581c8cc85902a430.zip
Review jan: remove unnecessary spin_lock, remove pointless void* cast.
git-svn-id: https://map66.svn.sourceforge.net/svnroot/map66@14 3484d885-4da6-438d-b19d-107d078dd756
-rw-r--r--ip6t_MAP66.c14
-rw-r--r--libip6t_MAP66.c3
2 files changed, 5 insertions, 12 deletions
diff --git a/ip6t_MAP66.c b/ip6t_MAP66.c
index 6cae5af..457bd5e 100644
--- a/ip6t_MAP66.c
+++ b/ip6t_MAP66.c
@@ -15,11 +15,6 @@ MODULE_AUTHOR("Sven-Ola <sven-ola()gmx.de>");
MODULE_DESCRIPTION("Xtables: MAP66 - IPv6 to IPv6 SNAT");
MODULE_LICENSE("GPL");
-#ifdef MAP66_DEBUG
-/* Use lock to serialize, so printks don't overlap */
-static DEFINE_SPINLOCK(MAP66_lock);
-#endif
-
/* One's complement add */
static inline u_int16_t add16(
u_int16_t a,
@@ -120,10 +115,9 @@ static unsigned int MAP66_tg6(
const struct xt_target_param *par)
{
struct ipv6hdr *hdr = ipv6_hdr(skb);
- const struct ip6t_MAP66_info *info = (const struct ip6t_MAP66_info *)par->targinfo;
+ const struct ip6t_MAP66_info *info = par->targinfo;
#ifdef MAP66_DEBUG
- spin_lock_bh(&MAP66_lock);
#if LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,28)
printk("MAP66: enter in=%s, out=%s, saddr=" NIP6_FMT ", daddr=" NIP6_FMT "\n",
NULL != par->in ? par->in->name : "",
@@ -156,9 +150,6 @@ static unsigned int MAP66_tg6(
if (0 == (IP6T_MAP66_OPT_NOCHECK & info->mapflags) &&
is_my_ipv6_addr(par->out, &hdr->saddr))
{
-#ifdef MAP66_DEBUG
- spin_unlock_bh(&MAP66_lock);
-#endif
return NF_DROP;
}
break;
@@ -181,7 +172,6 @@ static unsigned int MAP66_tg6(
NULL != par->out ? par->out->name : "",
&hdr->saddr, &hdr->daddr);
#endif
- spin_unlock_bh(&MAP66_lock);
#endif
return IP6T_CONTINUE;
@@ -190,7 +180,7 @@ static unsigned int MAP66_tg6(
static bool MAP66_tg6_check(
const struct xt_tgchk_param *par)
{
- const struct ip6t_MAP66_info *info = (const struct ip6t_MAP66_info *)par->targinfo;
+ const struct ip6t_MAP66_info *info = par->targinfo;
if (0 >= info->prefixlength || 8 <= info->prefixlength) {
printk("MAP66: Unsupported prefix length /%d\n", 16 * info->prefixlength);
diff --git a/libip6t_MAP66.c b/libip6t_MAP66.c
index 1d56d7f..35c8311 100644
--- a/libip6t_MAP66.c
+++ b/libip6t_MAP66.c
@@ -83,6 +83,9 @@ static int MAP66_parse(
char *p;
struct ip6t_MAP66_info* info = (struct ip6t_MAP66_info*)(*target)->data;
+ void* bla = NULL;
+ info = bla;
+
switch(c) {
case '1':
if (!optarg) {