aboutsummaryrefslogtreecommitdiff
path: root/sys/netinet
diff options
context:
space:
mode:
authorLuigi Rizzo <luigi@FreeBSD.org>2002-08-15 16:53:43 +0000
committerLuigi Rizzo <luigi@FreeBSD.org>2002-08-15 16:53:43 +0000
commit4bbf3b8b3a31c6ba24d224e95f6585906c20256f (patch)
tree97b2cb6feae80af918fa72af7390006c5860f8b9 /sys/netinet
parent6835e7427cc67c60f9f4956e4b74d996a537bf11 (diff)
downloadsrc-4bbf3b8b3a31c6ba24d224e95f6585906c20256f.tar.gz
src-4bbf3b8b3a31c6ba24d224e95f6585906c20256f.zip
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
Notes
Notes: svn path=/head/; revision=101927
Diffstat (limited to 'sys/netinet')
-rw-r--r--sys/netinet/ip_dummynet.c2
-rw-r--r--sys/netinet/ip_dummynet.h1
2 files changed, 2 insertions, 1 deletions
diff --git a/sys/netinet/ip_dummynet.c b/sys/netinet/ip_dummynet.c
index 4a407d1750b0..49f58fcd2498 100644
--- a/sys/netinet/ip_dummynet.c
+++ b/sys/netinet/ip_dummynet.c
@@ -1246,7 +1246,7 @@ dropit:
if (q)
q->drops++ ;
m_freem(m);
- return ENOBUFS ;
+ return ( (fs && (fs->flags_fs & DN_NOERROR)) ? 0 : ENOBUFS);
}
/*
diff --git a/sys/netinet/ip_dummynet.h b/sys/netinet/ip_dummynet.h
index 30c5f6fc35f8..e8ae0e9ca0fd 100644
--- a/sys/netinet/ip_dummynet.h
+++ b/sys/netinet/ip_dummynet.h
@@ -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