Commit Graph

62 Commits

Author SHA1 Message Date
Craig Rodrigues
749f65e3e3 Use print as a function for Python 3 [PEP 3105]
Import print_function from the __future__ module
to activate this for Python 2.  This works as far back as Python 2.6.0a2:
   https://docs.python.org/2/library/__future__.html

[PEP 3105] https://www.python.org/dev/peps/pep-3105/
2015-11-19 00:01:52 +00:00
John Baldwin
179fa75e6e Reassign copyright statements on several files from Advanced
Computing Technologies LLC to Hudson River Trading LLC.

Approved by:	Hudson River Trading LLC (who owns ACT LLC)
MFC after:	1 week
2015-04-23 14:22:20 +00:00
Warner Losh
3bdf775801 NO_MAN= has been deprecated in favor of MAN= for some time, go ahead
and finish the job. ncurses is now the only Makefile in the tree that
uses it since it wasn't a simple mechanical change, and will be
addressed in a future commit.
2014-04-13 05:21:56 +00:00
Ed Maste
f77a2d2f24 Remove unused variable. 2012-11-20 01:42:18 +00:00
Ed Maste
4039f071d0 Use '%zu' and '%zd' as appropriate for size_t / ssize_t. 2012-11-19 23:07:38 +00:00
Eitan Adler
1f35187f99 Covert regression test to python 3
Approved by:	cperciva
MFC after:	3 days
2012-10-22 02:29:44 +00:00
Robert Watson
e397f116c3 Properly initialise the "len" argument to getsockname(2) in the tcpdrop
regression test so that it works (more) consistently.

Approved by:	re (bz)
Sponsored by:	Juniper Networks
2011-08-06 19:20:17 +00:00
Robert Watson
7fcc404b47 Add a very simple IPDIVERT test, which creates IP divert sockets and
checks for collision/non-collision properties in binding them.  This
test would have identified a bug recently reported on current@
involding my disaggregation of the pcbinfo lock.

It would be nice if this test also exercised packet diversion and
injection, but that is for another day.

MFC after:	3 days
Sponsored by:	Juniper Networks, Inc.
2011-06-04 16:25:12 +00:00
Bjoern A. Zeeb
3e622db1cb Upgrade jail(2) to latest jail(2) API to make the regression test work
again.  Eventually should switch to jail_set(2).

Reported by:	rwatson
MFC after:	10 days
2011-05-30 09:41:38 +00:00
Robert Watson
0d9535331d Rework TIMEWAIT regression test so that kernel-allocated port numbers are
used rather than a fixed userspace one, avoiding conflicts between the two
test runs.

MFC after:	3 days
Sponsored by:	Juniper Networks, Inc.
2011-05-30 09:34:15 +00:00
Robert Watson
57431792c8 Add missing include of stdio.h.
MFC after:	3 days
Sponsored by:	Juniper Networks, Inc.
2011-05-30 09:06:24 +00:00
Robert Watson
e8c546028b In the tcpdrop regression test, allow the kernel to allocate us a port
rather than using a fixed port number.  This means that the regression test
can be run many times in a row without waiting on TIMEWAIT to release a
hard-coded port number.

MFC after:	3 days
Sponsored by:	Juniper Networks, Inc.
2011-05-30 09:04:35 +00:00
Robert Watson
27d36ca1a8 Add missing #include of err.h.
MFC after:	3 days
Sponsored by:	Juniper Networks, Inc.
2011-05-30 08:54:32 +00:00
George V. Neville-Neil
e162ea60d4 Add a queue to hold packets while we await an ARP reply.
When a fast machine first brings up some non TCP networking program
it is quite possible that we will drop packets due to the fact that
only one packet can be held per ARP entry.  This leads to packets
being missed when a program starts or restarts if the ARP data is
not currently in the ARP cache.

This code adds a new sysctl, net.link.ether.inet.maxhold, which defines
a system wide maximum number of packets to be held in each ARP entry.
Up to maxhold packets are queued until an ARP reply is received or
the ARP times out.  The default setting is the old value of 1
which has been part of the BSD networking code since time
immemorial.

Expose the time we hold an incomplete ARP entry by adding
the sysctl net.link.ether.inet.wait, which defaults to 20
seconds, the value used when the new ARP code was added..

Reviewed by:	bz, rpaulo
MFC after: 3 weeks
2010-11-12 22:03:02 +00:00
Robert Watson
a848550a77 Update udpzerobyte to understand that passing 0 as a length to recv(2)
will cause it to return 0, not EAGAIN.

