| 87 | (a)->__u6_addr.__u6_addr32[1] == 0 && \ |
| 88 | (a)->__u6_addr.__u6_addr32[2] == 0) |
| 89 | int |
| 90 | ipfw_check_nat64prefix(const struct in6_addr *prefix, int length) |
| 91 | { |
| 92 | |
| 93 | switch (length) { |
| 94 | case 32: |
| 95 | case 40: |
| 96 | case 48: |
| 97 | case 56: |
| 98 | case 64: |
| 99 | /* Well-known prefix has 96 prefix length */ |
| 100 | if (IN6_IS_ADDR_WKPFX(prefix)) |
| 101 | return (EINVAL); |
| 102 | /* FALLTHROUGH */ |
| 103 | case 96: |
| 104 | /* Bits 64 to 71 must be set to zero */ |
| 105 | if (prefix->__u6_addr.__u6_addr8[8] != 0) |
| 106 | return (EINVAL); |
| 107 | /* XXX: looks incorrect */ |
| 108 | if (IN6_IS_ADDR_MULTICAST(prefix) || |
| 109 | IN6_IS_ADDR_UNSPECIFIED(prefix) || |
| 110 | IN6_IS_ADDR_LOOPBACK(prefix)) |
| 111 | return (EINVAL); |
| 112 | return (0); |
| 113 | } |
| 114 | return (EINVAL); |
| 115 | } |
| 116 | |
| 117 | static struct _s_x nat64statscmds[] = { |
| 118 | { "reset", TOK_RESET }, |
no outgoing calls
no test coverage detected