Commit Graph

3613 Commits

Author SHA1 Message Date
Luigi Rizzo
7da98b8ab6 MFC 205602:
Honor ip.fw.one_pass when a packet comes out of a pipe without being delayed.
I forgot to handle this case when i did the mtag cleanup three months ago.

I am merging immediately because this bugfix is important for
people using RELENG_8.

PR:           145004
2010-03-24 15:19:47 +00:00
Luigi Rizzo
8018e843a3 MFC of a large number of ipfw and dummynet fixes and enhancements
done in CURRENT over the last 4 months.
HEAD and RELENG_8 are almost in sync now for ipfw, dummynet
the pfil hooks and related components.

Among the most noticeable changes:
- r200855 more efficient lookup of skipto rules, and remove O(N)
  blocks from critical sections in the kernel;
- r204591 large restructuring of the dummynet module, with support
  for multiple scheduling algorithms (4 available so far)
See the original commit logs for details.

Changes in the kernel/userland ABI should be harmless because the
kernel is able to understand previous requests from RELENG_8 and
RELENG_7. For this reason, this changeset would be applicable
to RELENG_7 as well, but i am not sure if it is worthwhile.
2010-03-23 09:58:59 +00:00
Matt Jacob
7733cf8fff MFC a number of changes from head for ISP (203478,203463,203444,202418,201758,
201408,201325,200089,198822,197373,197372,197214,196162). Since one of those
changes was a semicolon cleanup from somebody else, this touches a lot more.
2010-02-11 18:34:06 +00:00
Qing Li
613e96b8c6 MFC r203401
Some of the existing ppp and vpn related scripts create and set
the IP addresses of the tunnel end points to the same value. In
these cases the loopback route is not installed for the local
end.
2010-02-09 19:27:54 +00:00
Julian Elischer
2ae7ec29fd MFC of 197952 and 198075
Virtualize the pfil hooks so that different jails may chose different
    packet filters. ALso allows ipfw to be enabled on on ejail and disabled
    on another. In 8.0 it's a global setting.
and
    Unbreak the VIMAGE build with IPSEC, broken with r197952 by
    virtualizing the pfil hooks.
    For consistency add the V_ to virtualize the pfil hooks in here as well.
2010-02-07 09:00:22 +00:00
Antoine Brodin
e2b36efde5 MFC r201145 to stable/8:
(S)LIST_HEAD_INITIALIZER takes a (S)LIST_HEAD as an argument.
  Fix some wrong usages.
  Note: this does not affect generated binaries as this argument is not used.

  PR:		137213
  Submitted by:	Eygene Ryabinkin (initial version)
2010-01-30 12:11:21 +00:00
George V. Neville-Neil
fbbbfe0ba5 MFC r196797:
Add ARP statistics to the kernel and netstat.
2010-01-28 16:48:44 +00:00
Michael Tuexen
b93b253dc6 MFC 202449:
Get rid of support of an old version of the SCTP-AUTH draft.
Get rid of unused MD5 code.
2010-01-24 22:17:08 +00:00
Bjoern A. Zeeb
be6797dde8 MFC r202469:
Garbage collect references to the no longer implemented tcp_fasttimo().
2010-01-24 12:22:38 +00:00
Bjoern A. Zeeb
3bcceea40e MFC r202468:
Add ip4.saddrsel/ip4.nosaddrsel (and equivalent for ip6) to control
  whether to use source address selection (default) or the primary
  jail address for unbound outgoing connections.

  This is intended to be used by people upgrading from single-IP
  jails to multi-IP jails but not having to change firewall rules,
  application ACLs, ... but to force their connections (unless
  otherwise changed) to the primry jail IP they had been used for
  years, as well as for people prefering to implement similar policies.

  Note that for IPv6, if configured incorrectly, this might lead to
  scope violations, which single-IPv6 jails could as well, as by the
  design of jails. [1]

  Reviewed by:		jamie, hrs (ipv6 part)
  Pointed out by:	hrs [1]
2010-01-23 16:40:35 +00:00
Navdeep Parhar
cbbe4a754c MFC r201416:
Avoid NULL dereference in arpresolve.

