From 19c99dfb93dc991362dc7c027817889c368516b9 Mon Sep 17 00:00:00 2001 From: Rafael Zalamena Date: Fri, 28 Oct 2016 16:06:53 +0000 Subject: Simplify the OFP_FLOW_MOD_MSG_INSTRUCTION_OFFSET() by using another macro already does exactly what it wants to do. ok reyk@ --- sys/net/switchofp.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'sys/net/switchofp.c') 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 @@ -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 -- cgit v1.2.3