diff options
author | Neil Horman <nhorman@redhat.com> | 2005-06-13 18:12:33 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2005-06-13 18:12:33 -0400 |
commit | cdac4e07748934e37e415437055ed591aed9eb21 (patch) | |
tree | 56ecdba35c5b549c2580daf88cb2282ebf6a401f | |
parent | bca735bd0d5969497704a125b05344b92155172f (diff) |
[SCTP] Add support for ip_nonlocal_bind sysctl & IP_FREEBIND socket option
Signed-off-by: Neil Horman <nhorman@redhat.com>
Signed-off-by: Sridhar Samudrala <sri@us.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r-- | include/net/ip.h | 1 | ||||
-rw-r--r-- | net/ipv4/af_inet.c | 1 | ||||
-rw-r--r-- | net/sctp/protocol.c | 7 |
3 files changed, 7 insertions, 2 deletions
diff --git a/include/net/ip.h b/include/net/ip.h index 3f63992eb712..32360bbe143f 100644 --- a/include/net/ip.h +++ b/include/net/ip.h | |||
@@ -163,6 +163,7 @@ DECLARE_SNMP_STAT(struct linux_mib, net_statistics); | |||
163 | 163 | ||
164 | extern int sysctl_local_port_range[2]; | 164 | extern int sysctl_local_port_range[2]; |
165 | extern int sysctl_ip_default_ttl; | 165 | extern int sysctl_ip_default_ttl; |
166 | extern int sysctl_ip_nonlocal_bind; | ||
166 | 167 | ||
167 | #ifdef CONFIG_INET | 168 | #ifdef CONFIG_INET |
168 | /* The function in 2.2 was invalid, producing wrong result for | 169 | /* The function in 2.2 was invalid, producing wrong result for |
diff --git a/net/ipv4/af_inet.c b/net/ipv4/af_inet.c index b3cb49ce5fad..03942f133944 100644 --- a/net/ipv4/af_inet.c +++ b/net/ipv4/af_inet.c | |||
@@ -1181,6 +1181,7 @@ EXPORT_SYMBOL(inet_stream_connect); | |||
1181 | EXPORT_SYMBOL(inet_stream_ops); | 1181 | EXPORT_SYMBOL(inet_stream_ops); |
1182 | EXPORT_SYMBOL(inet_unregister_protosw); | 1182 | EXPORT_SYMBOL(inet_unregister_protosw); |
1183 | EXPORT_SYMBOL(net_statistics); | 1183 | EXPORT_SYMBOL(net_statistics); |
1184 | EXPORT_SYMBOL(sysctl_ip_nonlocal_bind); | ||
1184 | 1185 | ||
1185 | #ifdef INET_REFCNT_DEBUG | 1186 | #ifdef INET_REFCNT_DEBUG |
1186 | EXPORT_SYMBOL(inet_sock_nr); | 1187 | EXPORT_SYMBOL(inet_sock_nr); |
diff --git a/net/sctp/protocol.c b/net/sctp/protocol.c index 2e1f9c3556f5..5135e1a25d25 100644 --- a/net/sctp/protocol.c +++ b/net/sctp/protocol.c | |||
@@ -378,10 +378,13 @@ static int sctp_v4_available(union sctp_addr *addr, struct sctp_sock *sp) | |||
378 | { | 378 | { |
379 | int ret = inet_addr_type(addr->v4.sin_addr.s_addr); | 379 | int ret = inet_addr_type(addr->v4.sin_addr.s_addr); |
380 | 380 | ||
381 | /* FIXME: ip_nonlocal_bind sysctl support. */ | ||
382 | 381 | ||
383 | if (addr->v4.sin_addr.s_addr != INADDR_ANY && ret != RTN_LOCAL) | 382 | if (addr->v4.sin_addr.s_addr != INADDR_ANY && |
383 | ret != RTN_LOCAL && | ||
384 | !sp->inet.freebind && | ||
385 | !sysctl_ip_nonlocal_bind) | ||
384 | return 0; | 386 | return 0; |
387 | |||
385 | return 1; | 388 | return 1; |
386 | } | 389 | } |
387 | 390 | ||