Requested by: kib@
2010-01-21 10:12:21 +00:00
Michael Tuexen
06ee5047d5 MFC 201523
Correct usage of parenthesis.
2010-01-17 18:18:01 +00:00
Michael Tuexen
45bde0da39 MFC 199459
Get rid of unused fields addr_over which is never really used,
only copied around.
2010-01-17 17:49:28 +00:00
Michael Tuexen
64224569da MFC 199374
Fix a bug where queued ASCONF messags are not sent out.
From Irene Ruengeler.
2010-01-17 17:46:48 +00:00
Michael Tuexen
533e1ca310 MFC 198621
Improve round robin stream scheduler and cleanup some code.
2010-01-17 17:45:09 +00:00
Michael Tuexen
53b14b7294 MFC 197341
Fix errnos.
2010-01-17 17:41:43 +00:00
Michael Tuexen
fb7bf5f374 MFC 198499
Improve the round robin stream scheduler.
2010-01-17 17:10:17 +00:00
Michael Tuexen
33dabcc064 MFC 199437
Use always LIST_EMPTY instead of sometime SCTP_LIST_EMPTY,
which is defined as LIST_EMPTY.
2010-01-17 17:05:59 +00:00
Michael Tuexen
24a263d9da MFC 199372
Do not start the iterator when there are no associations.
This fixes a bug found by Irene Ruengeler.
2010-01-17 17:03:40 +00:00
Michael Tuexen
801fc2d035 MFC 199369
Do not hold the lock longer than necessary.
2010-01-17 17:01:01 +00:00
Michael Tuexen
a8725a275a MFC 198522:
Bugfix: Use formula from section 7.2.3 of RFC 4960. Reported by Martin Becke.
2010-01-17 16:58:37 +00:00
Qing Li
4cc5ccf399 MFC r201544
An existing incomplete ARP entry would expire a subsequent
statically configured entry of the same host. This bug was
due to the expiration timer was not cancelled when installing
the static entry. Since there exist a potential race condition
with respect to timer cancellation, simply check for the
LLE_STATIC bit inside the expiration function instead of
cancelling the active timer.
2010-01-12 00:04:13 +00:00
Ruslan Ermilov
60ee8f1ae1 MFC: r200026,201801: Swap carp(4) log levels. 2010-01-11 12:32:06 +00:00
Qing Li
a17a2dcab6 MFC r201285
Consolidate the route message generation code for when address
aliases were added or deleted. The announced route entry for
an address alias is no longer empty because this empty route
entry was causing some route daemon to fail and exit abnormally.
2010-01-05 22:33:10 +00:00
Qing Li
32c5340155 MFC r201282, r201543
r201282
-------
The proxy arp entries could not be added into the system over the
IFF_POINTOPOINT link types. The reason was due to the routing
entry returned from the kernel covering the remote end is of an
interface type that does not support ARP. This patch fixes this
problem by providing a hint to the kernel routing code, which
indicates the prefix route instead of the PPP host route should
be returned to the caller. Since a host route to the local end
point is also added into the routing table, and there could be
multiple such instantiations due to multiple PPP links can be
created with the same local end IP address, this patch also fixes
the loopback route installation failure problem observed prior to
this patch. The reference count of loopback route to local end would
be either incremented or decremented. The first instantiation would
create the entry and the last removal would delete the route entry.

r201543
-------
The IFA_RTSELF address flag marks a loopback route has been installed
for the interface address. This marker is necessary to properly support
PPP types of links where multiple links can have the same local end
IP address. The IFA_RTSELF flag bit maps to the RTF_HOST value, which
was combined into the route flag bits during prefix installation in
IPv6. This inclusion causing the prefix route to be unusable. This
patch fixes this bug by excluding the IFA_RTSELF flag during route
installation.

PR:		ports/141342, kern/141134
2010-01-05 22:14:55 +00:00
John Baldwin
e10b0dfd66 MFC 200847:
- Rename the __tcpi_(snd|rcv)_mss fields of the tcp_info structure to remove
  the leading underscores since they are now implemented.
- Implement the tcpi_rto and tcpi_last_data_recv fields in the tcp_info
  structure.
2010-01-05 17:04:14 +00:00
Shteryana Shopova
aed7a0f878 MFC r201254:
Make sure the multicast forwarding cache entry's stall queue is properly
initialized before trying to insert an entry into it.