Add UNIX domain socket support to udpzerobyte, which suggests this
regression test should be moved to the general sockets test area rather
than netinet.
2008-10-07 21:01:23 +00:00
Robert Watson
dba96bd99f Add IPv6 support to zero-size UDP transmit/receive test. 2008-10-07 14:13:59 +00:00
Robert Watson
8c3bc1af40 Regression test for the loopback handling of zero-length UDP packets, which
should be delivered but without payload.
2008-10-07 10:31:55 +00:00
Mike Silbersack
fd2e4074d2 This is a regression test to verify the proper behavior of IP ID generation
code.  It will push 200000 packets, then report back what the min and max
periods it saw for different IDs were.
2008-02-06 15:48:43 +00:00
Bjoern A. Zeeb
4f744c0454 Convert errx(-1, ..., strerror(errno)) to err(-1, ...).
Discussed with: rwatson
2007-11-28 20:38:05 +00:00
Bjoern A. Zeeb
551944a21a Add support for tcpmd5 tests.
Add README.tcpmd5 to describe how to build a simple test setup
and run tests.

Convert compile time options to run time options [1].

Discussed with:	rwatson
Suggested by:	rwatson [1]
2007-11-28 20:33:58 +00:00
Bruce M Simpson
b13321fc4e Add regression test for SSM code. 2007-06-12 16:29:22 +00:00
Bruce M Simpson
71498f308b Import rewrite of IPv4 socket multicast layer to support source-specific
and protocol-independent host mode multicast. The code is written to
accomodate IPv6, IGMPv3 and MLDv2 with only a little additional work.

This change only pertains to FreeBSD's use as a multicast end-station and
does not concern multicast routing; for an IGMPv3/MLDv2 router
implementation, consider the XORP project.

The work is based on Wilbert de Graaf's IGMPv3 code drop for FreeBSD 4.6,
which is available at: http://www.kloosterhof.com/wilbert/igmpv3.html

Summary
 * IPv4 multicast socket processing is now moved out of ip_output.c
   into a new module, in_mcast.c.
 * The in_mcast.c module implements the IPv4 legacy any-source API in
   terms of the protocol-independent source-specific API.
 * Source filters are lazy allocated as the common case does not use them.
   They are part of per inpcb state and are covered by the inpcb lock.
 * struct ip_mreqn is now supported to allow applications to specify
   multicast joins by interface index in the legacy IPv4 any-source API.
 * In UDP, an incoming multicast datagram only requires that the source
   port matches the 4-tuple if the socket was already bound by source port.
   An unbound socket SHOULD be able to receive multicasts sent from an
   ephemeral source port.
 * The UDP socket multicast filter mode defaults to exclusive, that is,
   sources present in the per-socket list will be blocked from delivery.
 * The RFC 3678 userland functions have been added to libc: setsourcefilter,
   getsourcefilter, setipv4sourcefilter, getipv4sourcefilter.
 * Definitions for IGMPv3 are merged but not yet used.
 * struct sockaddr_storage is now referenced from <netinet/in.h>. It
   is therefore defined there if not already declared in the same way
   as for the C99 types.
 * The RFC 1724 hack (specify 0.0.0.0/8 addresses to IP_MULTICAST_IF
   which are then interpreted as interface indexes) is now deprecated.
 * A patch for the Rhyolite.com routed in the FreeBSD base system
   is available in the -net archives. This only affects individuals
   running RIPv1 or RIPv2 via point-to-point and/or unnumbered interfaces.
 * Make IPv6 detach path similar to IPv4's in code flow; functionally same.
 * Bump __FreeBSD_version to 700048; see UPDATING.

This work was financially supported by another FreeBSD committer.

Obtained from:  p4://bms_netdev
Submitted by:   Wilbert de Graaf (original work)
Reviewed by:    rwatson (locking), silence from fenner,
		net@ (but with encouragement)
2007-06-12 16:24:56 +00:00
Bruce M Simpson
201096bc46 Nuke ipblock. A more complete multicast regression test suite is on the way. 2007-04-12 11:46:30 +00:00
Bruce M Simpson
e52a7d1f39 Fix a bug whereby group addresses were incorrectly computed in the test.
[Since the change to strict refcounting for in_multi objects, this test
 began to fail; formerly the refcount was a count of the number of requests
 for a given address, NOT a count of pointers to the object.]
2007-04-09 19:44:08 +00:00
Bruce M Simpson
2509455360 Add a small test program for the additional socket options which
RFC 3678 (Source-specific Multicast API) brings to FreeBSD.
2007-04-06 23:39:17 +00:00
Bruce M Simpson
f6c0136c7f Add raw IP support (protocol 114) to ipbroadcast regression test. 2007-03-13 23:36:48 +00:00
Bruce M Simpson
48451912c9 Add -A to specify local address for bind(). 2007-03-08 14:37:00 +00:00
Bruce M Simpson
f3bb407b7c Support IP_SENDIF in -CURRENT. 2007-03-08 14:27:24 +00:00
Bruce M Simpson
df7babd689 Add -t to set IP TTL. 2007-03-01 18:36:16 +00:00
Bruce M Simpson
2b743a9e9d Introduce a test program for IPv4 broadcast datagram send. 2007-03-01 13:26:13 +00:00
Bruce M Simpson
3250f640aa For the IPv4 multicast membership socket regression test:
Add command line flags to increase the number of test iterations.
 Be deterministic by default, for automated operation.
 Better document assumptions.
