WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

[Xen-devel] [PATCH 2 of 2] Remus: fix alignment bug in python rtnl libra

To: xen-devel@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-devel] [PATCH 2 of 2] Remus: fix alignment bug in python rtnl library
From: Brendan Cully <brendan@xxxxxxxxx>
Date: Wed, 14 Apr 2010 14:50:48 -0700
Cc: Jeremy Fitzhardinge <jeremy@xxxxxxxx>
Delivery-date: Wed, 14 Apr 2010 14:55:40 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <patchbomb.1271281846@xxxxxxxxxxxxxxxxx>
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
References: <patchbomb.1271281846@xxxxxxxxxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Mercurial-patchbomb/1.5.1+67-217557b26bc7
# HG changeset patch
# User Brendan Cully <brendan@xxxxxxxxx>
# Date 1271281121 25200
# Node ID 16eee52ac2ee7c3d4ddc25c9f4371ad7a9a00ae9
# Parent  b0d4c221e926feff21bea0c2f3c852a692782586
Remus: fix alignment bug in python rtnl library

diff --git a/tools/python/xen/remus/netlink.py 
b/tools/python/xen/remus/netlink.py
--- a/tools/python/xen/remus/netlink.py
+++ b/tools/python/xen/remus/netlink.py
@@ -77,7 +77,7 @@
         return align(self.rta_len)
 
     def pack(self):
-        self.rta_len = align(self.fmtlen + len(self.body))
+        self.rta_len = self.fmtlen + align(len(self.body), 2)
         s = struct.pack(self.fmt, self.rta_len, self.rta_type) + self.body
         pad = self.rta_len - len(s)
         if pad:
@@ -88,7 +88,7 @@
         args = struct.unpack(self.fmt, msg[:self.fmtlen])
         self.rta_len, self.rta_type = args
 
-        self.body = msg[align(self.fmtlen):self.rta_len]
+        self.body = msg[self.fmtlen:self.rta_len]
 
 class rtattrlist(object):
     def __init__(self, msg):

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel