Skip to contentSkip to conversation

ipv6: setsockopt(IPIPPROTO_IPV6,IPV6_MINHOPCOUNT) forgot to set return value

PATCH In review Hannes Frederic Sowa 3 participants 3 messages Nov 11, 2012 – Nov 13, 2012

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

PATCH 1/1 ipv6: setsockopt(IPIPPROTO_IPV6,IPV6_MINHOPCOUNT) forgot to set return value

---
 net/ipv6/ipv6_sockglue.c | 1 +
 1 file changed, 1 insertion(+)
net/ipv6/ipv6_sockglue.c +1 -0
index ba6d13d..e02faed 100644
@@ -827,6 +827,7 @@ pref_skip_coa:
 		if (val < 0 || val > 255)
 			goto e_inval;
 		np->min_hopcount = val;
+		retv = 0;
 		break;
 	case IPV6_DONTFRAG:
 		np->dontfrag = valbool;
#1 lore raw

Wonder if this ever worked? The patch should go
to stable as well.

The original coding style was prone to these kind of errors because of the use of "goto e_inval" to do the unlock, and fall through is prone to these kind of errors.