* RFC 3173 p 2.2. Non-Expansion Policy: * If the total size of a compressed payload and the IPComp header, as * defined in section 3, is not smaller than the size of the original * payload, the IP datagram MUST be sent in the original non-compressed * form. * * When we use IPComp in tunnel mode, for small packets we will receive * encapsulated IP-IP datagrams without any compression and wit
| 105 | * header. |
| 106 | */ |
| 107 | static int |
| 108 | ipcomp_encapcheck(union sockaddr_union *src, union sockaddr_union *dst) |
| 109 | { |
| 110 | struct secasvar *sav; |
| 111 | |
| 112 | sav = key_allocsa_tunnel(src, dst, IPPROTO_IPCOMP); |
| 113 | if (sav == NULL) |
| 114 | return (0); |
| 115 | key_freesav(&sav); |
| 116 | |
| 117 | if (src->sa.sa_family == AF_INET) |
| 118 | return (sizeof(struct in_addr) << 4); |
| 119 | else |
| 120 | return (sizeof(struct in6_addr) << 4); |
| 121 | } |
| 122 | |
| 123 | static int |
| 124 | ipcomp_nonexp_input(struct mbuf *m, int off, int proto, void *arg __unused) |
no test coverage detected