提交 7dbf0755 编写于 作者: A Arnaldo Carvalho de Melo 提交者: David S. Miller

[INET_DIAG]: Use inet_twsk() with TIME_WAIT sockets

The fields being accessed in inet_diag_dump are outside sock_common, the
common part of struct sock and struct inet_timewait_sock.
Signed-off-by: NArnaldo Carvalho de Melo <acme@mandriva.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 a2c2064f
...@@ -697,14 +697,14 @@ static int inet_diag_dump(struct sk_buff *skb, struct netlink_callback *cb) ...@@ -697,14 +697,14 @@ static int inet_diag_dump(struct sk_buff *skb, struct netlink_callback *cb)
if (r->idiag_states & TCPF_TIME_WAIT) { if (r->idiag_states & TCPF_TIME_WAIT) {
sk_for_each(sk, node, sk_for_each(sk, node,
&hashinfo->ehash[i + hashinfo->ehash_size].chain) { &hashinfo->ehash[i + hashinfo->ehash_size].chain) {
struct inet_sock *inet = inet_sk(sk); const struct inet_timewait_sock *tw = inet_twsk(sk);
if (num < s_num) if (num < s_num)
goto next_dying; goto next_dying;
if (r->id.idiag_sport != inet->sport && if (r->id.idiag_sport != tw->tw_sport &&
r->id.idiag_sport) r->id.idiag_sport)
goto next_dying; goto next_dying;
if (r->id.idiag_dport != inet->dport && if (r->id.idiag_dport != tw->tw_dport &&
r->id.idiag_dport) r->id.idiag_dport)
goto next_dying; goto next_dying;
if (inet_diag_dump_sock(skb, sk, cb) < 0) { if (inet_diag_dump_sock(skb, sk, cb) < 0) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册