774 Commits

Author SHA1 Message Date
mav
9025c17b0c MFC rev. 1.23-1.24
To avoid control data losses, do not acknowledge recieving of control packet
if netgraph reported error while delivering to destination.
Reset 'next send' counter to the last requested by peer on ack timeout,
to resend all subsequest packets after lost one again without additional hints.
2008-03-11 19:14:10 +00:00
mav
c3331adffe MFC rev. 1.61
Send only one incoming notification at a time to reduce queue
trashing and improve performance.
Remove waitflag argument from ng_ksocket_incoming2(), it means nothing
as function call was queued by netgraph.
Remove node validity check, as node validity guarantied by netgraph.
Update comments.
2008-03-11 19:04:42 +00:00
mav
ec0275f98d MFC: rev. 1.148-1.149
Implement 128 items node name hash for faster name search.
Increase node ID hash size from 32 to 128 items.
Increase default queue items allocation limit from 512 to 4096 items
to avoid terrible unpredicted effects for netgraph operation of their
exhaustion while allocating control messages.
Add separate configurable 512 items limit for data items allocation
for DoS/overload protection.
2008-03-10 20:38:56 +00:00
mav
3d9f1f5c36 MFC rev. 1.93-1.94
Make session ID generator to use session ID hash.
Make session ID generator thread-safe.
Use more compact LIST instead of TAILQ for session hash.
Add all listening hooks into LIST to simplify searches.
Use ng_findhook() instead of own equal implementation.
2008-03-09 20:05:39 +00:00
mav
28e6df5f37 MFC: Add support for the libalias redirect functionality.
Submitted by:   Vadim Goncharov <vadim_nuclight@mail.ru>
2008-03-09 20:02:35 +00:00
mav
86c1681769 MFC rev. 1.147
Fix incorrect constant used in rev. 1.146 that broke node writer locking.
2008-02-26 12:40:06 +00:00
mav
7777b8f104 MFC rev. 1.35
Fix shutdown bug made by previous commit.
2008-02-25 13:53:13 +00:00
mav
9094c56bb6 Partial MFC rev. 1.23-1.24
- Avoid data copying. bpf_filter() is able to work directly on mbuf chain
 - Prepare hooks direct pointers on setup to avoid heavy ng_findhook() calls
during operarion.
Merge is 'Partial' due to lack of JITTER support on 6.x.
2008-02-24 13:21:13 +00:00
mav
28a071a256 MFC:
Do not use bcmp() to compare two bytes with constants.
2008-02-06 21:44:45 +00:00
mav
089bb21733 Massive sync with HEAD:
- Instead of direct manipulation on queue and worklist mutexes, bring macros
for doing this job. This change will make it easy to migrate from using
spinning locks to adaptive ones.
- We don't need spinning locks here. Change them to the adaptive mutexes. This
change should bring no performance decrease, as it did not in my tests.
- Despite several examples in the kernel, the third argument of
sysctl_handle_int is not sizeof the int type you want to export.
- Implement stack protection based on GET_STACK_USAGE() macro.
This fixes system panics possible with complicated netgraph setups
and allows to avoid unneded extra queueing for stack unwrapping.
- Cleanup and tune ng_snd_item() function as it is one of the
most busy netgraph functions.
2008-02-06 21:37:45 +00:00
mav
f4efd80bdf MFC rev. 1.34
Move all possible node logic out of the rcvdata() function
to the newhook()/disconnect().
Unify function names with other nodes.
2008-02-05 22:47:28 +00:00
mav
551c6a92bc MFC rev. 1.89-1.91
Implement Session-ID hashing to improve receive performance scalability
for big number of concurrent sessions.
2008-02-05 19:24:09 +00:00
mav
12701fd0b9 Revert previous commit.
glebius@ noticed that it was not a bug, but undocumented feature.
2008-02-03 10:30:45 +00:00
mav
b7b3f062da MFC rev. 1.15
Run expire even without export hook connected.
2008-02-02 15:56:32 +00:00
mav
e8e6822c41 MFC rev. 1.88
Add support for optional "AC-Name\Service-Name" syntax at NGM_PPPOE_CONNECT
argument. It allows ppp, mpd or any other node consumer to request
connection to specified access concentrator.
2008-01-29 21:24:28 +00:00
mav
b9d942b6c6 MFC rev. 1.72-1.74
Improve multilink receive performance with fragment headers preallocation.
Improve multilink performance by netgraph item reuse.
2008-01-29 21:19:26 +00:00
mav
d5e0acaf5b MFC rev. 1.26-1.27
Remove one very strange unneded if.
Fix memory leak when export hook is not connected.
2008-01-28 19:46:17 +00:00
mav
1d3d1372bb MFC rev 1.71
Fix bundle xmit octets stats for packet-split operation mode.
2008-01-23 12:17:34 +00:00
mav
2ad5643261 MFC rev. 1.87
Fix incorrectly placed bracket in pppoe_find_svc().
2007-12-29 17:38:24 +00:00
mav
833592a55b MFC rev. 1.22
Increase control channel xmit queue to 128 packets.
Previous value 16 was too small for real LAC as temporal activity
spike cound easily overflow queue demanding tunnel disconnection due
to possible state inconsistency.
2007-12-29 17:35:32 +00:00
mav
2db2bc42f3 MFC rev 1.84-1.85
Remove ng_pppoe_sendpacket() function to simplify code as it is called
as much times as it has cases inside of it.
Split ng_pppoe_rcvdata() function into three hook-specific ones
to simplify code and reduce stack usage.
2007-12-12 19:14:05 +00:00
glebius
d8a8749418 MFC:
- Merge all the ng_send_fn2* functions into one - ng_send_fn2(),
    removing some copy&pasted code.
  - Reduce copy and paste in ng_apply_item().
  - Resurrect ng_send_fn() as a valid symbol, not a define.

  Reviewed by:	mav, julian

