summaryrefslogtreecommitdiffstats
path: root/ip6t_MAP66.c
diff options
context:
space:
mode:
Diffstat (limited to 'ip6t_MAP66.c')
-rw-r--r--ip6t_MAP66.c10
1 files changed, 7 insertions, 3 deletions
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");
+ }
}
}