Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
cloud-kernel
提交
f185071d
cloud-kernel
项目概览
openanolis
/
cloud-kernel
1 年多 前同步成功
通知
160
Star
36
Fork
7
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
10
列表
看板
标记
里程碑
合并请求
2
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
cloud-kernel
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
10
Issue
10
列表
看板
标记
里程碑
合并请求
2
合并请求
2
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
f185071d
编写于
7月 10, 2012
作者:
D
David S. Miller
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
ipv4: Remove inetpeer from routes.
No longer used. Signed-off-by:
N
David S. Miller
<
davem@davemloft.net
>
上级
31248731
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
6 addition
and
118 deletion
+6
-118
include/net/route.h
include/net/route.h
+0
-57
net/ipv4/route.c
net/ipv4/route.c
+6
-54
net/ipv4/xfrm4_policy.c
net/ipv4/xfrm4_policy.c
+0
-7
未找到文件。
include/net/route.h
浏览文件 @
f185071d
...
...
@@ -40,7 +40,6 @@
#define RT_CONN_FLAGS(sk) (RT_TOS(inet_sk(sk)->tos) | sock_flag(sk, SOCK_LOCALROUTE))
struct
fib_nh
;
struct
inet_peer
;
struct
fib_info
;
struct
rtable
{
struct
dst_entry
dst
;
...
...
@@ -66,44 +65,9 @@ struct rtable {
/* Miscellaneous cached information */
u32
rt_pmtu
;
unsigned
long
_peer
;
/* long-living peer info */
struct
fib_info
*
fi
;
/* for client ref to shared metrics */
};
static
inline
struct
inet_peer
*
rt_peer_ptr
(
struct
rtable
*
rt
)
{
return
inetpeer_ptr
(
rt
->
_peer
);
}
static
inline
bool
rt_has_peer
(
struct
rtable
*
rt
)
{
return
inetpeer_ptr_is_peer
(
rt
->
_peer
);
}
static
inline
void
__rt_set_peer
(
struct
rtable
*
rt
,
struct
inet_peer
*
peer
)
{
__inetpeer_ptr_set_peer
(
&
rt
->
_peer
,
peer
);
}
static
inline
bool
rt_set_peer
(
struct
rtable
*
rt
,
struct
inet_peer
*
peer
)
{
return
inetpeer_ptr_set_peer
(
&
rt
->
_peer
,
peer
);
}
static
inline
void
rt_init_peer
(
struct
rtable
*
rt
,
struct
inet_peer_base
*
base
)
{
inetpeer_init_ptr
(
&
rt
->
_peer
,
base
);
}
static
inline
void
rt_transfer_peer
(
struct
rtable
*
rt
,
struct
rtable
*
ort
)
{
rt
->
_peer
=
ort
->
_peer
;
if
(
rt_has_peer
(
ort
))
{
struct
inet_peer
*
peer
=
rt_peer_ptr
(
ort
);
atomic_inc
(
&
peer
->
refcnt
);
}
}
static
inline
bool
rt_is_input_route
(
const
struct
rtable
*
rt
)
{
return
rt
->
rt_route_iif
!=
0
;
...
...
@@ -326,27 +290,6 @@ static inline struct rtable *ip_route_newports(struct flowi4 *fl4, struct rtable
return
rt
;
}
extern
void
rt_bind_peer
(
struct
rtable
*
rt
,
__be32
daddr
,
int
create
);
static
inline
struct
inet_peer
*
__rt_get_peer
(
struct
rtable
*
rt
,
__be32
daddr
,
int
create
)
{
if
(
rt_has_peer
(
rt
))
return
rt_peer_ptr
(
rt
);
rt_bind_peer
(
rt
,
daddr
,
create
);
return
(
rt_has_peer
(
rt
)
?
rt_peer_ptr
(
rt
)
:
NULL
);
}
static
inline
struct
inet_peer
*
rt_get_peer
(
struct
rtable
*
rt
,
__be32
daddr
)
{
return
__rt_get_peer
(
rt
,
daddr
,
0
);
}
static
inline
struct
inet_peer
*
rt_get_peer_create
(
struct
rtable
*
rt
,
__be32
daddr
)
{
return
__rt_get_peer
(
rt
,
daddr
,
1
);
}
static
inline
int
inet_iif
(
const
struct
sk_buff
*
skb
)
{
return
skb_rtable
(
skb
)
->
rt_iif
;
...
...
net/ipv4/route.c
浏览文件 @
f185071d
...
...
@@ -889,7 +889,6 @@ static void rt_cache_invalidate(struct net *net)
get_random_bytes
(
&
shuffle
,
sizeof
(
shuffle
));
atomic_add
(
shuffle
+
1U
,
&
net
->
ipv4
.
rt_genid
);
inetpeer_invalidate_family
(
AF_INET
);
}
/*
...
...
@@ -1216,22 +1215,6 @@ static struct rtable *rt_intern_hash(unsigned int hash, struct rtable *rt,
return
rt
;
}
void
rt_bind_peer
(
struct
rtable
*
rt
,
__be32
daddr
,
int
create
)
{
struct
inet_peer_base
*
base
;
struct
inet_peer
*
peer
;
base
=
inetpeer_base_ptr
(
rt
->
_peer
);
if
(
!
base
)
return
;
peer
=
inet_getpeer_v4
(
base
,
daddr
,
create
);
if
(
peer
)
{
if
(
!
rt_set_peer
(
rt
,
peer
))
inet_putpeer
(
peer
);
}
}
/*
* Peer allocation may fail only in serious out-of-memory conditions. However
* we still can generate some output.
...
...
@@ -1588,10 +1571,6 @@ static void ipv4_dst_destroy(struct dst_entry *dst)
fib_info_put
(
rt
->
fi
);
rt
->
fi
=
NULL
;
}
if
(
rt_has_peer
(
rt
))
{
struct
inet_peer
*
peer
=
rt_peer_ptr
(
rt
);
inet_putpeer
(
peer
);
}
}
...
...
@@ -1711,26 +1690,11 @@ static unsigned int ipv4_mtu(const struct dst_entry *dst)
static
void
rt_init_metrics
(
struct
rtable
*
rt
,
const
struct
flowi4
*
fl4
,
struct
fib_info
*
fi
)
{
struct
inet_peer_base
*
base
;
struct
inet_peer
*
peer
;
base
=
inetpeer_base_ptr
(
rt
->
_peer
);
BUG_ON
(
!
base
);
peer
=
inet_getpeer_v4
(
base
,
rt
->
rt_dst
,
0
);
if
(
peer
)
{
__rt_set_peer
(
rt
,
peer
);
if
(
inet_metrics_new
(
peer
))
memcpy
(
peer
->
metrics
,
fi
->
fib_metrics
,
sizeof
(
u32
)
*
RTAX_MAX
);
dst_init_metrics
(
&
rt
->
dst
,
peer
->
metrics
,
false
);
}
else
{
if
(
fi
->
fib_metrics
!=
(
u32
*
)
dst_default_metrics
)
{
rt
->
fi
=
fi
;
atomic_inc
(
&
fi
->
fib_clntref
);
}
dst_init_metrics
(
&
rt
->
dst
,
fi
->
fib_metrics
,
true
);
if
(
fi
->
fib_metrics
!=
(
u32
*
)
dst_default_metrics
)
{
rt
->
fi
=
fi
;
atomic_inc
(
&
fi
->
fib_clntref
);
}
dst_init_metrics
(
&
rt
->
dst
,
fi
->
fib_metrics
,
true
);
}
static
void
rt_set_nexthop
(
struct
rtable
*
rt
,
const
struct
flowi4
*
fl4
,
...
...
@@ -1820,7 +1784,6 @@ static int ip_route_input_mc(struct sk_buff *skb, __be32 daddr, __be32 saddr,
rth
->
rt_mark
=
skb
->
mark
;
rth
->
rt_pmtu
=
0
;
rth
->
rt_gateway
=
daddr
;
rt_init_peer
(
rth
,
dev_net
(
dev
)
->
ipv4
.
peers
);
rth
->
fi
=
NULL
;
if
(
our
)
{
rth
->
dst
.
input
=
ip_local_deliver
;
...
...
@@ -1946,7 +1909,6 @@ static int __mkroute_input(struct sk_buff *skb,
rth
->
rt_mark
=
skb
->
mark
;
rth
->
rt_pmtu
=
0
;
rth
->
rt_gateway
=
daddr
;
rt_init_peer
(
rth
,
&
res
->
table
->
tb_peers
);
rth
->
fi
=
NULL
;
rth
->
dst
.
input
=
ip_forward
;
...
...
@@ -2125,7 +2087,6 @@ out: return err;
rth
->
rt_mark
=
skb
->
mark
;
rth
->
rt_pmtu
=
0
;
rth
->
rt_gateway
=
daddr
;
rt_init_peer
(
rth
,
net
->
ipv4
.
peers
);
rth
->
fi
=
NULL
;
if
(
res
.
type
==
RTN_UNREACHABLE
)
{
rth
->
dst
.
input
=
ip_error
;
...
...
@@ -2323,9 +2284,6 @@ static struct rtable *__mkroute_output(const struct fib_result *res,
rth
->
rt_mark
=
fl4
->
flowi4_mark
;
rth
->
rt_pmtu
=
0
;
rth
->
rt_gateway
=
fl4
->
daddr
;
rt_init_peer
(
rth
,
(
res
->
table
?
&
res
->
table
->
tb_peers
:
dev_net
(
dev_out
)
->
ipv4
.
peers
));
rth
->
fi
=
NULL
;
RT_CACHE_STAT_INC
(
out_slow_tot
);
...
...
@@ -2662,7 +2620,6 @@ struct dst_entry *ipv4_blackhole_route(struct net *net, struct dst_entry *dst_or
rt
->
rt_dst
=
ort
->
rt_dst
;
rt
->
rt_src
=
ort
->
rt_src
;
rt
->
rt_gateway
=
ort
->
rt_gateway
;
rt_transfer_peer
(
rt
,
ort
);
rt
->
fi
=
ort
->
fi
;
if
(
rt
->
fi
)
atomic_inc
(
&
rt
->
fi
->
fib_clntref
);
...
...
@@ -2700,7 +2657,7 @@ static int rt_fill_info(struct net *net,
struct
rtmsg
*
r
;
struct
nlmsghdr
*
nlh
;
unsigned
long
expires
=
0
;
u32
id
=
0
,
error
;
u32
error
;
nlh
=
nlmsg_put
(
skb
,
pid
,
seq
,
event
,
sizeof
(
*
r
),
flags
);
if
(
nlh
==
NULL
)
...
...
@@ -2753,11 +2710,6 @@ static int rt_fill_info(struct net *net,
goto
nla_put_failure
;
error
=
rt
->
dst
.
error
;
if
(
rt_has_peer
(
rt
))
{
const
struct
inet_peer
*
peer
=
rt_peer_ptr
(
rt
);
inet_peer_refcheck
(
peer
);
id
=
atomic_read
(
&
peer
->
ip_id_count
)
&
0xffff
;
}
expires
=
rt
->
dst
.
expires
;
if
(
expires
)
{
if
(
time_before
(
jiffies
,
expires
))
...
...
@@ -2792,7 +2744,7 @@ static int rt_fill_info(struct net *net,
goto
nla_put_failure
;
}
if
(
rtnl_put_cacheinfo
(
skb
,
&
rt
->
dst
,
id
,
expires
,
error
)
<
0
)
if
(
rtnl_put_cacheinfo
(
skb
,
&
rt
->
dst
,
0
,
expires
,
error
)
<
0
)
goto
nla_put_failure
;
return
nlmsg_end
(
skb
,
nlh
);
...
...
net/ipv4/xfrm4_policy.c
浏览文件 @
f185071d
...
...
@@ -90,8 +90,6 @@ static int xfrm4_fill_dst(struct xfrm_dst *xdst, struct net_device *dev,
xdst
->
u
.
dst
.
dev
=
dev
;
dev_hold
(
dev
);
rt_transfer_peer
(
&
xdst
->
u
.
rt
,
rt
);
/* Sheit... I remember I did this right. Apparently,
* it was magically lost, so this code needs audit */
xdst
->
u
.
rt
.
rt_flags
=
rt
->
rt_flags
&
(
RTCF_BROADCAST
|
RTCF_MULTICAST
|
...
...
@@ -210,11 +208,6 @@ static void xfrm4_dst_destroy(struct dst_entry *dst)
dst_destroy_metrics_generic
(
dst
);
if
(
rt_has_peer
(
&
xdst
->
u
.
rt
))
{
struct
inet_peer
*
peer
=
rt_peer_ptr
(
&
xdst
->
u
.
rt
);
inet_putpeer
(
peer
);
}
xfrm_dst_destroy
(
xdst
);
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录