git://git.onelab.eu
/
linux-2.6.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
fedora core 6 1.2949 + vserver 2.2.0
[linux-2.6.git]
/
net
/
ipv4
/
inet_diag.c
diff --git
a/net/ipv4/inet_diag.c
b/net/ipv4/inet_diag.c
index
457db99
..
e81c685
100644
(file)
--- a/
net/ipv4/inet_diag.c
+++ b/
net/ipv4/inet_diag.c
@@
-11,7
+11,6
@@
* 2 of the License, or (at your option) any later version.
*/
* 2 of the License, or (at your option) any later version.
*/
-#include <linux/config.h>
#include <linux/module.h>
#include <linux/types.h>
#include <linux/fcntl.h>
#include <linux/module.h>
#include <linux/types.h>
#include <linux/fcntl.h>
@@
-37,8
+36,8
@@
static const struct inet_diag_handler **inet_diag_table;
struct inet_diag_entry {
static const struct inet_diag_handler **inet_diag_table;
struct inet_diag_entry {
-
u
32 *saddr;
-
u
32 *daddr;
+
__be
32 *saddr;
+
__be
32 *daddr;
u16 sport;
u16 dport;
u16 family;
u16 sport;
u16 dport;
u16 family;
@@
-295,7
+294,7
@@
out:
return err;
}
return err;
}
-static int bitstring_match(const
u32 *a1, const u
32 *a2, int bits)
+static int bitstring_match(const
__be32 *a1, const __be
32 *a2, int bits)
{
int words = bits >> 5;
{
int words = bits >> 5;
@@
-306,8
+305,8
@@
static int bitstring_match(const u32 *a1, const u32 *a2, int bits)
return 0;
}
if (bits) {
return 0;
}
if (bits) {
- __
u
32 w1, w2;
- __
u
32 mask;
+ __
be
32 w1, w2;
+ __
be
32 mask;
w1 = a1[words];
w2 = a2[words];
w1 = a1[words];
w2 = a2[words];
@@
-353,7
+352,7
@@
static int inet_diag_bc_run(const void *bc, int len,
case INET_DIAG_BC_S_COND:
case INET_DIAG_BC_D_COND: {
struct inet_diag_hostcond *cond;
case INET_DIAG_BC_S_COND:
case INET_DIAG_BC_D_COND: {
struct inet_diag_hostcond *cond;
-
u
32 *addr;
+
__be
32 *addr;
cond = (struct inet_diag_hostcond *)(op + 1);
if (cond->port != -1 &&
cond = (struct inet_diag_hostcond *)(op + 1);
if (cond->port != -1 &&
@@
-694,6
+693,8
@@
static int inet_diag_dump(struct sk_buff *skb, struct netlink_callback *cb)
sk_for_each(sk, node, &hashinfo->listening_hash[i]) {
struct inet_sock *inet = inet_sk(sk);
sk_for_each(sk, node, &hashinfo->listening_hash[i]) {
struct inet_sock *inet = inet_sk(sk);
+ if (!nx_check(sk->sk_nid, VS_WATCH_P|VS_IDENT))
+ continue;
if (num < s_num) {
num++;
continue;
if (num < s_num) {
num++;
continue;
@@
-754,6
+755,8
@@
skip_listen_ht:
sk_for_each(sk, node, &head->chain) {
struct inet_sock *inet = inet_sk(sk);
sk_for_each(sk, node, &head->chain) {
struct inet_sock *inet = inet_sk(sk);
+ if (!nx_check(sk->sk_nid, VS_WATCH_P|VS_IDENT))
+ continue;
if (num < s_num)
goto next_normal;
if (!(r->idiag_states & (1 << sk->sk_state)))
if (num < s_num)
goto next_normal;
if (!(r->idiag_states & (1 << sk->sk_state)))
@@
-778,6
+781,8
@@
next_normal:
inet_twsk_for_each(tw, node,
&hashinfo->ehash[i + hashinfo->ehash_size].chain) {
inet_twsk_for_each(tw, node,
&hashinfo->ehash[i + hashinfo->ehash_size].chain) {
+ if (!nx_check(tw->tw_nid, VS_WATCH_P|VS_IDENT))
+ continue;
if (num < s_num)
goto next_dying;
if (r->id.idiag_sport != tw->tw_sport &&
if (num < s_num)
goto next_dying;
if (r->id.idiag_sport != tw->tw_sport &&
@@
-910,11
+915,10
@@
static int __init inet_diag_init(void)
sizeof(struct inet_diag_handler *));
int err = -ENOMEM;
sizeof(struct inet_diag_handler *));
int err = -ENOMEM;
- inet_diag_table = k
m
alloc(inet_diag_table_size, GFP_KERNEL);
+ inet_diag_table = k
z
alloc(inet_diag_table_size, GFP_KERNEL);
if (!inet_diag_table)
goto out;
if (!inet_diag_table)
goto out;
- memset(inet_diag_table, 0, inet_diag_table_size);
idiagnl = netlink_kernel_create(NETLINK_INET_DIAG, 0, inet_diag_rcv,
THIS_MODULE);
if (idiagnl == NULL)
idiagnl = netlink_kernel_create(NETLINK_INET_DIAG, 0, inet_diag_rcv,
THIS_MODULE);
if (idiagnl == NULL)