diff options
| -rw-r--r-- | net/ipv4/tcp_metrics.c | 10 | ||||
| -rw-r--r-- | net/unix/af_unix.c | 2 |
2 files changed, 11 insertions, 1 deletions
diff --git a/net/ipv4/tcp_metrics.c b/net/ipv4/tcp_metrics.c index 378b1886d..5f3c077a5 100644 --- a/net/ipv4/tcp_metrics.c +++ b/net/ipv4/tcp_metrics.c @@ -229,6 +229,8 @@ static struct tcp_metrics_block *__tcp_get_metrics_req(struct request_sock *req, unsigned int hash; struct net *net; + memset(&addr, 0, sizeof(addr)); + addr.family = req->rsk_ops->family; switch (addr.family) { case AF_INET: @@ -263,6 +265,8 @@ static struct tcp_metrics_block *__tcp_get_metrics_tw(struct inet_timewait_sock unsigned int hash; struct net *net; + memset(&addr, 0, sizeof(addr)); + addr.family = tw->tw_family; switch (addr.family) { case AF_INET: @@ -298,6 +302,8 @@ static struct tcp_metrics_block *tcp_get_metrics(struct sock *sk, unsigned int hash; struct net *net; + memset(&addr, 0, sizeof(addr)); + addr.family = sk->sk_family; switch (addr.family) { case AF_INET: @@ -903,6 +909,8 @@ static int tcp_metrics_nl_cmd_get(struct sk_buff *skb, struct genl_info *info) void *reply; int ret; + memset(&addr, 0, sizeof(addr)); + ret = parse_nl_addr(info, &addr, &hash, 0); if (ret < 0) return ret; @@ -981,6 +989,8 @@ static int tcp_metrics_nl_cmd_del(struct sk_buff *skb, struct genl_info *info) struct net *net = genl_info_net(info); int ret; + memset(&addr, 0, sizeof(addr)); + ret = parse_nl_addr(info, &addr, &hash, 1); if (ret < 0) return ret; diff --git a/net/unix/af_unix.c b/net/unix/af_unix.c index 285546cc2..0a4beba3e 100644 --- a/net/unix/af_unix.c +++ b/net/unix/af_unix.c @@ -997,7 +997,7 @@ static int unix_bind(struct socket *sock, struct sockaddr *uaddr, int addr_len) struct sockaddr_un *sunaddr = (struct sockaddr_un *)uaddr; char *sun_path = sunaddr->sun_path; int err; - unsigned int hash; + unsigned int hash = 0; struct unix_address *addr; struct hlist_head *list; |
