summaryrefslogtreecommitdiff
path: root/sys/net
diff options
context:
space:
mode:
authorReyk Floeter <reyk@cvs.openbsd.org>2016-11-18 16:56:10 +0000
committerReyk Floeter <reyk@cvs.openbsd.org>2016-11-18 16:56:10 +0000
commit423f04e373bf98e65459bde608107b9d3611ab3b (patch)
treebbf38e05b0b4744f123c217896c29225bb041b0f /sys/net
parent2572da0a217b77440ad6e4816bfd6b6d3a0d5eeb (diff)
Define a group_id map and rename the defines accordingly.
Requested by rzalamena@
Diffstat (limited to 'sys/net')
-rw-r--r--sys/net/ofp.h9
-rw-r--r--sys/net/switchofp.c8
2 files changed, 9 insertions, 8 deletions
diff --git a/sys/net/ofp.h b/sys/net/ofp.h
index d2cdea98145..9732841dbd2 100644
--- a/sys/net/ofp.h
+++ b/sys/net/ofp.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: ofp.h,v 1.9 2016/11/18 14:54:22 reyk Exp $ */
+/* $OpenBSD: ofp.h,v 1.10 2016/11/18 16:56:09 reyk Exp $ */
/*
* Copyright (c) 2013-2016 Reyk Floeter <reyk@openbsd.org>
@@ -638,9 +638,10 @@ struct ofp_error {
#define OFP_GROUP_T_INDIRECT 2 /* Indirect group */
#define OFP_GROUP_T_FAST_FAILOVER 3 /* Fast failover group */
-#define OFP_GROUP_MAX 0xffffff00 /* Last usable group number */
-#define OFP_GROUP_ALL 0xfffffffc /* Represents all groups for delete command */
-#define OFP_GROUP_ANY 0xffffffff /* Special wildcard: no group specified */
+/* Special group identifiers */
+#define OFP_GROUP_ID_MAX 0xffffff00 /* Last usable group number */
+#define OFP_GROUP_ID_ALL 0xfffffffc /* Represents all groups for delete command */
+#define OFP_GROUP_ID_ANY 0xffffffff /* Special wildcard: no group specified */
struct ofp_bucket {
uint16_t b_len;
diff --git a/sys/net/switchofp.c b/sys/net/switchofp.c
index d8760c63c78..4a491f297bc 100644
--- a/sys/net/switchofp.c
+++ b/sys/net/switchofp.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: switchofp.c,v 1.32 2016/11/18 16:23:13 rzalamena Exp $ */
+/* $OpenBSD: switchofp.c,v 1.33 2016/11/18 16:56:09 reyk Exp $ */
/*
* Copyright (c) 2016 Kazuya GODA <goda@openbsd.org>
@@ -2090,7 +2090,7 @@ swofp_flow_filter(struct swofp_flow_entry *swfe, uint64_t cookie,
((swfe->swfe_cookie & cookie_mask) != (cookie & cookie_mask)))
return (0);
- if ((out_port == OFP_PORT_ANY) && (out_group == OFP_GROUP_ALL))
+ if ((out_port == OFP_PORT_ANY) && (out_group == OFP_GROUP_ID_ALL))
return (1);
if ((out_port != OFP_PORT_ANY) &&
@@ -2098,7 +2098,7 @@ swofp_flow_filter(struct swofp_flow_entry *swfe, uint64_t cookie,
swofp_flow_filter_out_port(swfe->swfe_apply_actions, out_port)))
return (0);
- if (out_port != OFP_GROUP_ALL) {
+ if (out_port != OFP_GROUP_ID_ALL) {
/* XXX ignore group */
}
@@ -5292,7 +5292,7 @@ swofp_group_mod_delete(struct switch_softc *sc, struct mbuf *m)
ogm = mtod(m, struct ofp_group_mod *);
group_id = ntohl(ogm->gm_group_id);
- if (group_id == OFP_GROUP_ALL)
+ if (group_id == OFP_GROUP_ID_ALL)
swofp_group_entry_delete_all(sc);
else if ((swge = swofp_group_entry_lookup(sc, group_id)) != NULL)
swofp_group_entry_delete(sc, swge);