summaryrefslogtreecommitdiffstats
path: root/sys/net
Commit message (Collapse)AuthorAgeFilesLines
* Fix big-endian build.dfr2004-06-141-2/+2
|
* Unbreak non-ALTQ kernel linking. I forgot about tbr_dequeue.mlaier2004-06-141-1/+1
| | | | | | | | | In the end drivers should be building with ALTQ checks by default, but for now build them with the old macros for non-ALTQ kernels. Note: Check new features w/ LINT *and* w/ LINT minus the new feature. Found-by: rwatson
* Add MAC framework bits to the output path.dfr2004-06-131-0/+6
|
* Remove advertising clause.dfr2004-06-131-4/+0
|
* Link ALTQ to the build and break with ABI for struct ifnet. Please recompilemlaier2004-06-135-12/+228
| | | | | | | | | | | | 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
* Add a new driver to support IP over firewire. This driver is intended todfr2004-06-133-0/+941
| | | | | | | | conform to the rfc2734 and rfc3146 standard for IP over firewire and should eventually supercede the fwe driver. Right now the broadcast channel number is hardwired and we don't support MCAP for multicast channel allocation - more infrastructure is required in the firewire code itself to fix these problems.
* Extend coverage of SOCK_LOCK(so) to include so_count, the socketrwatson2004-06-122-1/+6
| | | | | | | | | | | | | | | | | | | | | | | | | reference count: - Assert SOCK_LOCK(so) macros that directly manipulate so_count: soref(), sorele(). - Assert SOCK_LOCK(so) in macros/functions that rely on the state of so_count: sofree(), sotryfree(). - Acquire SOCK_LOCK(so) before calling these functions or macros in various contexts in the stack, both at the socket and protocol layers. - In some cases, perform soisdisconnected() before sotryfree(), as this could result in frobbing of a non-present socket if sotryfree() actually frees the socket. - Note that sofree()/sotryfree() will release the socket lock even if they don't free the socket. Submitted by: sam Sponsored by: FreeBSD Foundation Obtained from: BSD/OS
* Constify raw_sendspace and raw_recvspace, as they're not mutable.rwatson2004-06-111-2/+2
|
* Switch to conditionally acquiring and dropping Giant around calls intorwatson2004-06-111-2/+2
| | | | | | ifp->if_output() basedd on debug.mpsafenet. That way once bpfwrite() can be called without Giant, it will acquire Giant (if desired) before entering the network stack.
* Un-staticize 'dst' sockaddr in the stack of bpfwrite() to preventrwatson2004-06-111-1/+2
| | | | | | | the need to synchronize access to the structure. I believe this should fit into the stack under the necessary circumstances, but if not we can either add synchronization or use a thread-local malloc for the duration.
* Introduce a netisr to deliver kernel-generated routing, avoidingrwatson2004-06-092-4/+53
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | recursive entering of the socket code from the routing code: - Modify rt_dispatch() to bundle up the sockaddr family, if any, associated with a pending mbuf to dispatch to routing sockets, in an m_tag on the mbuf. - Allocate NETISR_ROUTE for use by routing sockets. - Introduce rtsintrq, an ifqueue to be used by the netisr, and introduce rts_input(), a function to unbundle the tagged sockaddr and inject the mbuf and address into raw_input(), which previously occurred in rt_dispatch(). - Introduce rts_init() to initialize rtsintrq, its mutex, and register the netisr. Perform this at the same point in system initialization as setup of the domains. This change introduces asynchrony between the generation of a pending routing socket message and delivery to sockets for use by userspace. It avoids socket->routing->rtsock->socket use and helps to avoid lock order reversals between the routing code and socket code (in particular, raw socket control blocks), as route locks are held over calls to rt_dispatch(). Reviewed by: "George V.Neville-Neil" <gnn@neville-neil.com> Conceptual head nod by: sam
* Use ldisc_[de]register() instead of frobbing linesw[] directly.phk2004-06-071-1/+2
|
* Add helper functions to calculate the standard ethernet CRC innaddy2004-06-022-0/+75
| | | | | | | | | little/big endian fashion, so that network drivers can just reference the standard implementation and don't have to bring their own. As discussed on arch@. Obtained from: NetBSD
* add missing #include <sys/module.h>phk2004-05-307-0/+7
|
* Add some missing <sys/module.h> includes which are masked by thephk2004-05-301-0/+1
| | | | one on death-row in <sys/kernel.h>
* Make the comment for DLT_NULL slightly more accurate.dwmalone2004-05-301-1/+1
| | | | | | PR: 62272 Submitted by: Radim Kolar <hsn@netmag.cz> MFC after: 1 week
* if_printf() won't emit a newline unless told to.yar2004-05-261-2/+3
|
* 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.
* After all the relevant drivers have been fixed, fix vlan(4) itselfyar2004-05-251-27/+27
| | | | | | | | | | WRT manipulating capabilities of the parent interface: - use ioctl(SIOCSIFCAP) to toggle VLAN_MTU (the way that was done before was just wrong); - use the right order of conditional clauses to set the MTU fudge (that is logically independent from toggling VLAN_MTU.)
* Remove another redundant if_output initialization.mux2004-05-241-1/+0
|
* Consult parent's if_capenable for active VLAN-related capabilities.yar2004-05-231-1/+8
| | | | | | | | | | This change is possible since all the relevant drivers have been fixed to set if_capenable properly. The field if_capabilities tracks supported capabilities, which may be disabled administratively. Inheriting checksum offload support from the parent interface isn't that easy because the checksumming capabilities of the parent may be toggled on the fly. Disable the code for now.
* Added dependency on the miibus module.ru2004-05-211-0/+1
|
* Zero the un-used portions of the struct sockaddr data before sendingcsjp2004-05-101-0/+1
| | | | | | | | | | | | | it back to userspace, so it does not break bind(2) on raw sockets in jails. Currently some processes, like traceroute(8) construct a routing request to determine its source address based on the destination. This sockaddr data is fed directly to bind(2). When bind calls ifa_ifwithaddr(9) to make sure the address exists on the interface, the comparison will fail causing bind(2) to return EADDRNOTAVAIL if the data wasnt zero'ed before initialization. Approved by: bmilekic (mentor)
* Add route.h to pick up the rt_ifmsg() declaration.scottl2004-05-041-0/+1
|
* o Fix misindentation in the previous commit.maxim2004-05-031-4/+4
|
* Link state change notification of ethernet media to the routing socket.andre2004-05-033-0/+34
| | | | | | | | | | | | | | | o Extend the if_data structure with an ifi_link_state field and provide the corresponding defines for the valid states. o The mii_linkchg() callback updates the ifi_link_state field and calls rt_ifmsg() to notify listeners on the routing socket in addition to the kqueue KNOTE. o If vlans are configured on a physical interface notify and update all vlan pseudo devices as well with the vlan_link_state() callback. No objections by: sam, wpaul, ru, bms Brucification by: bde
* Give jail(8) the feature to allow raw sockets from within abmilekic2004-04-261-2/+13
| | | | | | | | | | | | | | | | | | | | | jail, which is less restrictive but allows for more flexible jail usage (for those who are willing to make the sacrifice). The default is off, but allowing raw sockets within jails can now be accomplished by tuning security.jail.allow_raw_sockets to 1. Turning this on will allow you to use things like ping(8) or traceroute(8) from within a jail. The patch being committed is not identical to the patch in the PR. The committed version is more friendly to APIs which pjd is working on, so it should integrate into his work quite nicely. This change has also been presented and addressed on the freebsd-hackers mailing list. Submitted by: Christian S.J. Peron <maneo@bsdpro.com> PR: kern/65800
* This commit does two things:luigi2004-04-255-61/+43
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 1. rt_check() cleanup: rt_check() is only necessary for some address families to gain access to the corresponding arp entry, so call it only in/near the *resolve() routines where it is actually used -- at the moment this is arpresolve(), nd6_storelladdr() (the call is embedded here), and atmresolve() (the call is just before atmresolve to reduce the number of changes). This change will make it a lot easier to decouple the arp table from the routing table. There is an extra call to rt_check() in if_iso88025subr.c to determine the routing info length. I have left it alone for the time being. The interface of arpresolve() and nd6_storelladdr() now changes slightly: + the 'rtentry' parameter (really a hint from the upper level layer) is now passed unchanged from *_output(), so it becomes the route to the final destination and not to the gateway. + the routines will return 0 if resolution is possible, non-zero otherwise. + arpresolve() returns EWOULDBLOCK in case the mbuf is being held waiting for an arp reply -- in this case the error code is masked in the caller so the upper layer protocol will not see a failure. 2. arpcom untangling Where possible, use 'struct ifnet' instead of 'struct arpcom' variables, and use the IFP2AC macro to access arpcom fields. This mostly affects the netatalk code. === Detailed changes: === net/if_arcsubr.c rt_check() cleanup, remove a useless variable net/if_atmsubr.c rt_check() cleanup net/if_ethersubr.c rt_check() cleanup, arpcom untangling net/if_fddisubr.c rt_check() cleanup, arpcom untangling net/if_iso88025subr.c rt_check() cleanup netatalk/aarp.c arpcom untangling, remove a block of duplicated code netatalk/at_extern.h arpcom untangling netinet/if_ether.c rt_check() cleanup (change arpresolve) netinet6/nd6.c rt_check() cleanup (change nd6_storelladdr)
* fix one typo and remove one wrong lineluigi2004-04-251-2/+1
|
* Correct and extend the description of the behaviour of rt_check().luigi2004-04-241-7/+27
|
* document the locking behaviour of the functions that accessluigi2004-04-241-3/+15
| | | | the routing table.
* arpcom untangling:luigi2004-04-242-3/+3
| | | | | | | | | | consistently with the rest of the code, use IFP2AC(ifp) to access the arpcom structure given the ifp. In this case also fix a difference in assumptions WRT the rest of the net/ sources: it is not the 'struct *softc' that starts with a 'struct arpcom', but a 'struct arpcom' that starts with a 'struct ifnet'
* arpcom untangling:luigi2004-04-241-5/+6
| | | | do not use struct arpcom directly, rather use IFP2AC(ifp).
* arpcom untangling:luigi2004-04-243-10/+7
| | | | | | | | | - use ifp instead if &ac->ac_if in a couple of nd6* calls; this removes a useless dependency. - use IFP2AC(ifp) instead of an extra variable to point to the struct arpcom; this does not remove the nesting dependency between arpcom and ifnet but makes it more evident.
* Add the comment of the previous commit to the source file directly.andre2004-04-231-1/+5
| | | | Requested by: ru
* Call ip_output() with IP_FORWARD flag to prevent it from overwriting theandre2004-04-231-2/+2
| | | | | | | | ip_id again. ip_id is already set to the ip_id of the encapsulated packet. Make a comment about mbuf allocation failures more realistic. Reviewed by: sobomax
* Readability fixes:luigi2004-04-211-12/+76
| | | | | | | | | | | | | | | | | | | | | | Clearly comment the assumptions on the structure of keys (addresses) and masks, and introduce a macro, LEN(p), to extract the size of these objects instead of using *(u_char *)p which might be confusing. Comment the confusion in the types used to pass around pointers to keys and masks, as a reminder to fix that at some point. Add a few comments on what some functions do. Comment a probably inefficient (but still correct) section of code in rn_walktree_from() The object code generated after this commit is the same as before. At some point we should also change same variable identifiers such as "t, tt, ttt" to fancier names such as "root, left, right" (just in case someone wants to understand the code!), replace misspelling of NULL as 0, remove 'register' declarations that make little sense these days.
* Clearly comment the assumptions that allow us to cast aluigi2004-04-211-17/+27
| | | | | 'struct radix_node *' to a 'struct rtentry *' in this code, and introduce a macro, RNTORT(), to do this type conversion.
* Fix the initial check for NULL arguments in rtfree (previouslyluigi2004-04-201-126/+82
| | | | | | | | | | | | | it checked for rt == NULL after dereferencing the pointer). We never check for those events elsewhere, so probably these checks might go away here as well. Slightly simplify (and document) the logic for memory allocation in rt_setgate(). The rest is mostly style changes -- replace 0 with NULL where appropriate, remove the macro SA() that was only used once, remove some useless debugging code in rt_fixchange, explain some odd-looking casts.
* Document an assumption on the structure of 'struct rtentry'luigi2004-04-201-0/+5
|
* Add some comments, move a static array of constants in the only placeluigi2004-04-191-8/+16
| | | | | where it is used, and replace R_Malloc with R_Zalloc in a couple of places removing the corresponding bzero()'s
* Fix a recently introduced panic in if_detach() by delayingluigi2004-04-191-11/+11
| | | | | | the invalidation of ifindex_table[] entry. Probably this code should be moved even further down, but for the time being let's do it this way.
* More style and deobfuscation fixes.ru2004-04-191-4/+4
| | | | Submitted by: bde
* Use an tempory struct ifnet *ifp instead of sc->sc_if to access thebrooks2004-04-191-9/+11
| | | | ifnet in stf_clone_create. Also use if_printf() instead of printf().
* First pass at softc list locking for if_ppp.c. Many parts ofrwatson2004-04-191-10/+43
| | | | | | | | | this patch were submitted by Maurycy Pawlowski-Wieronski. In addition to Maurycy's change, break out softc tear down from ppp_clone_destroy() into ppp_destroy() rather than performing a convoluted series of extraction casts and indirections during tear down at mod unload. Submitted by: Maurycy Pawlowski-Wieronski <maurycy@fouk.org>
* Style and code unobfuscation.ru2004-04-181-4/+4
|
* Fixed a bug from rev. 1.42: cast to a correct type.ru2004-04-181-2/+2
| | | | Submitted by: luigi
* Make if_(un)route static in if.c as they are called from if_up/if_down only.mlaier2004-04-182-4/+4
| | | | | | | This is also cleanup to make locking easier. Reviewed by: luigi Approved by: bms(mentor)
* + move MKGet()/MKFree() into the only file that can use them.luigi2004-04-182-28/+19
| | | | | | | | + remove useless wrappers around bcmp(), bcopy(), bzero(). The code assumes that bcmp() returns 0 if the size is 0, but this is true for both the libc and the libkern versions. + nuke Bcmp, Bzero, Bcopy from radix.h now that nobody uses them anymore.
* + replace Bcmp/Bzero with 'the real thing' as in the rest of the file.luigi2004-04-181-3/+4
| | | | + remember to check and fix or explain a strange cast in route_output()
OpenPOWER on IntegriCloud