summaryrefslogtreecommitdiffstats
path: root/sys/net/if_spppsubr.c
Commit message (Collapse)AuthorAgeFilesLines
* Commit step 1 of the vimage project, (network stack)bz2008-08-171-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | virtualization work done by Marko Zec (zec@). This is the first in a series of commits over the course of the next few weeks. Mark all uses of global variables to be virtualized with a V_ prefix. Use macros to map them back to their global names for now, so this is a NOP change only. We hope to have caught at least 85-90% of what is needed so we do not invalidate a lot of outstanding patches again. Obtained from: //depot/projects/vimage-commit2/... Reviewed by: brooks, des, ed, mav, julian, jamie, kris, rwatson, zec, ... (various people I forgot, different versions) md5 (with a bit of help) Sponsored by: NLnet Foundation, The FreeBSD Foundation X-MFC after: never V_Commit_Message_Reviewed_By: more people than the patch
* Cast the ioctl define to the type of the variable being switched on.mjacob2007-06-101-2/+2
|
* MFp4: 92972, 98913 + one more changebz2006-12-121-6/+10
| | | | | | | In ip6_sprintf no longer use and return one of eight static buffers for printing/logging ipv6 addresses. The caller now has to hand in a sufficiently large buffer as first argument.
* Correct buffer overflow in the handling of LCP options in ppp(4)cperciva2006-08-231-12/+24
| | | | Security: FreeBSD-SA-06:18.ppp
* Use TAILQ_FOREACH instead of poking around in the guts of the listbrooks2006-07-151-8/+5
| | | | macros.
* Fix -Wundef from compiling the amd64 LINT.ru2005-12-041-1/+1
|
* Use monotonic time_uptime instead of 'time_second' as timebaseandre2005-09-191-3/+3
| | | | for timeouts.
* Propagate rename of IFF_OACTIVE and IFF_RUNNING to IFF_DRV_OACTIVE andrwatson2005-08-091-16/+18
| | | | | | | | | | | | | | IFF_DRV_RUNNING, as well as the move from ifnet.if_flags to ifnet.if_drv_flags. Device drivers are now responsible for synchronizing access to these flags, as they are in if_drv_flags. This helps prevent races between the network stack and device driver in maintaining the interface flags field. Many __FreeBSD__ and __FreeBSD_version checks maintained and continued; some less so. Reviewed by: pjd, bz MFC after: 7 days
* scope cleanup. with this changeume2005-07-251-2/+6
| | | | | | | | | | | | | | | | | | | - most of the kernel code will not care about the actual encoding of scope zone IDs and won't touch "s6_addr16[1]" directly. - similarly, most of the kernel code will not care about link-local scoped addresses as a special case. - scope boundary check will be stricter. For example, the current *BSD code allows a packet with src=::1 and dst=(some global IPv6 address) to be sent outside of the node, if the application do: s = socket(AF_INET6); bind(s, "::1"); sendto(s, some_global_IPv6_addr); This is clearly wrong, since ::1 is only meaningful within a single node, but the current implementation of the *BSD kernel cannot reject this attempt. Submitted by: JINMEI Tatuya <jinmei__at__isl.rdc.toshiba.co.jp> Obtained from: KAME
* Stop embedding struct ifnet at the top of driver softcs. Instead thebrooks2005-06-101-44/+71
| | | | | | | | | | | | | | | | | | | | struct ifnet or the layer 2 common structure it was embedded in have been replaced with a struct ifnet pointer to be filled by a call to the new function, if_alloc(). The layer 2 common structure is also allocated via if_alloc() based on the interface type. It is hung off the new struct ifnet member, if_l2com. This change removes the size of these structures from the kernel ABI and will allow us to better manage them as interfaces come and go. Other changes of note: - Struct arpcom is no longer referenced in normal interface code. Instead the Ethernet address is accessed via the IFP2ENADDR() macro. To enforce this ac_enaddr has been renamed to _ac_enaddr. - The second argument to ether_ifattach is now always the mac address from driver private storage rather than sometimes being ac_enaddr. Reviewed by: sobomax, sam
* /* -> /*- for license, minor formatting changesimp2005-01-071-1/+2
|
* Add FR support to sppp (MFCronyx).rik2004-12-281-12/+38
| | | | | | | | | | Silence on: net@, current@, hackers@. No objections: joerg Requested by: by many (mostly Cronyx) users for a long long time. MFC after: 10 days PR: kern/21771, kern/66348
* Kill double inclusion for <netinet/in.h> and <netinet/in_systm.h>.rik2004-12-141-2/+0
|
* Make sppp MPSAFE.rik2004-12-121-110/+229
| | | | | | | MPSAFE could be turned off by IFF_NEEDSGIANT. Silence on: net@, current@, hackers@. No objections: joerg
* Apply error and success logic consistently to the function netisr_queue() andandre2004-08-271-1/+1
| | | | | | | | | | | | | | | | | | its users. netisr_queue() now returns (0) on success and ERRNO on failure. At the moment ENXIO (netisr queue not functional) and ENOBUFS (netisr queue full) are supported. Previously it would return (1) on success but the return value of IF_HANDOFF() was interpreted wrongly and (0) was actually returned on success. Due to this schednetisr() was never called to kick the scheduling of the isr. However this was masked by other normal packets coming through netisr_dispatch() causing the dequeueing of waiting packets. PR: kern/70988 Found by: MOROHOSHI Akihiko <moro@remus.dti.ne.jp> MFC after: 3 days
* Do a pass over all modules in the kernel and make them return EOPNOTSUPPphk2004-07-151-2/+1
| | | | | | | | for unknown events. A number of modules return EINVAL in this instance, and I have left those alone for now and instead taught MOD_QUIESCE to accept this as "didn't do anything".
* Do not m_free packet since IF_HANDOFF (called from netisr_queue) willrik2004-06-281-1/+1
| | | | do it for us, just count it.
* Do not count loobacks as other fuilures.rik2004-06-251-1/+2
| | | | | | As a result magic will not be rejected any more in case of loopback. Discussed with: joerg@
* Replace IF_HANDOFF with new IFQ_HANDOFF to enqueue with ALTQ once enabled onmlaier2004-06-151-5/+10
| | | | the respective drivers.
* Link ALTQ to the build and break with ABI for struct ifnet. Please recompilemlaier2004-06-131-2/+2
| | | | | | | | | | | | your (network) modules as well as any userland that might make sense of sizeof(struct ifnet). This does not change the queueing yet. These changes will follow in a seperate commit. Same with the driver changes, which need case by case evaluation. __FreeBSD_version bump will follow. Tested-by: (i386)LINT
* Keepalive timer should be added if we does not have any sppp consumers beforerik2004-05-251-2/+2
| | | | and should be deleted if we do not have any anymore.
* Compare spppq to NULL instead of using spppq as a boolean.rwatson2004-03-141-2/+2
|
* Constify interactive_ports, as its value is static, and therefore doesn'trwatson2004-03-131-1/+1
| | | | require synchronization.
* Remove #ifdef for ancient source FreeBSD compat.phk2004-01-211-11/+0
|
* Replace the if_name and if_unit members of struct ifnet with new membersbrooks2003-10-311-1/+1
| | | | | | | | | | | | | if_xname, if_dname, and if_dunit. if_xname is the name of the interface and if_dname/unit are the driver name and instance. This change paves the way for interface renaming and enhanced pseudo device creation and configuration symantics. Approved By: re (in principle) Reviewed By: njl, imp Tested On: i386, amd64, sparc64 Obtained From: NetBSD (if_xname)
* Use M_WAITOK instead of M_WAIT in sppp_attach().gj2003-07-261-1/+1
|
* Finish driving a stake through the heart of netns and the associatedpeter2003-03-051-25/+0
| | | | | | ifdefs scattered around the place - its dead Jim! The SMB stuff had stolen AF_NS, make it official.
* Update netisr handling; Each SWI now registers its queue, and all queuejlemon2003-03-041-30/+16
| | | | | | | | | | drain routines are done by swi_net, which allows for better queue control at some future point. Packets may also be directly dispatched to a netisr instead of queued, this may be of interest at some installations, but currently defaults to off. Reviewed by: hsu, silby, jayanth, sam Sponsored by: DARPA, NAI Labs
* Back out M_* changes, per decision of the TRB.imp2003-02-191-6/+6
| | | | Approved by: trb
* o Restore an interrupt priority level before return.maxim2003-02-171-0/+2
| | | | | | Submitted by: Roman Kurakin <rik@cronyx.ru> Reviewed by: joerg MFC after: 5 days
* Remove M_TRYWAIT/M_WAITOK/M_WAIT. Callers should use 0.alfred2003-01-211-6/+6
| | | | Merge M_NOWAIT/M_DONTWAIT into a single flag M_NOWAIT.
* Be consistent about functions being static.phk2002-10-161-2/+2
| | | | Spotted by: FlexeLint
* s/__attribute__((__packed__))/__packed/galfred2002-09-231-3/+3
|
* Replace various spelling with FALLTHROUGH which is lint()ablecharnier2002-08-251-7/+7
|
* Fix a misplaced break statement within a switch that accidentally madejoerg2002-05-101-1/+1
| | | | | | | | | | it into an "#ifdef INET6" block. This caused a (harmless but annoying) EINVAL return value to be sent even though the operation completed successfully. PR: kern/37786 Submitted by: Ari Suutari <ari.suutari@syncrontech.com>,David Malone <dwmalone@maths.tcd.ie> MFC after: 1 day
* "pointers are not permitted as case values", so force the macros to ints.obrien2002-05-011-2/+2
|
* Change callers of mtx_init() to pass in an appropriate lock type name. Injhb2002-04-041-2/+2
| | | | | | | most cases NULL is passed, but in some cases such as network driver locks (which use the MTX_NETWORK_LOCK macro) and UMA zone locks, a name is used. Tested on: i386, alpha, sparc64
* Implement an option to administratively disable the negotiation ofjoerg2001-12-301-7/+50
| | | | | | | | | | | | | | | | | IPv6 on an sppp interface. In an IPv6-enabled kernel, every IPv6 interface automatically gets an IPv6 address assigned (and IPv6 multicast packets sent at initialization time). For sppp links where we know our remote peer wouldn't support IPv6 at all, there's no point in attempting to negotiate IPV6CP (or to even dial out for an IPv6 packet at all for dial-on-demand interfaces). I wish there were a more generic way to administratively disable IPv6 on an interface instead. ume told me there isn't. While i was at it, converted both, enable_vj and enable_ipv6 into flag bits in struct sppp (enable_vj used to be an int of its own). MFC after: 1 month
* Merge last-minute fix from the i4b file made by gj:joerg2001-12-301-2/+4
| | | | | | | Protect mtx_init() invocations with mtx_intialized() checks to avoid a reported panic. MFC after: 1 month
* We explicitly close LCP when going to state CLOSED, so we better openjoerg2001-12-301-0/+4
| | | | | | | | it again when going from INITIAL to STARTING. This has been done for passive or auto-conecting interfaces always, but not for permanent ones. Obtained from: NetBSD (rev 1.32)
* run IPCP only if we have IPv4 in kerneljoerg2001-12-301-1/+7
| | | | | Obtained from: NetBSD (rev 1.19) MFC after: 1 month
* Fix a long-standing blatant bug where the operator precedence betweenjoerg2001-12-301-4/+4
| | | | | | | | & and && has been botched. This was likely the cause for some havoc with various negotiation cases of sppp in the past. Obtained from: NetBSD (rev 1.13) MFC after: 1 week
* Fix compilation without INET (though not really tested yet withoutjoerg2001-12-301-6/+10
| | | | | | | INET). Obtained from: NetBSD (rev 1.12) MFC after: 1 month
* Add the `packed' attribute to structures which describe wire protocoljoerg2001-12-301-4/+4
| | | | | | | data formats. Obtained from: NetBSD (rev 1.6) MFC after: 1 month
* Extend the hack where 0.0.0.1 meant `any address for remote isjoerg2001-12-301-2/+2
| | | | | | | acceptable' to addresses 0.0.0.*. This allows for multiple such interfaces. MFC after: 1 month
* Fix the handling of VJ uncompression. Unfortunately, tcp_uncompress()joerg2001-12-301-14/+39
| | | | | | | | | | | | | | | | | | | | makes the implied assumption there were another 128 bytes of space in front of the packet handed off to it... which is not the case for sppp. This could easily end up in corrupting random memory. This fix is about the same as revs 1.6, 1.8, and 1.9 from our i4b_ispppsubr.c. Also fixed IPCP option negotiation to zero out the options when starting IPCP. Otherwise, if negotiation parameters change between various IPCP startups, it could happen that old options would still be requested (this happened if VJ was turned off, and ended up in half off the link still negotiating for VJ compression). IMHO, the base system's sppp is now feature-wise up to date with the one in the i4b part of the tree, so the latter can be disabled. MFC after: 1 month
* Convert sppp_params() to use a malloced structure in order to reducejoerg2001-12-281-45/+65
| | | | | | | | kernel stack usage. This effectively merges rev 1.3 of i4b's i4b_ispppsubr.c. MFC after: 1 month
* Fix my breakage to the low-level hardware sync drivers brought by thejoerg2001-12-281-25/+26
| | | | | | | | | | | | inclusion of VJ compression into sppp. Now, instead of the need to include this and that and everything plus the kitchensink in each of those drivers, struct sppp uses struct slcompress as an opaque structure only referenced by a pointer. The actual structure is then malloced at initialization time. While i was at it, also fixed a bug where received VJ packets would only be recognized if INET6 was defined.
* Implement timestamps so i4b/driver/i4b_isppp.c can derive the idlejoerg2001-12-281-4/+25
| | | | | | | | | | | | time from the PPP packets sent. This effectively merges rev 1.2 of the old i4b_ispppsubr.c, with the exception that i eventually ended up in debugging and fixing it so the idle time is now really detected. ;-) (The version in i4b simply doesn't work right since it still accounts for incoming LCP echo packets which it is supposed to ignore for idle time considerations...) Obtained from: i4b MFC after: 1 month
* Break out the relevant fields from struct sppp into a structjoerg2001-12-271-1/+7
| | | | | | | | | | | | sppp_parms that are needed for the SPPPIO[GS]DEFS ioctl commands. This allows it to keep struct sppp inside #ifdef _KERNEL (where it belongs), and prevents userland programs that wish to include <net/if_sppp.h> from including the earth, the hell, and the universe before the are able to resolve all the kernel-internal stuff that's in struct sppp. Discussed with: hm MFC after: 1 month
OpenPOWER on IntegriCloud