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

[INET_DIAG]: Rename tcp_diag.[ch] to inet_diag.[ch]

Next changeset will introduce net/ipv4/tcp_diag.c, moving the code that was put
transitioanlly in inet_diag.c.
Signed-off-by: NArnaldo Carvalho de Melo <acme@mandriva.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 73c1f4a0
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
#include <linux/config.h> #include <linux/config.h>
#include <linux/module.h> #include <linux/module.h>
#include <linux/tcp_diag.h> #include <linux/inet_diag.h>
#include "dccp.h" #include "dccp.h"
......
...@@ -30,7 +30,7 @@ obj-$(CONFIG_IP_ROUTE_MULTIPATH_WRANDOM) += multipath_wrandom.o ...@@ -30,7 +30,7 @@ obj-$(CONFIG_IP_ROUTE_MULTIPATH_WRANDOM) += multipath_wrandom.o
obj-$(CONFIG_IP_ROUTE_MULTIPATH_DRR) += multipath_drr.o obj-$(CONFIG_IP_ROUTE_MULTIPATH_DRR) += multipath_drr.o
obj-$(CONFIG_NETFILTER) += netfilter/ obj-$(CONFIG_NETFILTER) += netfilter/
obj-$(CONFIG_IP_VS) += ipvs/ obj-$(CONFIG_IP_VS) += ipvs/
obj-$(CONFIG_IP_INET_DIAG) += tcp_diag.o obj-$(CONFIG_IP_INET_DIAG) += inet_diag.o
obj-$(CONFIG_IP_ROUTE_MULTIPATH_CACHED) += multipath.o obj-$(CONFIG_IP_ROUTE_MULTIPATH_CACHED) += multipath.o
obj-$(CONFIG_TCP_CONG_BIC) += tcp_bic.o obj-$(CONFIG_TCP_CONG_BIC) += tcp_bic.o
obj-$(CONFIG_TCP_CONG_WESTWOOD) += tcp_westwood.o obj-$(CONFIG_TCP_CONG_WESTWOOD) += tcp_westwood.o
......
...@@ -32,7 +32,7 @@ ...@@ -32,7 +32,7 @@
#include <linux/inet.h> #include <linux/inet.h>
#include <linux/stddef.h> #include <linux/stddef.h>
#include <linux/tcp_diag.h> #include <linux/inet_diag.h>
static const struct inet_diag_handler **inet_diag_table; static const struct inet_diag_handler **inet_diag_table;
...@@ -140,7 +140,7 @@ static int inet_diag_fill(struct sk_buff *skb, struct sock *sk, ...@@ -140,7 +140,7 @@ static int inet_diag_fill(struct sk_buff *skb, struct sock *sk,
} }
#endif #endif
#define EXPIRES_IN_MS(tmo) ((tmo-jiffies)*1000+HZ-1)/HZ #define EXPIRES_IN_MS(tmo) ((tmo - jiffies) * 1000 + HZ - 1) / HZ
if (icsk->icsk_pending == ICSK_TIME_RETRANS) { if (icsk->icsk_pending == ICSK_TIME_RETRANS) {
r->idiag_timer = 1; r->idiag_timer = 1;
...@@ -311,11 +311,11 @@ static int inet_diag_bc_run(const void *bc, int len, ...@@ -311,11 +311,11 @@ static int inet_diag_bc_run(const void *bc, int len,
yes = !(entry->userlocks & SOCK_BINDPORT_LOCK); yes = !(entry->userlocks & SOCK_BINDPORT_LOCK);
break; break;
case INET_DIAG_BC_S_COND: case INET_DIAG_BC_S_COND:
case INET_DIAG_BC_D_COND: case INET_DIAG_BC_D_COND: {
{ struct inet_diag_hostcond *cond;
struct inet_diag_hostcond *cond = (struct inet_diag_hostcond*)(op+1);
u32 *addr; u32 *addr;
cond = (struct inet_diag_hostcond *)(op + 1);
if (cond->port != -1 && if (cond->port != -1 &&
cond->port != (op->code == INET_DIAG_BC_S_COND ? cond->port != (op->code == INET_DIAG_BC_S_COND ?
entry->sport : entry->dport)) { entry->sport : entry->dport)) {
...@@ -337,7 +337,8 @@ static int inet_diag_bc_run(const void *bc, int len, ...@@ -337,7 +337,8 @@ static int inet_diag_bc_run(const void *bc, int len,
cond->family == AF_INET) { cond->family == AF_INET) {
if (addr[0] == 0 && addr[1] == 0 && if (addr[0] == 0 && addr[1] == 0 &&
addr[2] == htonl(0xffff) && addr[2] == htonl(0xffff) &&
bitstring_match(addr+3, cond->addr, cond->prefix_len)) bitstring_match(addr + 3, cond->addr,
cond->prefix_len))
break; break;
} }
yes = 0; yes = 0;
...@@ -379,7 +380,7 @@ static int inet_diag_bc_audit(const void *bytecode, int bytecode_len) ...@@ -379,7 +380,7 @@ static int inet_diag_bc_audit(const void *bytecode, int bytecode_len)
int len = bytecode_len; int len = bytecode_len;
while (len > 0) { while (len > 0) {
struct inet_diag_bc_op *op = (struct inet_diag_bc_op*)bc; struct inet_diag_bc_op *op = (struct inet_diag_bc_op *)bc;
//printk("BC: %d %d %d {%d} / %d\n", op->code, op->yes, op->no, op[1].no, len); //printk("BC: %d %d %d {%d} / %d\n", op->code, op->yes, op->no, op[1].no, len);
switch (op->code) { switch (op->code) {
...@@ -390,17 +391,17 @@ static int inet_diag_bc_audit(const void *bytecode, int bytecode_len) ...@@ -390,17 +391,17 @@ static int inet_diag_bc_audit(const void *bytecode, int bytecode_len)
case INET_DIAG_BC_S_LE: case INET_DIAG_BC_S_LE:
case INET_DIAG_BC_D_GE: case INET_DIAG_BC_D_GE:
case INET_DIAG_BC_D_LE: case INET_DIAG_BC_D_LE:
if (op->yes < 4 || op->yes > len+4) if (op->yes < 4 || op->yes > len + 4)
return -EINVAL; return -EINVAL;
case INET_DIAG_BC_JMP: case INET_DIAG_BC_JMP:
if (op->no < 4 || op->no > len+4) if (op->no < 4 || op->no > len + 4)
return -EINVAL; return -EINVAL;
if (op->no < len && if (op->no < len &&
!valid_cc(bytecode, bytecode_len, len-op->no)) !valid_cc(bytecode, bytecode_len, len - op->no))
return -EINVAL; return -EINVAL;
break; break;
case INET_DIAG_BC_NOP: case INET_DIAG_BC_NOP:
if (op->yes < 4 || op->yes > len+4) if (op->yes < 4 || op->yes > len + 4)
return -EINVAL; return -EINVAL;
break; break;
default: default:
......
...@@ -35,7 +35,7 @@ ...@@ -35,7 +35,7 @@
#include <linux/mm.h> #include <linux/mm.h>
#include <linux/module.h> #include <linux/module.h>
#include <linux/skbuff.h> #include <linux/skbuff.h>
#include <linux/tcp_diag.h> #include <linux/inet_diag.h>
#include <net/tcp.h> #include <net/tcp.h>
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
#include <linux/mm.h> #include <linux/mm.h>
#include <linux/module.h> #include <linux/module.h>
#include <linux/skbuff.h> #include <linux/skbuff.h>
#include <linux/tcp_diag.h> #include <linux/inet_diag.h>
#include <net/tcp.h> #include <net/tcp.h>
/* TCP Westwood structure */ /* TCP Westwood structure */
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册