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

MFC after:      3 days
This commit is contained in:
archie 2001-10-10 19:58:11 +00:00
parent 4af7ad0301
commit af6aab288d

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;