Skip to content

Commit

Permalink
netlink: fix unaligned access in nla_get_be64()
Browse files Browse the repository at this point in the history
This patch fixes a unaligned access in nla_get_be64() that was
introduced by myself in a17c859.

Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Pablo Neira Ayuso authored and David S. Miller committed Mar 20, 2010
1 parent 6830c25 commit f5d410f
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion include/net/netlink.h
Original file line number Diff line number Diff line change
Expand Up @@ -945,7 +945,11 @@ static inline u64 nla_get_u64(const struct nlattr *nla)
*/
static inline __be64 nla_get_be64(const struct nlattr *nla)
{
return *(__be64 *) nla_data(nla);
__be64 tmp;

nla_memcpy(&tmp, nla, sizeof(tmp));

return tmp;
}

/**
Expand Down

0 comments on commit f5d410f

Please sign in to comment.