aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGleb Smirnoff <glebius@FreeBSD.org>2005-01-16 11:13:18 +0000
committerGleb Smirnoff <glebius@FreeBSD.org>2005-01-16 11:13:18 +0000
commit28935658c419427c8e01f03f423774618a14b55e (patch)
tree717313b72c1381ac00398d9ecbf0e60d21fadb98
parent34af7a1a3819cc7c91af11022af37c1b7cabef3f (diff)
downloadsrc-28935658c419427c8e01f03f423774618a14b55e.tar.gz
src-28935658c419427c8e01f03f423774618a14b55e.zip
- Reduce number of arguments passed to dummynet_io(), we already have cookie
in struct ip_fw_args itself. - Remove redundant &= 0xffff from dummynet_io().
Notes
Notes: svn path=/head/; revision=140345
-rw-r--r--sys/net/bridge.c2
-rw-r--r--sys/net/if_ethersubr.c3
-rw-r--r--sys/netinet/ip_dummynet.c6
-rw-r--r--sys/netinet/ip_dummynet.h3
-rw-r--r--sys/netinet/ip_fw_pfil.c4
5 files changed, 7 insertions, 11 deletions
diff --git a/sys/net/bridge.c b/sys/net/bridge.c
index 3a4b7aaac4cd..63dfb36a31ce 100644
--- a/sys/net/bridge.c
+++ b/sys/net/bridge.c
@@ -1097,7 +1097,7 @@ bdg_forward(struct mbuf *m0, struct ifnet *dst)
}
args.oif = real_dst;
- ip_dn_io_ptr(m, args.cookie, DN_TO_BDG_FWD, &args);
+ ip_dn_io_ptr(m, DN_TO_BDG_FWD, &args);
return m0;
}
/*
diff --git a/sys/net/if_ethersubr.c b/sys/net/if_ethersubr.c
index 590e551cb293..0871077639b2 100644
--- a/sys/net/if_ethersubr.c
+++ b/sys/net/if_ethersubr.c
@@ -464,8 +464,7 @@ ether_ipfw_chk(struct mbuf **m0, struct ifnet *dst,
*/
*m0 = NULL ;
}
- ip_dn_io_ptr(m, args.cookie,
- dst ? DN_TO_ETH_OUT: DN_TO_ETH_DEMUX, &args);
+ ip_dn_io_ptr(m, dst ? DN_TO_ETH_OUT: DN_TO_ETH_DEMUX, &args);
return 0;
}
/*
diff --git a/sys/netinet/ip_dummynet.c b/sys/netinet/ip_dummynet.c
index 93f06961dfba..fea5981d5591 100644
--- a/sys/netinet/ip_dummynet.c
+++ b/sys/netinet/ip_dummynet.c
@@ -1122,7 +1122,7 @@ locate_flowset(int pipe_nr, struct ip_fw *rule)
*
*/
static int
-dummynet_io(struct mbuf *m, int pipe_nr, int dir, struct ip_fw_args *fwa)
+dummynet_io(struct mbuf *m, int dir, struct ip_fw_args *fwa)
{
struct dn_pkt_tag *pkt;
struct m_tag *mtag;
@@ -1146,13 +1146,11 @@ dummynet_io(struct mbuf *m, int pipe_nr, int dir, struct ip_fw_args *fwa)
is_pipe = (fwa->rule->fw_flg & IP_FW_F_COMMAND) == IP_FW_F_PIPE;
#endif
- pipe_nr &= 0xffff ;
-
DUMMYNET_LOCK();
/*
* This is a dummynet rule, so we expect an O_PIPE or O_QUEUE rule.
*/
- fs = locate_flowset(pipe_nr, fwa->rule);
+ fs = locate_flowset(fwa->cookie, fwa->rule);
if (fs == NULL)
goto dropit ; /* this queue/pipe does not exist! */
pipe = fs->pipe ;
diff --git a/sys/netinet/ip_dummynet.h b/sys/netinet/ip_dummynet.h
index 1020f12b6f16..d9c6aaa70396 100644
--- a/sys/netinet/ip_dummynet.h
+++ b/sys/netinet/ip_dummynet.h
@@ -343,8 +343,7 @@ struct dn_pipe { /* a pipe */
#ifdef _KERNEL
typedef int ip_dn_ctl_t(struct sockopt *); /* raw_ip.c */
typedef void ip_dn_ruledel_t(void *); /* ip_fw.c */
-typedef int ip_dn_io_t(struct mbuf *m, int pipe_nr, int dir,
- struct ip_fw_args *fwa);
+typedef int ip_dn_io_t(struct mbuf *m, int dir, struct ip_fw_args *fwa);
extern ip_dn_ctl_t *ip_dn_ctl_ptr;
extern ip_dn_ruledel_t *ip_dn_ruledel_ptr;
extern ip_dn_io_t *ip_dn_io_ptr;
diff --git a/sys/netinet/ip_fw_pfil.c b/sys/netinet/ip_fw_pfil.c
index d186aab94c8e..22308bb66b7b 100644
--- a/sys/netinet/ip_fw_pfil.c
+++ b/sys/netinet/ip_fw_pfil.c
@@ -140,7 +140,7 @@ again:
case IP_FW_DUMMYNET:
if (!DUMMYNET_LOADED)
goto drop;
- ip_dn_io_ptr(*m0, args.cookie, DN_TO_IP_IN, &args);
+ ip_dn_io_ptr(*m0, DN_TO_IP_IN, &args);
*m0 = NULL;
return 0; /* packet consumed */
@@ -240,7 +240,7 @@ again:
case IP_FW_DUMMYNET:
if (!DUMMYNET_LOADED)
break;
- ip_dn_io_ptr(*m0, args.cookie, DN_TO_IP_OUT, &args);
+ ip_dn_io_ptr(*m0, DN_TO_IP_OUT, &args);
*m0 = NULL;
return 0; /* packet consumed */