aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv4/ip_sockglue.c
diff options
context:
space:
mode:
authorArnaldo Carvalho de Melo <acme@mandriva.com>2005-12-14 02:26:10 -0500
committerDavid S. Miller <davem@sunset.davemloft.net>2006-01-03 16:10:58 -0500
commitd83d8461f902c672bc1bd8fbc6a94e19f092da97 (patch)
tree0534c553ab92baa2eb9dbb5bba64f2c4540b1e89 /net/ipv4/ip_sockglue.c
parent22712813620fa8e682dbfb253a60ca0131da1e07 (diff)
[IP_SOCKGLUE]: Remove most of the tcp specific calls
As DCCP needs to be called in the same spots. Now we have a member in inet_sock (is_icsk), set at sock creation time from struct inet_protosw->flags (if INET_PROTOSW_ICSK is set, like for TCP and DCCP) to see if a struct sock instance is a inet_connection_sock for places like the ones in ip_sockglue.c (v4 and v6) where we previously were looking if sk_type was SOCK_STREAM, that is insufficient because we now use the same code for DCCP, that has sk_type SOCK_DCCP. Signed-off-by: Arnaldo Carvalho de Melo <acme@mandriva.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv4/ip_sockglue.c')
-rw-r--r--net/ipv4/ip_sockglue.c13
1 files changed, 6 insertions, 7 deletions
diff --git a/net/ipv4/ip_sockglue.c b/net/ipv4/ip_sockglue.c
index 4f2d87257309..add019c746f8 100644
--- a/net/ipv4/ip_sockglue.c
+++ b/net/ipv4/ip_sockglue.c
@@ -29,8 +29,7 @@
29#include <net/sock.h> 29#include <net/sock.h>
30#include <net/ip.h> 30#include <net/ip.h>
31#include <net/icmp.h> 31#include <net/icmp.h>
32#include <net/tcp.h> 32#include <net/tcp_states.h>
33#include <linux/tcp.h>
34#include <linux/udp.h> 33#include <linux/udp.h>
35#include <linux/igmp.h> 34#include <linux/igmp.h>
36#include <linux/netfilter.h> 35#include <linux/netfilter.h>
@@ -427,8 +426,8 @@ int ip_setsockopt(struct sock *sk, int level, int optname, char __user *optval,
427 err = ip_options_get_from_user(&opt, optval, optlen); 426 err = ip_options_get_from_user(&opt, optval, optlen);
428 if (err) 427 if (err)
429 break; 428 break;
430 if (sk->sk_type == SOCK_STREAM) { 429 if (inet->is_icsk) {
431 struct tcp_sock *tp = tcp_sk(sk); 430 struct inet_connection_sock *icsk = inet_csk(sk);
432#if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) 431#if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE)
433 if (sk->sk_family == PF_INET || 432 if (sk->sk_family == PF_INET ||
434 (!((1 << sk->sk_state) & 433 (!((1 << sk->sk_state) &
@@ -436,10 +435,10 @@ int ip_setsockopt(struct sock *sk, int level, int optname, char __user *optval,
436 inet->daddr != LOOPBACK4_IPV6)) { 435 inet->daddr != LOOPBACK4_IPV6)) {
437#endif 436#endif
438 if (inet->opt) 437 if (inet->opt)
439 tp->ext_header_len -= inet->opt->optlen; 438 icsk->icsk_ext_hdr_len -= inet->opt->optlen;
440 if (opt) 439 if (opt)
441 tp->ext_header_len += opt->optlen; 440 icsk->icsk_ext_hdr_len += opt->optlen;
442 tcp_sync_mss(sk, tp->pmtu_cookie); 441 icsk->icsk_sync_mss(sk, icsk->icsk_pmtu_cookie);
443#if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) 442#if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE)
444 } 443 }
445#endif 444#endif