/*
+ * Test if an address is a local override. This function is compiled-in
+ * to support hosts with a /64 from their own ISP and nothing more; they
+ * need to access local IPv6 addresses. We rely on the 6bed4 port being
+ * 0 to decide that an address cannot be anything but a local override.
+ * Define LOCAL_OVERRIDES_PORT0 to enable this feature.
+ */
+#ifdef LOCAL_OVERRIDES_PORT0
+static inline bool is_local_override (struct in6_addr *ip6) {
+ return ip6->s6addr [6] == 0;
+}
+#else
+#define is_local_override (ip6) false
+#endif
+
+/*
* Test if the provided IPv6 address matches the prefix used for 6bed4.
*/
static inline bool is_6bed4 (struct in6_addr *ip6) {
- return memcmp (&v6listen, ip6->s6_addr, 8) == 0 && (ip6->s6_addr[12] != 0 || ip6->s6_addr[13] != 0);
+ return memcmp (&v6listen, ip6->s6_addr, 8) == 0;
}
} else if ((v4dst6->s6_addr [0] != 0xff) && !(v4dst6->s6_addr [8] & 0x01)) {
//
// Plain Unicast
- if (validate_originator (&v4name, v4src6)) {
+ if (is_local_override (v4dst6)) {
+ handle_4to6_plain_unicast (buflen);
+ } else if (validate_originator (&v4name, v4src6)) {
if (v4v6hoplimit-- <= 1) {
return;
}
--- /dev/null
+/* The error line below is here to satisfy RFC requirements: We cannot
+ * distribute code that has non-standard protocol numbers built in as
+ * defaults. So you must read this and understand that you are running
+ * a non-compliant, experimental code version. When you agree, please
+ * change the error directives to warnings -- then, the code will build.
+ *
+ * Sincerely, Rick van Rein, OpenFortress.
+ */
+
+#error "Build uses experimental Neighbor Discovery Option Type 253 for Destination Link-Layer Address"
+
+#define ND_OPT_DESTINATION_LINKADDR 253
+
+
+#error "Build uses experimental UDP port number 27629 or 0x6bed"
+
+#define UDP_PORT_6BED4 25788
+
+
+#warning "Build uses temporary IPv4 address information"
+
+#define SERVER_6BED4_IPV4_TXT "145.100.190.242"
+#define SERVER_6BED4_IPV4_INT32 ( (145L << 24) | (100L << 16) | (190L << 8) | 242L )
+#define SERVER_6BED4_IPV4_INT0 145
+#define SERVER_6BED4_IPV4_INT1 100
+#define SERVER_6BED4_IPV4_INT2 190
+#define SERVER_6BED4_IPV4_INT3 242
+#define SERVER_6BED4_IPV4_BINSTR "\x91\x64\xbe\xf2"
+
+#define SERVER_6BED4_PORT_TXT "25788"
+#define SERVER_6BED4_PORT_BINSTR "\xbc\x64"
+
+#define SERVER_6BED4_IPV4_PORT_TXT "145.100.190.242:27629"
+#define SERVER_6BED4_PORT_IPV4_ADDRSTR "\xbe\x64\x91\x64\xbe\xf2"
+#define SERVER_6BED4_PORT_IPV4_MACSTR "\xbc\x64\x91\x64\xbe\xf2"
+
+/* Define LOCAL_OVERRIDES_PORT0 to forcefully detect 6bed4 port 0 as an
+ * override to a local address. This is used when a host uses its own /64
+ * and has no other addresses available.
+ */
+#define LOCAL_OVERRIDES_PORT0 yes
#define SERVER_6BED4_PORT_IPV4_ADDRSTR "\xbe\x64\x91\x64\xbe\xf2"
#define SERVER_6BED4_PORT_IPV4_MACSTR "\xbc\x64\x91\x64\xbe\xf2"
+/* Define LOCAL_OVERRIDES_PORT0 to forcefully detect 6bed4 port 0 as an
+ * override to a local address. This is used when a host uses its own /64
+ * and has no other addresses available.
+ */
+// #define LOCAL_OVERRIDES_PORT0 yes