summaryrefslogtreecommitdiff
path: root/usr.sbin/eigrpd/log.c
diff options
context:
space:
mode:
authorRenato Westphal <renato@cvs.openbsd.org>2016-02-21 18:56:50 +0000
committerRenato Westphal <renato@cvs.openbsd.org>2016-02-21 18:56:50 +0000
commitf19f2e96d3470069d6f90f7ad0de1bbfd259f7ea (patch)
tree851e88c53f72ea4a186c6731f26012fd1d7ce437 /usr.sbin/eigrpd/log.c
parent54da42ba9ad6a8ab87f50e96753770a5627cacdd (diff)
Copy structs by assignment instead of memcpy.
Copying by straight assignment is shorter, easier to read and has a higher level of abstraction. We'll only avoid it when copying from an unaligned source (e.g., network buffers).
Diffstat (limited to 'usr.sbin/eigrpd/log.c')
-rw-r--r--usr.sbin/eigrpd/log.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/usr.sbin/eigrpd/log.c b/usr.sbin/eigrpd/log.c
index ce8ad3998fc..79bf8214699 100644
--- a/usr.sbin/eigrpd/log.c
+++ b/usr.sbin/eigrpd/log.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: log.c,v 1.1 2015/10/02 04:26:47 renato Exp $ */
+/* $OpenBSD: log.c,v 1.2 2016/02/21 18:56:49 renato Exp $ */
/*
* Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org>
@@ -195,7 +195,7 @@ log_in6addr(const struct in6_addr *addr)
memset(&sa_in6, 0, sizeof(sa_in6));
sa_in6.sin6_len = sizeof(sa_in6);
sa_in6.sin6_family = AF_INET6;
- memcpy(&sa_in6.sin6_addr, addr, sizeof(sa_in6.sin6_addr));
+ sa_in6.sin6_addr = *addr;
recoverscope(&sa_in6);
@@ -210,7 +210,7 @@ log_in6addr_scope(const struct in6_addr *addr, unsigned int ifindex)
memset(&sa_in6, 0, sizeof(sa_in6));
sa_in6.sin6_len = sizeof(sa_in6);
sa_in6.sin6_family = AF_INET6;
- memcpy(&sa_in6.sin6_addr, addr, sizeof(sa_in6.sin6_addr));
+ sa_in6.sin6_addr = *addr;
addscope(&sa_in6, ifindex);