[Libvirt-cim] [PATCH] FilterEntry: Set HdrProtocolID8021 property

Eduardo Lima (Etrunko) eblima at linux.vnet.ibm.com
Thu Oct 6 19:48:39 UTC 2011


 src/Virt_FilterEntry.c |  14 ++++++++++++--
 1 files changed, 12 insertions(+), 2 deletions(-)


# HG changeset patch
# User Eduardo Lima (Etrunko) <eblima at br.ibm.com>
# Date 1317929569 10800
# Node ID 8384b32b9a79999bcf3c414d94bc18789b6d9318
# Parent  e6c6f9ccb51303f67fce26e74de9ab746d10a04b
FilterEntry: Set HdrProtocolID8021 property

Also remove a couple of duplicate (CMPIValue *) casts.

Signed-off-by: Eduardo Lima (Etrunko) <eblima at br.ibm.com>

diff --git a/src/Virt_FilterEntry.c b/src/Virt_FilterEntry.c
--- a/src/Virt_FilterEntry.c
+++ b/src/Virt_FilterEntry.c
@@ -27,6 +27,8 @@
 
 #include <arpa/inet.h>
 
+#include <stdlib.h>
+
 #include "acl_parsing.h"
 #include "misc_util.h"
 #include "xmlgen.h"
@@ -247,7 +249,7 @@
 
         array = octets_to_cmpi(broker, bytes, size);
         if (array != NULL)
-                CMSetProperty(inst, "HdrDestMACAddr8021", (CMPIValue *)
+                CMSetProperty(inst, "HdrDestMACAddr8021",
                         (CMPIValue *)&array, CMPI_uint8A);
 
         memset(bytes, 0, sizeof(bytes));
@@ -256,8 +258,16 @@
 
         array = octets_to_cmpi(broker, bytes, size);
         if (array != NULL)
-                CMSetProperty(inst, "HdrDestMACMask8021", (CMPIValue *)
+                CMSetProperty(inst, "HdrDestMACMask8021",
                         (CMPIValue *)&array, CMPI_uint8A);
+
+        if (rule->var.mac.protocol_id != NULL) {
+                unsigned long n = strtoul(rule->var.mac.protocol_id,
+                                          NULL, 16);
+                CMSetProperty(inst, "HdrProtocolID8021",
+                              (CMPIValue *)&n, CMPI_uint16);
+        }
+
 }
 
 static void fill_rule_data(struct acl_rule *rule,




More information about the Libvirt-cim mailing list