Fix bug that cheated hook names out of the last 2 bytes.

MFC after:      3 days
This commit is contained in:
Archie Cobbs 2001-10-10 19:58:11 +00:00
parent 129bc89568
commit 6628011155

View File

@ -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;