diff options
author | Claudio Jeker <claudio@cvs.openbsd.org> | 2010-07-14 17:06:53 +0000 |
---|---|---|
committer | Claudio Jeker <claudio@cvs.openbsd.org> | 2010-07-14 17:06:53 +0000 |
commit | f51b553ba61c61a6b84975dcb563401977bc1c91 (patch) | |
tree | 5aad48606d7555c9548fdfaa3ee1e62146910abf /usr.sbin/ospf6d | |
parent | 8191e05dd61cac932a5589aaf0aae7688e258bb2 (diff) |
use offsetof() instead of self knitted version to please gcc4.
stolen from ospf.h
Diffstat (limited to 'usr.sbin/ospf6d')
-rw-r--r-- | usr.sbin/ospf6d/ospf6.h | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/usr.sbin/ospf6d/ospf6.h b/usr.sbin/ospf6d/ospf6.h index 00b70742476..10f8889cb1e 100644 --- a/usr.sbin/ospf6d/ospf6.h +++ b/usr.sbin/ospf6d/ospf6.h @@ -1,4 +1,4 @@ -/* $OpenBSD: ospf6.h,v 1.16 2010/02/23 11:20:03 claudio Exp $ */ +/* $OpenBSD: ospf6.h,v 1.17 2010/07/14 17:06:52 claudio Exp $ */ /* * Copyright (c) 2004, 2005, 2007 Esben Norby <norby@openbsd.org> @@ -22,6 +22,7 @@ #define _OSPF_H_ #include <netinet/in.h> +#include <stddef.h> /* misc */ #define OSPF6_VERSION 3 @@ -281,7 +282,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; |