summaryrefslogtreecommitdiff
path: root/usr.sbin/ospfd/kroute.c
diff options
context:
space:
mode:
Diffstat (limited to 'usr.sbin/ospfd/kroute.c')
-rw-r--r--usr.sbin/ospfd/kroute.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/usr.sbin/ospfd/kroute.c b/usr.sbin/ospfd/kroute.c
index 51a67da19eb..9f924a87143 100644
--- a/usr.sbin/ospfd/kroute.c
+++ b/usr.sbin/ospfd/kroute.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: kroute.c,v 1.20 2005/08/08 08:38:42 claudio Exp $ */
+/* $OpenBSD: kroute.c,v 1.21 2005/12/14 00:44:40 claudio Exp $ */
/*
* Copyright (c) 2004 Esben Norby <norby@openbsd.org>
@@ -884,11 +884,12 @@ fetchifs(int ifindex)
if (sa->sa_family == AF_LINK) {
sdl = (struct sockaddr_dl *)sa;
if (sdl->sdl_nlen >= sizeof(kif->k.ifname))
- strlcpy(kif->k.ifname, sdl->sdl_data,
- sizeof(kif->k.ifname));
+ memcpy(kif->k.ifname, sdl->sdl_data,
+ sizeof(kif->k.ifname) - 1);
else if (sdl->sdl_nlen > 0)
- strlcpy(kif->k.ifname, sdl->sdl_data,
- sdl->sdl_nlen + 1);
+ memcpy(kif->k.ifname, sdl->sdl_data,
+ sdl->sdl_nlen);
+ /* string already terminated via calloc() */
}
kif_insert(kif);