| 2550 | } |
| 2551 | |
| 2552 | static int |
| 2553 | ip6_pcbopt(int optname, u_char *buf, int len, struct ip6_pktopts **pktopt, |
| 2554 | struct ucred *cred, int uproto) |
| 2555 | { |
| 2556 | struct ip6_pktopts *opt; |
| 2557 | |
| 2558 | if (*pktopt == NULL) { |
| 2559 | *pktopt = malloc(sizeof(struct ip6_pktopts), M_IP6OPT, |
| 2560 | M_NOWAIT); |
| 2561 | if (*pktopt == NULL) |
| 2562 | return (ENOBUFS); |
| 2563 | ip6_initpktopts(*pktopt); |
| 2564 | } |
| 2565 | opt = *pktopt; |
| 2566 | |
| 2567 | return (ip6_setpktopt(optname, buf, len, opt, cred, 1, 0, uproto)); |
| 2568 | } |
| 2569 | |
| 2570 | #define GET_PKTOPT_VAR(field, lenexpr) do { \ |
| 2571 | if (pktopt && pktopt->field) { \ |
no test coverage detected