Skip to content

Commit b410f04

Browse files
Zhang Changzhongkuba-moo
authored andcommitted
ipv4: fix error return code in rtm_to_fib_config()
Fix to return a negative error code from the error handling case instead of 0, as done elsewhere in this function. Fixes: d156626 ("ipv4: Allow ipv6 gateway with ipv4 routes") Reported-by: Hulk Robot <[email protected]> Signed-off-by: Zhang Changzhong <[email protected]> Reviewed-by: David Ahern <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
1 parent 0b32e91 commit b410f04

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

net/ipv4/fib_frontend.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -825,7 +825,7 @@ static int rtm_to_fib_config(struct net *net, struct sk_buff *skb,
825825
if (has_gw && has_via) {
826826
NL_SET_ERR_MSG(extack,
827827
"Nexthop configuration can not contain both GATEWAY and VIA");
828-
goto errout;
828+
return -EINVAL;
829829
}
830830

831831
return 0;

0 commit comments

Comments
 (0)