diff options
author | ru <ru@FreeBSD.org> | 2006-02-14 06:36:39 +0000 |
---|---|---|
committer | ru <ru@FreeBSD.org> | 2006-02-14 06:36:39 +0000 |
commit | a77fb4360bb170f10b7e19e403fe1d6fbd7a20b1 (patch) | |
tree | 9201c526bdcb5a0f93d4716ab0e76b7360ef7108 /sys/netinet/ip_dummynet.c | |
parent | 27b6060817627cc3f497e771ae2559a76b11439f (diff) | |
download | FreeBSD-src-a77fb4360bb170f10b7e19e403fe1d6fbd7a20b1.zip FreeBSD-src-a77fb4360bb170f10b7e19e403fe1d6fbd7a20b1.tar.gz |
When sending a packet from dummynet, indicate that we're forwarding
it so that ip_id etc. don't get overwritten. This fixes forwarding
of fragmented IP packets through a dummynet pipe -- fragments came
out with modified and different(!) ip_id's, making it impossible to
reassemble a datagram at the receiver side.
Submitted by: Alexander Karptsov (reworked by me)
MFC after: 3 days
Diffstat (limited to 'sys/netinet/ip_dummynet.c')
-rw-r--r-- | sys/netinet/ip_dummynet.c | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/sys/netinet/ip_dummynet.c b/sys/netinet/ip_dummynet.c index 4390cfe..4c02915 100644 --- a/sys/netinet/ip_dummynet.c +++ b/sys/netinet/ip_dummynet.c @@ -769,7 +769,7 @@ dummynet_send(struct mbuf *m) pkt = dn_tag_get(m); switch (pkt->dn_dir) { case DN_TO_IP_OUT: - ip_output(m, NULL, NULL, pkt->flags, NULL, NULL); + ip_output(m, NULL, NULL, IP_FORWARDING, NULL, NULL); break ; case DN_TO_IP_IN : ip = mtod(m, struct ip *); @@ -783,7 +783,7 @@ dummynet_send(struct mbuf *m) break; case DN_TO_IP6_OUT: - ip6_output(m, NULL, NULL, pkt->flags, NULL, NULL, NULL); + ip6_output(m, NULL, NULL, IPV6_FORWARDING, NULL, NULL, NULL); break; #endif case DN_TO_IFB_FWD: @@ -1129,7 +1129,6 @@ locate_pipe(int pipe_nr) * ifp the 'ifp' parameter from the caller. * NULL in ip_input, destination interface in ip_output, * rule matching rule, in case of multiple passes - * flags flags from the caller, only used in ip_output * */ static int @@ -1213,8 +1212,6 @@ dummynet_io(struct mbuf *m, int dir, struct ip_fw_args *fwa) pkt->dn_dir = dir ; pkt->ifp = fwa->oif; - if (dir == DN_TO_IP_OUT || dir == DN_TO_IP6_OUT) - pkt->flags = fwa->flags; if (q->head == NULL) q->head = m; |