Changeset View
Changeset View
Standalone View
Standalone View
sys/netpfil/ipfw/nat64/nat64_translate.h
Show First 20 Lines • Show All 103 Lines • ▼ Show 20 Lines | if (addr->s6_addr16[0] == 0 || /* 0000::/8 Reserved by IETF */ | ||||
return (1); | return (1); | ||||
return (0); | return (0); | ||||
} | } | ||||
static inline int | static inline int | ||||
nat64_check_ip4(in_addr_t ia) | nat64_check_ip4(in_addr_t ia) | ||||
{ | { | ||||
/* IN_LOOPBACK */ | /* These checks are ordered from most likely to least */ | ||||
if ((ia & htonl(0xff000000)) == htonl(0x7f000000)) | if (IN_MULTICAST(ntohl(ia)) || IN_LOOPBACK(ntohl(ia)) || | ||||
return (1); | IN_LINKLOCAL(ntohl(ia)) || IN_EXPERIMENTAL(ntohl(ia))) | ||||
/* IN_LINKLOCAL */ | |||||
if ((ia & htonl(0xffff0000)) == htonl(0xa9fe0000)) | |||||
return (1); | |||||
/* IN_MULTICAST & IN_EXPERIMENTAL */ | |||||
if ((ia & htonl(0xe0000000)) == htonl(0xe0000000)) | |||||
return (1); | return (1); | ||||
return (0); | return (0); | ||||
} | } | ||||
karels: Do you intend to commit this comment, or to follow up on it? Sure looks like everything is in… | |||||
Done Inline ActionsI intend to fix it, this is WIP. But I also need some feedback before I go make a 1000 line diff, I have just done the critical stuff in the kernel that makes it even possible to transport packets when you alter the macro's values. rgrimes: I intend to fix it, this is WIP. But I also need some feedback before I go make a 1000 line… | |||||
/* Well-known prefix 64:ff9b::/96 */ | /* Well-known prefix 64:ff9b::/96 */ | ||||
#define IPV6_ADDR_INT32_WKPFX htonl(0x64ff9b) | #define IPV6_ADDR_INT32_WKPFX htonl(0x64ff9b) | ||||
#define IN6_IS_ADDR_WKPFX(a) \ | #define IN6_IS_ADDR_WKPFX(a) \ | ||||
((a)->s6_addr32[0] == IPV6_ADDR_INT32_WKPFX && \ | ((a)->s6_addr32[0] == IPV6_ADDR_INT32_WKPFX && \ | ||||
(a)->s6_addr32[1] == 0 && (a)->s6_addr32[2] == 0) | (a)->s6_addr32[1] == 0 && (a)->s6_addr32[2] == 0) | ||||
int nat64_check_private_ip4(const struct nat64_config *cfg, in_addr_t ia); | int nat64_check_private_ip4(const struct nat64_config *cfg, in_addr_t ia); | ||||
Show All 19 Lines |
Do you intend to commit this comment, or to follow up on it? Sure looks like everything is in network byte order, might as well just fix it.