diff --git a/sys/netgraph/ng_message.h b/sys/netgraph/ng_message.h --- a/sys/netgraph/ng_message.h +++ b/sys/netgraph/ng_message.h @@ -42,7 +42,10 @@ #ifndef _NETGRAPH_NG_MESSAGE_H_ #define _NETGRAPH_NG_MESSAGE_H_ -/* ASCII string size limits */ +/* + * ASCII string size limits + * Check with struct sockaddr_ng if changing. + */ #define NG_TYPESIZ 32 /* max type name len (including null) */ #define NG_HOOKSIZ 32 /* max hook name len (including null) */ #define NG_NODESIZ 32 /* max node name len (including null) */ diff --git a/sys/netgraph/ng_socket.h b/sys/netgraph/ng_socket.h --- a/sys/netgraph/ng_socket.h +++ b/sys/netgraph/ng_socket.h @@ -60,7 +60,7 @@ struct sockaddr_ng { unsigned char sg_len; /* total length */ sa_family_t sg_family; /* address family */ - char sg_data[14]; /* actually longer; address value */ + char sg_data[32]; /* see NG_NODESIZ in ng_message.h */ }; #endif /* _NETGRAPH_NG_SOCKET_H_ */ diff --git a/tests/sys/netgraph/socket.c b/tests/sys/netgraph/socket.c --- a/tests/sys/netgraph/socket.c +++ b/tests/sys/netgraph/socket.c @@ -53,12 +53,7 @@ /* Named node. */ ATF_REQUIRE(NgMkSockNode(name, &cs, NULL) == 0); ATF_REQUIRE(getsockname(cs, (struct sockaddr *)&sg, &len) == 0); -#if 0 - /* sockaddr_ng truncates name now. */ ATF_REQUIRE(strcmp(sg.sg_data, NAME) == 0); -#else - ATF_REQUIRE(strncmp(sg.sg_data, NAME, sizeof(sg.sg_data)) == 0); -#endif } ATF_TP_ADD_TCS(tp)