summaryrefslogtreecommitdiffstats
path: root/sys/netgraph/atm
diff options
context:
space:
mode:
Diffstat (limited to 'sys/netgraph/atm')
-rw-r--r--sys/netgraph/atm/ng_atm.c8
-rw-r--r--sys/netgraph/atm/ng_atm.h4
2 files changed, 6 insertions, 6 deletions
diff --git a/sys/netgraph/atm/ng_atm.c b/sys/netgraph/atm/ng_atm.c
index f1afeb1..1750cdd 100644
--- a/sys/netgraph/atm/ng_atm.c
+++ b/sys/netgraph/atm/ng_atm.c
@@ -991,7 +991,7 @@ ng_atm_rcvmsg(node_p node, item_p item, hook_p lasthook)
case NGM_ATM_GET_VCC:
{
- char hook[NG_HOOKLEN + 1];
+ char hook[NG_HOOKSIZ];
struct atmio_vcctable *vccs;
struct ngvcc *vcc;
u_int i;
@@ -1000,12 +1000,12 @@ ng_atm_rcvmsg(node_p node, item_p item, hook_p lasthook)
error = ENXIO;
break;
}
- if (msg->header.arglen != NG_HOOKLEN + 1) {
+ if (msg->header.arglen != NG_HOOKSIZ) {
error = EINVAL;
break;
}
- strncpy(hook, msg->data, NG_HOOKLEN + 1);
- hook[NG_HOOKLEN] = '\0';
+ strncpy(hook, msg->data, NG_HOOKSIZ);
+ hook[NG_HOOKSIZ - 1] = '\0';
LIST_FOREACH(vcc, &priv->vccs, link)
if (strcmp(NG_HOOK_NAME(vcc->hook), hook) == 0)
break;
diff --git a/sys/netgraph/atm/ng_atm.h b/sys/netgraph/atm/ng_atm.h
index 675b437..ebf7cb6 100644
--- a/sys/netgraph/atm/ng_atm.h
+++ b/sys/netgraph/atm/ng_atm.h
@@ -126,7 +126,7 @@ struct ngm_atm_config {
* Structure to open a VCC.
*/
struct ngm_atm_cpcs_init {
- char name[NG_HOOKLEN + 1];
+ char name[NG_HOOKSIZ];
uint32_t flags; /* flags. (if_atm.h) */
uint16_t vci; /* VCI to open */
uint16_t vpi; /* VPI to open */
@@ -177,7 +177,7 @@ struct ngm_atm_cpcs_init {
* Structure to close a VCI without disconnecting the hook
*/
struct ngm_atm_cpcs_term {
- char name[NG_HOOKLEN + 1];
+ char name[NG_HOOKSIZ];
};
#define NGM_ATM_CPCS_TERM_INFO \
{ \
OpenPOWER on IntegriCloud