| 1024 | } |
| 1025 | |
| 1026 | static int |
| 1027 | rip_connect(struct socket *so, struct sockaddr *nam, struct thread *td) |
| 1028 | { |
| 1029 | struct sockaddr_in *addr = (struct sockaddr_in *)nam; |
| 1030 | struct inpcb *inp; |
| 1031 | |
| 1032 | if (nam->sa_len != sizeof(*addr)) |
| 1033 | return (EINVAL); |
| 1034 | if (CK_STAILQ_EMPTY(&V_ifnet)) |
| 1035 | return (EADDRNOTAVAIL); |
| 1036 | if (addr->sin_family != AF_INET && addr->sin_family != AF_IMPLINK) |
| 1037 | return (EAFNOSUPPORT); |
| 1038 | |
| 1039 | inp = sotoinpcb(so); |
| 1040 | KASSERT(inp != NULL, ("rip_connect: inp == NULL")); |
| 1041 | |
| 1042 | INP_INFO_WLOCK(&V_ripcbinfo); |
| 1043 | INP_WLOCK(inp); |
| 1044 | rip_delhash(inp); |
| 1045 | inp->inp_faddr = addr->sin_addr; |
| 1046 | rip_inshash(inp); |
| 1047 | soisconnected(so); |
| 1048 | INP_WUNLOCK(inp); |
| 1049 | INP_INFO_WUNLOCK(&V_ripcbinfo); |
| 1050 | return (0); |
| 1051 | } |
| 1052 | |
| 1053 | static int |
| 1054 | rip_shutdown(struct socket *so) |
nothing calls this directly
no test coverage detected