2007-02-02 21:10:37 +00:00
Maxim Konovalov
8847579c57 o style.Makefile(5): WARNS= -> WARNS?=. 2006-07-09 11:51:14 +00:00
Maxim Konovalov
90967a95ce o Convert to Test::Harness testing infratructure. 2006-05-20 19:18:24 +00:00
Maxim Konovalov
cd915ab751 o A tiny regression test exposes bug in rip_disconnect(). 2006-05-14 22:03:00 +00:00
Bruce M Simpson
9b5b26f66f Add multicast group join/leave functionality to IPv4 regression
test suite.
2006-05-14 14:11:54 +00:00
Robert Watson
fc19db6c7b Add a second pass to the close-before-accept test using a call to the
tcp drop sysctl.  This should exercise the ECONNABORTED accept case.
2006-04-03 11:57:41 +00:00
Robert Watson
1b2c980983 Add regression test for tcpdrop sysctl. 2006-04-03 11:34:36 +00:00
Robert Watson
4f29da19bd Add a regression test to exercise the case where accept() is called and
the next waiting socket has had a close on the remote endpoint already.
2006-04-03 10:08:35 +00:00
Robert Watson
876f7f842a When running the second part of the test, kill off the server process from
the first part before starting, or the TCP port we want to bind may be in
use still.  Sleep for a short period between tests.

Use SIGTERM instead of SIGKILL.
2006-04-02 11:09:37 +00:00
Robert Watson
dfe0ec64aa Pass the right pid into the parent and child tasks so that when a test
fails, we kill the right partner process.
2006-04-02 11:03:05 +00:00
Robert Watson
8c4d74c408 Add makefile for tcpsocktimewait missed in previous commit. 2006-04-02 10:50:46 +00:00
Robert Watson
b4c2aeb1c4 Add a short regression test that triggers a TCP socket to enter time wait
while the socket is still open; one variant closes the socket while in
time wait, and a second lets time wait expire while the socket is open.
2006-04-02 00:07:38 +00:00
Ruslan Ermilov
6aebd02aa8 Style: NO_MAN doesn't need any value. 2006-03-15 10:46:38 +00:00
Robert Watson
e9cc9cec0c Add a regression test to test two variations on the same bug: joining a
multicast group using a raw socket, then removing the interface on which
the group is found, and joining a multicast group using a udp socket,
then removing the interface on which the group is found.  An if_disc
interface is used as the interface on which to attach.

NB: A panic currently results from running this regression test, so do
so with caution.

PR:		77665
Reported by:	Gavin Atkinson <gavin dot atkinson at ury dot york dot ac dot uk>
Reported by:	Brooks Davis <brooks at FreeBSD dot org>
2005-09-05 13:23:01 +00:00
Pawel Jakub Dawidek
3c0a99e66e Change jail IP from 1.0.0.127 to 127.0.0.1, which shows, that this test
doesn't examine the real issue as it pass without problems.
2005-07-23 05:40:17 +00:00
Robert Watson
b7b85f242e Add a simple multicast socket regression test set:
- Test that the basic socket options have the right defaults, that we can
  change them, read them back, etc.

- Add and remove some multicast addresses.

- Send a loopback multicast address and make sure it arrives intact.

There's more that could be done here, but it's a start.

MFC after:	3 days
2005-07-22 19:36:29 +00:00
Robert Watson
31ae050211 Add an #ifdef'd non-blocking version of the test.
Update copyright.
2005-05-16 00:54:47 +00:00
Robert Watson
20ef44d423 Use WARNS?= instead of WARNS= in Makefiles so that global warning
settings can override local ones.

Pointed out by:	ru
2005-01-22 22:42:39 +00:00
Robert Watson
2d7142bf0d In refactoring the test before committing, a pointer was passed instead
of a structure for the sockaddr_in.  Pass the pointer to connect()
instead of the pointer to the pointer.

Specify a port number to connect to.
2005-01-16 15:01:28 +00:00
Robert Watson
81cfeee7bf Add udpconnectjail, a simple regression test to exercise an (as yet)
unfixed bug in the jail() implementation relating to using the connect()
system call on UDP sockets.

PR:	26506
2005-01-16 13:05:32 +00:00