ip6: Perform sanity check before processing prefix messages

Verifies that the provided message consists of at least the prefix header.
This commit is contained in:
Thomas Graf 2011-09-09 11:39:07 +02:00 committed by Dan Williams
parent 3f3a63084c
commit 1134eee1e6

View file

@ -624,6 +624,11 @@ process_prefix (NMIP6Manager *manager, struct nl_msg *msg)
nm_log_dbg (LOGD_IP6, "processing netlink new prefix message");
if (!nlmsg_valid_hdr (nlmsg_hdr (msg), sizeof(*pmsg))) {
nm_log_dbg (LOGD_IP6, "ignoring invalid prefix message");
return NULL;
}
pmsg = (struct prefixmsg *) NLMSG_DATA (nlmsg_hdr (msg));
device = nm_ip6_manager_get_device (manager, pmsg->prefix_ifindex);