summaryrefslogtreecommitdiffstats
path: root/sys/netgraph/ng_pppoe.c
Commit message (Collapse)AuthorAgeFilesLines
* Use more compact LIST instead of TAILQ for session hash.mav2008-03-031-62/+32
| | | | | Add all listening hooks into LIST to simplify searches. Use ng_findhook() instead of own equal implementation.
* Make session ID generator to use session ID hash.mav2008-03-021-40/+37
| | | | Make session ID generator thread-safe.
* Do not use bcmp() to compare two bytes with constants.mav2008-02-061-3/+2
|
* Tune the message for better informativity.mav2008-02-011-1/+2
| | | | Print the hook pointer as other functions do.
* Band-aid recent commit by mav by replacing a variable in a CTR statement withbenno2008-02-011-1/+1
| | | | | | | the variable that appears as if it should've been there. Pointy hat to: mav Not tested either by: benno
* Implement Session-ID hashing to improve receive performance scalabilitymav2008-01-311-31/+70
| | | | for big number of concurrent sessions.
* Add support for optional "AC-Name\Service-Name" syntax at NGM_PPPOE_CONNECTmav2007-12-291-6/+37
| | | | | | | argument. It allows ppp, mpd or any other node consumer to request connection to specified access concentrator. Proposed by: Alexander A. Burylov <burylov@mail.ru>
* Fix incorrectly placed bracket in pppoe_find_svc().mav2007-12-261-1/+1
|
* Split ng_pppoe_rcvdata() function into three hook-specific onesmav2007-10-141-464/+465
| | | | to simplify code and reduce stack usage.
* Remove ng_pppoe_sendpacket() function to simplify code as it is calledmav2007-10-141-79/+39
| | | | as much times as it has cases inside of it.
* Dead code removal.mav2007-09-211-11/+0
| | | | Approved by: re (kensmith), glebius (mentor)
* This is optimization of ether and debug hooks determination. Itmav2007-09-211-44/+27
| | | | | | | simplifies code and should speedup pppoe_findsession() function which is called for every incoming packet. Approved by: re (kensmith), glebius (mentor)
* This patch fixes thread unsafe usage of global pkt_hdrmav2007-09-211-22/+20
| | | | | | variable. Second part is not so important, but IMO is also good. Approved by: re (kensmith), glebius (mentor)
* Some perfectionizm against last revision.glebius2006-08-101-2/+2
| | | | Submitted by: ru
* Fix ng_pppoe(4) after turning off "autosrc feature" on ng_ether(4).glebius2006-08-091-20/+72
| | | | | | | | | | | | - Store the Ethernet header in node softc. - Initialize header with dst addr and ethertype in node constructor method. - In node connect method send NGM_ETHER_GET_ENADDR message downwards. - If received reply from ng_ether(4) store the src addr in softc. - Add NGM_PPPOE_SETENDADDR message that allows user to override the address with whatever he/she wants.
* - Use log(9) instead of printf(9).glebius2006-08-071-26/+44
| | | | | | | | - Print node ID, where possible. - Prepend log messages with function name, or at least with "ng_pppoe". Reviewed by: julian Tested by: Joao Barros <joao.barros gmail.com>
* o Introduce D-Link compat mode, that is default to off and can be setglebius2006-01-271-59/+80
| | | | | | | | | | by NGM_PPPOE_SETMODE message. When D-Link compat mode is on, we will broadcast PADI with empty Service-Name to all listening hooks. o Rewrite the compatibility options. Before we had two modes - standard and non-standard (aka 3Com). Now we have standard mode and two compat flags, that can be combined. o Be consistent and do s/STUPID/3COM/g. I don't say that 3Com mode isn't stupid, just want to make code easier to read.
* From the RFC2516 it is not clear, what is the correct behavior for aglebius2006-01-261-43/+117
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | PPPoE AC, servicing a specific Service-Name, when client sends a PADI with an empty Service-Name. Should it reply with all available service names or should it be silent? Our implementation had chosen the latter, while some other had chosen the former (they say Linux and Cisco). Now some PPPoE clients appear, that rely on the assumption that AC will send all names in a PADO reply to a PADI with wildcard Service-Name. These clients can't connect to FreeBSD AC. I have requested comments from authors of RFC2516 via email, but received no reply. This change makes FreeBSD AC compatible with D-Link DI-614+ and D-Link DI-624+ SOHO routers, and probably others. Big thanks to D-Link's Russian office, namely Victor Platov, for assistance and support in investigation and testing of this change. Details: o Split pppoe_match_svc() into three different functions serving different purposes: - pppoe_match_svc() - match non-empty Service-Name tag from PADI against all available hooks in listening state. - pppoe_find_svc() - check that given Service-Name is not yet registered. - pppoe_broadcast_padi() - send a copy of PADI packet with empty Service-Name tag to all listening hooks. o For NGM_PPPOE_LISTEN message use pppoe_find_svc(). o In ng_pppoe_rcvdata() in a PADI case use pppoe_match_svc() for a non-empty Service-Name tag, and pppoe_broadcast_padi() in either case. A side effect from the above changes is that now pppoed(8) and mpd will reply to a empty Service-Name PADI sending a PADO with two Service-Name tags - an empty one and correct one. This is not fatal, and will be corrected in pppoed(8) and mpd later. No need to update node interface version. Supported by: D-Link
* - Remove debugging printfs.glebius2006-01-211-240/+243
| | | | | | | - Add some ktr(4) debugging. - Whitespaces at eols. - Tidy up comments. - u_intXX -> uintXX
* Dej'a vu of revision 1.35glebius2005-09-191-1/+1
| | | | | PR: kern/86258 Submitted by: Hiroshi Oota <ghelp excite.co.jp>
* Remove obsoleted sysctl interface for switching between standard and 3Comglebius2005-07-051-39/+1
| | | | | | | | | | PPPoE modes. The interface was declared obsoleted before 5.3-RELEASE. When running as access concentrator ng_pppoe(4) supports both modes simultanously. When running as client mode can be swicthed in ppp(8) configuration. Approved by: re (scottl)
* Remove ng_connect_t where it is unused. Probably it remained from ng_source.c.glebius2005-03-141-13/+0
|
* Drop mythical module dependency on ng_ether.ru2005-02-131-2/+0
|
* /* -> /*- for license, minor formatting changesimp2005-01-071-2/+3
|
* - Use ng_callout() instead of timeout()glebius2004-12-081-30/+23
| | | | | | | - remove spl(9) calls Tested by: Ilya Pizik Approved by: julian (mentor)
* Since last change moved ';' from macro to code, we need to embraceglebius2004-10-311-2/+2
| | | | | | | | macros with 'do {} while (0)' to avoid error in case macro is not defined. Prodded by: julian, archie Pointy hat to: glebius
* Rename debug macro to DBG and indent it properly.glebius2004-10-281-23/+21
| | | | | Requested by: maxim Approved by: julian (mentor)
* Another stupid error from my side. PPPOE_NONSTANDARD was first definedglebius2004-08-011-9/+9
| | | | | | | | in enum {}, and then redefined with #define. No warnings from compiler, though. Submitted by: bz Pointy hat to: glebius
* When node is server serve both standard RFC2516 and non-standard 3Comglebius2004-07-271-42/+111
| | | | | | | | | | clients simultaneously. When node is client its mode is configured with a control message. sysctl net.graph.nonstandard_pppoe is deprecated but kept for backward compatibility for some time. Approved by: julian
* Add a note indicating that the eh_prototype field used to constructrwatson2004-07-141-0/+4
| | | | ethernet headers is unsynchronized.
* Having moved metadata usage to mbuf tags, remove code that supportsjulian2004-06-261-2/+2
| | | | | | the old way of doing it. Submitted by: Gleb Smirnoff <glebius@cell.sick.ru>
* Switch to using C99 sparse initialisers for the type methods array.julian2004-05-291-12/+10
| | | | | | | | Should make no binary difference. Submitted by: Gleb Smirnoff <glebius@cell.sick.ru> Reviewed by: Harti Brandt <harti@freebsd.org> MFC after: 1 week
* Get rid of the deprecated *LEN constants in favour of the newharti2004-01-261-2/+2
| | | | *SIZ constants that include the trailing \0 byte.
* The default value of net.graph.nonstandard_pppoe is changed to -1,yar2003-12-191-2/+2
| | | | | | | | | | | | | | | | which means "always stay in the standard mode of PPPoE operation regardless of any junk floating around." As the referenced PR stated clearly, the old default setting of 0 was extremely dangerous because it opened a possibility for a spurious frame not only to put down a single PPPoE node running FreeBSD, but to plague *every* FreeBSD node in a PPPoE network in such a way that those nodes would keep poisoning each other until rebooted simultaneously. PR: kern/47920 Reviewed by: Gleb Smirnoff <glebius <at> cell.sick.ru> MFC after: 1 week
* Fixed compilation on 64-bit platforms.ru2003-12-191-2/+2
|
* There are two modes of ng_pppoe operation, standard andyar2003-12-181-11/+38
| | | | | | | | | | | | | | | | | | | nonstandard. They differ in the values of certain fields in the PPPoE frame. Previously, ng_pppoe would start in standard mode, yet switch to nonstandard one upon reception of a single nonstandard frame. After having done so, ng_pppoe would be unable to interact with standard PPPoE peers. Thus, a DoS condition existed that could be triggered by a buggy peer or malicious party. Since few people have expressed their displeasure WRT this problem, the default operation of ng_pppoe is left untouched for now. However, a new value for the sysctl net.graph.nonstandard_pppoe is introduced, -1, which will force ng_pppoe stay in standard mode regardless of any bogus frames floating around. PR: kern/47920 Submitted by: Gleb Smirnoff <glebius <at> cell.sick.ru> MFC after: 1 week
* Back out M_* changes, per decision of the TRB.imp2003-02-191-9/+9
| | | | Approved by: trb
* Remove M_TRYWAIT/M_WAITOK/M_WAIT. Callers should use 0.alfred2003-01-211-9/+9
| | | | Merge M_NOWAIT/M_DONTWAIT into a single flag M_NOWAIT.
* Use %z to print a size_t value.jhb2002-11-081-1/+1
|
* use __packed.alfred2002-09-231-2/+2
|
* Don't use "NULL" when "0" is really meant.archie2002-08-221-3/+3
|
* NUL terminate the ACNAME passed to userland.brian2002-06-221-3/+4
|
* Const'ify variables to make it clear we're not writing to the mbuf data.archie2002-06-051-31/+33
| | | | | Reviewed by: julian, brian MFC after: 1 week
* Fix GCC warnings caused by initializing a zero length array. In the process,archie2002-05-311-4/+4
| | | | | | | simply things a bit by getting rid of 'struct ng_parse_struct_info' which was useless because it only contained one field. MFC after: 2 weeks
* Add a NGM_PPPOE_SESSIONID message to the ng_pppoe node.brian2002-05-141-0/+19
| | | | | | | This message is sent to the control socket when the SessionID is established. Approved by: archie (after a very cursory glance)
* Send a NGM_PPPOE_ACNAME message to userland when a node is connected.brian2002-02-201-1/+23
| | | | | | Submitted by: Andre Albsmeier <andre@albsmeier.net> Shuffled about by: brian Approved by: julian
* Update to C99, s/__FUNCTION__/__func__/,obrien2001-12-101-1/+1
| | | | also don't use ANSI string concatenation.
* MFS: change name of sysctl to something more diplomatic.julian2001-09-041-9/+9
|
* Pack struct uniqtag declarations to stop our data field from being pushedbrian2001-08-021-2/+2
| | | | | | | 4 bytes to the right on the alpha. Tested by: Thomas Pornin <Thomas.Pornin@ens.fr> MFC after: 1 week
* If an attempt is made to LISTEN for a service tag that's already beingbrian2001-07-251-14/+28
| | | | | | | | | | | | | LISTENed for, return EEXISTS. Only match the magic "*" service tag if no other LISTEN service tags match. Require an explicit LISTEN for an empty service tag in order to match empty service requests. Approved by: julian MFC after: 3 days
OpenPOWER on IntegriCloud