]> granicus.if.org Git - libnl/commit
Fix stale data pointers when constructing messages
authorThomas Graf <tgr@deb.localdomain>
Mon, 14 Jan 2008 15:17:56 +0000 (16:17 +0100)
committerThomas Graf <tgr@deb.localdomain>
Mon, 14 Jan 2008 15:17:56 +0000 (16:17 +0100)
commit6de17f3308cfd53ad922d144a1b28ddd962d6678
treef589f1328bae4d165a4e0842a21322645134890c
parent13c85b663390547d8787aa8f45fbd009f4f8a332
Fix stale data pointers when constructing messages

Patrick McHardy reported a problem where pointers to the
payload of a netlink message as returned by f.e. the
nesting helpers become stale when the payload data
chunk is reallocated.

In order to avoid further problems, the payload chunk is
no longer extended on the fly. Instead the allocation is
made during netlink message object allocation time with
a default size of a page which should be fine for the
majority of all users. Additionally the functions
nlmsg_alloc_size() and nlmsg_set_default_size() have been
added to allocate messages of a particular length and to
modify the default message size.
include/netlink-types.h
include/netlink/msg.h
lib/attr.c
lib/msg.c
lib/nl.c