PR:		kern/142052
Reviewed by:	bms
2010-01-04 15:58:36 +00:00
Hajimu UMEMOTO
479812d91c MFC r200055, r200102:
- Teach an IPv6 to the debug prints.
- Use INET_ADDRSTRLEN and INET6_ADDRSTRLEN rather than hard
  coded number.
2010-01-04 15:22:38 +00:00
Hajimu UMEMOTO
30feab0076 MFC r200027: Teach an IPv6 to send_pkt() and ipfw_tick().
It fixes the issue which keep-alive doesn't work for an IPv6.
2010-01-04 15:05:11 +00:00
Bjoern A. Zeeb
950cde5085 MFC r200473:
Throughout the network stack we have a few places of
        if (jailed(cred))
  left.  If you are running with a vnet (virtual network stack) those will
  return true and defer you to classic IP-jails handling and thus things
  will be "denied" or returned with an error.

  Work around this problem by introducing another "jailed()" function,
  jailed_without_vnet(), that also takes vnets into account, and permits
  the calls, should the jail from the given cred have its own virtual
  network stack.

  We cannot change the classic jailed() call to do that,  as it is used
  outside the network stack as well.

  Discussed with:       julian, zec, jamie, rwatson (back in Sept)
2009-12-28 14:40:58 +00:00
Robert Watson
1120ce6b69 Merge r198438 from head to stable/8:
Correct spelling typo in ip_input comment.

  Pointed out by:       N.J. Mann <njm at njm.me.uk>,
                John Nielsen <john at jnielsen.net>, julian (!), lstewart
2009-12-14 11:53:02 +00:00
Robert Watson
ec610c212b Merge r198393 from head to stable/8:
Improve grammar in ip_input comment while attempting to maintain what
  might be its meaning.

(Note, merge of the revision correcting a spelling error in this commit
will follow as well!)
2009-12-14 11:15:47 +00:00
Michael Tuexen
cf19fced17 MFC 197288,197326,197327,197328,197342,197914,197929,
197955,199365,199370,199371,199373,199866
This MFCs all SCTP/VNET relevant fixes from head.

Approved by: rrs (mentor)
2009-12-07 07:33:51 +00:00
Bjoern A. Zeeb
b4e227f473 MFC r198050:
Compare pointer to NULL rather than 0.
2009-12-05 19:44:16 +00:00
Luigi Rizzo
3cdcbc4885 some simple MFC:
r200020:
  change the type of the opcode from enum *:8  to u_int8_t
  so the size and alignment of the ipfw_insn is not compiler dependent.
  No changes in the code generated by gcc.

r200023:
  Add new sockopt names for ipfw and dummynet.

  This commit is just grabbing entries for the new names
  that will be used in the future, so you don't need to
  rebuild anything now.

r200034
  Dispatch sockopt calls to ipfw and dummynet
  using the new option numbers, IP_FW3 and IP_DUMMYNET3.
  Right now the modules return an error if called with those arguments
  so there is no danger of unwanted behaviour.

r200040
  - initialize src_ip in the main loop to prevent a compiler warning
    (gcc 4.x under linux, not sure how real is the complaint).
  - rename a macro argument to prevent name clashes.
  -  add the macro name on a couple of #endif
  - add a blank line for readability.
2009-12-05 12:51:51 +00:00
Attilio Rao
a5e831ded9 MFC r199208, r199223:
Move inet_aton() (specular to inet_ntoa(), already present in libkern)
into libkern in order to made it usable by other modules than alias_proxy.

Sponsored by:	Sandvine Incorporated
2009-11-22 16:04:49 +00:00
Bruce M Simpson
025bbb4984 MFC r199522..199528:
Pullup IPv6 mcast SSM KPI fixes from HEAD, including fix for
  filter deallocation from Stef Walter.
2009-11-20 12:30:40 +00:00
Michael Tuexen
21bd3c552d MFC 199477
Fix a bug where the system panics when a SHUTDOWN is received with an
illegal TSN.
This bug was reported by Irene Ruengeler.

