| 126 | } |
| 127 | |
| 128 | void |
| 129 | ipsec_setspidx_inpcb(struct inpcb *inp, struct secpolicyindex *spidx, |
| 130 | u_int dir) |
| 131 | { |
| 132 | |
| 133 | ipsec_setsockaddrs_inpcb(inp, &spidx->src, &spidx->dst, dir); |
| 134 | #ifdef INET6 |
| 135 | if (inp->inp_vflag & INP_IPV6) { |
| 136 | spidx->prefs = sizeof(struct in6_addr) << 3; |
| 137 | spidx->prefd = sizeof(struct in6_addr) << 3; |
| 138 | } |
| 139 | #endif |
| 140 | #ifdef INET |
| 141 | if (inp->inp_vflag & INP_IPV4) { |
| 142 | spidx->prefs = sizeof(struct in_addr) << 3; |
| 143 | spidx->prefd = sizeof(struct in_addr) << 3; |
| 144 | } |
| 145 | #endif |
| 146 | spidx->ul_proto = IPPROTO_TCP; /* XXX: currently only TCP uses this */ |
| 147 | spidx->dir = dir; |
| 148 | KEYDBG(IPSEC_DUMP, |
| 149 | printf("%s: ", __func__); kdebug_secpolicyindex(spidx, NULL)); |
| 150 | } |
| 151 | |
| 152 | /* Initialize PCB policy. */ |
| 153 | int |
no test coverage detected