diff --git a/sys/netgraph/ng_socket.c b/sys/netgraph/ng_socket.c index 87924cea29e0..139aa0edaf27 100644 --- a/sys/netgraph/ng_socket.c +++ b/sys/netgraph/ng_socket.c @@ -355,8 +355,8 @@ ngd_send(struct socket *so, int flags, struct mbuf *m, struct sockaddr *addr, * then handle specially. */ if ((sap == NULL) - || ((len = sap->sg_len) <= 2) - || (*sap->sg_data == '\0')) { + || ((len = sap->sg_len - 2) <= 0) + || (*sap->sg_data == '\0')) { if (NG_NODE_NUMHOOKS(pcbp->sockdata->node) != 1) { error = EDESTADDRREQ; goto release;