mirror of
https://github.com/openvswitch/ovs
synced 2025-10-21 14:49:41 +00:00
Add build checks for portable OpenFlow structure padding and alignment.
This causes the build to fail with an error message if openflow.h contains a structure whose members are not aligned in a portable way.
This commit is contained in:
1
include/openflow/.gitignore
vendored
Normal file
1
include/openflow/.gitignore
vendored
Normal file
@@ -0,0 +1 @@
|
||||
/openflow.h.stamp
|
@@ -2,3 +2,19 @@ noinst_HEADERS += \
|
||||
include/openflow/openflow-mgmt.h \
|
||||
include/openflow/nicira-ext.h \
|
||||
include/openflow/openflow.h
|
||||
|
||||
if HAVE_PYTHON
|
||||
all-local: include/openflow/openflow.h.stamp
|
||||
include/openflow/openflow.h.stamp: \
|
||||
include/openflow/openflow.h build-aux/check-structs
|
||||
$(PYTHON) $(srcdir)/build-aux/check-structs $(srcdir)/include/openflow/openflow.h
|
||||
touch $@
|
||||
|
||||
all-local: include/openflow/nicira-ext.h.stamp
|
||||
include/openflow/nicira-ext.h.stamp: include/openflow/openflow.h include/openflow/nicira-ext.h build-aux/check-structs
|
||||
$(PYTHON) $(srcdir)/build-aux/check-structs $(srcdir)/include/openflow/openflow.h $(srcdir)/include/openflow/nicira-ext.h
|
||||
touch $@
|
||||
endif
|
||||
|
||||
EXTRA_DIST += build-aux/check-structs
|
||||
DISTCLEANFILES += include/openflow/openflow.h.stamp
|
||||
|
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2008, 2009 Nicira Networks
|
||||
* Copyright (c) 2008, 2009, 2010 Nicira Networks
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -65,7 +65,7 @@ struct nicira_header {
|
||||
uint32_t vendor; /* NX_VENDOR_ID. */
|
||||
uint32_t subtype; /* One of NXT_* above. */
|
||||
};
|
||||
OFP_ASSERT(sizeof(struct nicira_header) == sizeof(struct ofp_vendor_header) + 4);
|
||||
OFP_ASSERT(sizeof(struct nicira_header) == 16);
|
||||
|
||||
|
||||
enum nx_action_subtype {
|
||||
|
Reference in New Issue
Block a user