summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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");
+ }
}
}