diff options
author | Jeffrey Hsu <hsu@FreeBSD.org> | 2002-06-10 20:05:46 +0000 |
---|---|---|
committer | Jeffrey Hsu <hsu@FreeBSD.org> | 2002-06-10 20:05:46 +0000 |
commit | f76fcf6d4c205c6bc580eae0aca8dc4a335f6a8a (patch) | |
tree | f0e255a19712887860d91eada0fa049d83035db7 /sys/netinet/raw_ip.c | |
parent | d8a186ebbb550fc8d615371a41b3a5bce7ff8812 (diff) | |
download | src-f76fcf6d4c205c6bc580eae0aca8dc4a335f6a8a.tar.gz src-f76fcf6d4c205c6bc580eae0aca8dc4a335f6a8a.zip |
Lock up inpcb.
Submitted by: Jennifer Yang <yangjihui@yahoo.com>
Notes
Notes:
svn path=/head/; revision=98102
Diffstat (limited to 'sys/netinet/raw_ip.c')
-rw-r--r-- | sys/netinet/raw_ip.c | 25 |
1 files changed, 23 insertions, 2 deletions
diff --git a/sys/netinet/raw_ip.c b/sys/netinet/raw_ip.c index 86915fc27605..13a84fda5ec9 100644 --- a/sys/netinet/raw_ip.c +++ b/sys/netinet/raw_ip.c @@ -673,13 +673,34 @@ rip_pcblist(SYSCTL_HANDLER_ARGS) return error; } +/* + * This is the wrapper function for in_setsockaddr. We just pass down + * the pcbinfo for in_setpeeraddr to lock. + */ +static int +rip_sockaddr(struct socket *so, struct sockaddr **nam) +{ + return (in_setsockaddr(so, nam, &ripcbinfo)); +} + +/* + * This is the wrapper function for in_setpeeraddr. We just pass down + * the pcbinfo for in_setpeeraddr to lock. + */ +static int +rip_peeraddr(struct socket *so, struct sockaddr **nam) +{ + return (in_setpeeraddr(so, nam, &ripcbinfo)); +} + + SYSCTL_PROC(_net_inet_raw, OID_AUTO/*XXX*/, pcblist, CTLFLAG_RD, 0, 0, rip_pcblist, "S,xinpcb", "List of active raw IP sockets"); struct pr_usrreqs rip_usrreqs = { rip_abort, pru_accept_notsupp, rip_attach, rip_bind, rip_connect, pru_connect2_notsupp, in_control, rip_detach, rip_disconnect, - pru_listen_notsupp, in_setpeeraddr, pru_rcvd_notsupp, + pru_listen_notsupp, rip_peeraddr, pru_rcvd_notsupp, pru_rcvoob_notsupp, rip_send, pru_sense_null, rip_shutdown, - in_setsockaddr, sosend, soreceive, sopoll + rip_sockaddr, sosend, soreceive, sopoll }; |