Page MenuHomeFreeBSD

D23737.id68476.diff
No OneTemporary

D23737.id68476.diff

Index: sys/netpfil/ipfw/nat64/nat64_translate.c
===================================================================
--- sys/netpfil/ipfw/nat64/nat64_translate.c
+++ sys/netpfil/ipfw/nat64/nat64_translate.c
@@ -91,6 +91,8 @@
static int nat64_direct_output(struct ifnet *, struct mbuf *,
struct sockaddr *, struct nat64_counters *, void *);
+static uint32_t nat64_get_ip4(struct in6_addr *addr);
+
struct nat64_methods {
nat64_output_t output;
nat64_output_one_t output_one;
@@ -1061,19 +1063,15 @@
m->m_pkthdr.len);
goto freeit;
}
-#if 0
/*
* Check that inner source matches the outer destination.
- * XXX: We need some method to convert IPv4 into IPv6 address here,
- * and compare IPv6 addresses.
*/
if (ip.ip_src.s_addr != nat64_get_ip4(&ip6->ip6_dst)) {
- DPRINTF(DP_GENERIC, "Inner source doesn't match destination ",
+ DPRINTF(DP_GENERIC, "Inner source doesn't match destination: "
"%04x vs %04x", ip.ip_src.s_addr,
nat64_get_ip4(&ip6->ip6_dst));
goto freeit;
}
-#endif
/*
* Create new mbuf for ICMPv6 datagram.
* NOTE: len is data length just after inner IP header.
@@ -1174,6 +1172,12 @@
m_freem(m);
NAT64STAT_INC(&cfg->stats, dropped);
return (NULL);
+}
+
+static uint32_t
+nat64_get_ip4(struct in6_addr *addr)
+{
+ return addr->__u6_addr.__u6_addr32[3];
}
int

File Metadata

Mime Type
text/plain
Expires
Thu, Nov 20, 10:32 AM (2 h, 34 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
25721187
Default Alt Text
D23737.id68476.diff (1 KB)

Event Timeline