Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
linux
Commits
ec50d2c5
Commit
ec50d2c5
authored
Jun 22, 2004
by
David S. Miller
Browse files
Options
Browse Files
Download
Plain Diff
Merge
bk://kernel.bkbits.net/acme/net-2.6
into nuts.davemloft.net:/disk1/BK/netnew-2.6
parents
26e9ff17
fb5f695c
Changes
22
Hide whitespace changes
Inline
Side-by-side
Showing
22 changed files
with
66 additions
and
71 deletions
+66
-71
include/linux/ip.h
include/linux/ip.h
+0
-2
include/linux/skbuff.h
include/linux/skbuff.h
+7
-5
include/net/protocol.h
include/net/protocol.h
+5
-6
include/net/sock.h
include/net/sock.h
+5
-1
net/core/sock.c
net/core/sock.c
+11
-0
net/ipv4/af_inet.c
net/ipv4/af_inet.c
+4
-4
net/ipv4/ah4.c
net/ipv4/ah4.c
+1
-1
net/ipv4/esp4.c
net/ipv4/esp4.c
+1
-1
net/ipv4/icmp.c
net/ipv4/icmp.c
+1
-1
net/ipv4/ip_gre.c
net/ipv4/ip_gre.c
+1
-1
net/ipv4/ip_input.c
net/ipv4/ip_input.c
+1
-1
net/ipv4/ip_output.c
net/ipv4/ip_output.c
+8
-8
net/ipv4/ipcomp.c
net/ipv4/ipcomp.c
+1
-1
net/ipv4/ipmr.c
net/ipv4/ipmr.c
+2
-2
net/ipv4/protocol.c
net/ipv4/protocol.c
+3
-3
net/ipv4/tcp.c
net/ipv4/tcp.c
+4
-14
net/ipv4/tcp_ipv4.c
net/ipv4/tcp_ipv4.c
+0
-4
net/ipv4/xfrm4_tunnel.c
net/ipv4/xfrm4_tunnel.c
+1
-1
net/ipv6/ip6_output.c
net/ipv6/ip6_output.c
+8
-8
net/ipv6/sit.c
net/ipv6/sit.c
+1
-1
net/ipv6/tcp_ipv6.c
net/ipv6/tcp_ipv6.c
+0
-5
net/sctp/protocol.c
net/sctp/protocol.c
+1
-1
No files found.
include/linux/ip.h
View file @
ec50d2c5
...
@@ -129,8 +129,6 @@ struct inet_opt {
...
@@ -129,8 +129,6 @@ struct inet_opt {
int
mc_index
;
/* Multicast device index */
int
mc_index
;
/* Multicast device index */
__u32
mc_addr
;
__u32
mc_addr
;
struct
ip_mc_socklist
*
mc_list
;
/* Group array */
struct
ip_mc_socklist
*
mc_list
;
/* Group array */
struct
page
*
sndmsg_page
;
/* Cached page for sendmsg */
u32
sndmsg_off
;
/* Cached offset for sendmsg */
/*
/*
* Following members are used to retain the infomation to build
* Following members are used to retain the infomation to build
* an ip header on each ip fragmentation while the socket is corked.
* an ip header on each ip fragmentation while the socket is corked.
...
...
include/linux/skbuff.h
View file @
ec50d2c5
...
@@ -664,13 +664,15 @@ static inline int skb_pagelen(const struct sk_buff *skb)
...
@@ -664,13 +664,15 @@ static inline int skb_pagelen(const struct sk_buff *skb)
return
len
+
skb_headlen
(
skb
);
return
len
+
skb_headlen
(
skb
);
}
}
static
inline
void
skb_fill_page_desc
(
struct
sk_buff
*
skb
,
int
i
,
struct
page
*
page
,
int
off
,
int
size
)
static
inline
void
skb_fill_page_desc
(
struct
sk_buff
*
skb
,
int
i
,
struct
page
*
page
,
int
off
,
int
size
)
{
{
skb_frag_t
*
frag
=
&
skb_shinfo
(
skb
)
->
frags
[
i
];
skb_frag_t
*
frag
=
&
skb_shinfo
(
skb
)
->
frags
[
i
];
frag
->
page
=
page
;
frag
->
page_offset
=
off
;
frag
->
page
=
page
;
frag
->
size
=
size
;
frag
->
page_offset
=
off
;
skb_shinfo
(
skb
)
->
nr_frags
=
i
+
1
;
frag
->
size
=
size
;
skb_shinfo
(
skb
)
->
nr_frags
=
i
+
1
;
}
}
#define SKB_PAGE_ASSERT(skb) BUG_ON(skb_shinfo(skb)->nr_frags)
#define SKB_PAGE_ASSERT(skb) BUG_ON(skb_shinfo(skb)->nr_frags)
...
...
include/net/protocol.h
View file @
ec50d2c5
...
@@ -34,8 +34,7 @@
...
@@ -34,8 +34,7 @@
/* This is used to register protocols. */
/* This is used to register protocols. */
struct
inet_protocol
struct
net_protocol
{
{
int
(
*
handler
)(
struct
sk_buff
*
skb
);
int
(
*
handler
)(
struct
sk_buff
*
skb
);
void
(
*
err_handler
)(
struct
sk_buff
*
skb
,
u32
info
);
void
(
*
err_handler
)(
struct
sk_buff
*
skb
,
u32
info
);
int
no_policy
;
int
no_policy
;
...
@@ -78,15 +77,15 @@ struct inet_protosw {
...
@@ -78,15 +77,15 @@ struct inet_protosw {
#define INET_PROTOSW_REUSE 0x01
/* Are ports automatically reusable? */
#define INET_PROTOSW_REUSE 0x01
/* Are ports automatically reusable? */
#define INET_PROTOSW_PERMANENT 0x02
/* Permanent protocols are unremovable. */
#define INET_PROTOSW_PERMANENT 0x02
/* Permanent protocols are unremovable. */
extern
struct
i
net_protocol
*
inet_protocol_base
;
extern
struct
net_protocol
*
inet_protocol_base
;
extern
struct
i
net_protocol
*
inet_protos
[
MAX_INET_PROTOS
];
extern
struct
net_protocol
*
inet_protos
[
MAX_INET_PROTOS
];
#if defined(CONFIG_IPV6) || defined (CONFIG_IPV6_MODULE)
#if defined(CONFIG_IPV6) || defined (CONFIG_IPV6_MODULE)
extern
struct
inet6_protocol
*
inet6_protos
[
MAX_INET_PROTOS
];
extern
struct
inet6_protocol
*
inet6_protos
[
MAX_INET_PROTOS
];
#endif
#endif
extern
int
inet_add_protocol
(
struct
i
net_protocol
*
prot
,
unsigned
char
num
);
extern
int
inet_add_protocol
(
struct
net_protocol
*
prot
,
unsigned
char
num
);
extern
int
inet_del_protocol
(
struct
i
net_protocol
*
prot
,
unsigned
char
num
);
extern
int
inet_del_protocol
(
struct
net_protocol
*
prot
,
unsigned
char
num
);
extern
void
inet_register_protosw
(
struct
inet_protosw
*
p
);
extern
void
inet_register_protosw
(
struct
inet_protosw
*
p
);
extern
void
inet_unregister_protosw
(
struct
inet_protosw
*
p
);
extern
void
inet_unregister_protosw
(
struct
inet_protosw
*
p
);
...
...
include/net/sock.h
View file @
ec50d2c5
...
@@ -167,6 +167,8 @@ struct sock_common {
...
@@ -167,6 +167,8 @@ struct sock_common {
* @sk_socket - Identd and reporting IO signals
* @sk_socket - Identd and reporting IO signals
* @sk_user_data - RPC layer private data
* @sk_user_data - RPC layer private data
* @sk_owner - module that owns this socket
* @sk_owner - module that owns this socket
* @sk_sndmsg_page - cached page for sendmsg
* @sk_sndmsg_off - cached offset for sendmsg
* @sk_send_head - front of stuff to transmit
* @sk_send_head - front of stuff to transmit
* @sk_write_pending - a write to stream socket waits to start
* @sk_write_pending - a write to stream socket waits to start
* @sk_queue_shrunk - write queue has been shrunk recently
* @sk_queue_shrunk - write queue has been shrunk recently
...
@@ -249,8 +251,10 @@ struct sock {
...
@@ -249,8 +251,10 @@ struct sock {
struct
timeval
sk_stamp
;
struct
timeval
sk_stamp
;
struct
socket
*
sk_socket
;
struct
socket
*
sk_socket
;
void
*
sk_user_data
;
void
*
sk_user_data
;
struct
sk_buff
*
sk_send_head
;
struct
module
*
sk_owner
;
struct
module
*
sk_owner
;
struct
page
*
sk_sndmsg_page
;
__u32
sk_sndmsg_off
;
struct
sk_buff
*
sk_send_head
;
int
sk_write_pending
;
int
sk_write_pending
;
void
*
sk_security
;
void
*
sk_security
;
__u8
sk_queue_shrunk
;
__u8
sk_queue_shrunk
;
...
...
net/core/sock.c
View file @
ec50d2c5
...
@@ -650,6 +650,14 @@ void sk_free(struct sock *sk)
...
@@ -650,6 +650,14 @@ void sk_free(struct sock *sk)
printk
(
KERN_DEBUG
"%s: optmem leakage (%d bytes) detected.
\n
"
,
printk
(
KERN_DEBUG
"%s: optmem leakage (%d bytes) detected.
\n
"
,
__FUNCTION__
,
atomic_read
(
&
sk
->
sk_omem_alloc
));
__FUNCTION__
,
atomic_read
(
&
sk
->
sk_omem_alloc
));
/*
* If sendmsg cached page exists, toss it.
*/
if
(
sk
->
sk_sndmsg_page
)
{
__free_page
(
sk
->
sk_sndmsg_page
);
sk
->
sk_sndmsg_page
=
NULL
;
}
security_sk_free
(
sk
);
security_sk_free
(
sk
);
kmem_cache_free
(
sk
->
sk_slab
,
sk
);
kmem_cache_free
(
sk
->
sk_slab
,
sk
);
module_put
(
owner
);
module_put
(
owner
);
...
@@ -1175,6 +1183,9 @@ void sock_init_data(struct socket *sock, struct sock *sk)
...
@@ -1175,6 +1183,9 @@ void sock_init_data(struct socket *sock, struct sock *sk)
sk
->
sk_error_report
=
sock_def_error_report
;
sk
->
sk_error_report
=
sock_def_error_report
;
sk
->
sk_destruct
=
sock_def_destruct
;
sk
->
sk_destruct
=
sock_def_destruct
;
sk
->
sk_sndmsg_page
=
NULL
;
sk
->
sk_sndmsg_off
=
0
;
sk
->
sk_peercred
.
pid
=
0
;
sk
->
sk_peercred
.
pid
=
0
;
sk
->
sk_peercred
.
uid
=
-
1
;
sk
->
sk_peercred
.
uid
=
-
1
;
sk
->
sk_peercred
.
gid
=
-
1
;
sk
->
sk_peercred
.
gid
=
-
1
;
...
...
net/ipv4/af_inet.c
View file @
ec50d2c5
...
@@ -1041,24 +1041,24 @@ void inet_unregister_protosw(struct inet_protosw *p)
...
@@ -1041,24 +1041,24 @@ void inet_unregister_protosw(struct inet_protosw *p)
}
}
#ifdef CONFIG_IP_MULTICAST
#ifdef CONFIG_IP_MULTICAST
static
struct
i
net_protocol
igmp_protocol
=
{
static
struct
net_protocol
igmp_protocol
=
{
.
handler
=
igmp_rcv
,
.
handler
=
igmp_rcv
,
};
};
#endif
#endif
static
struct
i
net_protocol
tcp_protocol
=
{
static
struct
net_protocol
tcp_protocol
=
{
.
handler
=
tcp_v4_rcv
,
.
handler
=
tcp_v4_rcv
,
.
err_handler
=
tcp_v4_err
,
.
err_handler
=
tcp_v4_err
,
.
no_policy
=
1
,
.
no_policy
=
1
,
};
};
static
struct
i
net_protocol
udp_protocol
=
{
static
struct
net_protocol
udp_protocol
=
{
.
handler
=
udp_rcv
,
.
handler
=
udp_rcv
,
.
err_handler
=
udp_err
,
.
err_handler
=
udp_err
,
.
no_policy
=
1
,
.
no_policy
=
1
,
};
};
static
struct
i
net_protocol
icmp_protocol
=
{
static
struct
net_protocol
icmp_protocol
=
{
.
handler
=
icmp_rcv
,
.
handler
=
icmp_rcv
,
};
};
...
...
net/ipv4/ah4.c
View file @
ec50d2c5
...
@@ -343,7 +343,7 @@ static struct xfrm_type ah_type =
...
@@ -343,7 +343,7 @@ static struct xfrm_type ah_type =
.
output
=
ah_output
.
output
=
ah_output
};
};
static
struct
i
net_protocol
ah4_protocol
=
{
static
struct
net_protocol
ah4_protocol
=
{
.
handler
=
xfrm4_rcv
,
.
handler
=
xfrm4_rcv
,
.
err_handler
=
ah4_err
,
.
err_handler
=
ah4_err
,
.
no_policy
=
1
,
.
no_policy
=
1
,
...
...
net/ipv4/esp4.c
View file @
ec50d2c5
...
@@ -595,7 +595,7 @@ static struct xfrm_type esp_type =
...
@@ -595,7 +595,7 @@ static struct xfrm_type esp_type =
.
output
=
esp_output
.
output
=
esp_output
};
};
static
struct
i
net_protocol
esp4_protocol
=
{
static
struct
net_protocol
esp4_protocol
=
{
.
handler
=
xfrm4_rcv
,
.
handler
=
xfrm4_rcv
,
.
err_handler
=
esp4_err
,
.
err_handler
=
esp4_err
,
.
no_policy
=
1
,
.
no_policy
=
1
,
...
...
net/ipv4/icmp.c
View file @
ec50d2c5
...
@@ -592,7 +592,7 @@ static void icmp_unreach(struct sk_buff *skb)
...
@@ -592,7 +592,7 @@ static void icmp_unreach(struct sk_buff *skb)
struct
iphdr
*
iph
;
struct
iphdr
*
iph
;
struct
icmphdr
*
icmph
;
struct
icmphdr
*
icmph
;
int
hash
,
protocol
;
int
hash
,
protocol
;
struct
i
net_protocol
*
ipprot
;
struct
net_protocol
*
ipprot
;
struct
sock
*
raw_sk
;
struct
sock
*
raw_sk
;
u32
info
=
0
;
u32
info
=
0
;
...
...
net/ipv4/ip_gre.c
View file @
ec50d2c5
...
@@ -1240,7 +1240,7 @@ int __init ipgre_fb_tunnel_init(struct net_device *dev)
...
@@ -1240,7 +1240,7 @@ int __init ipgre_fb_tunnel_init(struct net_device *dev)
}
}
static
struct
i
net_protocol
ipgre_protocol
=
{
static
struct
net_protocol
ipgre_protocol
=
{
.
handler
=
ipgre_rcv
,
.
handler
=
ipgre_rcv
,
.
err_handler
=
ipgre_err
,
.
err_handler
=
ipgre_err
,
};
};
...
...
net/ipv4/ip_input.c
View file @
ec50d2c5
...
@@ -223,7 +223,7 @@ static inline int ip_local_deliver_finish(struct sk_buff *skb)
...
@@ -223,7 +223,7 @@ static inline int ip_local_deliver_finish(struct sk_buff *skb)
int
protocol
=
skb
->
nh
.
iph
->
protocol
;
int
protocol
=
skb
->
nh
.
iph
->
protocol
;
int
hash
;
int
hash
;
struct
sock
*
raw_sk
;
struct
sock
*
raw_sk
;
struct
i
net_protocol
*
ipprot
;
struct
net_protocol
*
ipprot
;
resubmit:
resubmit:
hash
=
protocol
&
(
MAX_INET_PROTOS
-
1
);
hash
=
protocol
&
(
MAX_INET_PROTOS
-
1
);
...
...
net/ipv4/ip_output.c
View file @
ec50d2c5
...
@@ -766,8 +766,8 @@ int ip_append_data(struct sock *sk,
...
@@ -766,8 +766,8 @@ int ip_append_data(struct sock *sk,
inet
->
cork
.
fragsize
=
mtu
=
dst_pmtu
(
&
rt
->
u
.
dst
);
inet
->
cork
.
fragsize
=
mtu
=
dst_pmtu
(
&
rt
->
u
.
dst
);
inet
->
cork
.
rt
=
rt
;
inet
->
cork
.
rt
=
rt
;
inet
->
cork
.
length
=
0
;
inet
->
cork
.
length
=
0
;
inet
->
sndmsg_page
=
NULL
;
sk
->
sk_
sndmsg_page
=
NULL
;
inet
->
sndmsg_off
=
0
;
sk
->
sk_
sndmsg_off
=
0
;
if
((
exthdrlen
=
rt
->
u
.
dst
.
header_len
)
!=
0
)
{
if
((
exthdrlen
=
rt
->
u
.
dst
.
header_len
)
!=
0
)
{
length
+=
exthdrlen
;
length
+=
exthdrlen
;
transhdrlen
+=
exthdrlen
;
transhdrlen
+=
exthdrlen
;
...
@@ -915,8 +915,8 @@ int ip_append_data(struct sock *sk,
...
@@ -915,8 +915,8 @@ int ip_append_data(struct sock *sk,
}
else
{
}
else
{
int
i
=
skb_shinfo
(
skb
)
->
nr_frags
;
int
i
=
skb_shinfo
(
skb
)
->
nr_frags
;
skb_frag_t
*
frag
=
&
skb_shinfo
(
skb
)
->
frags
[
i
-
1
];
skb_frag_t
*
frag
=
&
skb_shinfo
(
skb
)
->
frags
[
i
-
1
];
struct
page
*
page
=
inet
->
sndmsg_page
;
struct
page
*
page
=
sk
->
sk_
sndmsg_page
;
int
off
=
inet
->
sndmsg_off
;
int
off
=
sk
->
sk_
sndmsg_off
;
unsigned
int
left
;
unsigned
int
left
;
if
(
page
&&
(
left
=
PAGE_SIZE
-
off
)
>
0
)
{
if
(
page
&&
(
left
=
PAGE_SIZE
-
off
)
>
0
)
{
...
@@ -928,7 +928,7 @@ int ip_append_data(struct sock *sk,
...
@@ -928,7 +928,7 @@ int ip_append_data(struct sock *sk,
goto
error
;
goto
error
;
}
}
get_page
(
page
);
get_page
(
page
);
skb_fill_page_desc
(
skb
,
i
,
page
,
inet
->
sndmsg_off
,
0
);
skb_fill_page_desc
(
skb
,
i
,
page
,
sk
->
sk_
sndmsg_off
,
0
);
frag
=
&
skb_shinfo
(
skb
)
->
frags
[
i
];
frag
=
&
skb_shinfo
(
skb
)
->
frags
[
i
];
}
}
}
else
if
(
i
<
MAX_SKB_FRAGS
)
{
}
else
if
(
i
<
MAX_SKB_FRAGS
)
{
...
@@ -939,8 +939,8 @@ int ip_append_data(struct sock *sk,
...
@@ -939,8 +939,8 @@ int ip_append_data(struct sock *sk,
err
=
-
ENOMEM
;
err
=
-
ENOMEM
;
goto
error
;
goto
error
;
}
}
inet
->
sndmsg_page
=
page
;
sk
->
sk_
sndmsg_page
=
page
;
inet
->
sndmsg_off
=
0
;
sk
->
sk_
sndmsg_off
=
0
;
skb_fill_page_desc
(
skb
,
i
,
page
,
0
,
0
);
skb_fill_page_desc
(
skb
,
i
,
page
,
0
,
0
);
frag
=
&
skb_shinfo
(
skb
)
->
frags
[
i
];
frag
=
&
skb_shinfo
(
skb
)
->
frags
[
i
];
...
@@ -954,7 +954,7 @@ int ip_append_data(struct sock *sk,
...
@@ -954,7 +954,7 @@ int ip_append_data(struct sock *sk,
err
=
-
EFAULT
;
err
=
-
EFAULT
;
goto
error
;
goto
error
;
}
}
inet
->
sndmsg_off
+=
copy
;
sk
->
sk_
sndmsg_off
+=
copy
;
frag
->
size
+=
copy
;
frag
->
size
+=
copy
;
skb
->
len
+=
copy
;
skb
->
len
+=
copy
;
skb
->
data_len
+=
copy
;
skb
->
data_len
+=
copy
;
...
...
net/ipv4/ipcomp.c
View file @
ec50d2c5
...
@@ -409,7 +409,7 @@ static struct xfrm_type ipcomp_type = {
...
@@ -409,7 +409,7 @@ static struct xfrm_type ipcomp_type = {
.
output
=
ipcomp_output
.
output
=
ipcomp_output
};
};
static
struct
i
net_protocol
ipcomp4_protocol
=
{
static
struct
net_protocol
ipcomp4_protocol
=
{
.
handler
=
xfrm4_rcv
,
.
handler
=
xfrm4_rcv
,
.
err_handler
=
ipcomp4_err
,
.
err_handler
=
ipcomp4_err
,
.
no_policy
=
1
,
.
no_policy
=
1
,
...
...
net/ipv4/ipmr.c
View file @
ec50d2c5
...
@@ -109,7 +109,7 @@ static int ip_mr_forward(struct sk_buff *skb, struct mfc_cache *cache, int local
...
@@ -109,7 +109,7 @@ static int ip_mr_forward(struct sk_buff *skb, struct mfc_cache *cache, int local
static
int
ipmr_cache_report
(
struct
sk_buff
*
pkt
,
vifi_t
vifi
,
int
assert
);
static
int
ipmr_cache_report
(
struct
sk_buff
*
pkt
,
vifi_t
vifi
,
int
assert
);
static
int
ipmr_fill_mroute
(
struct
sk_buff
*
skb
,
struct
mfc_cache
*
c
,
struct
rtmsg
*
rtm
);
static
int
ipmr_fill_mroute
(
struct
sk_buff
*
skb
,
struct
mfc_cache
*
c
,
struct
rtmsg
*
rtm
);
static
struct
i
net_protocol
pim_protocol
;
static
struct
net_protocol
pim_protocol
;
static
struct
timer_list
ipmr_expire_timer
;
static
struct
timer_list
ipmr_expire_timer
;
...
@@ -1876,7 +1876,7 @@ static struct file_operations ipmr_mfc_fops = {
...
@@ -1876,7 +1876,7 @@ static struct file_operations ipmr_mfc_fops = {
#endif
#endif
#ifdef CONFIG_IP_PIMSM_V2
#ifdef CONFIG_IP_PIMSM_V2
static
struct
i
net_protocol
pim_protocol
=
{
static
struct
net_protocol
pim_protocol
=
{
.
handler
=
pim_rcv
,
.
handler
=
pim_rcv
,
};
};
#endif
#endif
...
...
net/ipv4/protocol.c
View file @
ec50d2c5
...
@@ -48,14 +48,14 @@
...
@@ -48,14 +48,14 @@
#include <net/ipip.h>
#include <net/ipip.h>
#include <linux/igmp.h>
#include <linux/igmp.h>
struct
i
net_protocol
*
inet_protos
[
MAX_INET_PROTOS
];
struct
net_protocol
*
inet_protos
[
MAX_INET_PROTOS
];
static
spinlock_t
inet_proto_lock
=
SPIN_LOCK_UNLOCKED
;
static
spinlock_t
inet_proto_lock
=
SPIN_LOCK_UNLOCKED
;
/*
/*
* Add a protocol handler to the hash tables
* Add a protocol handler to the hash tables
*/
*/
int
inet_add_protocol
(
struct
i
net_protocol
*
prot
,
unsigned
char
protocol
)
int
inet_add_protocol
(
struct
net_protocol
*
prot
,
unsigned
char
protocol
)
{
{
int
hash
,
ret
;
int
hash
,
ret
;
...
@@ -77,7 +77,7 @@ int inet_add_protocol(struct inet_protocol *prot, unsigned char protocol)
...
@@ -77,7 +77,7 @@ int inet_add_protocol(struct inet_protocol *prot, unsigned char protocol)
* Remove a protocol from the hash tables.
* Remove a protocol from the hash tables.
*/
*/
int
inet_del_protocol
(
struct
i
net_protocol
*
prot
,
unsigned
char
protocol
)
int
inet_del_protocol
(
struct
net_protocol
*
prot
,
unsigned
char
protocol
)
{
{
int
hash
,
ret
;
int
hash
,
ret
;
...
...
net/ipv4/tcp.c
View file @
ec50d2c5
...
@@ -628,16 +628,6 @@ static void tcp_listen_stop (struct sock *sk)
...
@@ -628,16 +628,6 @@ static void tcp_listen_stop (struct sock *sk)
BUG_TRAP
(
!
sk
->
sk_ack_backlog
);
BUG_TRAP
(
!
sk
->
sk_ack_backlog
);
}
}
static
inline
void
fill_page_desc
(
struct
sk_buff
*
skb
,
int
i
,
struct
page
*
page
,
int
off
,
int
size
)
{
skb_frag_t
*
frag
=
&
skb_shinfo
(
skb
)
->
frags
[
i
];
frag
->
page
=
page
;
frag
->
page_offset
=
off
;
frag
->
size
=
size
;
skb_shinfo
(
skb
)
->
nr_frags
=
i
+
1
;
}
static
inline
void
tcp_mark_push
(
struct
tcp_opt
*
tp
,
struct
sk_buff
*
skb
)
static
inline
void
tcp_mark_push
(
struct
tcp_opt
*
tp
,
struct
sk_buff
*
skb
)
{
{
TCP_SKB_CB
(
skb
)
->
flags
|=
TCPCB_FLAG_PSH
;
TCP_SKB_CB
(
skb
)
->
flags
|=
TCPCB_FLAG_PSH
;
...
@@ -740,7 +730,7 @@ static ssize_t do_tcp_sendpages(struct sock *sk, struct page **pages, int poffse
...
@@ -740,7 +730,7 @@ static ssize_t do_tcp_sendpages(struct sock *sk, struct page **pages, int poffse
skb_shinfo
(
skb
)
->
frags
[
i
-
1
].
size
+=
copy
;
skb_shinfo
(
skb
)
->
frags
[
i
-
1
].
size
+=
copy
;
}
else
if
(
i
<
MAX_SKB_FRAGS
)
{
}
else
if
(
i
<
MAX_SKB_FRAGS
)
{
get_page
(
page
);
get_page
(
page
);
fill_page_desc
(
skb
,
i
,
page
,
offset
,
copy
);
skb_
fill_page_desc
(
skb
,
i
,
page
,
offset
,
copy
);
}
else
{
}
else
{
tcp_mark_push
(
tp
,
skb
);
tcp_mark_push
(
tp
,
skb
);
goto
new_segment
;
goto
new_segment
;
...
@@ -816,8 +806,8 @@ ssize_t tcp_sendpage(struct socket *sock, struct page *page, int offset,
...
@@ -816,8 +806,8 @@ ssize_t tcp_sendpage(struct socket *sock, struct page *page, int offset,
return
res
;
return
res
;
}
}
#define TCP_PAGE(sk) (
inet_sk(sk)->
sndmsg_page)
#define TCP_PAGE(sk) (
sk->sk_
sndmsg_page)
#define TCP_OFF(sk) (
inet_sk(sk)->
sndmsg_off)
#define TCP_OFF(sk) (
sk->sk_
sndmsg_off)
static
inline
int
select_size
(
struct
sock
*
sk
,
struct
tcp_opt
*
tp
)
static
inline
int
select_size
(
struct
sock
*
sk
,
struct
tcp_opt
*
tp
)
{
{
...
@@ -980,7 +970,7 @@ int tcp_sendmsg(struct kiocb *iocb, struct sock *sk, struct msghdr *msg,
...
@@ -980,7 +970,7 @@ int tcp_sendmsg(struct kiocb *iocb, struct sock *sk, struct msghdr *msg,
skb_shinfo
(
skb
)
->
frags
[
i
-
1
].
size
+=
skb_shinfo
(
skb
)
->
frags
[
i
-
1
].
size
+=
copy
;
copy
;
}
else
{
}
else
{
fill_page_desc
(
skb
,
i
,
page
,
off
,
copy
);
skb_
fill_page_desc
(
skb
,
i
,
page
,
off
,
copy
);
if
(
TCP_PAGE
(
sk
))
{
if
(
TCP_PAGE
(
sk
))
{
get_page
(
page
);
get_page
(
page
);
}
else
if
(
off
+
copy
<
PAGE_SIZE
)
{
}
else
if
(
off
+
copy
<
PAGE_SIZE
)
{
...
...
net/ipv4/tcp_ipv4.c
View file @
ec50d2c5
...
@@ -2113,10 +2113,6 @@ static int tcp_v4_destroy_sock(struct sock *sk)
...
@@ -2113,10 +2113,6 @@ static int tcp_v4_destroy_sock(struct sock *sk)
if
(
tp
->
bind_hash
)
if
(
tp
->
bind_hash
)
tcp_put_port
(
sk
);
tcp_put_port
(
sk
);
/* If sendmsg cached page exists, toss it. */
if
(
inet_sk
(
sk
)
->
sndmsg_page
)
__free_page
(
inet_sk
(
sk
)
->
sndmsg_page
);
atomic_dec
(
&
tcp_sockets_allocated
);
atomic_dec
(
&
tcp_sockets_allocated
);
return
0
;
return
0
;
...
...
net/ipv4/xfrm4_tunnel.c
View file @
ec50d2c5
...
@@ -167,7 +167,7 @@ static struct xfrm_type ipip_type = {
...
@@ -167,7 +167,7 @@ static struct xfrm_type ipip_type = {
.
output
=
ipip_output
.
output
=
ipip_output
};
};
static
struct
i
net_protocol
ipip_protocol
=
{
static
struct
net_protocol
ipip_protocol
=
{
.
handler
=
ipip_rcv
,
.
handler
=
ipip_rcv
,
.
err_handler
=
ipip_err
,
.
err_handler
=
ipip_err
,
.
no_policy
=
1
,
.
no_policy
=
1
,
...
...
net/ipv6/ip6_output.c
View file @
ec50d2c5
...
@@ -852,8 +852,8 @@ int ip6_append_data(struct sock *sk, int getfrag(void *from, char *to, int offse
...
@@ -852,8 +852,8 @@ int ip6_append_data(struct sock *sk, int getfrag(void *from, char *to, int offse
np
->
cork
.
hop_limit
=
hlimit
;
np
->
cork
.
hop_limit
=
hlimit
;
inet
->
cork
.
fragsize
=
mtu
=
dst_pmtu
(
&
rt
->
u
.
dst
);
inet
->
cork
.
fragsize
=
mtu
=
dst_pmtu
(
&
rt
->
u
.
dst
);
inet
->
cork
.
length
=
0
;
inet
->
cork
.
length
=
0
;
inet
->
sndmsg_page
=
NULL
;
sk
->
sk_
sndmsg_page
=
NULL
;
inet
->
sndmsg_off
=
0
;
sk
->
sk_
sndmsg_off
=
0
;
exthdrlen
=
rt
->
u
.
dst
.
header_len
+
(
opt
?
opt
->
opt_flen
:
0
);
exthdrlen
=
rt
->
u
.
dst
.
header_len
+
(
opt
?
opt
->
opt_flen
:
0
);
length
+=
exthdrlen
;
length
+=
exthdrlen
;
transhdrlen
+=
exthdrlen
;
transhdrlen
+=
exthdrlen
;
...
@@ -969,8 +969,8 @@ int ip6_append_data(struct sock *sk, int getfrag(void *from, char *to, int offse
...
@@ -969,8 +969,8 @@ int ip6_append_data(struct sock *sk, int getfrag(void *from, char *to, int offse
}
else
{
}
else
{
int
i
=
skb_shinfo
(
skb
)
->
nr_frags
;
int
i
=
skb_shinfo
(
skb
)
->
nr_frags
;
skb_frag_t
*
frag
=
&
skb_shinfo
(
skb
)
->
frags
[
i
-
1
];
skb_frag_t
*
frag
=
&
skb_shinfo
(
skb
)
->
frags
[
i
-
1
];
struct
page
*
page
=
inet
->
sndmsg_page
;
struct
page
*
page
=
sk
->
sk_
sndmsg_page
;
int
off
=
inet
->
sndmsg_off
;
int
off
=
sk
->
sk_
sndmsg_off
;
unsigned
int
left
;
unsigned
int
left
;
if
(
page
&&
(
left
=
PAGE_SIZE
-
off
)
>
0
)
{
if
(
page
&&
(
left
=
PAGE_SIZE
-
off
)
>
0
)
{
...
@@ -982,7 +982,7 @@ int ip6_append_data(struct sock *sk, int getfrag(void *from, char *to, int offse
...
@@ -982,7 +982,7 @@ int ip6_append_data(struct sock *sk, int getfrag(void *from, char *to, int offse
goto
error
;
goto
error
;
}
}
get_page
(
page
);
get_page
(
page
);
skb_fill_page_desc
(
skb
,
i
,
page
,
inet
->
sndmsg_off
,
0
);
skb_fill_page_desc
(
skb
,
i
,
page
,
sk
->
sk_
sndmsg_off
,
0
);
frag
=
&
skb_shinfo
(
skb
)
->
frags
[
i
];
frag
=
&
skb_shinfo
(
skb
)
->
frags
[
i
];
}
}
}
else
if
(
i
<
MAX_SKB_FRAGS
)
{
}
else
if
(
i
<
MAX_SKB_FRAGS
)
{
...
@@ -993,8 +993,8 @@ int ip6_append_data(struct sock *sk, int getfrag(void *from, char *to, int offse
...
@@ -993,8 +993,8 @@ int ip6_append_data(struct sock *sk, int getfrag(void *from, char *to, int offse
err
=
-
ENOMEM
;
err
=
-
ENOMEM
;
goto
error
;
goto
error
;
}
}
inet
->
sndmsg_page
=
page
;
sk
->
sk_
sndmsg_page
=
page
;
inet
->
sndmsg_off
=
0
;
sk
->
sk_
sndmsg_off
=
0
;
skb_fill_page_desc
(
skb
,
i
,
page
,
0
,
0
);
skb_fill_page_desc
(
skb
,
i
,
page
,
0
,
0
);
frag
=
&
skb_shinfo
(
skb
)
->
frags
[
i
];
frag
=
&
skb_shinfo
(
skb
)
->
frags
[
i
];
...
@@ -1008,7 +1008,7 @@ int ip6_append_data(struct sock *sk, int getfrag(void *from, char *to, int offse
...
@@ -1008,7 +1008,7 @@ int ip6_append_data(struct sock *sk, int getfrag(void *from, char *to, int offse
err
=
-
EFAULT
;
err
=
-
EFAULT
;
goto
error
;
goto
error
;
}
}
inet
->
sndmsg_off
+=
copy
;
sk
->
sk_
sndmsg_off
+=
copy
;
frag
->
size
+=
copy
;
frag
->
size
+=
copy
;
skb
->
len
+=
copy
;
skb
->
len
+=
copy
;
skb
->
data_len
+=
copy
;
skb
->
data_len
+=
copy
;
...
...
net/ipv6/sit.c
View file @
ec50d2c5
...
@@ -800,7 +800,7 @@ int __init ipip6_fb_tunnel_init(struct net_device *dev)
...
@@ -800,7 +800,7 @@ int __init ipip6_fb_tunnel_init(struct net_device *dev)
return
0
;
return
0
;
}
}
static
struct
i
net_protocol
sit_protocol
=
{
static
struct
net_protocol
sit_protocol
=
{
.
handler
=
ipip6_rcv
,
.
handler
=
ipip6_rcv
,
.
err_handler
=
ipip6_err
,
.
err_handler
=
ipip6_err
,
};
};
...
...
net/ipv6/tcp_ipv6.c
View file @
ec50d2c5
...
@@ -1893,7 +1893,6 @@ static int tcp_v6_init_sock(struct sock *sk)
...
@@ -1893,7 +1893,6 @@ static int tcp_v6_init_sock(struct sock *sk)
static
int
tcp_v6_destroy_sock
(
struct
sock
*
sk
)
static
int
tcp_v6_destroy_sock
(
struct
sock
*
sk
)
{
{
struct
tcp_opt
*
tp
=
tcp_sk
(
sk
);
struct
tcp_opt
*
tp
=
tcp_sk
(
sk
);
struct
inet_opt
*
inet
=
inet_sk
(
sk
);
tcp_clear_xmit_timers
(
sk
);
tcp_clear_xmit_timers
(
sk
);
...
@@ -1910,10 +1909,6 @@ static int tcp_v6_destroy_sock(struct sock *sk)
...
@@ -1910,10 +1909,6 @@ static int tcp_v6_destroy_sock(struct sock *sk)
if
(
tcp_sk
(
sk
)
->
bind_hash
)
if
(
tcp_sk
(
sk
)
->
bind_hash
)
tcp_put_port
(
sk
);
tcp_put_port
(
sk
);
/* If sendmsg cached page exists, toss it. */
if
(
inet
->
sndmsg_page
!=
NULL
)
__free_page
(
inet
->
sndmsg_page
);
atomic_dec
(
&
tcp_sockets_allocated
);
atomic_dec
(
&
tcp_sockets_allocated
);
return
inet6_destroy_sock
(
sk
);
return
inet6_destroy_sock
(
sk
);
...
...
net/sctp/protocol.c
View file @
ec50d2c5
...
@@ -875,7 +875,7 @@ static struct inet_protosw sctp_stream_protosw = {
...
@@ -875,7 +875,7 @@ static struct inet_protosw sctp_stream_protosw = {
};
};
/* Register with IP layer. */
/* Register with IP layer. */
static
struct
i
net_protocol
sctp_protocol
=
{
static
struct
net_protocol
sctp_protocol
=
{
.
handler
=
sctp_rcv
,
.
handler
=
sctp_rcv
,
.
err_handler
=
sctp_v4_err
,
.
err_handler
=
sctp_v4_err
,
.
no_policy
=
1
,
.
no_policy
=
1
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment