MCPcopy Create free account
hub / github.com/F-Stack/f-stack / send_attach

Function send_attach

freebsd/netinet6/send.c:79–110  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

77#define SEND_LOCK_DESTROY() mtx_destroy(&send_mtx)
78
79static int
80send_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
112static int
113send_output(struct mbuf *m, struct ifnet *ifp, int direction)

Callers

nothing calls this directly

Calls 2

soreserveFunction · 0.85
priv_checkFunction · 0.50

Tested by

no test coverage detected