summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorsven-ola <sven-ola@3484d885-4da6-438d-b19d-107d078dd756>2010-10-18 10:04:21 +0200
committersven-ola <sven-ola@3484d885-4da6-438d-b19d-107d078dd756>2010-10-18 10:04:21 +0200
commitc25768e4311eaf9e9d9166e42fe74e9c597c466d (patch)
treee3d97792cf822fe296f20d99d772ec74d9cc4e51
parent0078f79fc3a613ac9b504c2a034ac01937b11de3 (diff)
downloadNPTv6-c25768e4311eaf9e9d9166e42fe74e9c597c466d.tar
NPTv6-c25768e4311eaf9e9d9166e42fe74e9c597c466d.zip
git-svn-id: https://map66.svn.sourceforge.net/svnroot/map66@55 3484d885-4da6-438d-b19d-107d078dd756
-rw-r--r--TODO4
-rw-r--r--ip6t_MAP66.c10
2 files changed, 10 insertions, 4 deletions
diff --git a/TODO b/TODO
index b89eed6..d7ded11 100644
--- a/TODO
+++ b/TODO
@@ -3,7 +3,9 @@ the salt can be added e.g. when restarting router/iptables or may be generated f
a particular host once. Purpose: hide MAC addresses behind the address mapping
gateway
-* Implment bit-offset for arbitrary prefix length
+* traceroute6 does not work behind MAP66 --csum?
+
+* Implement bit-offset for arbitrary prefix length
* Check compat with tcpdump. Linux2.4 needs to copy skb() for that -> oops
diff --git a/ip6t_MAP66.c b/ip6t_MAP66.c
index dcdea68..1711757 100644
--- a/ip6t_MAP66.c
+++ b/ip6t_MAP66.c
@@ -135,8 +135,10 @@ static unsigned int MAP66_tg6(
struct sk_buff *skb,
const struct xt_target_param *par)
{
+ struct ipv6hdr* hdr = ipv6_hdr(skb);
+ unsigned char* transport = (unsigned char* )(hdr + 1);
+ u8 nexthdr = 0;
u_int16_t* pcsum = NULL;
- struct ipv6hdr *hdr = ipv6_hdr(skb);
const struct ip6t_MAP66_info *info = par->targinfo;
pr_devel("MAP66: enter in=%s, out=%s, saddr=" NIP6_FMT ", daddr=" NIP6_FMT "\n",
@@ -165,8 +167,7 @@ static unsigned int MAP66_tg6(
#endif
if (0 != (IP6T_MAP66_OPT_CSUM & info->mapflags)) {
- u8 nexthdr = hdr->nexthdr;
- unsigned char* transport = (unsigned char* )hdr + sizeof(struct ipv6hdr);
+ nexthdr = hdr->nexthdr;
if (ipv6_ext_hdr(nexthdr)) {
int hoff = ipv6_skip_exthdr(skb, sizeof(struct ipv6hdr), &nexthdr
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0)
@@ -209,6 +210,9 @@ static unsigned int MAP66_tg6(
{
map16((u_int16_t *)&hdr->daddr, (u_int16_t *)&info->pfix_dst_to,
info->pfix_dst_len, info->pfix_dst_csum, pcsum);
+ if (NULL != pcsum && IPPROTO_ICMPV6 == nexthdr && 128 > ((struct icmp6hdr*)transport)->icmp6_type) {
+ printk("Need to change returning ICMPv6 dest addr for traceroute\n");
+ }
}
}