int ok = 1;
struct ifreq ifreq;
memset (&ifreq, 0, sizeof (ifreq));
- strncpy (ifreq.ifr_name, "6bed4_rfc", IFNAMSIZ);
+ strncpy (ifreq.ifr_name, "6bed4", IFNAMSIZ);
ifreq.ifr_flags = IFF_TUN;
if (ok && (ioctl (v6sox, TUNSETIFF, (void *) &ifreq) == -1)) {
ok = 0;
* Hop Limit has been altered, and this is not part of the
* checksum calculations.
*/
-void relay_6bed4_plain_unicast (ssize_t v4datalen, struct in6_addr *ip6) {
+void relay_6bed4_plain_unicast (uint8_t* data, ssize_t v4datalen, struct in6_addr *ip6) {
v4name.sin_port = htons (ip6->s6_addr [9] << 8 | ip6->s6_addr [8] ^ 0x02);
uint8_t *addr = (uint8_t *) &v4name.sin_addr.s_addr;
addr [0] = ip6->s6_addr [10];
((uint8_t *) &v4name.sin_addr.s_addr) [3],
ntohs (v4name.sin_port),
sendto (v4sox,
- v4data, v4datalen,
+ data, v4datalen,
MSG_DONTWAIT,
(struct sockaddr *) &v4name, sizeof (v4name)));
}
return;
}
if (prefix_6bed4 (v4dst6)) {
- relay_6bed4_plain_unicast (buflen, v4dst6);
+ relay_6bed4_plain_unicast (v4data, buflen, v4dst6);
} else {
handle_4to6_plain_unicast (buflen);
}
return; /* hop limit exceeded, drop */
}
if ((v6dst6->s6_addr [0] == 0xff) /* TODO:UDP_PORT_NOT_YET_FORCED_TO_EVEN || (v6dst6->s6_addr [8] & 0x01) */ ) {
+printf ("Received multicast IPv6 data, flags=0x%04x, proto=0x%04x\n", v6tuncmd.flags, v6tuncmd.proto);
//OPTIONAL// handle_6to4_plain_multicast ()
return; /* multicast, drop */
}
}
//
// Harvest socket address data from destination IPv6, then send
- relay_6bed4_plain_unicast (rawlen - sizeof (struct tun_pi), v6dst6);
+ relay_6bed4_plain_unicast (v6data, rawlen - sizeof (struct tun_pi), v6dst6);
}