summaryrefslogtreecommitdiff
path: root/usr.sbin/bgpd
diff options
context:
space:
mode:
authorClaudio Jeker <claudio@cvs.openbsd.org>2018-07-22 06:03:18 +0000
committerClaudio Jeker <claudio@cvs.openbsd.org>2018-07-22 06:03:18 +0000
commit7b1530f152f8d6b109c0e2e7406fdc6148b37d5f (patch)
tree82a8b8f76c03e635d0c703862aa6347a3569e71f /usr.sbin/bgpd
parent0fe42dda2dff6b26f0c22e60ca1d4c93db66f9e1 (diff)
Adjust a log message and make sure that the data pointer is never increased
beyond the end. There was no access to it but still bad style. OK tb@
Diffstat (limited to 'usr.sbin/bgpd')
-rw-r--r--usr.sbin/bgpd/rde.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/usr.sbin/bgpd/rde.c b/usr.sbin/bgpd/rde.c
index 3afe468ed9c..686c1befcda 100644
--- a/usr.sbin/bgpd/rde.c
+++ b/usr.sbin/bgpd/rde.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: rde.c,v 1.397 2018/07/20 14:58:20 claudio Exp $ */
+/* $OpenBSD: rde.c,v 1.398 2018/07/22 06:03:17 claudio Exp $ */
/*
* Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org>
@@ -1222,7 +1222,7 @@ rde_update_dispatch(struct imsg *imsg)
state.aspath.nexthop = NULL;
}
if ((pos = rde_get_mp_nexthop(mpp, mplen, aid, &state)) == -1) {
- log_peer_warnx(&peer->conf, "bad nlri prefix");
+ log_peer_warnx(&peer->conf, "bad nlri nexthop");
rde_update_err(peer, ERR_UPDATE, ERR_UPD_OPTATTR,
mpa.reach, mpa.reach_len);
goto done;
@@ -1815,9 +1815,9 @@ rde_get_mp_nexthop(u_char *data, u_int16_t len, u_int8_t aid,
log_warnx("bad multiprotocol nexthop, bad size");
return (-1);
}
- data += sizeof(u_int64_t);
nexthop.aid = AID_INET;
- memcpy(&nexthop.v4, data, sizeof(nexthop.v4));
+ memcpy(&nexthop.v4, data + sizeof(u_int64_t),
+ sizeof(nexthop.v4));
break;
default:
log_warnx("bad multiprotocol nexthop, bad AID");