Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
Kernel
提交
988cf74d
K
Kernel
项目概览
openeuler
/
Kernel
12 个月 前同步成功
通知
5
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
K
Kernel
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
988cf74d
编写于
7月 03, 2017
作者:
D
David S. Miller
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
inet: Stop generating UFO packets.
Signed-off-by:
N
David S. Miller
<
davem@davemloft.net
>
上级
08a00fea
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
0 addition
and
152 deletion
+0
-152
net/ipv4/ip_output.c
net/ipv4/ip_output.c
+0
-76
net/ipv6/ip6_output.c
net/ipv6/ip6_output.c
+0
-76
未找到文件。
net/ipv4/ip_output.c
浏览文件 @
988cf74d
...
...
@@ -853,61 +853,6 @@ csum_page(struct page *page, int offset, int copy)
return
csum
;
}
static
inline
int
ip_ufo_append_data
(
struct
sock
*
sk
,
struct
sk_buff_head
*
queue
,
int
getfrag
(
void
*
from
,
char
*
to
,
int
offset
,
int
len
,
int
odd
,
struct
sk_buff
*
skb
),
void
*
from
,
int
length
,
int
hh_len
,
int
fragheaderlen
,
int
transhdrlen
,
int
maxfraglen
,
unsigned
int
flags
)
{
struct
sk_buff
*
skb
;
int
err
;
/* There is support for UDP fragmentation offload by network
* device, so create one single skb packet containing complete
* udp datagram
*/
skb
=
skb_peek_tail
(
queue
);
if
(
!
skb
)
{
skb
=
sock_alloc_send_skb
(
sk
,
hh_len
+
fragheaderlen
+
transhdrlen
+
20
,
(
flags
&
MSG_DONTWAIT
),
&
err
);
if
(
!
skb
)
return
err
;
/* reserve space for Hardware header */
skb_reserve
(
skb
,
hh_len
);
/* create space for UDP/IP header */
skb_put
(
skb
,
fragheaderlen
+
transhdrlen
);
/* initialize network header pointer */
skb_reset_network_header
(
skb
);
/* initialize protocol header pointer */
skb
->
transport_header
=
skb
->
network_header
+
fragheaderlen
;
skb
->
csum
=
0
;
if
(
flags
&
MSG_CONFIRM
)
skb_set_dst_pending_confirm
(
skb
,
1
);
__skb_queue_tail
(
queue
,
skb
);
}
else
if
(
skb_is_gso
(
skb
))
{
goto
append
;
}
skb
->
ip_summed
=
CHECKSUM_PARTIAL
;
/* specify the length of each IP datagram fragment */
skb_shinfo
(
skb
)
->
gso_size
=
maxfraglen
-
fragheaderlen
;
skb_shinfo
(
skb
)
->
gso_type
=
SKB_GSO_UDP
;
append:
return
skb_append_datato_frags
(
sk
,
skb
,
getfrag
,
from
,
(
length
-
transhdrlen
));
}
static
int
__ip_append_data
(
struct
sock
*
sk
,
struct
flowi4
*
fl4
,
struct
sk_buff_head
*
queue
,
...
...
@@ -965,18 +910,6 @@ static int __ip_append_data(struct sock *sk,
csummode
=
CHECKSUM_PARTIAL
;
cork
->
length
+=
length
;
if
((((
length
+
(
skb
?
skb
->
len
:
fragheaderlen
))
>
mtu
)
||
(
skb
&&
skb_is_gso
(
skb
)))
&&
(
sk
->
sk_protocol
==
IPPROTO_UDP
)
&&
(
rt
->
dst
.
dev
->
features
&
NETIF_F_UFO
)
&&
!
dst_xfrm
(
&
rt
->
dst
)
&&
(
sk
->
sk_type
==
SOCK_DGRAM
)
&&
!
sk
->
sk_no_check_tx
)
{
err
=
ip_ufo_append_data
(
sk
,
queue
,
getfrag
,
from
,
length
,
hh_len
,
fragheaderlen
,
transhdrlen
,
maxfraglen
,
flags
);
if
(
err
)
goto
error
;
return
0
;
}
/* So, what's going on in the loop below?
*
...
...
@@ -1287,15 +1220,6 @@ ssize_t ip_append_page(struct sock *sk, struct flowi4 *fl4, struct page *page,
if
(
!
skb
)
return
-
EINVAL
;
if
((
size
+
skb
->
len
>
mtu
)
&&
(
sk
->
sk_protocol
==
IPPROTO_UDP
)
&&
(
rt
->
dst
.
dev
->
features
&
NETIF_F_UFO
))
{
if
(
skb
->
ip_summed
!=
CHECKSUM_PARTIAL
)
return
-
EOPNOTSUPP
;
skb_shinfo
(
skb
)
->
gso_size
=
mtu
-
fragheaderlen
;
skb_shinfo
(
skb
)
->
gso_type
=
SKB_GSO_UDP
;
}
cork
->
length
+=
size
;
while
(
size
>
0
)
{
...
...
net/ipv6/ip6_output.c
浏览文件 @
988cf74d
...
...
@@ -1114,69 +1114,6 @@ struct dst_entry *ip6_sk_dst_lookup_flow(struct sock *sk, struct flowi6 *fl6,
}
EXPORT_SYMBOL_GPL
(
ip6_sk_dst_lookup_flow
);
static
inline
int
ip6_ufo_append_data
(
struct
sock
*
sk
,
struct
sk_buff_head
*
queue
,
int
getfrag
(
void
*
from
,
char
*
to
,
int
offset
,
int
len
,
int
odd
,
struct
sk_buff
*
skb
),
void
*
from
,
int
length
,
int
hh_len
,
int
fragheaderlen
,
int
exthdrlen
,
int
transhdrlen
,
int
mtu
,
unsigned
int
flags
,
const
struct
flowi6
*
fl6
)
{
struct
sk_buff
*
skb
;
int
err
;
/* There is support for UDP large send offload by network
* device, so create one single skb packet containing complete
* udp datagram
*/
skb
=
skb_peek_tail
(
queue
);
if
(
!
skb
)
{
skb
=
sock_alloc_send_skb
(
sk
,
hh_len
+
fragheaderlen
+
transhdrlen
+
20
,
(
flags
&
MSG_DONTWAIT
),
&
err
);
if
(
!
skb
)
return
err
;
/* reserve space for Hardware header */
skb_reserve
(
skb
,
hh_len
);
/* create space for UDP/IP header */
skb_put
(
skb
,
fragheaderlen
+
transhdrlen
);
/* initialize network header pointer */
skb_set_network_header
(
skb
,
exthdrlen
);
/* initialize protocol header pointer */
skb
->
transport_header
=
skb
->
network_header
+
fragheaderlen
;
skb
->
protocol
=
htons
(
ETH_P_IPV6
);
skb
->
csum
=
0
;
if
(
flags
&
MSG_CONFIRM
)
skb_set_dst_pending_confirm
(
skb
,
1
);
__skb_queue_tail
(
queue
,
skb
);
}
else
if
(
skb_is_gso
(
skb
))
{
goto
append
;
}
skb
->
ip_summed
=
CHECKSUM_PARTIAL
;
/* Specify the length of each IPv6 datagram fragment.
* It has to be a multiple of 8.
*/
skb_shinfo
(
skb
)
->
gso_size
=
(
mtu
-
fragheaderlen
-
sizeof
(
struct
frag_hdr
))
&
~
7
;
skb_shinfo
(
skb
)
->
gso_type
=
SKB_GSO_UDP
;
skb_shinfo
(
skb
)
->
ip6_frag_id
=
ipv6_select_ident
(
sock_net
(
sk
),
&
fl6
->
daddr
,
&
fl6
->
saddr
);
append:
return
skb_append_datato_frags
(
sk
,
skb
,
getfrag
,
from
,
(
length
-
transhdrlen
));
}
static
inline
struct
ipv6_opt_hdr
*
ip6_opt_dup
(
struct
ipv6_opt_hdr
*
src
,
gfp_t
gfp
)
{
...
...
@@ -1385,19 +1322,6 @@ static int __ip6_append_data(struct sock *sk,
*/
cork
->
length
+=
length
;
if
((((
length
+
(
skb
?
skb
->
len
:
headersize
))
>
mtu
)
||
(
skb
&&
skb_is_gso
(
skb
)))
&&
(
sk
->
sk_protocol
==
IPPROTO_UDP
)
&&
(
rt
->
dst
.
dev
->
features
&
NETIF_F_UFO
)
&&
!
dst_xfrm
(
&
rt
->
dst
)
&&
(
sk
->
sk_type
==
SOCK_DGRAM
)
&&
!
udp_get_no_check6_tx
(
sk
))
{
err
=
ip6_ufo_append_data
(
sk
,
queue
,
getfrag
,
from
,
length
,
hh_len
,
fragheaderlen
,
exthdrlen
,
transhdrlen
,
mtu
,
flags
,
fl6
);
if
(
err
)
goto
error
;
return
0
;
}
if
(
!
skb
)
goto
alloc_new_skb
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录