| 132 | |
| 133 | #ifdef INET |
| 134 | static int |
| 135 | ip_pseudo_compute(struct mbuf *m, MD5_CTX *ctx) |
| 136 | { |
| 137 | struct ippseudo ipp; |
| 138 | struct ip *ip; |
| 139 | |
| 140 | ip = mtod(m, struct ip *); |
| 141 | ipp.ippseudo_src.s_addr = ip->ip_src.s_addr; |
| 142 | ipp.ippseudo_dst.s_addr = ip->ip_dst.s_addr; |
| 143 | ipp.ippseudo_p = IPPROTO_TCP; |
| 144 | ipp.ippseudo_pad = 0; |
| 145 | ipp.ippseudo_len = htons(m->m_pkthdr.len - (ip->ip_hl << 2)); |
| 146 | MD5Update(ctx, (char *)&ipp, sizeof(ipp)); |
| 147 | return (ip->ip_hl << 2); |
| 148 | } |
| 149 | #endif |
| 150 | |
| 151 | #ifdef INET6 |
no test coverage detected