Skip to content

Commit

Permalink
Fixed crash when header is not present in nlmsg_base object ('not a N…
Browse files Browse the repository at this point in the history
…LA but a simple C struct', see #522)
  • Loading branch information
Vic063 committed Jul 5, 2018
1 parent 4069fa7 commit 3db590a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pyroute2/netlink/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -1067,7 +1067,7 @@ def encode(self):
if self.nla_map:
offset = self.encode_nlas(offset)
# calculate the size and write it
if self.header is not None:
if 'header' in self and self.header is not None:
self.length = self['header']['length'] = (offset -
self.offset -
diff)
Expand Down

0 comments on commit 3db590a

Please sign in to comment.