diff options
author | 2010-06-26 18:02:07 +0000 | |
---|---|---|
committer | 2010-06-26 18:02:07 +0000 | |
commit | 370c8b16f06d274a06e92bb7a9cc30085441aea3 (patch) | |
tree | 47282db39b197eb85742cb628f75013a7de7caa1 | |
parent | merge release 1.10.2 (diff) | |
download | wireguard-openbsd-370c8b16f06d274a06e92bb7a9cc30085441aea3.tar.xz wireguard-openbsd-370c8b16f06d274a06e92bb7a9cc30085441aea3.zip |
Use offsetof() instead of writing our own version (...which generates
warnings from gcc4)
os claudio@
-rw-r--r-- | usr.sbin/ospfd/ospf.h | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/usr.sbin/ospfd/ospf.h b/usr.sbin/ospfd/ospf.h index 1bddb36de20..740fb4e8ad8 100644 --- a/usr.sbin/ospfd/ospf.h +++ b/usr.sbin/ospfd/ospf.h @@ -1,4 +1,4 @@ -/* $OpenBSD: ospf.h,v 1.18 2010/02/16 08:39:05 dlg Exp $ */ +/* $OpenBSD: ospf.h,v 1.19 2010/06/26 18:02:07 guenther Exp $ */ /* * Copyright (c) 2004, 2005 Esben Norby <norby@openbsd.org> @@ -22,6 +22,7 @@ #define _OSPF_H_ #include <netinet/in.h> +#include <stddef.h> /* misc */ #define OSPF_VERSION 2 @@ -238,7 +239,7 @@ struct lsa_hdr { u_int16_t len; }; -#define LS_CKSUM_OFFSET ((u_int16_t)(&((struct lsa_hdr *)0)->ls_chksum)) +#define LS_CKSUM_OFFSET offsetof(struct lsa_hdr, ls_chksum) struct lsa { struct lsa_hdr hdr; |