/[base]/stable/7/sys/netinet/ip_dummynet.c
ViewVC logotype

Log of /stable/7/sys/netinet/ip_dummynet.c

Parent Directory Parent Directory | Revision Log Revision Log


Links to HEAD: (view) (download) (annotate)
Sticky Revision:


Revision 189393 - (view) (download) (annotate) - [select for diffs]
Modified Thu Mar 5 07:42:47 2009 UTC (15 years, 4 months ago) by luigi
File length: 63721 byte(s)
Diff to previous 188679
Merge a couple of changes from HEAD, plus fix a potential warning.
In detail:
+ we used SYSCTL_LONG to show a 64-bit variable. For the time being
  just remove the variable from the list of sysctl-exported values.
  Unfortunately our SYSCTL macros do not do proper type checking
  of the arguments so we might have some more bugs of this kind
  across the codebase;

+ fw_debug has not been used for ages, so remove it;

+ gcc 4.2.4 tells me that src_ip.s_addr may be not initialized,
  so make sure it is.
  I need to check what is the status of this field in head.


Revision 188679 - (view) (download) (annotate) - [select for diffs]
Modified Mon Feb 16 16:36:31 2009 UTC (15 years, 4 months ago) by luigi
File length: 63682 byte(s)
Diff to previous 188589
make the dependency on lock.h and mutex.h explicit instead of
inheriting them from net/if.h


Revision 188589 - (view) (download) (annotate) - [select for diffs]
Modified Fri Feb 13 18:31:35 2009 UTC (15 years, 4 months ago) by luigi
File length: 63653 byte(s)
Diff to previous 188586
remove some unnecessary #include
Again, this change is not directly applicable to HEAD due
to the presence of vnet.h and vinet.h which bring in almost
every network-related header.


Revision 188586 - (view) (download) (annotate) - [select for diffs]
Modified Fri Feb 13 18:04:55 2009 UTC (15 years, 4 months ago) by luigi
File length: 63715 byte(s)
Diff to previous 188576
document why certain headers are required.


Revision 188576 - (view) (download) (annotate) - [select for diffs]
Modified Fri Feb 13 13:35:41 2009 UTC (15 years, 4 months ago) by luigi
File length: 63551 byte(s)
Diff to previous 184504
remove some unnecessary #include

The change is not directly applicable to HEAD because there
a lot of headers are already included by vnet.h


Revision 184504 - (view) (download) (annotate) - [select for diffs]
Modified Fri Oct 31 12:58:12 2008 UTC (15 years, 8 months ago) by oleg
File length: 63567 byte(s)
Diff to previous 180191
Direct commit (r184414 is not applicable to stable due to ABI change):

Workaround possible q_time overflow (will happen after 2^32/(86400*hz)
days of uptime (~50days for hz = 1000)), which may lead to:
- broken shaping in 'fast' io mode.
- incorrect average queue length calculation in RED/GRED algorithm.

PR:		kern/128401
Approved by:	re (kensmith)


Revision 180191 - (view) (download) (annotate) - [select for diffs]
Modified Wed Jul 2 17:28:41 2008 UTC (16 years ago) by rwatson
File length: 63540 byte(s)
Diff to previous 179150
Merge ip_dummynet.c:1.116, raw_ip.c:1.185 (r179201) from head to
stable/7:

  Consistently check IPFW and DUMMYNET privileges in the configuration
  routines for those modules, rather than in the raw socket code.  This
  each privilege check to occur in exactly once place and avoids
  duplicate checks across layers.

  Sponsored by:   nCircle Network Security, Inc.


Revision 179150 - (view) (download) (annotate) - [select for diffs]
Modified Tue May 20 11:32:03 2008 UTC (16 years, 1 month ago) by dwmalone
File length: 63423 byte(s)
Diff to previous 178486
MFC:
Dummynet has a limit of 100 slots queue size (or 1MB, if you give
the limit in bytes) hard coded into both the kernel and userland.
Make both these limits a sysctl, so it is easy to change the limit.


Revision 178486 - (view) (download) (annotate) - [select for diffs]
Modified Fri Apr 25 10:29:26 2008 UTC (16 years, 2 months ago) by oleg
File length: 63005 byte(s)
Diff to previous 172506
MFC:
src/sys/netinet/ip_dummynet.h	1.41
src/sys/netinet/ip_dummynet.c	1.111-1.114
src/sys/netinet/ip_fw_pfil.c	1.26
src/sys/net/if_bridge.c		1.107
src/sys/net/if_ethersubr.c	1.240
src/sbin/ipfw/ipfw.8		1.206

