Commit 549a3f23 authored by David S. Miller's avatar David S. Miller Committed by David S. Miller

[NETLINK]: Initialize nl_pad in getname and recvmsg, noticed by Uli Drepper.

parent 2ce39f92
......@@ -394,6 +394,7 @@ static int netlink_getname(struct socket *sock, struct sockaddr *addr, int *addr
struct sockaddr_nl *nladdr=(struct sockaddr_nl *)addr;
nladdr->nl_family = AF_NETLINK;
nladdr->nl_pad = 0;
*addr_len = sizeof(*nladdr);
if (peer) {
......@@ -717,6 +718,7 @@ static int netlink_recvmsg(struct kiocb *kiocb, struct socket *sock,
if (msg->msg_name) {
struct sockaddr_nl *addr = (struct sockaddr_nl*)msg->msg_name;
addr->nl_family = AF_NETLINK;
addr->nl_pad = 0;
addr->nl_pid = NETLINK_CB(skb).pid;
addr->nl_groups = NETLINK_CB(skb).dst_groups;
msg->msg_namelen = sizeof(*addr);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment