| 77 | #define SEND_LOCK_DESTROY() mtx_destroy(&send_mtx) |
| 78 | |
| 79 | static int |
| 80 | send_attach(struct socket *so, int proto, struct thread *td) |
| 81 | { |
| 82 | int error; |
| 83 | |
| 84 | SEND_LOCK(); |
| 85 | if (V_send_so != NULL) { |
| 86 | SEND_UNLOCK(); |
| 87 | return (EEXIST); |
| 88 | } |
| 89 | |
| 90 | error = priv_check(td, PRIV_NETINET_RAW); |
| 91 | if (error) { |
| 92 | SEND_UNLOCK(); |
| 93 | return(error); |
| 94 | } |
| 95 | |
| 96 | if (proto != IPPROTO_SEND) { |
| 97 | SEND_UNLOCK(); |
| 98 | return (EPROTONOSUPPORT); |
| 99 | } |
| 100 | error = soreserve(so, send_sendspace, send_recvspace); |
| 101 | if (error) { |
| 102 | SEND_UNLOCK(); |
| 103 | return(error); |
| 104 | } |
| 105 | |
| 106 | V_send_so = so; |
| 107 | SEND_UNLOCK(); |
| 108 | |
| 109 | return (0); |
| 110 | } |
| 111 | |
| 112 | static int |
| 113 | send_output(struct mbuf *m, struct ifnet *ifp, int direction) |
nothing calls this directly
no test coverage detected