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.
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.
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.
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.
- 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.
- 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.
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.
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.
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.
- 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)
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)
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)
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.
- Add support for setmode and settarget messages.
- Allow node to bypass traffic while no alias address defined.
- Fix result of some mechanical change.
- 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.
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
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
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>