summaryrefslogtreecommitdiff
path: root/zebra/ioctl_solaris.c
diff options
context:
space:
mode:
authorQuentin Young <qlyoung@cumulusnetworks.com>2019-02-25 17:37:34 +0000
committerQuentin Young <qlyoung@cumulusnetworks.com>2019-02-25 17:52:37 +0000
commit138a49659671bc247a98c51869c625e8fcd6d46e (patch)
tree31a62cbc67996a7c7dd21c170c0e856be6954616 /zebra/ioctl_solaris.c
parent5a80b8c7c254b9955e357555ebd929ab9bc123ef (diff)
zebra: remove all instances of strncpy
We have strlcpy. Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
Diffstat (limited to 'zebra/ioctl_solaris.c')
-rw-r--r--zebra/ioctl_solaris.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/zebra/ioctl_solaris.c b/zebra/ioctl_solaris.c
index fc554219bc..c523ee983d 100644
--- a/zebra/ioctl_solaris.c
+++ b/zebra/ioctl_solaris.c
@@ -44,7 +44,7 @@ extern struct zebra_privs_t zserv_privs;
/* clear and set interface name string */
void lifreq_set_name(struct lifreq *lifreq, const char *ifname)
{
- strncpy(lifreq->lifr_name, ifname, IFNAMSIZ);
+ strlcpy(lifreq->lifr_name, ifname, sizeof(lifreq->lifr_name));
}
int vrf_if_ioctl(unsigned long request, caddr_t buffer, vrf_id_t vrf_id)
@@ -199,7 +199,7 @@ int if_set_prefix(struct interface *ifp, struct connected *ifc)
ifaddr = *p;
- strncpy(ifreq.ifr_name, ifp->name, IFNAMSIZ);
+ strlcpy(ifreq.ifr_name, ifp->name, sizeof(ifreq.ifr_name));
addr.sin_addr = p->prefix;
addr.sin_family = p->family;
@@ -250,7 +250,7 @@ int if_unset_prefix(struct interface *ifp, struct connected *ifc)
p = (struct prefix_ipv4 *)ifc->address;
- strncpy(ifreq.ifr_name, ifp->name, IFNAMSIZ);
+ strlcpy(ifreq.ifr_name, ifp->name, sizeof(ifreq.ifr_name));
memset(&addr, 0, sizeof(struct sockaddr_in));
addr.sin_family = p->family;