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
This commit is contained in:
Luigi Rizzo 2002-08-15 16:53:43 +00:00
parent 6835e7427c
commit 4bbf3b8b3a
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=101927
2 changed files with 2 additions and 1 deletions

View File

@ -1246,7 +1246,7 @@ dummynet_io(struct mbuf *m, int pipe_nr, int dir, struct ip_fw_args *fwa)
if (q)
q->drops++ ;
m_freem(m);
return ENOBUFS ;
return ( (fs && (fs->flags_fs & DN_NOERROR)) ? 0 : ENOBUFS);
}
/*

View File

@ -259,6 +259,7 @@ struct dn_flow_set {
#define DN_IS_RED 0x0002
#define DN_IS_GENTLE_RED 0x0004
#define DN_QSIZE_IS_BYTES 0x0008 /* queue size is measured in bytes */
#define DN_NOERROR 0x0010 /* do not report ENOBUFS on drops */
#define DN_IS_PIPE 0x4000
#define DN_IS_QUEUE 0x8000