Added a new macro for calculating the number of bytes required
for padding. Fixed a minor typo.
Signed-off-by: Ankur Sharma <ankursha...@vmware.com>
Tested-by: Ankur Sharma <ankursha...@vmware.com>
Reported-at: https://github.com/openvswitch/ovs-issues/issues/37
Acked-by: Eitan Eliahu <elia...@vmware.com>
Acked-by: Alin Gabriel Serdean <aserdean at cloudbasesolutions.com>

---
 datapath-windows/ovsext/Netlink/NetlinkProto.h | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/datapath-windows/ovsext/Netlink/NetlinkProto.h 
b/datapath-windows/ovsext/Netlink/NetlinkProto.h
index 898cc84..2c438a6 100644
--- a/datapath-windows/ovsext/Netlink/NetlinkProto.h
+++ b/datapath-windows/ovsext/Netlink/NetlinkProto.h
@@ -39,6 +39,9 @@
 /* Returns X rounded up to the nearest multiple of Y. */
 #define ROUND_UP(X, Y) (DIV_ROUND_UP(X, Y) * (Y))
 
+/* Returns the least number that, when added to X, yields a multiple of Y. */
+#define PAD_SIZE(X, Y) (ROUND_UP(X, Y) - (X))
+
 /* Netlink message */
 
 /* nlmsg_flags bits. */
@@ -92,7 +95,7 @@ typedef struct _GENL_MSG_HDR {
     UINT8 cmd;
     UINT8 version;
     UINT16 reserved;
-} GENL_MSG_HDR, *PGENL_MDG_HDR;
+} GENL_MSG_HDR, *PGENL_MSG_HDR;
 BUILD_ASSERT_DECL(sizeof(GENL_MSG_HDR) == 4);
 
 /* Netlink attributes */
-- 
1.9.1

_______________________________________________
dev mailing list
dev@openvswitch.org
http://openvswitch.org/mailman/listinfo/dev

Reply via email to