- style(9) cleanup.
- dummynet_io() declaration has changed.
- Alter packet flow inside dummynet and introduce 'fast' mode of dummynet
  operation: allow certain packets to bypass dummynet scheduler. Benefits are:
  -- lower latency: if packet flow does not exceed pipe bandwidth, packets
     will not be (up to tick) delayed (due to dummynet's scheduler granularity).
  -- lower overhead: if packet avoids dummynet scheduler it shouldn't reenter
     ip stack later. Such packets can be fastforwarded.
  -- recursion (which can lead to kernel stack exhaution) eliminated. This fix
     long existed panic, which can be triggered this way:
	kldload dummynet
	sysctl net.inet.ip.fw.one_pass=0
	ipfw pipe 1 config bw 0
	for i in `jot 30`; do ipfw add 1 pipe 1 icmp from any to any; done
	ping -c 1 localhost
- New sysctl nodes:
  net.inet.ip.dummynet.io_fast -	enables 'fast' dummynet io
  net.inet.ip.dummynet.io_pkt -		packets passed to dummynet
  net.inet.ip.dummynet.io_pkt_fast -	packets avoided dummynet scheduler
  net.inet.ip.dummynet.io_pkt_drop -	packets dropped by dummynet
- Workaround p->numbytes overflow, which can result in infinite loop inside
  dummynet module (prerequisite is using queues with "fat" pipe).

PR:	kern/113548 kern/121955


Revision 172506 - (view) (download) (annotate) - [select for diffs]
Modified Wed Oct 10 16:59:15 2007 UTC (16 years, 8 months ago) by cvs2svn
File length: 61826 byte(s)
Diff to previous 172467
This commit was manufactured by cvs2svn to create branch 'RELENG_7'.

Revision 172467 - (view) (download) (annotate) - [select for diffs]
Modified Sun Oct 7 20:44:24 2007 UTC (16 years, 8 months ago) by silby
Original Path: head/sys/netinet/ip_dummynet.c
File length: 61826 byte(s)
Diff to previous 171744
Add FBSDID to all files in netinet so that people can more
easily include file version information in bug reports.

Approved by:	re (kensmith)


Revision 171744 - (view) (download) (annotate) - [select for diffs]
Modified Mon Aug 6 14:26:03 2007 UTC (16 years, 11 months ago) by rwatson
Original Path: head/sys/netinet/ip_dummynet.c
File length: 61795 byte(s)
Diff to previous 171637
Remove the now-unused NET_{LOCK,UNLOCK,ASSERT}_GIANT() macros, which
previously conditionally acquired Giant based on debug.mpsafenet.  As that
has now been removed, they are no longer required.  Removing them
significantly simplifies error-handling in the socket layer, eliminated
quite a bit of unwinding of locking in error cases.

While here clean up the now unneeded opt_net.h, which previously was used
for the NET_WITH_GIANT kernel option.  Clean up some related gotos for
consistency.

Reviewed by:	bz, csjp
Tested by:	kris
Approved by:	re (kensmith)


Revision 171637 - (view) (download) (annotate) - [select for diffs]
Modified Sat Jul 28 07:31:30 2007 UTC (16 years, 11 months ago) by rwatson
Original Path: head/sys/netinet/ip_dummynet.c
File length: 61891 byte(s)
Diff to previous 170856
Replace references to NET_CALLOUT_MPSAFE with CALLOUT_MPSAFE, and remove
definition of NET_CALLOUT_MPSAFE, which is no longer required now that
debug.mpsafenet has been removed.

The once over:	bz
Approved by:	re (kensmith)


Revision 170856 - (view) (download) (annotate) - [select for diffs]
Modified Sun Jun 17 00:33:34 2007 UTC (17 years ago) by mjacob
Original Path: head/sys/netinet/ip_dummynet.c
File length: 61895 byte(s)
Diff to previous 169454
Replace incorrect local OFFSET_OF macro with the correct and generic
offsetof macro.


Revision 169454 - (view) (download) (annotate) - [select for diffs]
Modified Thu May 10 15:58:48 2007 UTC (17 years, 1 month ago) by rwatson
Original Path: head/sys/netinet/ip_dummynet.c
File length: 61896 byte(s)
Diff to previous 163758
Move universally to ANSI C function declarations, with relatively
consistent style(9)-ish layout.


Revision 163758 - (view) (download) (annotate) - [select for diffs]
Modified Sun Oct 29 12:09:24 2006 UTC (17 years, 8 months ago) by oleg
Original Path: head/sys/netinet/ip_dummynet.c
File length: 61888 byte(s)
Diff to previous 163721
- Use non-recursive mutex. MTX_RECURSE is unnecessary since rev. 1.70
- Pay respect to net.isr.direct: use netisr_dispatch() instead of ip_input()

Reviewed by:	glebius, rwatson

- purge_flow_set():
    - Do not leak memory while purging queues which are not bound to pipe.
    - style(9) cleanup

MFC after:	2 months


Revision 163721 - (view) (download) (annotate) - [select for diffs]
Modified Fri Oct 27 13:05:37 2006 UTC (17 years, 8 months ago) by oleg
Original Path: head/sys/netinet/ip_dummynet.c
File length: 62034 byte(s)
Diff to previous 163720
- Convert
	net.inet.ip.dummynet.curr_time
	net.inet.ip.dummynet.searches
	net.inet.ip.dummynet.search_steps
  to SYSCTL_LONG nodes. It will prevent frequent wrap around on 64bit archs.

- Implement simple mechanics for dummynet(4) internal time correction.
  Under certain circumstances (system high load, dummynet lock contention, etc)
  dummynet's tick counter can be significantly slower than it should be.
  (I've observed up to 25% difference on one of my production servers).
  Since this counter used for packet scheduling, it's accuracy is vital for
  precise bandwidth limitation.

  Introduce new sysctl nodes:
  net.inet.ip.dummynet.
    tick_lost		- number of ticks coalesced by taskqueue thread.
    tick_adjustment	- number of time corrections done.
    tick_diff		- adjusted vs non-adjusted tick counter difference
    tick_delta		- last vs 'standard' tick differnece (usec).
    tick_delta_sum	- accumulated (and not corrected yet) time
  			  difference (usec).

Reviewed by:	glebius
MFC after:	2 month


Revision 163720 - (view) (download) (annotate) - [select for diffs]
Modified Fri Oct 27 11:16:58 2006 UTC (17 years, 8 months ago) by oleg
Original Path: head/sys/netinet/ip_dummynet.c
File length: 59857 byte(s)
Diff to previous 163717
Use separate thread for servicing dummynet(4).
Utilize taskqueue(9) API.

Submitted by:	glebius
MFC after:	2 month


Revision 163717 - (view) (download) (annotate) - [select for diffs]
Modified Fri Oct 27 10:52:32 2006 UTC (17 years, 8 months ago) by oleg
Original Path: head/sys/netinet/ip_dummynet.c
File length: 59293 byte(s)
Diff to previous 159397
style(9) cleanup.

MFC after:	2 month


Revision 159397 - (view) (download) (annotate) - [select for diffs]
Modified Thu Jun 8 11:13:23 2006 UTC (18 years ago) by oleg
Original Path: head/sys/netinet/ip_dummynet.c
File length: 59554 byte(s)
Diff to previous 155861
Fix following rules: pipe X (tag|altq) Y ...

Approved by:	glebius (mentor)
MFC after:	2 weeks


Revision 155861 - (view) (download) (annotate) - [select for diffs]
Modified Mon Feb 20 12:30:32 2006 UTC (18 years, 4 months ago) by ume
Original Path: head/sys/netinet/ip_dummynet.c
File length: 59453 byte(s)
Diff to previous 155659
Obey opt_inet6.h in kernel build directory.

Reported by:	Peter Losher <plosher-keyword-freebsd.a36e57__at__plosh.net>
MFC after:	3 days


Revision 155659 - (view) (download) (annotate) - [select for diffs]
Modified Tue Feb 14 06:36:39 2006 UTC (18 years, 4 months ago) by ru
Original Path: head/sys/netinet/ip_dummynet.c
File length: 59485 byte(s)
Diff to previous 155248
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


Revision 155248 - (view) (download) (annotate) - [select for diffs]
Modified Fri Feb 3 11:38:19 2006 UTC (18 years, 5 months ago) by glebius
Original Path: head/sys/netinet/ip_dummynet.c
File length: 59611 byte(s)
Diff to previous 155245
Dropping the lock in the transmit_event() is not safe, because we
store some pipe pointers on stack. If user reconfigures dummynet
in the interlock gap, we can work with freed pipes after relock.

To fix this, we decided not to send packets in transmit_event(),
but fill a queue. At the end of dummynet() and dummynet_io(),
after the lock is dropped, if there is something in the queue
we run dummynet_send() to process the queue.

In collaboration with:	ru


Revision 155245 - (view) (download) (annotate) - [select for diffs]
Modified Fri Feb 3 10:42:28 2006 UTC (18 years, 5 months ago) by glebius
Original Path: head/sys/netinet/ip_dummynet.c
File length: 59003 byte(s)
Diff to previous 152910
Axe unused function.


Revision 152910 - (view) (download) (annotate) - [select for diffs]
Modified Tue Nov 29 00:11:01 2005 UTC (18 years, 7 months ago) by glebius
Original Path: head/sys/netinet/ip_dummynet.c
File length: 59805 byte(s)
Diff to previous 150636
First step in removing welding between ipfw(4) and dummynet.

o Do not use ipfw_insn_pipe->pipe_ptr in locate_flowset(). The
  _ipfw_insn_pipe isn't touched by this commit to preserve ABI
  compatibility.
o To optimize the lookup of the pipe/flowset in locate_flowset()
  introduce hashes for pipes and queues:
  - To preserve ABI compatibility utilize the place of global list
    pointer for SLIST_ENTRY.
  - Introduce locate_flowset(queue nr) and locate_pipe(pipe nr).
o Rework all the dummynet code to deal with the hashes, not global
  lists. Also did some style(9) changes in the code blocks that were
  touched by this sweep:
  - Be conservative about flowset and pipe variable names on stack,
    use "fs" and "pipe" everywhere.
  - Cleanup whitespaces.
  - Sort variables.
  - Give variables more meaningful names.
  - Uppercase and dots in comments.
  - ENOMEM when malloc(9) failed.


Revision 150636 - (view) (download) (annotate) - [select for diffs]
Modified Tue Sep 27 18:10:43 2005 UTC (18 years, 9 months ago) by mlaier
Original Path: head/sys/netinet/ip_dummynet.c
File length: 59899 byte(s)
Diff to previous 150350
Remove bridge(4) from the tree.  if_bridge(4) is a full functional
replacement and has additional features which make it superior.

Discussed on:	-arch
Reviewed by:	thompsa
X-MFC-after:	never (RELENG_6 as transition period)


Revision 150350 - (view) (download) (annotate) - [select for diffs]
Modified Mon Sep 19 22:31:45 2005 UTC (18 years, 9 months ago) by andre
Original Path: head/sys/netinet/ip_dummynet.c
File length: 60540 byte(s)
Diff to previous 147205
Use monotonic 'time_uptime' instead of 'time_second' as timebase
for timeouts.


Revision 147205 - (view) (download) (annotate) - [select for diffs]
Modified Fri Jun 10 01:25:22 2005 UTC (19 years ago) by thompsa
Original Path: head/sys/netinet/ip_dummynet.c
File length: 60540 byte(s)
Diff to previous 145864
Add dummynet(4) support to if_bridge, this code is largely based on bridge.c.

This is the final piece to match bridge.c in functionality, we can now be a
drop-in replacement.

Approved by:	mlaier (mentor)


Revision 145864 - (view) (download) (annotate) - [select for diffs]
Modified Wed May 4 13:12:52 2005 UTC (19 years, 2 months ago) by glebius
Original Path: head/sys/netinet/ip_dummynet.c
File length: 60319 byte(s)
Diff to previous 145268
IPFW version 2 is the only option in HEAD and RELENG_5.
Thus, cleanup unnecessary now ifdefs.


Revision 145268 - (view) (download) (annotate) - [select for diffs]
Modified Tue Apr 19 10:12:21 2005 UTC (19 years, 2 months ago) by phk
Original Path: head/sys/netinet/ip_dummynet.c
File length: 60657 byte(s)
Diff to previous 145246
Make DUMMYNET compile without INET6


Revision 145246 - (view) (download) (annotate) - [select for diffs]
Modified Mon Apr 18 18:35:05 2005 UTC (19 years, 2 months ago) by brooks
Original Path: head/sys/netinet/ip_dummynet.c
File length: 60564 byte(s)
Diff to previous 144693
Add IPv6 support to IPFW and Dummynet.

Submitted by:	Mariano Tortoriello and Raffaele De Lorenzo (via luigi)


Revision 144693 - (view) (download) (annotate) - [select for diffs]
Modified Wed Apr 6 00:26:08 2005 UTC (19 years, 3 months ago) by brooks
Original Path: head/sys/netinet/ip_dummynet.c
File length: 58654 byte(s)
Diff to previous 144691
Use ACTION_PTR(r) instead of (r->cmd + r->act_ofs).

Reviewed by:	md5


Revision 144691 - (view) (download) (annotate) - [select for diffs]
Modified Tue Apr 5 23:38:16 2005 UTC (19 years, 3 months ago) by brooks
Original Path: head/sys/netinet/ip_dummynet.c
File length: 58677 byte(s)
Diff to previous 142906
Make dummynet_flush() match its prototype.


Revision 142906 - (view) (download) (annotate) - [select for diffs]
Modified Tue Mar 1 12:01:17 2005 UTC (19 years, 4 months ago) by glebius
Original Path: head/sys/netinet/ip_dummynet.c
File length: 58673 byte(s)
Diff to previous 140345
Use NET_CALLOUT_MPSAFE macro.


Revision 140345 - (view) (download) (annotate) - [select for diffs]
Modified Sun Jan 16 11:13:18 2005 UTC (19 years, 5 months ago) by glebius
Original Path: head/sys/netinet/ip_dummynet.c
File length: 58691 byte(s)
Diff to previous 139823
- Reduce number of arguments passed to dummynet_io(), we already have cookie
  in struct ip_fw_args itself.
- Remove redundant &= 0xffff from dummynet_io().


Revision 139823 - (view) (download) (annotate) - [select for diffs]
Modified Fri Jan 7 01:45:51 2005 UTC (19 years, 5 months ago) by imp
Original Path: head/sys/netinet/ip_dummynet.c
File length: 58725 byte(s)
Diff to previous 134290
/* -> /*- for license, minor formatting changes


Revision 134290 - (view) (download) (annotate) - [select for diffs]
Modified Wed Aug 25 09:31:30 2004 UTC (19 years, 10 months ago) by pjd
Original Path: head/sys/netinet/ip_dummynet.c
File length: 58724 byte(s)
Diff to previous 133920
Allocate memory when dumping pipes with M_WAITOK flag.
On a system with huge number of pipes, M_NOWAIT failes almost always,
because of memory fragmentation.
My fix is different than the patch proposed by Pawel Malachowski,
because in FreeBSD 5.x we cannot sleep while holding dummynet mutex
(in 4.x there is no such lock).
My fix is also ugly, but there is no easy way to prepare nice and clean fix.

PR:		kern/46557
Submitted by:	Eugene Grosbein <eugen@grosbein.pp.ru>
Reviewed by:	mlaier


Revision 133920 - (view) (download) (annotate) - [select for diffs]
Modified Tue Aug 17 22:05:54 2004 UTC (19 years, 10 months ago) by andre
Original Path: head/sys/netinet/ip_dummynet.c
File length: 58248 byte(s)
Diff to previous 132199
Convert ipfw to use PFIL_HOOKS.  This is change is transparent to userland
and preserves the ipfw ABI.  The ipfw core packet inspection and filtering
functions have not been changed, only how ipfw is invoked is different.

However there are many changes how ipfw is and its add-on's are handled:

 In general ipfw is now called through the PFIL_HOOKS and most associated
 magic, that was in ip_input() or ip_output() previously, is now done in
 ipfw_check_[in|out]() in the ipfw PFIL handler.

 IPDIVERT is entirely handled within the ipfw PFIL handlers.  A packet to
 be diverted is checked if it is fragmented, if yes, ip_reass() gets in for
 reassembly.  If not, or all fragments arrived and the packet is complete,
 divert_packet is called directly.  For 'tee' no reassembly attempt is made
 and a copy of the packet is sent to the divert socket unmodified.  The
 original packet continues its way through ip_input/output().

 ipfw 'forward' is done via m_tag's.  The ipfw PFIL handlers tag the packet
 with the new destination sockaddr_in.  A check if the new destination is a
 local IP address is made and the m_flags are set appropriately.  ip_input()
 and ip_output() have some more work to do here.  For ip_input() the m_flags
 are checked and a packet for us is directly sent to the 'ours' section for
 further processing.  Destination changes on the input path are only tagged
 and the 'srcrt' flag to ip_forward() is set to disable destination checks
 and ICMP replies at this stage.  The tag is going to be handled on output.
 ip_output() again checks for m_flags and the 'ours' tag.  If found, the
 packet will be dropped back to the IP netisr where it is going to be picked
 up by ip_input() again and the directly sent to the 'ours' section.  When
 only the destination changes, the route's 'dst' is overwritten with the
 new destination from the forward m_tag.  Then it jumps back at the route
 lookup again and skips the firewall check because it has been marked with
 M_SKIP_FIREWALL.  ipfw 'forward' has to be compiled into the kernel with
 'option IPFIREWALL_FORWARD' to enable it.

 DUMMYNET is entirely handled within the ipfw PFIL handlers.  A packet for
 a dummynet pipe or queue is directly sent to dummynet_io().  Dummynet will
 then inject it back into ip_input/ip_output() after it has served its time.
 Dummynet packets are tagged and will continue from the next rule when they
 hit the ipfw PFIL handlers again after re-injection.

 BRIDGING and IPFW_ETHER are not changed yet and use ipfw_chk() directly as
 they did before.  Later this will be changed to dedicated ETHER PFIL_HOOKS.

More detailed changes to the code:

 conf/files
	Add netinet/ip_fw_pfil.c.

 conf/options
	Add IPFIREWALL_FORWARD option.

 modules/ipfw/Makefile
	Add ip_fw_pfil.c.

 net/bridge.c
	Disable PFIL_HOOKS if ipfw for bridging is active.  Bridging ipfw
	is still directly invoked to handle layer2 headers and packets would
	get a double ipfw when run through PFIL_HOOKS as well.

 netinet/ip_divert.c
	Removed divert_clone() function.  It is no longer used.

 netinet/ip_dummynet.[ch]
	Neither the route 'ro' nor the destination 'dst' need to be stored
	while in dummynet transit.  Structure members and associated macros
	are removed.

 netinet/ip_fastfwd.c
	Removed all direct ipfw handling code and replace it with the new
	'ipfw forward' handling code.

 netinet/ip_fw.h
	Removed 'ro' and 'dst' from struct ip_fw_args.

 netinet/ip_fw2.c
	(Re)moved some global variables and the module handling.

 netinet/ip_fw_pfil.c
	New file containing the ipfw PFIL handlers and module initialization.

 netinet/ip_input.c
	Removed all direct ipfw handling code and replace it with the new
	'ipfw forward' handling code.  ip_forward() does not longer require
	the 'next_hop' struct sockaddr_in argument.  Disable early checks
	if 'srcrt' is set.

 netinet/ip_output.c
	Removed all direct ipfw handling code and replace it with the new
	'ipfw forward' handling code.

 netinet/ip_var.h
	Add ip_reass() as general function.  (Used from ipfw PFIL handlers
	for IPDIVERT.)

 netinet/raw_ip.c
	Directly check if ipfw and dummynet control pointers are active.

 netinet/tcp_input.c
	Rework the 'ipfw forward' to local code to work with the new way of
	forward tags.

 netinet/tcp_sack.c
	Remove include 'opt_ipfw.h' which is not needed here.

 sys/mbuf.h
	Remove m_claim_next() macro which was exclusively for ipfw 'forward'
	and is no longer needed.

Approved by:	re (scottl)


Revision 132199 - (view) (download) (annotate) - [select for diffs]
Modified Thu Jul 15 08:26:07 2004 UTC (19 years, 11 months ago) by phk
Original Path: head/sys/netinet/ip_dummynet.c
File length: 59094 byte(s)
Diff to previous 131011
Do a pass over all modules in the kernel and make them return EOPNOTSUPP
for unknown events.

A number of modules return EINVAL in this instance, and I have left
those alone for now and instead taught MOD_QUIESCE to accept this
as "didn't do anything".


Revision 131011 - (view) (download) (annotate) - [select for diffs]
Modified Thu Jun 24 02:01:48 2004 UTC (20 years ago) by rwatson
Original Path: head/sys/netinet/ip_dummynet.c
File length: 59073 byte(s)
Diff to previous 126513
When asserting non-Giant locks in the network stack, also assert
Giant if debug.mpsafenet=0, as any points that require synchronization
in the SMPng world also required it in the Giant-world:

- inpcb locks (including IPv6)
- inpcbinfo locks (including IPv6)
- dummynet subsystem lock
- ipfw2 subsystem lock


Revision 126513 - (view) (download) (annotate) - [select for diffs]
Modified Wed Mar 3 01:33:22 2004 UTC (20 years, 4 months ago) by mlaier
Original Path: head/sys/netinet/ip_dummynet.c
File length: 59018 byte(s)
Diff to previous 126239
Add some missing DUMMYNET_UNLOCK() in config_pipe().

Noticed by:	Simon Coggins
Approved by:	bms(mentor)


Revision 126239 - (view) (download) (annotate) - [select for diffs]
Modified Wed Feb 25 19:55:29 2004 UTC (20 years, 4 months ago) by mlaier
Original Path: head/sys/netinet/ip_dummynet.c
File length: 58925 byte(s)
Diff to previous 125952
Re-remove MT_TAGs. The problems with dummynet have been fixed now.

Tested by: -current, bms(mentor), me
Approved by: bms(mentor), sam


Revision 125952 - (view) (download) (annotate) - [select for diffs]
Modified Wed Feb 18 00:04:52 2004 UTC (20 years, 4 months ago) by mlaier
Original Path: head/sys/netinet/ip_dummynet.c
File length: 58429 byte(s)
Diff to previous 125784
Backout MT_TAG removal (i.e. bring back MT_TAGs) for now, as dummynet is
not working properly with the patch in place.

Approved by: bms(mentor)


Revision 125784 - (view) (download) (annotate) - [select for diffs]
Modified Fri Feb 13 19:14:16 2004 UTC (20 years, 4 months ago) by mlaier
Original Path: head/sys/netinet/ip_dummynet.c
File length: 58843 byte(s)
Diff to previous 123893
This set of changes eliminates the use of MT_TAG "pseudo mbufs", replacing
them mostly with packet tags (one case is handled by using an mbuf flag
since the linkage between "caller" and "callee" is direct and there's no
need to incur the overhead of a packet tag).

This is (mostly) work from: sam

Silence from: -arch
Approved by: bms(mentor), sam, rwatson


Revision 123893 - (view) (download) (annotate) - [select for diffs]
Modified Sat Dec 27 14:08:53 2003 UTC (20 years, 6 months ago) by maxim
Original Path: head/sys/netinet/ip_dummynet.c
File length: 58429 byte(s)
Diff to previous 123169
o Fix a comment: softticks lives in sys/kern/kern_timeout.c.

PR:		kern/60613
Submitted by:	Gleb Smirnoff
MFC after:	3 days


Revision 123169 - (view) (download) (annotate) - [select for diffs]
Modified Sat Dec 6 09:01:25 2003 UTC (20 years, 7 months ago) by emax
Original Path: head/sys/netinet/ip_dummynet.c
File length: 58427 byte(s)
Diff to previous 122966
Do not panic when flushing dummynet firewall rules

Reviewed by: andre
Approved by: re (scottl)


Revision 122966 - (view) (download) (annotate) - [select for diffs]
Modified Sun Nov 23 18:13:41 2003 UTC (20 years, 7 months ago) by sam
Original Path: head/sys/netinet/ip_dummynet.c
File length: 58427 byte(s)
Diff to previous 122334
Use MPSAFE callouts only when debug.mpsafenet is 1.  Both timer routines
potentially transmit packets that may enter KAME IPsec w/o Giant if the
callouts are marked MPSAFE.

Reviewed by:	ume
Approved by:	re (rwatson)


Revision 122334 - (view) (download) (annotate) - [select for diffs]
Modified Sat Nov 8 23:36:32 2003 UTC (20 years, 7 months ago) by sam
Original Path: head/sys/netinet/ip_dummynet.c
File length: 58405 byte(s)
Diff to previous 121816
replace explicit changes to rt_refcnt by RT_ADDREF and RT_REMREF
macros that expand to include assertions when the system is built
with INVARIANTS

Supported by:	FreeBSD Foundation


Revision 121816 - (view) (download) (annotate) - [select for diffs]
Modified Fri Oct 31 18:32:15 2003 UTC (20 years, 8 months ago) by brooks
Original Path: head/sys/netinet/ip_dummynet.c
File length: 58501 byte(s)
Diff to previous 121699
Replace the if_name and if_unit members of struct ifnet with new members
if_xname, if_dname, and if_dunit. if_xname is the name of the interface
and if_dname/unit are the driver name and instance.

This change paves the way for interface renaming and enhanced pseudo
device creation and configuration symantics.

Approved By:	re (in principle)
Reviewed By:	njl, imp
Tested On:	i386, amd64, sparc64
Obtained From:	NetBSD (if_xname)


Revision 121699 - (view) (download) (annotate) - [select for diffs]
Modified Wed Oct 29 19:03:58 2003 UTC (20 years, 8 months ago) by sam
Original Path: head/sys/netinet/ip_dummynet.c
File length: 58558 byte(s)
Diff to previous 121140
o add locking to protect routing table refcnt manipulations
o add some more debugging help for figuring out why folks are
  getting complaints about releasing routing table entries with
  a zero refcnt
o fix comment that talked about spl's
o remove duplicate define of DUMMYNET_DEBUG

Supported by:	FreeBSD Foundation


Revision 121140 - (view) (download) (annotate) - [select for diffs]
Modified Thu Oct 16 16:21:25 2003 UTC (20 years, 8 months ago) by sam
Original Path: head/sys/netinet/ip_dummynet.c
File length: 58505 byte(s)
Diff to previous 120140
Drop dummynet lock when calling back into the network stack to deliver
packets.  This eliminates a LOR with Giant that caused outbound pipes
to fail.

Supported by:	FreeBSD Foundation


Revision 120140 - (view) (download) (annotate) - [select for diffs]
Modified Wed Sep 17 00:54:04 2003 UTC (20 years, 9 months ago) by sam
Original Path: head/sys/netinet/ip_dummynet.c
File length: 58389 byte(s)
Diff to previous 118259
Minor fixups + add locking.

o change time to MPSAFE callout
o make debug printfs conditional on DUMMYNET_DEBUG and runtime controllable
  by net.inet.ip.dummynet.debug
o make boot-time printf dependent on bootverbose

Sponsored by:	FreeBSD Foundation


Revision 118259 - (view) (download) (annotate) - [select for diffs]
Modified Thu Jul 31 10:24:36 2003 UTC (20 years, 11 months ago) by maxim
Original Path: head/sys/netinet/ip_dummynet.c
File length: 57092 byte(s)
Diff to previous 118008
o Fix a typo in previous commit.


Revision 118008 - (view) (download) (annotate) - [select for diffs]
Modified Fri Jul 25 09:59:16 2003 UTC (20 years, 11 months ago) by maxim
Original Path: head/sys/netinet/ip_dummynet.c
File length: 57092 byte(s)
Diff to previous 116982
o Do not overwrite saved interrupt priority level by alloc_hash(),
  use a separate variable.
o Restore interrupt priority level before return (no-op in HEAD).

Spotted by:	Don Bowman <don@sandvine.com>
MFC after:	5 days


Revision 116982 - (view) (download) (annotate) - [select for diffs]
Modified Sat Jun 28 14:23:22 2003 UTC (21 years ago) by luigi
Original Path: head/sys/netinet/ip_dummynet.c
File length: 57067 byte(s)
Diff to previous 116764
Remove a stale comment, fix indentation.


Revision 116764 - (view) (download) (annotate) - [select for diffs]
Modified Mon Jun 23 21:38:21 2003 UTC (21 years ago) by luigi
Original Path: head/sys/netinet/ip_dummynet.c
File length: 57131 byte(s)
Diff to previous 115793
Fix typo in a (commented out) debugging string.

Spotted by: diff


Revision 115793 - (view) (download) (annotate) - [select for diffs]
Modified Wed Jun 4 01:17:37 2003 UTC (21 years, 1 month ago) by ticso
Original Path: head/sys/netinet/ip_dummynet.c
File length: 57131 byte(s)
Diff to previous 112711
Change handling to support strong alignment architectures such as alpha and
sparc64.

PR:		alpha/50658
Submitted by:	rizzo
Tested on:	alpha


Revision 112711 - (view) (download) (annotate) - [select for diffs]
Modified Thu Mar 27 15:00:10 2003 UTC (21 years, 3 months ago) by maxim
Original Path: head/sys/netinet/ip_dummynet.c
File length: 56943 byte(s)
Diff to previous 112710
Fix indentation.


Revision 112710 - (view) (download) (annotate) - [select for diffs]
Modified Thu Mar 27 14:56:36 2003 UTC (21 years, 3 months ago) by maxim
Original Path: head/sys/netinet/ip_dummynet.c
File length: 56951 byte(s)
Diff to previous 109569
o Protect set_fs_param() by splimp(9).

Quote from kern/37573:

	There is an obvious race in netinet/ip_dummynet.c:config_pipe().
	Interrupts are not blocked when changing the params of an
	existing pipe.  The specific crash observed:

	... -> config_pipe -> set_fs_parms -> config_red

	malloc a new w_q_lookup table but take an interrupt before
	intializing it, interrupt handler does:

	... -> dummynet_io -> red_drops

	red_drops dereferences the uninitialized (zeroed) w_q_lookup
	table.

o Flush accumulated credits for idle pipes.
o Flush accumulated credits when change pipe characteristics.
o Change dn_flow_queue.numbytes type to unsigned long.

	Overlapping dn_flow_queue->numbytes in ready_event() leads to
	numbytes becomes negative and SET_TICKS() macro returns a very
	big value.  heap_insert() overlaps dn_key again and inserts a
	queue to a ready heap with a sched_time points to the past.
	That leads to an "infinity" loop.

PR:		kern/33234, kern/37573, misc/42459, kern/43133,
		kern/44045, kern/48099
Submitted by:	Mike Hibler <mike@cs.utah.edu> (kern/37573)
MFC after:	6 weeks


Revision 109569 - (view) (download) (annotate) - [select for diffs]
Modified Mon Jan 20 13:03:34 2003 UTC (21 years, 5 months ago) by maxim
Original Path: head/sys/netinet/ip_dummynet.c
File length: 56718 byte(s)
Diff to previous 108533
De-anonymity a couple of messages I missed in a previous sweep.
Move one of them under DEB macro.

Noticed by:	Wiktor Niesiobedzki <w@evip.pl>


Revision 108533 - (view) (download) (annotate) - [select for diffs]
Modified Wed Jan 1 18:49:04 2003 UTC (21 years, 6 months ago) by schweikh
Original Path: head/sys/netinet/ip_dummynet.c
File length: 56692 byte(s)
Diff to previous 108258
Correct typos, mostly s/ a / an / where appropriate. Some whitespace cleanup,
especially in troff files.


Revision 108258 - (view) (download) (annotate) - [select for diffs]
Modified Tue Dec 24 13:45:24 2002 UTC (21 years, 6 months ago) by maxim
Original Path: head/sys/netinet/ip_dummynet.c
File length: 56690 byte(s)
Diff to previous 107900
o De-anonymity dummynet(4) and ipfw(4) messages, prepend them
by 'dummynet: ' and 'ipfw: ' prefixes.

PR:		kern/41609


Revision 107900 - (view) (download) (annotate) - [select for diffs]
Modified Sun Dec 15 10:24:36 2002 UTC (21 years, 6 months ago) by maxim
Original Path: head/sys/netinet/ip_dummynet.c
File length: 56457 byte(s)
Diff to previous 107898
o Trim EOL whitespaces.

MFC after:	1 week


Revision 107898 - (view) (download) (annotate) - [select for diffs]
Modified Sun Dec 15 10:21:30 2002 UTC (21 years, 6 months ago) by maxim
Original Path: head/sys/netinet/ip_dummynet.c
File length: 56505 byte(s)
Diff to previous 106935
o M_DONTWAIT is mbuf(9) flag: malloc(M_DONTWAIT) -> malloc(M_NOWAIT).
The bug does not affect anything because M_NOWAIT == M_DONTWAIT.

Reviewed by:	luigi
MFC after:	1 week


Revision 106935 - (view) (download) (annotate) - [select for diffs]
Modified Thu Nov 14 23:46:04 2002 UTC (21 years, 7 months ago) by sam
Original Path: head/sys/netinet/ip_dummynet.c
File length: 56518 byte(s)
Diff to previous 106846
track changes to not strip the Ethernet header from input packets

Reviewed by:	many
Approved by:	re


Revision 106846 - (view) (download) (annotate) - [select for diffs]
Modified Wed Nov 13 11:31:44 2002 UTC (21 years, 7 months ago) by maxim
Original Path: head/sys/netinet/ip_dummynet.c
File length: 56623 byte(s)
Diff to previous 105194
Due to a memory alignment sizeof(struct ipfw_flow_id) is bigger than
ipfw_flow_id structure actual size and bcmp(3) may fail to compare
them properly. Compare members of these structures instead.

PR:		kern/44078
Submitted by:	Oleg Bulyzhin <oleg@rinet.ru>
Reviewed by:	luigi
MFC after:	2 weeks


Revision 105194 - (view) (download) (annotate) - [select for diffs]
Modified Wed Oct 16 01:54:46 2002 UTC (21 years, 8 months ago) by sam
Original Path: head/sys/netinet/ip_dummynet.c
File length: 56472 byte(s)
Diff to previous 104975
Replace aux mbufs with packet tags:

o instead of a list of mbufs use a list of m_tag structures a la openbsd
o for netgraph et. al. extend the stock openbsd m_tag to include a 32-bit
  ABI/module number cookie
o for openbsd compatibility define a well-known cookie MTAG_ABI_COMPAT and
  use this in defining openbsd-compatible m_tag_find and m_tag_get routines
o rewrite KAME use of aux mbufs in terms of packet tags
o eliminate the most heavily used aux mbufs by adding an additional struct
  inpcb parameter to ip_output and ip6_output to allow the IPsec code to
  locate the security policy to apply to outbound packets
o bump __FreeBSD_version so code can be conditionalized
o fixup ipfilter's call to ip_output based on __FreeBSD_version

Reviewed by:	julian, luigi (silent), -arch, -net, darren
Approved by:	julian, silence from everyone else
Obtained from:	openbsd (mostly)
MFC after:	1 month


Revision 104975 - (view) (download) (annotate) - [select for diffs]
Modified Sat Oct 12 07:45:23 2002 UTC (21 years, 8 months ago) by seanc
Original Path: head/sys/netinet/ip_dummynet.c
File length: 56466 byte(s)
Diff to previous 101927
Increase the max dummynet hash size from 1024 to 65536.  Default is still
1024.

Silence on:	-net, -ipfw 4weeks+
Reviewed by:	dd
Approved by:	knu (mentor)
MFC after:	3 weeks


Revision 101927 - (view) (download) (annotate) - [select for diffs]
Modified Thu Aug 15 16:53:43 2002 UTC (21 years, 10 months ago) by luigi
Original Path: head/sys/netinet/ip_dummynet.c
File length: 56442 byte(s)
Diff to previous 100228
Kernel support for a dummynet option:
When a pipe or queue has the "noerror" attribute, do not report
drops to the caller (ip_output() and friends).
(2 lines to implement it, 2 lines to document it.)

This will let you simulate losses on the sender side as if they
happened in the middle of the network, i.e. with no explicit feedback
to the sender.

manpage and ipfw2.c changes to follow shortly, together with other
ipfw2 changes.

Requested by: silby
MFC after: 3 days


Revision 100228 - (view) (download) (annotate) - [select for diffs]
Modified Wed Jul 17 07:21:42 2002 UTC (21 years, 11 months ago) by luigi
Original Path: head/sys/netinet/ip_dummynet.c
File length: 56398 byte(s)
Diff to previous 99642
Fix a panic when doing "ipfw add pipe 1 log ..."

Also synchronize ip_dummynet.c with the version in RELENG_4 to
ease MFC's.


Revision 99642 - (view) (download) (annotate) - [select for diffs]
Modified Tue Jul 9 06:53:38 2002 UTC (22 years ago) by luigi
Original Path: head/sys/netinet/ip_dummynet.c
File length: 55976 byte(s)
Diff to previous 99620
Change one variable to make it easier to switch between ipfw and ipfw2


Revision 99620 - (view) (download) (annotate) - [select for diffs]
Modified Mon Jul 8 22:37:55 2002 UTC (22 years ago) by luigi
Original Path: head/sys/netinet/ip_dummynet.c
File length: 55983 byte(s)
Diff to previous 98943
Forgot to update one field name in one of the latest commits.


Revision 98943 - (view) (download) (annotate) - [select for diffs]
Modified Thu Jun 27 23:02:18 2002 UTC (22 years ago) by luigi
Original Path: head/sys/netinet/ip_dummynet.c
File length: 56005 byte(s)
Diff to previous 98613
The new ipfw code.

This code makes use of variable-size kernel representation of rules
(exactly the same concept of BPF instructions, as used in the BSDI's
firewall), which makes firewall operation a lot faster, and the
code more readable and easier to extend and debug.

The interface with the rest of the system is unchanged, as witnessed
by this commit. The only extra kernel files that I am touching
are if_fw.h and ip_dummynet.c, which is quite tied to ipfw. In
userland I only had to touch those programs which manipulate the
internal representation of firewall rules).

The code is almost entirely new (and I believe I have written the
vast majority of those sections which were taken from the former
ip_fw.c), so rather than modifying the old ip_fw.c I decided to
create a new file, sys/netinet/ip_fw2.c .  Same for the user
interface, which is in sbin/ipfw/ipfw2.c (it still compiles to
/sbin/ipfw).  The old files are still there, and will be removed
in due time.

I have not renamed the header file because it would have required
touching a one-line change to a number of kernel files.

In terms of user interface, the new "ipfw" is supposed to accepts
the old syntax for ipfw rules (and produce the same output with
"ipfw show". Only a couple of the old options (out of some 30 of
them) has not been implemented, but they will be soon.

On the other hand, the new code has some very powerful extensions.
First, you can put "or" connectives between match fields (and soon
also between options), and write things like

ipfw add allow ip from { 1.2.3.4/27 or 5.6.7.8/30 } 10-23,25,1024-3000 to any

This should make rulesets slightly more compact (and lines longer!),
by condensing 2 or more of the old rules into single ones.

Also, as an example of how easy the rules can be extended, I have
implemented an 'address set' match pattern, where you can specify
an IP address in a format like this:

        10.20.30.0/26{18,44,33,22,9}

which will match the set of hosts listed in braces belonging to the
subnet 10.20.30.0/26 . The match is done using a bitmap, so it is
essentially a constant time operation requiring a handful of CPU
instructions (and a very small amount of memmory -- for a full /24
subnet, the instruction only consumes 40 bytes).

Again, in this commit I have focused on functionality and tried
to minimize changes to the other parts of the system. Some performance
improvement can be achieved with minor changes to the interface of
ip_fw_chk_t. This will be done later when this code is settled.

The code is meant to compile unmodified on RELENG_4 (once the
PACKET_TAG_* changes have been merged), for this reason
you will see #ifdef __FreeBSD_version in a couple of places.
This should minimize errors when (hopefully soon) it will be time
to do the MFC.


Revision 98613 - (view) (download) (annotate) - [select for diffs]
Modified Sat Jun 22 11:51:02 2002 UTC (22 years ago) by luigi
Original Path: head/sys/netinet/ip_dummynet.c
File length: 56179 byte(s)
Diff to previous 96511
Remove (almost all) global variables that were used to hold
packet forwarding state ("annotations") during ip processing.
The code is considerably cleaner now.

The variables removed by this change are:

        ip_divert_cookie        used by divert sockets
        ip_fw_fwd_addr          used for transparent ip redirection
        last_pkt                used by dynamic pipes in dummynet

Removal of the first two has been done by carrying the annotations
into volatile structs prepended to the mbuf chains, and adding
appropriate code to add/remove annotations in the routines which
make use of them, i.e. ip_input(), ip_output(), tcp_input(),
bdg_forward(), ether_demux(), ether_output_frame(), div_output().

On passing, remove a bug in divert handling of fragmented packet.
Now it is the fragment at offset 0 which sets the divert status of
the whole packet, whereas formerly it was the last incoming fragment
to decide.

Removal of last_pkt required a change in the interface of ip_fw_chk()
and dummynet_io(). On passing, use the same mechanism for dummynet
annotations and for divert/forward annotations.

option IPFIREWALL_FORWARD is effectively useless, the code to
implement it is very small and is now in by default to avoid the
obfuscation of conditionally compiled code.

NOTES:
 * there is at least one global variable left, sro_fwd, in ip_output().
   I am not sure if/how this can be removed.

 * I have deliberately avoided gratuitous style changes in this commit
   to avoid cluttering the diffs. Minor stule cleanup will likely be
   necessary

 * this commit only focused on the IP layer. I am sure there is a
   number of global variables used in the TCP and maybe UDP stack.

 * despite the number of files touched, there are absolutely no API's
   or data structures changed by this commit (except the interfaces of
   ip_fw_chk() and dummynet_io(), which are internal anyways), so
   an MFC is quite safe and unintrusive (and desirable, given the
   improved readability of the code).

MFC after: 10 days


Revision 96511 - (view) (download) (annotate) - [select for diffs]
Modified Mon May 13 10:37:19 2002 UTC (22 years, 1 month ago) by luigi
Original Path: head/sys/netinet/ip_dummynet.c
File length: 56409 byte(s)
Diff to previous 91406
Add ipfw hooks to ether_demux() and ether_output_frame().
Ipfw processing of frames at layer 2 can be enabled by the sysctl variable

	net.link.ether.ipfw=1

Consider this feature experimental, because right now, the firewall
is invoked in the places indicated below, and controlled by the
sysctl variables listed on the right.  As a consequence, a packet
can be filtered from 1 to 4 times depending on the path it follows,
which might make a ruleset a bit hard to follow.

I will add an ipfw option to tell if we want a given rule to apply
to ether_demux() and ether_output_frame(), but we have run out of
flags in the struct ip_fw so i need to think a bit on how to implement
this.

		to upper layers
	     |			     |
	     +----------->-----------+
	     ^			     V
	[ip_input]		[ip_output]	net.inet.ip.fw.enable=1
	     |			     |
	     ^			     V
	[ether_demux]      [ether_output_frame]	net.link.ether.ipfw=1
	     |			     |
	     +->- [bdg_forward]-->---+		net.link.ether.bridge_ipfw=1
	     ^			     V
	     |			     |
		 to devices


Revision 91406 - (view) (download) (annotate) - [select for diffs]
Modified Wed Feb 27 18:32:23 2002 UTC (22 years, 4 months ago) by jhb
Original Path: head/sys/netinet/ip_dummynet.c
File length: 55654 byte(s)
Diff to previous 86047
Simple p_ucred -> td_ucred changes to start using the per-thread ucred
reference.


Revision 86047 - (view) (download) (annotate) - [select for diffs]
Modified Sun Nov 4 22:56:25 2001 UTC (22 years, 8 months ago) by luigi
Original Path: head/sys/netinet/ip_dummynet.c
File length: 55662 byte(s)
Diff to previous 84516
MFS: sync the ipfw/dummynet/bridge code with the one recently merged
     into stable (mostly , but not only, formatting and comments changes).


Revision 84516 - (view) (download) (annotate) - [select for diffs]
Modified Fri Oct 5 05:45:27 2001 UTC (22 years, 9 months ago) by ps
Original Path: head/sys/netinet/ip_dummynet.c
File length: 55340 byte(s)
Diff to previous 84058
Make it so dummynet and bridge can be loaded as modules.

Submitted by:	billf


Revision 84058 - (view) (download) (annotate) - [select for diffs]
Modified Thu Sep 27 23:44:27 2001 UTC (22 years, 9 months ago) by luigi
Original Path: head/sys/netinet/ip_dummynet.c
File length: 54705 byte(s)
Diff to previous 83994
Two main changes here:
 + implement "limit" rules, which permit to limit the number of sessions
   between certain host pairs (according to masks). These are a special
   type of stateful rules, which might be of interest in some cases.
   See the ipfw manpage for details.

 + merge the list pointers and ipfw rule descriptors in the kernel, so
   the code is smaller, faster and more readable. This patch basically
   consists in replacing "foo->rule->bar" with "rule->bar" all over
   the place.
   I have been willing to do this for ages!

MFC after: 1 week


Revision 83994 - (view) (download) (annotate) - [select for diffs]
Modified Wed Sep 26 21:53:20 2001 UTC (22 years, 9 months ago) by brooks
Original Path: head/sys/netinet/ip_dummynet.c
File length: 54806 byte(s)
Diff to previous 83970
Include sys/proc.h for the definition of securelevel_ge().

Submitted by:	LINT


Revision 83970 - (view) (download) (annotate) - [select for diffs]
Modified Wed Sep 26 19:58:29 2001 UTC (22 years, 9 months ago) by rwatson
Original Path: head/sys/netinet/ip_dummynet.c
File length: 54784 byte(s)
Diff to previous 72270
o Modify IPFW and DUMMYNET administrative setsockopt() calls to use
  securelevel_gt() to check the securelevel, rather than direct access
  to the securelevel variable.

Obtained from:	TrustedBSD Project


Revision 72270 - (view) (download) (annotate) - [select for diffs]
Modified Sat Feb 10 00:10:18 2001 UTC (23 years, 4 months ago) by luigi
Original Path: head/sys/netinet/ip_dummynet.c
File length: 54718 byte(s)
Diff to previous 71999
Sync with the bridge/dummynet/ipfw code already tested in stable.

In ip_fw.[ch] change a couple of variable and field names to
avoid having types, variables and fields with the same name.


Revision 71999 - (view) (download) (annotate) - [select for diffs]
Modified Sun Feb 4 13:13:25 2001 UTC (23 years, 5 months ago) by phk
Original Path: head/sys/netinet/ip_dummynet.c
File length: 54779 byte(s)
Diff to previous 71909
Mechanical change to use <sys/queue.h> macro API instead of
fondling implementation details.

Created with: sed(1)
Reviewed by: md5(1)


Revision 71909 - (view) (download) (annotate) - [select for diffs]
Modified Fri Feb 2 00:18:00 2001 UTC (23 years, 5 months ago) by luigi
Original Path: head/sys/netinet/ip_dummynet.c
File length: 54796 byte(s)
Diff to previous 71686
MFS: bridge/ipfw/dummynet fixes (bridge.c will be committed separately)


Revision 71686 - (view) (download) (annotate) - [select for diffs]
Modified Fri Jan 26 19:43:54 2001 UTC (23 years, 5 months ago) by luigi
Original Path: head/sys/netinet/ip_dummynet.c
File length: 54810 byte(s)
Diff to previous 71667
Minor cleanups after yesterday's patch.
The code (bridging and dummynet) actually worked fine!


Revision 71667 - (view) (download) (annotate) - [select for diffs]
Modified Fri Jan 26 06:49:34 2001 UTC (23 years, 5 months ago) by luigi
Original Path: head/sys/netinet/ip_dummynet.c
File length: 54836 byte(s)
Diff to previous 71395
Bring dummynet in line with the code that now works in -STABLE.
It compiles, but I cannot test functionality yet.


Revision 71395 - (view) (download) (annotate) - [select for diffs]
Modified Mon Jan 22 23:04:13 2001 UTC (23 years, 5 months ago) by luigi
Original Path: head/sys/netinet/ip_dummynet.c
File length: 53804 byte(s)
Diff to previous 71133
Change critical section protection for dummynet from splnet() to
splimp() -- we need it because dummynet can be invoked by the
bridging code at splimp().

This should cure the pipe "stalls" that several people have been
reporting on -stable while using bridging+dummynet (the problem
would not affect routers using dummynet).


Revision 71133 - (view) (download) (annotate) - [select for diffs]
Modified Tue Jan 16 23:49:49 2001 UTC (23 years, 5 months ago) by luigi
Original Path: head/sys/netinet/ip_dummynet.c
File length: 52644 byte(s)
Diff to previous 69781
Some dummynet patches that I forgot to commit last summer.
One of them fixes a potential panic when bridging is used and
you run out of mbufs (though i have no idea if the bug has
ever hit anyone).


Revision 69781 - (view) (download) (annotate) - [select for diffs]
Modified Fri Dec 8 21:51:06 2000 UTC (23 years, 6 months ago) by dwmalone
Original Path: head/sys/netinet/ip_dummynet.c
File length: 51263 byte(s)
Diff to previous 69099
Convert more malloc+bzero to malloc+M_ZERO.

Submitted by:	josh@zipperup.org
Submitted by:	Robert Drehmel <robd@gmx.net>


Revision 69099 - (view) (download) (annotate) - [select for diffs]
Modified Thu Nov 23 22:25:03 2000 UTC (23 years, 7 months ago) by bmilekic
Original Path: head/sys/netinet/ip_dummynet.c
File length: 51413 byte(s)
Diff to previous 63330
Fixup (hopefully) bridging + ipfw + dummynet together...

* Some dummynet code incorrectly handled a malloc()-allocated pseudo-mbuf
  header structure, called "pkt," and could consequently pollute the mbuf
  free list if it was ever passed to m_freem(). The fix involved passing not
  pkt, but essentially pkt->m_next (which is a real mbuf) to the mbuf
  utility routines.

* Also, for dummynet, in bdg_forward(), made the code copy the ethernet header
  back into the mbuf (prepended) because the dummynet code that follows expects
  it to be there but it is, unfortunately for dummynet, passed to bdg_forward
  as a seperate argument.

PRs: kern/19551 ; misc/21534 ; kern/23010
Submitted by: Thomas Moestl <tmoestl@gmx.net>
Reviewed by: bmilekic
Approved by: luigi


Revision 63330 - (view) (download) (annotate) - [select for diffs]
Modified Mon Jul 17 20:03:27 2000 UTC (23 years, 11 months ago) by luigi
Original Path: head/sys/netinet/ip_dummynet.c
File length: 51365 byte(s)
Diff to previous 61657
close PR 19544 - ipfw pipe delete causes panic when no pipes defined

PR: 19544


Revision 61657 - (view) (download) (annotate) - [select for diffs]
Modified Wed Jun 14 10:07:22 2000 UTC (24 years ago) by luigi
Original Path: head/sys/netinet/ip_dummynet.c
File length: 51349 byte(s)
Diff to previous 61413
Fix behaviour of "ipfw pipe show" -- previous code gave
ambiguous data to the userland program (kernel operation was
safe, anyways).


Revision 61413 - (view) (download) (annotate) - [select for diffs]
Modified Thu Jun 8 09:45:23 2000 UTC (24 years, 1 month ago) by luigi
Original Path: head/sys/netinet/ip_dummynet.c
File length: 51131 byte(s)
Diff to previous 60938
Implement WF2Q+ in dummynet.


Revision 60938 - (view) (download) (annotate) - [select for diffs]
Modified Fri May 26 02:09:24 2000 UTC (24 years, 1 month ago) by jake
Original Path: head/sys/netinet/ip_dummynet.c
File length: 28127 byte(s)
Diff to previous 60833
Back out the previous change to the queue(3) interface.
It was not discussed and should probably not happen.

Requested by:		msmith and others


Revision 60833 - (view) (download) (annotate) - [select for diffs]
Modified Tue May 23 20:41:01 2000 UTC (24 years, 1 month ago) by jake
Original Path: head/sys/netinet/ip_dummynet.c
File length: 28134 byte(s)
Diff to previous 60536
Change the way that the queue(3) structures are declared; don't assume that
the type argument to *_HEAD and *_ENTRY is a struct.

Suggested by:	phk
Reviewed by:	phk
Approved by:	mdodd


Revision 60536 - (view) (download) (annotate) - [select for diffs]
Modified Sun May 14 02:18:43 2000 UTC (24 years, 1 month ago) by archie
Original Path: head/sys/netinet/ip_dummynet.c
File length: 28127 byte(s)
Diff to previous 57140
Move code to handle BPF and bridging for incoming Ethernet packets out
of the individual drivers and into the common routine ether_input().
Also, remove the (incomplete) hack for matching ethernet headers
in the ip_fw code.

The good news: net result of 1016 lines removed, and this should make
bridging now work with *all* Ethernet drivers.

The bad news: it's nearly impossible to test every driver, especially
for bridging, and I was unable to get much testing help on the mailing
lists.

Reviewed by:	freebsd-net


Revision 57140 - (view) (download) (annotate) - [select for diffs]
Modified Fri Feb 11 13:23:14 2000 UTC (24 years, 4 months ago) by luigi
Original Path: head/sys/netinet/ip_dummynet.c
File length: 27877 byte(s)
Diff to previous 57113
Forgot one line: don't try to match flags when looking for a flow.

Approved-by: jordan


Revision 57113 - (view) (download) (annotate) - [select for diffs]
Modified Thu Feb 10 14:17:40 2000 UTC (24 years, 4 months ago) by luigi
Original Path: head/sys/netinet/ip_dummynet.c
File length: 27820 byte(s)
Diff to previous 56991
Support for stateful (dynamic) ipfw rules. They are very
similar to ipfilter's keep-state.

Look at the updated ipfw(8) manpage for details.

Approved-by: jordan


Revision 56991 - (view) (download) (annotate) - [select for diffs]
Modified Fri Feb 4 16:45:33 2000 UTC (24 years, 5 months ago) by luigi
Original Path: head/sys/netinet/ip_dummynet.c
File length: 27630 byte(s)
Diff to previous 55597
Fix a (mostly harmless) scheduling-in-the-past problem with
dummynet (already fixed in -stable, was waiting for Jordan's
approval due to the code freeze).

Reported-By: Mike Tancsa
Approved-By: Jordan


Revision 55597 - (view) (download) (annotate) - [select for diffs]
Added Sat Jan 8 11:24:46 2000 UTC (24 years, 6 months ago) by luigi
Original Path: head/sys/netinet/ip_dummynet.c
File length: 27630 byte(s)
Diff to previous 55009
Implement per-flow queueing. Using a single pipe config rule,
now you can dynamically create rate-limited queues for different
flows using masks on dst/src IP, port and protocols.
Read the ipfw(8) manpage for details and examples.

Restructure the internals of the traffic shaper to use heaps,
so that it manages efficiently large number of queues.

Fix a bug which was present in the previous versions which could
cause, under certain unfrequent conditions, to send out very large
bursts of traffic.

All in all, this new code is much cleaner than the previous one and
should also perform better.

Work supported by Akamba Corp.



This form allows you to request diffs between any two revisions of this file. For each of the two "sides" of the diff, enter a numeric revision.

  Diffs between and
  Type of Diff should be a

  ViewVC Help
Powered by ViewVC 1.1.27