Skip to contentSkip to conversation

ipv6: fix leaking uninitialized port number of offender sockaddr

PATCH In review Hannes Frederic Sowa 2 participants 2 messages Nov 23, 2013

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ipv6: fix leaking uninitialized port number of offender sockaddr

Offenders don't have port numbers, so set it to 0.

---
 net/ipv6/datagram.c | 1 +
 1 file changed, 1 insertion(+)
net/ipv6/datagram.c +1 -0
index a454b0f..6b1f73b 100644
@@ -377,6 +377,7 @@ int ipv6_recv_error(struct sock *sk, struct msghdr *msg, int len)
 	if (serr->ee.ee_origin != SO_EE_ORIGIN_LOCAL) {
 		sin->sin6_family = AF_INET6;
 		sin->sin6_flowinfo = 0;
+		sin->sin6_port = 0;
 		if (skb->protocol == htons(ETH_P_IPV6)) {
 			sin->sin6_addr = ipv6_hdr(skb)->saddr;
 			if (np->rxopt.all)
Signature · 1 line
1.8.3.1