diff options
author | 2018-10-25 15:49:42 +0000 | |
---|---|---|
committer | 2018-10-25 15:49:42 +0000 | |
commit | d3aa99b5d9f5b7355680c77da7b670c489ee0367 (patch) | |
tree | a8343eeb60d3eab8a67c65d1e86c72d5ffb5494c | |
parent | Fix a resource leak in doaccept(). (diff) | |
download | wireguard-openbsd-d3aa99b5d9f5b7355680c77da7b670c489ee0367.tar.xz wireguard-openbsd-d3aa99b5d9f5b7355680c77da7b670c489ee0367.zip |
Calculate ASPATH_HEADER_SIZE correctly by using offsetof() instead of the
sizeof calculation that did not respect possible padding bytes.
OK sthen@ denis@
-rw-r--r-- | usr.sbin/bgpd/rde.h | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/usr.sbin/bgpd/rde.h b/usr.sbin/bgpd/rde.h index 6e73ff6f1a1..9be8402acb5 100644 --- a/usr.sbin/bgpd/rde.h +++ b/usr.sbin/bgpd/rde.h @@ -1,4 +1,4 @@ -/* $OpenBSD: rde.h,v 1.198 2018/10/24 08:26:37 claudio Exp $ */ +/* $OpenBSD: rde.h,v 1.199 2018/10/25 15:49:42 claudio Exp $ */ /* * Copyright (c) 2003, 2004 Claudio Jeker <claudio@openbsd.org> and @@ -23,6 +23,7 @@ #include <sys/queue.h> #include <sys/tree.h> #include <stdint.h> +#include <stddef.h> #include "bgpd.h" #include "log.h" @@ -125,7 +126,7 @@ struct rde_peer { #define AS_SEQUENCE 2 #define AS_CONFED_SEQUENCE 3 #define AS_CONFED_SET 4 -#define ASPATH_HEADER_SIZE (sizeof(struct aspath) - sizeof(u_char)) +#define ASPATH_HEADER_SIZE (offsetof(struct aspath, data)) struct aspath { LIST_ENTRY(aspath) entry; |