diff options
Diffstat (limited to 'net/ipv4/udp.c')
-rw-r--r-- | net/ipv4/udp.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/net/ipv4/udp.c b/net/ipv4/udp.c index 24b5c59b1c53..b61a770884fa 100644 --- a/net/ipv4/udp.c +++ b/net/ipv4/udp.c | |||
@@ -401,9 +401,9 @@ static int compute_score(struct sock *sk, struct net *net, | |||
401 | bool dev_match = (sk->sk_bound_dev_if == dif || | 401 | bool dev_match = (sk->sk_bound_dev_if == dif || |
402 | sk->sk_bound_dev_if == sdif); | 402 | sk->sk_bound_dev_if == sdif); |
403 | 403 | ||
404 | if (exact_dif && !dev_match) | 404 | if (!dev_match) |
405 | return -1; | 405 | return -1; |
406 | if (sk->sk_bound_dev_if && dev_match) | 406 | if (sk->sk_bound_dev_if) |
407 | score += 4; | 407 | score += 4; |
408 | } | 408 | } |
409 | 409 | ||
@@ -952,8 +952,10 @@ int udp_sendmsg(struct sock *sk, struct msghdr *msg, size_t len) | |||
952 | sock_tx_timestamp(sk, ipc.sockc.tsflags, &ipc.tx_flags); | 952 | sock_tx_timestamp(sk, ipc.sockc.tsflags, &ipc.tx_flags); |
953 | 953 | ||
954 | if (ipc.opt && ipc.opt->opt.srr) { | 954 | if (ipc.opt && ipc.opt->opt.srr) { |
955 | if (!daddr) | 955 | if (!daddr) { |
956 | return -EINVAL; | 956 | err = -EINVAL; |
957 | goto out_free; | ||
958 | } | ||
957 | faddr = ipc.opt->opt.faddr; | 959 | faddr = ipc.opt->opt.faddr; |
958 | connected = 0; | 960 | connected = 0; |
959 | } | 961 | } |
@@ -1074,6 +1076,7 @@ do_append_data: | |||
1074 | 1076 | ||
1075 | out: | 1077 | out: |
1076 | ip_rt_put(rt); | 1078 | ip_rt_put(rt); |
1079 | out_free: | ||
1077 | if (free) | 1080 | if (free) |
1078 | kfree(ipc.opt); | 1081 | kfree(ipc.opt); |
1079 | if (!err) | 1082 | if (!err) |