aboutsummaryrefslogtreecommitdiff
path: root/sys/netgraph/ng_l2tp.c
Commit message (Collapse)AuthorAgeFilesLines
* ng_l2tp: Fix callout synchronization in the rexmit timeout handlerMark Johnston2020-09-251-5/+7
| | | | | | | | | | | | | | | | | | A received control packet may cause the transmit queue to be flushed, in which case ng_l2tp_seq_recv_nr() cancels the transmit timeout handler. The handler checks to see if it was cancelled before doing anything, but did so before acquiring the node lock, so a small race window could cause ng_l2tp_seq_rack_timeout() to attempt to flush an empty queue, ultimately causing a null pointer dereference. PR: 241133 Reviewed by: bz, glebius, Lutz Donnerhacke MFC after: 3 days Sponsored by: Rubicon Communications, LLC (Netgate) Differential Revision: https://reviews.freebsd.org/D26548 Notes: svn path=/head/; revision=366167
* net: clean up empty lines in .c and .h filesMateusz Guzik2020-09-011-5/+2
| | | | Notes: svn path=/head/; revision=365071
* Protect access to seq->xwin[] with the seq mutex.Gleb Smirnoff2019-10-031-1/+4
| | | | | | | MFC after: 5 weeks Notes: svn path=/head/; revision=353027
* Writing out the L2TP control packet requires 12 bytes ofBjoern A. Zeeb2016-11-171-0/+10
| | | | | | | | | | | | contiguous memory but in one path we did not always guarantee this, thus do a m_pullup() there. PR: 214385 Submitted by: Joe Jones (joeknockando googlemail.com) MFC after: 3 days Notes: svn path=/head/; revision=308748
* Fix circular math macro.Gleb Smirnoff2014-01-031-1/+1
| | | | | | | | | Submitted by: Lutz Donnerhacke via Dmitry Luhtionov German lesson at: http://lutz.donnerhacke.de/Blog/Der-Fluch-der-Stabilitaet PR: 146082 Notes: svn path=/head/; revision=260225
* Mechanically substitute flags from historic mbuf allocator withGleb Smirnoff2012-12-051-7/+7
| | | | | | | | | | | | malloc(9) flags within sys. Exceptions: - sys/contrib not touched - sys/mbuf.h edited manually Notes: svn path=/head/; revision=243882
* Mark MALLOC_DEFINEs static that have no corresponding MALLOC_DECLAREs.Ed Schouten2011-11-071-1/+1
| | | | | | | This means that their use is restricted to a single C file. Notes: svn path=/head/; revision=227293
* Node constructor methods are supposed to be called in syscallGleb Smirnoff2011-04-181-3/+1
| | | | | | | | | | context always. Convert nodes to consistently use M_WAITOK flag for memory allocation. Reviewed by: julian Notes: svn path=/head/; revision=220768
* Make ng_l2tp irrelevant to data alignment.Alexander Motin2010-03-311-15/+31
| | | | Notes: svn path=/head/; revision=206015
* Add memmove() to the kernel, making the kernel compile with Clang.Ed Schouten2009-02-281-3/+0
| | | | | | | | | | | | | | | When copying big structures, LLVM generates calls to memmove(), because it may not be able to figure out whether structures overlap. This caused linker errors to occur. memmove() is now implemented using bcopy(). Ideally it would be the other way around, but that can be solved in the future. On ARM we don't do add anything, because it already has memmove(). Discussed on: arch@ Reviewed by: rdivacky Notes: svn path=/head/; revision=189170
* Fix typo. Clear session stats instead of config and part of stats.Alexander Motin2008-11-221-1/+1
| | | | | | | | Found with: Coverity Prevent(tm) CID: 2472 Notes: svn path=/head/; revision=185182
* Fix a number of style issues in the MALLOC / FREE commit. I've tried toDag-Erling Smørgrav2008-10-231-1/+2
| | | | | | | | be careful not to fix anything that was already broken; the NFSv4 code is particularly bad in this respect. Notes: svn path=/head/; revision=184214
* Retire the MALLOC and FREE macros. They are an abomination unto style(9).Dag-Erling Smørgrav2008-10-231-5/+4
| | | | | | | MFC after: 3 months Notes: svn path=/head/; revision=184205
* Don't use memcpy() to copy several bytes.Alexander Motin2008-07-281-40/+22
| | | | | | | | Store IDs is host order. It is not so important to bloat code for it. Combine m_adj() and M_PREPEND() into single M_PREPEND(). Notes: svn path=/head/; revision=180943
* Add session ID hashing to speedup incoming packets dispatch in caseAlexander Motin2008-03-161-38/+47
| | | | | | | | of many connections working via the same tunnel. For example, in case of full "client <-> LAC <-> LNS" setup. Notes: svn path=/head/; revision=177279
* Addition to the previous commit. Release inproc in case of memory error.Alexander Motin2008-03-091-0/+1
| | | | Notes: svn path=/head/; revision=176971
* To avoid control data losses do not acknowledge recieving of control packetAlexander Motin2008-03-081-54/+44
| | | | | | | | | 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. Notes: svn path=/head/; revision=176962
* Increase control channel xmit queue to 128 packets.Alexander Motin2007-12-121-1/+1
| | | | | | | | | 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. Notes: svn path=/head/; revision=174554
* Protect struct seq with mutex.Alexander Motin2007-10-121-17/+72
| | | | | | | Approved by: glebius (mentor) Notes: svn path=/head/; revision=172565
* Remove one unneded assertion. It is also checked inAlexander Motin2007-10-121-5/+0
| | | | | | | | | ng_l2tp_seq_check(). Approved by: glebius (mentor) Notes: svn path=/head/; revision=172564
* Replace single rcvdata with 3 distinct to simplify code andAlexander Motin2007-10-121-74/+77
| | | | | | | | | reduce stack usage. Approved by: mentor (glebius) Notes: svn path=/head/; revision=172563
* Remove duplicate variables.Alexander Motin2007-10-121-11/+3
| | | | Notes: svn path=/head/; revision=172562
* Avoid false assertion on transmit and delayed ack timeout with enabled ↵Alexander Motin2007-04-241-23/+34
| | | | | | | | | | | | invariants. Replace callout_pending() by callout_active() to remove race window. Reviewed by: archie Approved by: glebius (mentor) Notes: svn path=/head/; revision=169004
* Global xmit stats calculation fix.Alexander Motin2007-04-231-0/+4
| | | | | | | Approved by: glebius (mentor) Notes: svn path=/head/; revision=168981
* Use the ISO standard function variable vs. a GCC'ism.David E. O'Brien2005-08-101-4/+4
| | | | Notes: svn path=/head/; revision=148915
* - Use ng_callout() instead of callout_reset(9).Gleb Smirnoff2005-01-111-93/+36
| | | | | | | | | | | | - Use callout_pending() instead of our own flags. - Remove home-grown protection of node, which has a scheduled callout(). - Remove spl(9) calls. Tested by: bz Notes: svn path=/head/; revision=140064
* /* -> /*- for license, minor formatting changesWarner Losh2005-01-071-2/+1
| | | | Notes: svn path=/head/; revision=139823
* Implement minimalistic L2TP sessions statistics and correct man pageBjoern A. Zeeb2004-08-031-2/+83
| | | | | | | | | | for L2TP tunnel statistics (which do not take an argument sessionID). Reviewed by: archie Approved by: pjd (mentor) Notes: svn path=/head/; revision=133060
* add a new control message to set sequence numbers on an uninitialized node.Bjoern A. Zeeb2004-08-031-1/+62
| | | | | | | | Reviewed by: archie Approved by: pjd (mentor) Notes: svn path=/head/; revision=133058
* Correct L2TP header offset handling:Bjoern A. Zeeb2004-08-031-2/+2
| | | | | | | | | | | | - according to RFC2661 an offset size of 0 is allowed. - when skipping offset padding do not forget to also skip the 2 octets of the offset size field. Reviewed by: archie Approved by: pjd (mentor) Notes: svn path=/head/; revision=133056
* Having moved metadata usage to mbuf tags, remove code that supportsJulian Elischer2004-06-261-2/+1
| | | | | | | | | the old way of doing it. Submitted by: Gleb Smirnoff <glebius@cell.sick.ru> Notes: svn path=/head/; revision=131155
* Switch to using C99 sparse initialisers for the type methods array.Julian Elischer2004-05-291-12/+9
| | | | | | | | | | | Should make no binary difference. Submitted by: Gleb Smirnoff <glebius@cell.sick.ru> Reviewed by: Harti Brandt <harti@freebsd.org> MFC after: 1 week Notes: svn path=/head/; revision=129823
* Rename internal structure to fix cut & paste error.Archie Cobbs2004-04-041-3/+3
| | | | | | | | Submitted by: Bjoern A. Zeeb <bzeeb+freebsd@zabbadoz.net> MFC After: 3 days Notes: svn path=/head/; revision=127866
* Don't use ovbcopy().Dag-Erling Smørgrav2003-04-041-1/+1
| | | | Notes: svn path=/head/; revision=113073
* Back out M_* changes, per decision of the TRB.Warner Losh2003-02-191-7/+7
| | | | | | | Approved by: trb Notes: svn path=/head/; revision=111119
* Remove M_TRYWAIT/M_WAITOK/M_WAIT. Callers should use 0.Alfred Perlstein2003-01-211-7/+7
| | | | | | | Merge M_NOWAIT/M_DONTWAIT into a single flag M_NOWAIT. Notes: svn path=/head/; revision=109623
* o Untangle the confusion with the malloc flags {M_WAITOK, M_NOWAIT} andBosko Milekic2002-12-191-5/+5
| | | | | | | | | | | | | the mbuf allocator flags {M_TRYWAIT, M_DONTWAIT}. o Fix a bpf_compat issue where malloc() was defined to just call bpf_alloc() and pass the 'canwait' flag(s) along. It's been changed to call bpf_alloc() but pass the corresponding M_TRYWAIT or M_DONTWAIT flag (and only one of those two). Submitted by: Hiten Pandya <hiten@unixdaemons.com> (hiten->commit_count++) Notes: svn path=/head/; revision=108107
* Don't use "NULL" when "0" is really meant.Archie Cobbs2002-08-221-1/+1
| | | | Notes: svn path=/head/; revision=102244
* New L2TP netgraph node type.Archie Cobbs2002-08-201-0/+1479
Obtained from: Packet Design Notes: svn path=/head/; revision=102195