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

Function rip_send

freebsd/netinet/raw_ip.c:1067–1094  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1065}
1066
1067static int
1068rip_send(struct socket *so, int flags, struct mbuf *m, struct sockaddr *nam,
1069 struct mbuf *control, struct thread *td)
1070{
1071 struct inpcb *inp;
1072 u_long dst;
1073
1074 inp = sotoinpcb(so);
1075 KASSERT(inp != NULL, ("rip_send: inp == NULL"));
1076
1077 /*
1078 * Note: 'dst' reads below are unlocked.
1079 */
1080 if (so->so_state & SS_ISCONNECTED) {
1081 if (nam) {
1082 m_freem(m);
1083 return (EISCONN);
1084 }
1085 dst = inp->inp_faddr.s_addr; /* Unlocked read. */
1086 } else {
1087 if (nam == NULL) {
1088 m_freem(m);
1089 return (ENOTCONN);
1090 }
1091 dst = ((struct sockaddr_in *)nam)->sin_addr.s_addr;
1092 }
1093 return (rip_output(m, so, dst));
1094}
1095#endif /* INET */
1096
1097static int

Callers

nothing calls this directly

Calls 2

rip_outputFunction · 0.85
m_freemFunction · 0.50

Tested by

no test coverage detected