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

Function raw_input_ext

freebsd/net/raw_usrreq.c:80–121  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

78}
79
80void
81raw_input_ext(struct mbuf *m0, struct sockproto *proto, struct sockaddr *src,
82 raw_input_cb_fn cb)
83{
84 struct rawcb *rp;
85 struct mbuf *m = m0;
86 struct socket *last;
87
88 last = NULL;
89 mtx_lock(&rawcb_mtx);
90 LIST_FOREACH(rp, &V_rawcb_list, list) {
91 if (rp->rcb_proto.sp_family != proto->sp_family)
92 continue;
93 if (rp->rcb_proto.sp_protocol &&
94 rp->rcb_proto.sp_protocol != proto->sp_protocol)
95 continue;
96 if (cb != NULL && (*cb)(m, proto, src, rp) != 0)
97 continue;
98 if (last) {
99 struct mbuf *n;
100 n = m_copym(m, 0, M_COPYALL, M_NOWAIT);
101 if (n) {
102 if (sbappendaddr(&last->so_rcv, src,
103 n, (struct mbuf *)0) == 0)
104 /* should notify about lost packet */
105 m_freem(n);
106 else
107 sorwakeup(last);
108 }
109 }
110 last = rp->rcb_socket;
111 }
112 if (last) {
113 if (sbappendaddr(&last->so_rcv, src,
114 m, (struct mbuf *)0) == 0)
115 m_freem(m);
116 else
117 sorwakeup(last);
118 } else
119 m_freem(m);
120 mtx_unlock(&rawcb_mtx);
121}
122
123/*ARGSUSED*/
124void

Callers 2

rts_inputFunction · 0.85
raw_inputFunction · 0.85

Calls 5

m_copymFunction · 0.85
sbappendaddrFunction · 0.85
mtx_lockFunction · 0.50
m_freemFunction · 0.50
mtx_unlockFunction · 0.50

Tested by

no test coverage detected