aboutsummaryrefslogtreecommitdiff
path: root/sys/netgraph
diff options
context:
space:
mode:
authorBjoern A. Zeeb <bz@FreeBSD.org>2005-05-28 13:15:44 +0000
committerBjoern A. Zeeb <bz@FreeBSD.org>2005-05-28 13:15:44 +0000
commit7cceedd6b591b46851affd7fe741abe2e24b1d87 (patch)
treed2777e4a0c42e59678fb9dce7a9b3ba4ee8e3d6e /sys/netgraph
parent958a52b82bb5f0680420c54060626ebfef59e57f (diff)
Notes
Diffstat (limited to 'sys/netgraph')
-rw-r--r--sys/netgraph/ng_socket.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/sys/netgraph/ng_socket.c b/sys/netgraph/ng_socket.c
index 2fe6b3169cd6..c016955de996 100644
--- a/sys/netgraph/ng_socket.c
+++ b/sys/netgraph/ng_socket.c
@@ -417,13 +417,17 @@ ngd_send(struct socket *so, int flags, struct mbuf *m, struct sockaddr *addr,
error = ENOTCONN;
goto release;
}
+
+ if (sap == NULL)
+ len = 0; /* Make compiler happy. */
+ else
+ len = sap->sg_len - 2;
+
/*
* If the user used any of these ways to not specify an address
* then handle specially.
*/
- if ((sap == NULL)
- || ((len = sap->sg_len - 2) <= 0)
- || (*sap->sg_data == '\0')) {
+ if ((sap == NULL) || (len <= 0) || (*sap->sg_data == '\0')) {
if (NG_NODE_NUMHOOKS(pcbp->sockdata->node) != 1) {
error = EDESTADDRREQ;
goto release;