summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorClaudio Jeker <claudio@cvs.openbsd.org>2020-10-21 06:53:55 +0000
committerClaudio Jeker <claudio@cvs.openbsd.org>2020-10-21 06:53:55 +0000
commit1ef55573827541102157286dd09b439e5279cee8 (patch)
tree98cfa0a4213a9e70342bea9e5ba80ef3849a5173
parentf011e15df495a55eaebd7eafb4efb2126b90915a (diff)
Move tmp16 declaration into the #ifdef __KAME__ block to remove a compiler
warning on non __KAME__ systems. OK deraadt@
-rw-r--r--usr.sbin/bgpd/util.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/usr.sbin/bgpd/util.c b/usr.sbin/bgpd/util.c
index 90315c8a92a..e765ec2202e 100644
--- a/usr.sbin/bgpd/util.c
+++ b/usr.sbin/bgpd/util.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: util.c,v 1.54 2020/05/10 13:38:46 deraadt Exp $ */
+/* $OpenBSD: util.c,v 1.55 2020/10/21 06:53:54 claudio Exp $ */
/*
* Copyright (c) 2006 Claudio Jeker <claudio@openbsd.org>
@@ -69,7 +69,6 @@ const char *
log_in6addr(const struct in6_addr *addr)
{
struct sockaddr_in6 sa_in6;
- u_int16_t tmp16;
bzero(&sa_in6, sizeof(sa_in6));
sa_in6.sin6_family = AF_INET6;
@@ -79,6 +78,7 @@ log_in6addr(const struct in6_addr *addr)
/* XXX thanks, KAME, for this ugliness... adopted from route/show.c */
if (IN6_IS_ADDR_LINKLOCAL(&sa_in6.sin6_addr) ||
IN6_IS_ADDR_MC_LINKLOCAL(&sa_in6.sin6_addr)) {
+ u_int16_t tmp16;
memcpy(&tmp16, &sa_in6.sin6_addr.s6_addr[2], sizeof(tmp16));
sa_in6.sin6_scope_id = ntohs(tmp16);
sa_in6.sin6_addr.s6_addr[2] = 0;