summaryrefslogtreecommitdiff
path: root/usr.sbin/ospfd
diff options
context:
space:
mode:
authorPhilip Guenthe <guenther@cvs.openbsd.org>2010-06-26 18:02:08 +0000
committerPhilip Guenthe <guenther@cvs.openbsd.org>2010-06-26 18:02:08 +0000
commit8304b91599f58cdfa3ec267b4f12a61214929f2e (patch)
tree2a55f36ab3eb716a798eaf9af99e52a141ed08c6 /usr.sbin/ospfd
parentb8356f8ddb7db759bb2d0127e1d696abbc40a6b7 (diff)
Use offsetof() instead of writing our own version (...which generates
warnings from gcc4) os claudio@
Diffstat (limited to 'usr.sbin/ospfd')
-rw-r--r--usr.sbin/ospfd/ospf.h5
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;