FreeBSD Bugzilla – Attachment 38768 Details for
Bug 61259
[patch] make "ipfw tee" work as intended under freebsd-5
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
file.diff
file.diff (text/plain), 3.58 KB, created by
P Kern
on 2004-01-12 17:10:18 UTC
(
hide
)
Description:
file.diff
Filename:
MIME Type:
Creator:
P Kern
Created:
2004-01-12 17:10:18 UTC
Size:
3.58 KB
patch
obsolete
>*** 892,912 **** > divert_packet(m, 1, divert_info & 0xffff, args.divert_rule); > ipstat.ips_delivered++; > >! /* If 'tee', continue with original packet */ >! if (clone == NULL) > return; >! m = clone; >! ip = mtod(m, struct ip *); >! ip->ip_len += hlen; >! /* >! * Jump backwards to complete processing of the >! * packet. But first clear divert_info to avoid >! * entering this block again. >! * We do not need to clear args.divert_rule >! * or args.next_hop as they will not be used. >! */ >! divert_info = 0; >! goto pass; > } > #endif > >--- 892,926 ---- > divert_packet(m, 1, divert_info & 0xffff, args.divert_rule); > ipstat.ips_delivered++; > >! /* If 'tee', restart the packet at this divert rule. */ >! if (clone != NULL) { >! struct m_hdr divert_tag; >! >! m = clone; >! ip = mtod(m, struct ip *); >! >! /* Restore packet header fields to original values */ >! ip->ip_len += hlen; >! ip->ip_len = htons(ip->ip_len); >! ip->ip_off = htons(ip->ip_off); >! >! /* >! * set the IPFW restart point. >! * adapted from div_output() in ip_divert.c >! */ >! divert_tag.mh_type = MT_TAG; >! divert_tag.mh_flags = PACKET_TAG_DIVERT; >! divert_tag.mh_next = m; >! divert_tag.mh_data = (caddr_t)(int)args.divert_rule; /* the matching rule # */ >! >! /* >! * resubmit packet to input processing. >! * XXX - need to decrement some ipstats >! * to avoid overcounting? >! */ >! ip_input((struct mbuf *)&divert_tag); > return; >! } > } > #endif > >*** sys/netinet/ip_output.c 2004/01/12 16:04:35 1.1 >--- sys/netinet/ip_output.c 2004/01/12 16:08:20 >*************** >*** 829,839 **** > /* Deliver packet to divert input routine */ > divert_packet(m, 0, off & 0xffff, args.divert_rule); > >! /* If 'tee', continue with original packet */ > if (clone != NULL) { >! m = clone; >! ip = mtod(m, struct ip *); >! goto pass; > } > goto done; > } >--- 829,853 ---- > /* Deliver packet to divert input routine */ > divert_packet(m, 0, off & 0xffff, args.divert_rule); > >! /* If 'tee', restart the packet at this divert rule. */ > if (clone != NULL) { >! struct m_hdr divert_tag; >! >! /* >! * set the IPFW restart point. >! * adapted from div_output() in ip_divert.c >! */ >! divert_tag.mh_type = MT_TAG; >! divert_tag.mh_flags = PACKET_TAG_DIVERT; >! divert_tag.mh_next = clone; >! divert_tag.mh_data = (caddr_t)(int)args.divert_rule; /* the matching rule # */ >! >! /* >! * resubmit packet to output processing >! * XXX - need to decrement some ipstats >! * to avoid overcounting? >! */ >! return (ip_output((struct mbuf *)&divert_tag, opt, ro, flags, imo, inp)); > } > goto done; > } >*** sbin/ipfw/ipfw.8 2003/12/17 19:58:31 1.1 >--- sbin/ipfw/ipfw.8 2003/12/18 14:33:25 >*************** >*** 654,663 **** > .Xr divert 4 > socket bound to port > .Ar port . >- The search terminates and the original packet is accepted >- (but see Section >- .Sx BUGS >- below). > .It Cm unreach Ar code > Discard packets that match this rule, and try to send an ICMP > unreachable notice with code >--- 654,659 ---- >*************** >*** 2133,2144 **** > are reassembled before delivery to the socket. > The action used on those packet is the one from the > rule which matches the first fragment of the packet. >- .Pp >- Packets that match a >- .Cm tee >- rule should not be immediately accepted, but should continue >- going through the rule list. >- This may be fixed in a later version. > .Pp > Packets diverted to userland, and then reinserted by a userland process > may lose various packet attributes. >--- 2129,2134 ----
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 61259
: 38768