debuggers.hg

changeset 21221:acba53182435

Remus: fix alignment bug in python rtnl library

Signed-off-by: Brendan Cully <brendan@cs.ubc.ca>
author Keir Fraser <keir.fraser@citrix.com>
date Thu Apr 15 08:42:40 2010 +0100 (2010-04-15)
parents 373daaeb636e
children 25a2a8686b1b
files tools/python/xen/remus/netlink.py
line diff
     1.1 --- a/tools/python/xen/remus/netlink.py	Thu Apr 15 08:42:08 2010 +0100
     1.2 +++ b/tools/python/xen/remus/netlink.py	Thu Apr 15 08:42:40 2010 +0100
     1.3 @@ -77,7 +77,7 @@ class rtattr(object):
     1.4          return align(self.rta_len)
     1.5  
     1.6      def pack(self):
     1.7 -        self.rta_len = align(self.fmtlen + len(self.body))
     1.8 +        self.rta_len = self.fmtlen + align(len(self.body), 2)
     1.9          s = struct.pack(self.fmt, self.rta_len, self.rta_type) + self.body
    1.10          pad = self.rta_len - len(s)
    1.11          if pad:
    1.12 @@ -88,7 +88,7 @@ class rtattr(object):
    1.13          args = struct.unpack(self.fmt, msg[:self.fmtlen])
    1.14          self.rta_len, self.rta_type = args
    1.15  
    1.16 -        self.body = msg[align(self.fmtlen):self.rta_len]
    1.17 +        self.body = msg[self.fmtlen:self.rta_len]
    1.18  
    1.19  class rtattrlist(object):
    1.20      def __init__(self, msg):