|
|
|
|
|
|
|
|
|
|
xen-devel
[Xen-devel] [PATCH 2 of 2] Remus: fix alignment bug in python rtnl libra
# 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
|
|
|
|
|