| 1589 | #endif /* INET */ |
| 1590 | |
| 1591 | int |
| 1592 | udp_set_kernel_tunneling(struct socket *so, udp_tun_func_t f, udp_tun_icmp_t i, void *ctx) |
| 1593 | { |
| 1594 | struct inpcb *inp; |
| 1595 | struct udpcb *up; |
| 1596 | |
| 1597 | KASSERT(so->so_type == SOCK_DGRAM, |
| 1598 | ("udp_set_kernel_tunneling: !dgram")); |
| 1599 | inp = sotoinpcb(so); |
| 1600 | KASSERT(inp != NULL, ("udp_set_kernel_tunneling: inp == NULL")); |
| 1601 | INP_WLOCK(inp); |
| 1602 | up = intoudpcb(inp); |
| 1603 | if ((up->u_tun_func != NULL) || |
| 1604 | (up->u_icmp_func != NULL)) { |
| 1605 | INP_WUNLOCK(inp); |
| 1606 | return (EBUSY); |
| 1607 | } |
| 1608 | up->u_tun_func = f; |
| 1609 | up->u_icmp_func = i; |
| 1610 | up->u_tun_ctx = ctx; |
| 1611 | INP_WUNLOCK(inp); |
| 1612 | return (0); |
| 1613 | } |
| 1614 | |
| 1615 | #ifdef INET |
| 1616 | static int |
no outgoing calls
no test coverage detected