summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorRafael Zalamena <rzalamena@cvs.openbsd.org>2016-10-28 16:06:53 +0000
committerRafael Zalamena <rzalamena@cvs.openbsd.org>2016-10-28 16:06:53 +0000
commit19c99dfb93dc991362dc7c027817889c368516b9 (patch)
tree52950891ae36430182ffcc9d7c4a57c31acc6759 /sys
parentfe955e496a26d54aa745f10b973827d3e85aa073 (diff)
Simplify the OFP_FLOW_MOD_MSG_INSTRUCTION_OFFSET() by using another macro
already does exactly what it wants to do. ok reyk@
Diffstat (limited to 'sys')
-rw-r--r--sys/net/switchofp.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/sys/net/switchofp.c b/sys/net/switchofp.c
index 4c356c10018..f3c546cdac7 100644
--- a/sys/net/switchofp.c
+++ b/sys/net/switchofp.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: switchofp.c,v 1.18 2016/10/28 09:01:49 rzalamena Exp $ */
+/* $OpenBSD: switchofp.c,v 1.19 2016/10/28 16:06:52 rzalamena Exp $ */
/*
* Copyright (c) 2016 Kazuya GODA <goda@openbsd.org>
@@ -388,9 +388,9 @@ for ((curr) = (head); (caddr_t)curr < ((caddr_t)head + (len)); \
/*
* Get instruction offset in ofp_flow_mod
*/
-#define OFP_FLOW_MOD_MSG_INSTRUCTION_OFFSET(ofm) \
-(offsetof(struct ofp_flow_mod, fm_match) + ntohs((ofm)->fm_match.om_length) + \
- (((0x8 - (ntohs((ofm)->fm_match.om_length) % 0x8)) & 0x7)))
+#define OFP_FLOW_MOD_MSG_INSTRUCTION_OFFSET(ofm) \
+ (offsetof(struct ofp_flow_mod, fm_match) + \
+ OFP_ALIGN(ntohs((ofm)->fm_match.om_length)))
/*
* Instructions "FOREACH" in ofp_flow_mod. You can get header using