summaryrefslogtreecommitdiffstats
path: root/sys/netgraph/ng_socket.c
diff options
context:
space:
mode:
authorrwatson <rwatson@FreeBSD.org>2007-05-11 10:20:51 +0000
committerrwatson <rwatson@FreeBSD.org>2007-05-11 10:20:51 +0000
commit47d37a80be0931ad72e67db6ba915221afdfeb4f (patch)
tree830d52c0a835e86532d14a328bcdb1121e33e37a /sys/netgraph/ng_socket.c
parent46a4c44c3b39d3c635f686c57785c0dd7511f2b6 (diff)
downloadFreeBSD-src-47d37a80be0931ad72e67db6ba915221afdfeb4f.zip
FreeBSD-src-47d37a80be0931ad72e67db6ba915221afdfeb4f.tar.gz
Reduce network stack oddness: implement .pru_sockaddr and .pru_peeraddr
protocol entry points using functions named proto_getsockaddr and proto_getpeeraddr rather than proto_setsockaddr and proto_setpeeraddr. While it's true that sockaddrs are allocated and set, the net effect is to retrieve (get) the socket address or peer address from a socket, not set it, so align names to that intent.
Diffstat (limited to 'sys/netgraph/ng_socket.c')
-rw-r--r--sys/netgraph/ng_socket.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/sys/netgraph/ng_socket.c b/sys/netgraph/ng_socket.c
index 2a03275..45cf520 100644
--- a/sys/netgraph/ng_socket.c
+++ b/sys/netgraph/ng_socket.c
@@ -466,7 +466,7 @@ ngd_connect(struct socket *so, struct sockaddr *nam, struct thread *td)
* Used for both data and control sockets
*/
static int
-ng_setsockaddr(struct socket *so, struct sockaddr **addr)
+ng_getsockaddr(struct socket *so, struct sockaddr **addr)
{
struct ngpcb *pcbp;
struct sockaddr_ng *sg;
@@ -1053,7 +1053,7 @@ static struct pr_usrreqs ngc_usrreqs = {
.pru_peeraddr = NULL,
.pru_send = ngc_send,
.pru_shutdown = NULL,
- .pru_sockaddr = ng_setsockaddr,
+ .pru_sockaddr = ng_getsockaddr,
.pru_close = NULL,
};
@@ -1067,7 +1067,7 @@ static struct pr_usrreqs ngd_usrreqs = {
.pru_peeraddr = NULL,
.pru_send = ngd_send,
.pru_shutdown = NULL,
- .pru_sockaddr = ng_setsockaddr,
+ .pru_sockaddr = ng_getsockaddr,
.pru_close = NULL,
};
OpenPOWER on IntegriCloud