Approved by:	re (kensmith)
2007-11-21 12:14:00 +00:00
emax
4a1e7a8d9e MFC
Allow RFCOMM servers to bind to a ''wildcard'' RFCOMM channel
zero (0). Actual RFCOMM channel will be assigned after listen(2)
call is done on a RFCOMM socket bound to a ''wildcard'' RFCOMM
channel zero (0).

Address locking issues in ng_btsocket_rfcomm_bind()

Submitted by:	Heiko Wundram (Beenic) < wundram at beenic dot net >
Approved by:	re (kensmith)
2007-11-07 17:42:45 +00:00
emax
0b258d1f6a Fix locking issue in ng_btsocket_l2cap_ctloutput()
Submitted by:	Heiko Wundram (Beenic) < wundram at beenic dot net >
Approved by:	re (kensmith)
2007-11-05 17:51:14 +00:00
mav
443a7ee14f MFC ng_base.c rev 1.136-1.137, netgraph.h rev 1.69, ng_socket.c rev 1.83
Implement new apply callback mechanism to handle item forwarding.
When item forwarded, refence counter is incremented, when item
processed, counter decremented. When counter reaches zero,
apply handler is getting called.
It allows to report connect() call status only when it is really completed.

Reviewed by:	julian
Approved by:	re (kensmith)
2007-10-28 17:52:08 +00:00
mav
3750cc7cc3 MFC rev. 1.18-1.21
- Fix thread safety.
 - Make some optimizations.
2007-10-12 05:09:13 +00:00
mav
24dfe5bdc7 MFC rev. 1.129,1.132
Fix misspellings in comments.
2007-09-28 07:33:01 +00:00
mav
4ae2b7a8da MFC rev. 1.82-1.84
Fix thread unsafe usage of global pkt_hdr variable.
Optimize ether and debug hooks determination.
Remove some dead code.
2007-09-26 19:15:14 +00:00
mav
e036ae33c5 MFC rev. 1.70
Fix typo which brokes VJ decompression
when VJC negotiated in only one direction.
2007-09-16 13:33:32 +00:00
mav
90496dfcb1 MFC ng_ppp.c rev. 1.68, 1.69.
Add proper fine-grained node locking.
Add 64bit statistic counters.
2007-08-28 18:49:33 +00:00
emax
d0e06d1dd8 MFC:
Return EADDRNOTAVAIL instead of EDESTADDRREQ error when listen(2)
is called on improperly bound socket.
2007-08-28 17:07:49 +00:00
mav
ff6b5cd0df MFC rev. 1.135
Add ng_send_fn() error handeling inside ng_con_nodes().
Without it some errors may left unnoticed and unhandeled
that lead to hooks left in half-connected state.
2007-08-19 19:36:46 +00:00
mav
1e69884eb7 MFC rev. 1.22
Reduce stack usage by 256 bytes per call. It helps to avoid kernel
stack overflow in complicated traffic filtering setups.
2007-08-02 10:49:27 +00:00
mav
bb968fb086 MFC rev. 1.1 of ng_nat.h and rev. 1.5,1.9,1.10 of ng_nat.c
- Add support for setmode and settarget messages.
 - Allow node to bypass traffic while no alias address defined.
 - Fix result of some mechanical change.
