diff --git a/sys/dev/netif/ar/if_ar.c b/sys/dev/netif/ar/if_ar.c
index 04a439a..3709d74 100644
--- a/sys/dev/netif/ar/if_ar.c
+++ b/sys/dev/netif/ar/if_ar.c
@@ -123,7 +123,7 @@ struct ar_softc {
 	int	running;	/* something is attached so we are running */
 	int	dcd;		/* do we have dcd? */
 	/* ---netgraph bits --- */
-	char		nodename[NG_NODELEN + 1]; /* store our node name */
+	char		nodename[NG_NODESIZ]; /* store our node name */
 	int		datahooks;	/* number of data hooks attached */
 	node_p		node;		/* netgraph node */
 	hook_p		hook;		/* data hook */
diff --git a/sys/dev/netif/mn/if_mn.c b/sys/dev/netif/mn/if_mn.c
index 9e6d44c..87eaca1 100644
--- a/sys/dev/netif/mn/if_mn.c
+++ b/sys/dev/netif/mn/if_mn.c
@@ -259,7 +259,7 @@ struct softc {
 	char		name[8];
 	u_int32_t	falc_irq, falc_state, framer_state;
 	struct schan *ch[M32_CHAN];
-	char	nodename[NG_NODELEN + 1];
+	char	nodename[NG_NODESIZ];
 	node_p	node;
 
 	u_long		cnt_fec;
diff --git a/sys/dev/netif/sr/if_sr.c b/sys/dev/netif/sr/if_sr.c
index da1a29c..717d619 100644
--- a/sys/dev/netif/sr/if_sr.c
+++ b/sys/dev/netif/sr/if_sr.c
@@ -139,7 +139,7 @@ struct sr_softc {
 	int	running;	/* something is attached so we are running */
 	int	dcd;		/* do we have dcd? */
 	/* ---netgraph bits --- */
-	char		nodename[NG_NODELEN + 1]; /* store our node name */
+	char		nodename[NG_NODESIZ]; /* store our node name */
 	int		datahooks;	/* number of data hooks attached */
 	node_p		node;		/* netgraph node */
 	hook_p		hook;		/* data hook */
@@ -2852,8 +2852,8 @@ ngsr_rcvmsg(node_p node,
 			    (*resp)->header.token = msg->header.token;
 			    (*resp)->header.typecookie = NG_SR_COOKIE;
 			    (*resp)->header.cmd = msg->header.cmd;
-			    strncpy((*resp)->header.cmdstr, "status",
-					NG_CMDSTRLEN);
+			    strlcpy((*resp)->header.cmdstr, "status",
+					NG_CMDSTRSIZ);
 			}
 			break;
 	    	    default:
diff --git a/sys/netgraph/bpf/ng_bpf.h b/sys/netgraph/bpf/ng_bpf.h
index 51e1e5f..8e7cde2 100644
--- a/sys/netgraph/bpf/ng_bpf.h
+++ b/sys/netgraph/bpf/ng_bpf.h
@@ -50,9 +50,9 @@
 
 /* Program structure for one hook */
 struct ng_bpf_hookprog {
-	char		thisHook[NG_HOOKLEN+1];		/* name of hook */
-	char		ifMatch[NG_HOOKLEN+1];		/* match dest hook */
-	char		ifNotMatch[NG_HOOKLEN+1];	/* !match dest hook */
+	char		thisHook[NG_HOOKSIZ];		/* name of hook */
+	char		ifMatch[NG_HOOKSIZ];		/* match dest hook */
+	char		ifNotMatch[NG_HOOKSIZ];		/* !match dest hook */
 	int32_t		bpf_prog_len;			/* #isns in program */
 	struct bpf_insn	bpf_prog[__ARRAY_ZERO];		/* bpf program */
 };
@@ -95,9 +95,9 @@ struct ng_bpf_hookstat {
 enum {
 	NGM_BPF_SET_PROGRAM = 1,	/* supply a struct ng_bpf_hookprog */
 	NGM_BPF_GET_PROGRAM,		/* returns a struct ng_bpf_hookprog */
-	NGM_BPF_GET_STATS,		/* supply name as char[NG_HOOKLEN+1] */
-	NGM_BPF_CLR_STATS,		/* supply name as char[NG_HOOKLEN+1] */
-	NGM_BPF_GETCLR_STATS,		/* supply name as char[NG_HOOKLEN+1] */
+	NGM_BPF_GET_STATS,		/* supply name as char[NG_HOOKSIZ] */
+	NGM_BPF_CLR_STATS,		/* supply name as char[NG_HOOKSIZ] */
+	NGM_BPF_GETCLR_STATS,		/* supply name as char[NG_HOOKSIZ] */
 };
 
 #endif /* _NETGRAPH_BPF_H_ */
diff --git a/sys/netgraph/bridge/ng_bridge.c b/sys/netgraph/bridge/ng_bridge.c
index 77840db..3f7d718 100644
--- a/sys/netgraph/bridge/ng_bridge.c
+++ b/sys/netgraph/bridge/ng_bridge.c
@@ -1012,7 +1012,7 @@ ng_bridge_timeout(void *arg)
 static const char *
 ng_bridge_nodename(node_p node)
 {
-	static char name[NG_NODELEN+1];
+	static char name[NG_NODESIZ];
 
 	if (node->name != NULL)
 		ksnprintf(name, sizeof(name), "%s", node->name);
diff --git a/sys/netgraph/etf/ng_etf.h b/sys/netgraph/etf/ng_etf.h
index 6f42c21..6a45fe4 100644
--- a/sys/netgraph/etf/ng_etf.h
+++ b/sys/netgraph/etf/ng_etf.h
@@ -73,7 +73,7 @@ struct ng_etfstat {
 
 /* This structure is returned by the NGM_ETF_GET_STATUS command */
 struct ng_etffilter {
-	char		matchhook[NG_HOOKLEN + 1]; /* hook name */
+	char		matchhook[NG_HOOKSIZ]; /* hook name */
 	u_int16_t	ethertype;	/* this ethertype to this hook */
 };	
 
diff --git a/sys/netgraph/ksocket/ng_ksocket.c b/sys/netgraph/ksocket/ng_ksocket.c
index 891251f..5995a9a 100644
--- a/sys/netgraph/ksocket/ng_ksocket.c
+++ b/sys/netgraph/ksocket/ng_ksocket.c
@@ -83,7 +83,7 @@ struct ng_ksocket_private {
 	LIST_ENTRY(ng_ksocket_private)	siblings;
 	u_int32_t	flags;
 	u_int32_t	response_token;
-	char		response_addr[NG_PATHLEN+1];
+	char		response_addr[NG_PATHSIZ];
 };
 typedef struct ng_ksocket_private *priv_p;
 
@@ -568,7 +568,7 @@ ng_ksocket_newhook(node_p node, hook_p hook, const char *name0)
 	struct thread *td = curthread->td_proc ? curthread : &thread0;	/* XXX broken */
 	const priv_p priv = node->private;
 	struct ng_mesg *msg;
-	char *s1, *s2, name[NG_HOOKLEN+1];
+	char *s1, *s2, name[NG_HOOKSIZ];
 	int family, type, protocol, error;
 
 	/* Check if we're already connected */
diff --git a/sys/netgraph/netgraph/ng_base.c b/sys/netgraph/netgraph/ng_base.c
index 0909da2..dbaa4b0 100644
--- a/sys/netgraph/netgraph/ng_base.c
+++ b/sys/netgraph/netgraph/ng_base.c
@@ -323,7 +323,7 @@ linker_api_available(void)
 static int
 ng_load_module(const char *name)
 {
-	char *path, filename[NG_TYPELEN + 4];
+	char *path, filename[NG_TYPESIZ + 3];
 	linker_file_t lf;
 	int error;
 
@@ -344,7 +344,7 @@ ng_load_module(const char *name)
 static int
 ng_unload_module(const char *name)
 {
-	char filename[NG_TYPELEN + 4];
+	char filename[NG_TYPESIZ + 3];
 	linker_file_t lf;
 	int error;
 
@@ -581,7 +581,7 @@ ng_name_node(node_p node, const char *name)
 	int i;
 
 	/* Check the name is valid */
-	for (i = 0; i < NG_NODELEN + 1; i++) {
+	for (i = 0; i < NG_NODESIZ; i++) {
 		if (name[i] == '\0' || name[i] == '.' || name[i] == ':')
 			break;
 	}
@@ -903,7 +903,7 @@ ng_newtype(struct ng_type *tp)
 	const size_t namelen = strlen(tp->name);
 
 	/* Check version and type name fields */
-	if (tp->version != NG_VERSION || namelen == 0 || namelen > NG_TYPELEN) {
+	if (tp->version != NG_VERSION || namelen == 0 || namelen >= NG_TYPESIZ) {
 		TRAP_ERROR;
 		return (EINVAL);
 	}
@@ -1092,7 +1092,7 @@ int
 ng_path2node(node_p here, const char *address, node_p *destp, char **rtnp)
 {
 	const	node_p start = here;
-	char    fullpath[NG_PATHLEN + 1];
+	char    fullpath[NG_PATHSIZ];
 	char   *nodename, *path, pbuf[2];
 	node_p  node;
 	char   *cp;
@@ -1173,7 +1173,7 @@ ng_path2node(node_p here, const char *address, node_p *destp, char **rtnp)
 
 	/* Now compute return address, i.e., the path to the sender */
 	if (rtnp != NULL) {
-		MALLOC(*rtnp, char *, NG_NODELEN + 2, M_NETGRAPH, M_NOWAIT);
+		MALLOC(*rtnp, char *, NG_NODESIZ + 1, M_NETGRAPH, M_NOWAIT);
 		if (*rtnp == NULL) {
 			TRAP_ERROR;
 			return (ENOMEM);
@@ -1350,8 +1350,8 @@ ng_generic_msg(node_p here, struct ng_mesg *msg, const char *retaddr,
 		/* Fill in node info */
 		ni = (struct nodeinfo *) rp->data;
 		if (here->name != NULL)
-			strncpy(ni->name, here->name, NG_NODELEN);
-		strncpy(ni->type, here->type->name, NG_TYPELEN);
+			strlcpy(ni->name, here->name, NG_NODESIZ);
+		strlcpy(ni->type, here->type->name, NG_TYPESIZ);
 		ni->id = ng_node2ID(here);
 		ni->hooks = here->numhooks;
 		*resp = rp;
@@ -1381,8 +1381,8 @@ ng_generic_msg(node_p here, struct ng_mesg *msg, const char *retaddr,
 
 		/* Fill in node info */
 		if (here->name)
-			strncpy(ni->name, here->name, NG_NODELEN);
-		strncpy(ni->type, here->type->name, NG_TYPELEN);
+			strlcpy(ni->name, here->name, NG_NODESIZ);
+		strlcpy(ni->type, here->type->name, NG_TYPESIZ);
 		ni->id = ng_node2ID(here);
 
 		/* Cycle through the linked list of hooks */
@@ -1397,13 +1397,13 @@ ng_generic_msg(node_p here, struct ng_mesg *msg, const char *retaddr,
 			}
 			if ((hook->flags & HK_INVALID) != 0)
 				continue;
-			strncpy(link->ourhook, hook->name, NG_HOOKLEN);
-			strncpy(link->peerhook, hook->peer->name, NG_HOOKLEN);
+			strlcpy(link->ourhook, hook->name, NG_HOOKSIZ);
+			strlcpy(link->peerhook, hook->peer->name, NG_HOOKSIZ);
 			if (hook->peer->node->name != NULL)
-				strncpy(link->nodeinfo.name,
-				    hook->peer->node->name, NG_NODELEN);
-			strncpy(link->nodeinfo.type,
-			   hook->peer->node->type->name, NG_TYPELEN);
+				strlcpy(link->nodeinfo.name,
+				    hook->peer->node->name, NG_NODESIZ);
+			strlcpy(link->nodeinfo.type,
+			   hook->peer->node->type->name, NG_TYPESIZ);
 			link->nodeinfo.id = ng_node2ID(hook->peer->node);
 			link->nodeinfo.hooks = hook->peer->node->numhooks;
 			ni->hooks++;
@@ -1461,8 +1461,8 @@ ng_generic_msg(node_p here, struct ng_mesg *msg, const char *retaddr,
 			if (!unnamed && node->name == NULL)
 				continue;
 			if (node->name != NULL)
-				strncpy(np->name, node->name, NG_NODELEN);
-			strncpy(np->type, node->type->name, NG_TYPELEN);
+				strlcpy(np->name, node->name, NG_NODESIZ);
+			strlcpy(np->type, node->type->name, NG_TYPESIZ);
 			np->id = ng_node2ID(node);
 			np->hooks = node->numhooks;
 			nl->numnames++;
@@ -1510,7 +1510,7 @@ ng_generic_msg(node_p here, struct ng_mesg *msg, const char *retaddr,
 				    __func__, "types");
 				break;
 			}
-			strncpy(tp->type_name, type->name, NG_TYPELEN);
+			strlcpy(tp->type_name, type->name, NG_TYPESIZ);
 			tp->numnodes = type->refs - 1; /* don't count list */
 			tl->numtypes++;
 		}
diff --git a/sys/netgraph/netgraph/ng_parse.c b/sys/netgraph/netgraph/ng_parse.c
index 52dca99..47bf133 100644
--- a/sys/netgraph/netgraph/ng_parse.c
+++ b/sys/netgraph/netgraph/ng_parse.c
@@ -820,7 +820,7 @@ const struct ng_parse_type ng_parse_fixedstring_type = {
 };
 
 const struct ng_parse_fixedstring_info ng_parse_nodebuf_info = {
-	NG_NODELEN + 1
+	NG_NODESIZ
 };
 const struct ng_parse_type ng_parse_nodebuf_type = {
 	&ng_parse_fixedstring_type,
@@ -828,7 +828,7 @@ const struct ng_parse_type ng_parse_nodebuf_type = {
 };
 
 const struct ng_parse_fixedstring_info ng_parse_hookbuf_info = {
-	NG_HOOKLEN + 1
+	NG_HOOKSIZ
 };
 const struct ng_parse_type ng_parse_hookbuf_type = {
 	&ng_parse_fixedstring_type,
@@ -836,7 +836,7 @@ const struct ng_parse_type ng_parse_hookbuf_type = {
 };
 
 const struct ng_parse_fixedstring_info ng_parse_pathbuf_info = {
-	NG_PATHLEN + 1
+	NG_PATHSIZ
 };
 const struct ng_parse_type ng_parse_pathbuf_type = {
 	&ng_parse_fixedstring_type,
@@ -844,7 +844,7 @@ const struct ng_parse_type ng_parse_pathbuf_type = {
 };
 
 const struct ng_parse_fixedstring_info ng_parse_typebuf_info = {
-	NG_TYPELEN + 1
+	NG_TYPESIZ
 };
 const struct ng_parse_type ng_parse_typebuf_type = {
 	&ng_parse_fixedstring_type,
@@ -852,7 +852,7 @@ const struct ng_parse_type ng_parse_typebuf_type = {
 };
 
 const struct ng_parse_fixedstring_info ng_parse_cmdbuf_info = {
-	NG_CMDSTRLEN + 1
+	NG_CMDSTRSIZ
 };
 const struct ng_parse_type ng_parse_cmdbuf_type = {
 	&ng_parse_fixedstring_type,
diff --git a/sys/netgraph/ng_device.c b/sys/netgraph/ng_device.c
index 04788cd..eceea8f 100644
--- a/sys/netgraph/ng_device.c
+++ b/sys/netgraph/ng_device.c
@@ -98,7 +98,7 @@ struct ngd_softc {
 	SLIST_HEAD(, ngd_connection) head;
 
 	node_p node;
-	char nodename[NG_NODELEN + 1];
+	char nodename[NG_NODESIZ];
 } ngd_softc;
 
 /* helper definition */
diff --git a/sys/netgraph/ng_message.h b/sys/netgraph/ng_message.h
index a8b59e2..dacf622 100644
--- a/sys/netgraph/ng_message.h
+++ b/sys/netgraph/ng_message.h
@@ -49,11 +49,11 @@
 #endif
 
 /* ASCII string size limits */
-#define NG_TYPELEN	15	/* max type name len (16 with null) */
-#define NG_HOOKLEN	15	/* max hook name len (16 with null) */
-#define NG_NODELEN	15	/* max node name len (16 with null) */
-#define NG_PATHLEN	511	/* max path len     (512 with null) */
-#define NG_CMDSTRLEN	15	/* max command string (16 with null) */
+#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) */
+#define NG_PATHSIZ	512	/* max path len (including null) */
+#define NG_CMDSTRSIZ	32	/* max command string (including null) */
 #define NG_TEXTRESPONSE 1024	/* allow this length for a text response */
 
 /* A netgraph message */
@@ -66,7 +66,7 @@ struct ng_mesg {
 		u_int32_t	token;			/* match with reply */
 		u_int32_t	typecookie;		/* node's type cookie */
 		u_int32_t	cmd;			/* command identifier */
-		u_char		cmdstr[NG_CMDSTRLEN+1];	/* cmd string + \0 */
+		u_char		cmdstr[NG_CMDSTRSIZ];	/* cmd string */
 	} header;
 	char	data[0];		/* placeholder for actual data */
 };
@@ -122,9 +122,9 @@ struct ng_mesg {
 
 /* Structure used for NGM_MKPEER */
 struct ngm_mkpeer {
-	char	type[NG_TYPELEN + 1];			/* peer type */
-	char	ourhook[NG_HOOKLEN + 1];		/* hook name */
-	char	peerhook[NG_HOOKLEN + 1];		/* peer hook name */
+	char	type[NG_TYPESIZ];		/* peer type */
+	char	ourhook[NG_HOOKSIZ];		/* hook name */
+	char	peerhook[NG_HOOKSIZ];		/* peer hook name */
 };
 
 /* Keep this in sync with the above structure definition */
@@ -137,9 +137,9 @@ struct ngm_mkpeer {
 
 /* Structure used for NGM_CONNECT */
 struct ngm_connect {
-	char	path[NG_PATHLEN + 1];			/* peer path */
-	char	ourhook[NG_HOOKLEN + 1];		/* hook name */
-	char	peerhook[NG_HOOKLEN + 1];		/* peer hook name */
+	char	path[NG_PATHSIZ];		/* peer path */
+	char	ourhook[NG_HOOKSIZ];		/* hook name */
+	char	peerhook[NG_HOOKSIZ];		/* peer hook name */
 };
 
 /* Keep this in sync with the above structure definition */
@@ -152,7 +152,7 @@ struct ngm_connect {
 
 /* Structure used for NGM_NAME */
 struct ngm_name {
-	char	name[NG_NODELEN + 1];			/* node name */
+	char	name[NG_NODESIZ];			/* node name */
 };
 
 /* Keep this in sync with the above structure definition */
@@ -163,7 +163,7 @@ struct ngm_name {
 
 /* Structure used for NGM_RMHOOK */
 struct ngm_rmhook {
-	char	ourhook[NG_HOOKLEN + 1];		/* hook name */
+	char	ourhook[NG_HOOKSIZ];		/* hook name */
 };
 
 /* Keep this in sync with the above structure definition */
@@ -174,8 +174,8 @@ struct ngm_rmhook {
 
 /* Structure used for NGM_NODEINFO */
 struct nodeinfo {
-	char		name[NG_NODELEN + 1];	/* node name (if any) */
-        char    	type[NG_TYPELEN + 1];   /* peer type */
+	char		name[NG_NODESIZ];	/* node name (if any) */
+        char    	type[NG_TYPESIZ];	/* peer type */
 	ng_ID_t		id;			/* unique identifier */
 	u_int32_t	hooks;			/* number of active hooks */
 };
@@ -191,8 +191,8 @@ struct nodeinfo {
 
 /* Structure used for NGM_LISTHOOKS */
 struct linkinfo {
-	char		ourhook[NG_HOOKLEN + 1];	/* hook name */
-	char		peerhook[NG_HOOKLEN + 1];	/* peer hook */
+	char		ourhook[NG_HOOKSIZ];	/* hook name */
+	char		peerhook[NG_HOOKSIZ];	/* peer hook */
 	struct nodeinfo	nodeinfo;
 };
 
@@ -231,7 +231,7 @@ struct namelist {
 
 /* Structure used for NGM_LISTTYPES */
 struct typeinfo {
-	char		type_name[NG_TYPELEN + 1];	/* name of type */
+	char		type_name[NG_TYPESIZ];		/* name of type */
 	u_int32_t	numnodes;			/* number alive */
 };
 
diff --git a/sys/netgraph/ng_parse.h b/sys/netgraph/ng_parse.h
index 378eccd..cc5329f 100644
--- a/sys/netgraph/ng_parse.h
+++ b/sys/netgraph/ng_parse.h
@@ -398,11 +398,11 @@ struct ng_parse_fixedstring_info {
 /*
  * COMMONLY USED BOUNDED LENGTH STRING TYPES
  */
-extern const struct ng_parse_type ng_parse_nodebuf_type;  /* NG_NODELEN + 1 */
-extern const struct ng_parse_type ng_parse_hookbuf_type;  /* NG_HOOKLEN + 1 */
-extern const struct ng_parse_type ng_parse_pathbuf_type;  /* NG_PATHLEN + 1 */
-extern const struct ng_parse_type ng_parse_typebuf_type;  /* NG_TYPELEN + 1 */
-extern const struct ng_parse_type ng_parse_cmdbuf_type;   /* NG_CMDSTRLEN + 1 */
+extern const struct ng_parse_type ng_parse_nodebuf_type;  /* NG_NODESIZ */
+extern const struct ng_parse_type ng_parse_hookbuf_type;  /* NG_HOOKSIZ */
+extern const struct ng_parse_type ng_parse_pathbuf_type;  /* NG_PATHSIZ */
+extern const struct ng_parse_type ng_parse_typebuf_type;  /* NG_TYPESIZ */
+extern const struct ng_parse_type ng_parse_cmdbuf_type;   /* NG_CMDSTRSIZ */
 
 /*
  * INTEGER TYPES
diff --git a/sys/netgraph/ppp/ng_ppp.c b/sys/netgraph/ppp/ng_ppp.c
index 3f519cc..39bf033 100644
--- a/sys/netgraph/ppp/ng_ppp.c
+++ b/sys/netgraph/ppp/ng_ppp.c
@@ -560,7 +560,7 @@ ng_ppp_rcvmsg(node_p node, struct ng_mesg *msg,
 		break;
 	case NGM_VJC_COOKIE:
 	    {
-		char path[NG_PATHLEN + 1];
+		char path[NG_PATHSIZ];
 		node_p origNode;
 
 		if ((error = ng_path2node(node, raddr, &origNode, NULL)) != 0)
diff --git a/sys/netgraph/pppoe/ng_pppoe.c b/sys/netgraph/pppoe/ng_pppoe.c
index cde7fdd..ac8b38b 100644
--- a/sys/netgraph/pppoe/ng_pppoe.c
+++ b/sys/netgraph/pppoe/ng_pppoe.c
@@ -142,7 +142,7 @@ struct sess_con {
 	hook_p  		hook;
 	u_int16_t		Session_ID;
 	enum state		state;
-	char			creator[NG_NODELEN + 1]; /* who to notify */
+	char			creator[NG_NODESIZ]; /* who to notify */
 	struct pppoe_full_hdr	pkt_hdr;	/* used when connected */
 	negp			neg;		/* used when negotiating */
 	/*struct sess_con	*hash_next;*/	/* not yet used */
@@ -685,8 +685,7 @@ AAA
 			neg->pkt->pkt_header.ph.sid = 0x0000;
 			neg->timeout = 0;
 
-			strncpy(sp->creator, retaddr, NG_NODELEN);
-			sp->creator[NG_NODELEN] = '\0';
+			strlcpy(sp->creator, retaddr, NG_NODESIZ);
 		}
 		switch (msg->header.cmd) {
 		case NGM_PPPOE_GET_STATUS:
@@ -849,7 +848,7 @@ send_acname(sessp sp, const struct pppoe_tag *tag)
 		return (ENOMEM);
 
 	sts = (struct ngpppoe_sts *)msg->data;
-	tlen = min(NG_HOOKLEN, ntohs(tag->tag_len));
+	tlen = min(NG_HOOKSIZ - 1, ntohs(tag->tag_len));
 	strncpy(sts->hook, tag->tag_data, tlen);
 	sts->hook[tlen] = '\0';
 	error = ng_send_msg(sp->hook->node, msg, sp->creator, NULL);
@@ -1676,7 +1675,7 @@ AAA
 	if (msg == NULL)
 		return (ENOMEM);
 	sts = (struct ngpppoe_sts *)msg->data;
-	strncpy(sts->hook, sp->hook->name, NG_HOOKLEN + 1);
+	strlcpy(sts->hook, sp->hook->name, NG_HOOKSIZ);
 	error = ng_send_msg(sp->hook->node, msg, sp->creator, NULL);
 	return (error);
 }
diff --git a/sys/netgraph/pppoe/ng_pppoe.h b/sys/netgraph/pppoe/ng_pppoe.h
index 8dc9163..63f2a39 100644
--- a/sys/netgraph/pppoe/ng_pppoe.h
+++ b/sys/netgraph/pppoe/ng_pppoe.h
@@ -109,8 +109,8 @@ struct ngpppoestat {
  * and begin negotiation.
  */
 struct ngpppoe_init_data {
-	char	hook[NG_HOOKLEN + 1];	/* hook to monitor on */
-	u_int16_t	data_len;		/* Length of the service name */
+	char	hook[NG_HOOKSIZ];	/* hook to monitor on */
+	u_int16_t	data_len;	/* Length of the service name */
 	char	data[0];		/* init data goes here */
 };
 
@@ -120,7 +120,7 @@ struct ngpppoe_init_data {
  * to whoever requested the connection. (close may use this too).
  */
 struct ngpppoe_sts {
-	char	hook[NG_HOOKLEN + 1]; /* hook associated with event session */
+	char	hook[NG_HOOKSIZ]; /* hook associated with event session */
 };
 
 
diff --git a/sys/netgraph/socket/ng_socket.c b/sys/netgraph/socket/ng_socket.c
index 9aef3ac..447e8e2 100644
--- a/sys/netgraph/socket/ng_socket.c
+++ b/sys/netgraph/socket/ng_socket.c
@@ -313,7 +313,7 @@ ngd_send(struct socket *so, int flags, struct mbuf *m, struct sockaddr *addr,
 	meta_p  mp = NULL;
 	int     len, error;
 	hook_p  hook = NULL;
-	char	hookname[NG_HOOKLEN + 1];
+	char	hookname[NG_HOOKSIZ];
 
 	if ((pcbp == NULL) || (control != NULL)) {
 		error = EINVAL;
@@ -340,7 +340,7 @@ ngd_send(struct socket *so, int flags, struct mbuf *m, struct sockaddr *addr,
 		 */
 		hook = LIST_FIRST(&pcbp->sockdata->node->hooks);
 	} else {
-		if (len > NG_HOOKLEN) {
+		if (len >= NG_HOOKSIZ) {
 			error = EINVAL;
 			goto release;
 		}
@@ -803,7 +803,7 @@ ngs_rcvdata(hook_p hook, struct mbuf *m, meta_p meta)
 	struct ngpcb *const pcbp = sockdata->datasock;
 	struct socket *so;
 	struct sockaddr_ng *addr;
-	char *addrbuf[NG_HOOKLEN + 1 + 4];
+	char *addrbuf[NG_HOOKSIZ + 4];
 	int addrlen;
 
 	/* If there is no data socket, black-hole it */
@@ -814,7 +814,7 @@ ngs_rcvdata(hook_p hook, struct mbuf *m, meta_p meta)
 	so = pcbp->ng_socket;
 
 	/* Get the return address into a sockaddr. */
-	addrlen = strlen(hook->name);	/* <= NG_HOOKLEN */
+	addrlen = strlen(hook->name);	/* <= NG_HOOKSIZ - 1 */
 	addr = (struct sockaddr_ng *) addrbuf;
 	addr->sg_len = addrlen + 3;
 	addr->sg_family = AF_NETGRAPH;