Approved by: re, rrs (mentor)
2009-11-18 15:35:03 +00:00
John Baldwin
24b458cf34 MFC 198990:
Several years ago a feature was added to TCP that casued soreceive() to
send an ACK right away if data was drained from a TCP socket that had
previously advertised a zero-sized window.  The current code requires the
receive window to be exactly zero for this to kick in.  If window scaling is
enabled and the window is smaller than the scale, then the effective window
that is advertised is zero.  However, in that case the zero-sized window
handling is not enabled because the window is not exactly zero.  The fix
changes the code to check the raw window value against zero.
2009-11-17 16:17:11 +00:00
Bruce M Simpson
7ea239483a MFC r199287:
Fix a functional regression in multicast.

  Userland daemons need to see IGMP traffic regardless of the group;
  omit the imo filter check if the proto is IGMP. The kernel part
  of IGMP will have already filtered appropriately at this point.

Submitted by:   Franz Struwig
Reported by:    Ivor Prebeg, Franz Struwig
2009-11-17 10:59:51 +00:00
Oleg Bulyzhin
c366b7c1e2 MFC r198845:
Fix two issues that can lead to exceeding configured pipe bandwidth:
- do not expire queues which are not ready to be expired.
- properly calculate available burst size.

MFC r199073:
style(9): add missing parentheses
2009-11-09 10:13:24 +00:00
Christian Brueffer
a4f93c1075 MFC: r198539
Close a stream file descriptor leak.
2009-11-04 13:30:32 +00:00
Qing Li
f60909e3e2 MFC r198418
Use the correct option name in the preprocessor command to enable
or disable diagnostic messages.

Reviewed by:	ru
2009-10-28 21:45:25 +00:00
Qing Li
0eb4d28bac MFC 198301
In the ARP callout timer expiration function, the current time_second
is compared against the entry expiration time value (that was set based
on time_second) to check if the current time is larger than the set
expiration time. Due to the +/- timer granularity value, the comparison
returns false, causing the alternative code to be executed. The
alternative code path freed the memory without removing that entry
from the table list, causing a use-after-free bug.

Reviewed by:	discussed with kmacy
Approved by:	re
Verified by:	rnoland, yongari
2009-10-20 21:36:56 +00:00
Qing Li
6f99a646e4 MFC r198111
This patch fixes the following issues in the ARP operation:

1. There is a regression issue in the ARP code. The incomplete
   ARP entry was timing out too quickly (1 second timeout), as
   such, a new entry is created each time arpresolve() is called.
   Therefore the maximum attempts made is always 1. Consequently
   the error code returned to the application is always 0.
2. Set the expiration of each incomplete entry to a 20-second
   lifetime.
3. Return "incomplete" entries to the application.
4. The return error code was incorrect.

Reviewed by:	kmacy
Approved by:	re
2009-10-20 17:44:50 +00:00
Robert Watson
92b52ada7c Merge r198196 from head to stable/8:
Rewrap ip_input() comment so that it prints more nicely.

Approved by:	re (kib)
2009-10-20 16:22:31 +00:00
Michael Tuexen
bef10df88e MFC r197868.
Use correct arguments when calling SCTP_RTALLOC().
Approved by: re, rrs (mentor)
2009-10-14 17:26:05 +00:00
Robert Watson
3e5cbaa4c7 Merge r197814 from head to stable/8:
Remove tcp_input lock statistics; these are intended for debugging only
  and are not intended to ship in 8.0 as they dirty additional cache
  lines in a performance-critical per-packet path.

Approved by:	re (kib, bz)
2009-10-09 09:18:22 +00:00
Robert Watson
f41dd6dca9 Merge r197795 from head to stable/8:
In tcp_input(), we acquire a global write lock at first only if a
  segment is likely to trigger a TCP state change (i.e., FIN/RST/SYN).
  If we later have to upgrade the lock, we acquire an inpcb reference
  and drop both global/inpcb locks before reacquiring in-order.  In
  that gap, the connection may transition into TIMEWAIT, so we need
  to loop back and reevaluate the inpcb after relocking.

  Reported by:        Kamigishi Rei <spambox at haruhiism.net>
  Reviewed by:        bz

Approved by:	re (kib)
2009-10-08 11:07:15 +00:00
Qing Li
c8c92b5491 MFC r197696
Remove a log message from production code. This log message can be
triggered by a misconfigured host that is sending out gratuious ARPs.
This log message can also be triggered during a network renumbering
event when multiple prefixes co-exist on a single network segment.

Approved by:	re
2009-10-06 20:33:02 +00:00