|
|
@@ -1095,12 +1095,6 @@ void inet_unregister_protosw(struct inet_protosw *p)
|
|
|
}
|
|
|
EXPORT_SYMBOL(inet_unregister_protosw);
|
|
|
|
|
|
-/*
|
|
|
- * Shall we try to damage output packets if routing dev changes?
|
|
|
- */
|
|
|
-
|
|
|
-int sysctl_ip_dynaddr __read_mostly;
|
|
|
-
|
|
|
static int inet_sk_reselect_saddr(struct sock *sk)
|
|
|
{
|
|
|
struct inet_sock *inet = inet_sk(sk);
|
|
|
@@ -1131,7 +1125,7 @@ static int inet_sk_reselect_saddr(struct sock *sk)
|
|
|
if (new_saddr == old_saddr)
|
|
|
return 0;
|
|
|
|
|
|
- if (sysctl_ip_dynaddr > 1) {
|
|
|
+ if (sock_net(sk)->ipv4.sysctl_ip_dynaddr > 1) {
|
|
|
pr_info("%s(): shifting inet->saddr from %pI4 to %pI4\n",
|
|
|
__func__, &old_saddr, &new_saddr);
|
|
|
}
|
|
|
@@ -1186,7 +1180,7 @@ int inet_sk_rebuild_header(struct sock *sk)
|
|
|
* Other protocols have to map its equivalent state to TCP_SYN_SENT.
|
|
|
* DCCP maps its DCCP_REQUESTING state to TCP_SYN_SENT. -acme
|
|
|
*/
|
|
|
- if (!sysctl_ip_dynaddr ||
|
|
|
+ if (!sock_net(sk)->ipv4.sysctl_ip_dynaddr ||
|
|
|
sk->sk_state != TCP_SYN_SENT ||
|
|
|
(sk->sk_userlocks & SOCK_BINDADDR_LOCK) ||
|
|
|
(err = inet_sk_reselect_saddr(sk)) != 0)
|