2007-07-25 19:10:39 +00:00
mav
e7055066ab MFC rev. 1.63 - 1.67
Multiple multilink fixes and optimizations.
2007-07-25 14:25:51 +00:00
mav
14053562dc MFC rev. 1.25 - 1.31
Several fixes and performance optimizations.
2007-07-25 14:03:46 +00:00
mav
30fb669fbf MFC rev. 1.15-1.17
- Use the ISO standard function variable vs. a GCC'ism.
 - Global xmit stats calculation fix.
 - Avoid false assertion on transmit and delayed ack timeout with enabled invariants.
   Replace callout_pending() by callout_active() to remove race window.
2007-07-25 13:50:57 +00:00
mav
9eb48d03b8 MFC rev. 1.40
Compensate low int math precision.
2007-07-25 13:32:48 +00:00
dwmalone
828724ce61 MFC 1.30: Help ng_fec deal with multicast addresses.
This isn't exactly the same patch as in -current as some of the
in-kernel multicast API is different.
2007-06-10 07:41:25 +00:00
emax
a8c82c781b MFC:
Try to silence Coverity by adding (void) in front of function call.
Also add a comment, explaining why return value is not being checked.

Requested by:	netchild
2007-04-04 22:21:09 +00:00
ru
12fae8db36 MFC: 1.38: Fix interface output being stuck under low memory conditions. 2007-03-11 10:11:16 +00:00
bms
176d53dfc4 MFC rev 1.60:
In the output path, mask off M_BCAST|M_MCAST so as to prevent incorrect
  addressing if a packet is later re-encapsulated and sent to a
  non-broadcast, non-multicast destination after being received on the
  ng_ksocket input hook.

These mbuf flags should not be set on the mbuf packet header chain until
the data thus sent re-enters ip_output() by way of the pru_sosend callback
anyway.

PR:		106999
Tested by:	ume
Submitted by:	Kevin Lahey
2007-03-04 14:54:02 +00:00
ru
183af56462 - Don't forget to reset the M_VLANTAG when removing a tag,
otherwise bad things may happen.  [1]

- More diff redux to HEAD.

Submitted by:	Vsevolod Lobko [1]
2007-02-01 14:32:37 +00:00
glebius
1c62bdd5f6 Sync ng_ppp(4) node with HEAD. This includes the rewrite of the PPP
stack and new options to specify the compression and encryption mode.

Submitted by:	Alexander Motin <mav alkar.net>
2007-01-28 17:14:08 +00:00
cvs2svn
7fc74e4ad3 This commit was manufactured by cvs2svn to create branch 'RELENG_6'. 2007-01-26 10:19:09 +00:00
glebius
139fbb1227 MFC 1.4:
Update ip and tcp pointers after m_pullup().

  Submitted by:	Alexander Motin <mav alkar.net>
2007-01-25 21:44:06 +00:00
glebius
0ac6b4cbce MFC 1.7, 1.8:
Return value PKT_ALIAS_FOUND_HEADER_FRAGMENT isn't an error case. The
  packet shouldn't be dropped.

  Submitted by:		Alexander Motin <mav alkar.net>

  Correctly calculate length of IP header.

  Submitted by:		Eugene Hartmann <eugene tpsb.com.ru>
2007-01-25 21:42:47 +00:00
glebius
4785e43cc0 MFC 1.20 - 1.24:
- Use bitcount32() from sys/systm.h instead of my own.
- Use hash functions with better distribution.
- Break long line.
2007-01-25 21:39:00 +00:00
glebius
051c9c045c MFC 1.13:
Recognize 802.1q frames in Ethernet input and process them.

  PR:		kern/101162
  Submitted by:	CoolDavid (Tseng Guo-Fu) <cooldavid cdpa.nsysu.edu.tw>
2007-01-25 21:35:43 +00:00
jhb
bd48914a94 MFC: Change the life cycle of bpf interface objects to close attach/detach
races with bpf(4).  This includes shims to preserve the ABI for any old
modules.  For more details see the commit log for 1.166 of sys/net/bpf.c.
2007-01-19 23:01:34 +00:00