| 204 | } |
| 205 | |
| 206 | static struct tcphdr * |
| 207 | tcp_lro_get_th(struct lro_entry *le, struct mbuf *m) |
| 208 | { |
| 209 | struct ether_header *eh; |
| 210 | struct tcphdr *th = NULL; |
| 211 | #ifdef INET6 |
| 212 | struct ip6_hdr *ip6 = NULL; /* Keep compiler happy. */ |
| 213 | #endif |
| 214 | #ifdef INET |
| 215 | struct ip *ip4 = NULL; /* Keep compiler happy. */ |
| 216 | #endif |
| 217 | |
| 218 | eh = mtod(m, struct ether_header *); |
| 219 | switch (le->eh_type) { |
| 220 | #ifdef INET6 |
| 221 | case ETHERTYPE_IPV6: |
| 222 | ip6 = (struct ip6_hdr *)(eh + 1); |
| 223 | th = (struct tcphdr *)(ip6 + 1); |
| 224 | break; |
| 225 | #endif |
| 226 | #ifdef INET |
| 227 | case ETHERTYPE_IP: |
| 228 | ip4 = (struct ip *)(eh + 1); |
| 229 | th = (struct tcphdr *)(ip4 + 1); |
| 230 | break; |
| 231 | #endif |
| 232 | } |
| 233 | return (th); |
| 234 | } |
| 235 | |
| 236 | void |
| 237 | tcp_lro_free(struct lro_ctrl *lc) |