summaryrefslogtreecommitdiffstats
path: root/sys/netgraph/ng_pppoe.c
diff options
context:
space:
mode:
authorharti <harti@FreeBSD.org>2004-01-26 14:05:31 +0000
committerharti <harti@FreeBSD.org>2004-01-26 14:05:31 +0000
commit14cb10664f95adf9dd36c845745d3d5c87d3d636 (patch)
treea18015e7df92db337721d9972123a9203ac17d71 /sys/netgraph/ng_pppoe.c
parent98f2740a9c4a3cda7a5f4e77919cfe1284eed47c (diff)
downloadFreeBSD-src-14cb10664f95adf9dd36c845745d3d5c87d3d636.zip
FreeBSD-src-14cb10664f95adf9dd36c845745d3d5c87d3d636.tar.gz
Get rid of the deprecated *LEN constants in favour of the new
*SIZ constants that include the trailing \0 byte.
Diffstat (limited to 'sys/netgraph/ng_pppoe.c')
-rw-r--r--sys/netgraph/ng_pppoe.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/netgraph/ng_pppoe.c b/sys/netgraph/ng_pppoe.c
index fb379b3..ba87b5d 100644
--- a/sys/netgraph/ng_pppoe.c
+++ b/sys/netgraph/ng_pppoe.c
@@ -917,7 +917,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';
NG_SEND_MSG_ID(error, NG_HOOK_NODE(sp->hook), msg, sp->creator, 0);
@@ -1763,7 +1763,7 @@ AAA
if (msg == NULL)
return (ENOMEM);
sts = (struct ngpppoe_sts *)msg->data;
- strncpy(sts->hook, NG_HOOK_NAME(sp->hook), NG_HOOKLEN + 1);
+ strncpy(sts->hook, NG_HOOK_NAME(sp->hook), NG_HOOKSIZ);
NG_SEND_MSG_ID(error, NG_HOOK_NODE(sp->hook), msg, sp->creator, 0);
return (error);
}
OpenPOWER on IntegriCloud