summaryrefslogtreecommitdiffstats
path: root/sys/net/if_iso88025subr.c
Commit message (Collapse)AuthorAgeFilesLines
* Return mbuf pointer or NULL from ip_fastforward() as the mbuf pointerandre2006-01-181-1/+1
| | | | | | | | | | | may have changed by m_pullup() during fastforward processing. While this is a bug it is actually never triggered in real world situations and it is not remotely exploitable. Found by: Coverity Prevent(tm) Coverity ID: CID780 Sponsored by: TCP/IP Optimization Fundraise 2005
* - Store pointer to the link-level address right in "struct ifnet"ru2005-11-111-12/+8
| | | | | | | | | | rather than in ifindex_table[]; all (except one) accesses are through ifp anyway. IF_LLADDR() works faster, and all (except one) ifaddr_byindex() users were converted to use ifp->if_addr. - Stop storing a (pointer to) Ethernet address in "struct arpcom", and drop the IFP2ENADDR() macro; all users have been converted to use IF_LLADDR() instead.
* - Make IFP2ENADDR() a pointer to IF_LLADDR() rather than anotherru2005-11-111-2/+3
| | | | | | | | copy of Ethernet address. - Change iso88025_ifattach() and fddi_ifattach() to accept MAC address as an argument, similar to ether_ifattach(), to make this work.
* o Make rt_check() function more strict:glebius2005-08-111-5/+7
| | | | | | | | | | - rt0 passed to rt_check() must not be NULL, assert this. - rt returned by rt_check() must be valid locked rtentry, if no error occured. o Modify callers, so that they never pass NULL rt0 to rt_check(). Reviewed by: sam, ume (nd6.c)
* Propagate rename of IFF_OACTIVE and IFF_RUNNING to IFF_DRV_OACTIVE andrwatson2005-08-091-2/+4
| | | | | | | | | | | | | | 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
* In preparation for fixing races in ARP (and probably in otherglebius2005-08-091-0/+1
| | | | L2/L3 mappings) make rt_check() return a locked rtentry.
* When allocating link layer ifnet address list entries inrwatson2005-08-021-2/+6
| | | | | | | | | ifp->if_resolvemulti(), do so with M_NOWAIT rather than M_WAITOK, so that a mutex can be held over the call. In the FDDI code, add a missing M_ZERO. Consumers are already aware that if_resolvemulti() can fail. MFC after: 1 week
* Stop embedding struct ifnet at the top of driver softcs. Instead thebrooks2005-06-101-11/+47
| | | | | | | | | | | | | | | | | | | | 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/+1
|
* Replace IF_HANDOFF with new IFQ_HANDOFF to enqueue with ALTQ once enabled onmlaier2004-06-151-2/+3
| | | | the respective drivers.
* This commit does two things:luigi2004-04-251-7/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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)
* arpcom untangling:luigi2004-04-241-3/+2
| | | | | | | | | - 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.
* + rename and document an unused field in struct arpcom (field is stillluigi2004-04-181-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | there so there are no ABI changes); + replace 5 redefinitions of the IPF2AC macro with one in if_arp.h Eventually (but before freezing the ABI) we need to get rid of struct arpcom (initially with the help of some smart #defines to avoid having to touch each and every driver, see below). Apart from the struct ifnet, struct arpcom now only stores a copy of the MAC address (ac_enaddr, but we already have another copy in the struct ifnet -- if_addrhead), and a netgraph-specific field which is _always_ accessed through the ifp, so it might well go into the struct ifnet too (where, besides, there is already an entry for AF_NETGRAPH data...) Too bad ac_enaddr is widely referenced by all drivers. But this can be fixed as follows: #define ac_enaddr ac_if.the_original_ac_enaddr_in_struct_ifnet (note that the right hand side would likely be a pointer rather than the base address of an array.)
* whoops, forgot to fix these places where arpresolve() was usedluigi2004-04-041-1/+1
| | | | Detected by: tinderbox
* Handle AF_ARP in *_output()mdodd2004-03-141-0/+27
| | | | Obtained from: NetBSD
* Constify iso88025_broadcastaddr to make it clear no explicitrwatson2004-03-131-3/+3
| | | | synchronization is required.
* Introduce ip_fastforward and remove ip_flow.andre2003-11-141-1/+1
| | | | | | | | | | | | | | | Short description of ip_fastforward: o adds full direct process-to-completion IPv4 forwarding code o handles ip fragmentation incl. hw support (ip_flow did not) o sends icmp needfrag to source if DF is set (ip_flow did not) o supports ipfw and ipfilter (ip_flow did not) o supports divert, ipfw fwd and ipfilter nat (ip_flow did not) o returns anything it can't handle back to normal ip_input Enable with sysctl -w net.inet.ip.fastforwarding=1 Reviewed by: sam (mentor)
* Enable IPv6 for Token Ring.mdodd2003-09-141-4/+0
|
* Cosmetic cleanups.mdodd2003-09-141-19/+21
|
* Cosmetic adjustment.mdodd2003-09-141-2/+1
|
* - Use IFP2AC().mdodd2003-03-161-2/+34
| | | | | | - Support IFF_MONITOR. - Borrow some consistency for if_input() routines from if_ethersubr.c. - Correct comments regarding fddi_input() that no longer apply.
* Don't strip header from packets before input routine is called.mdodd2003-03-151-4/+26
|
* Use if_printf().mdodd2003-03-151-2/+2
|
* iso88025_ifattach() changes:mdodd2003-03-151-2/+18
| | | | | - Call if_attach(). - Conditionally call bpfattach() based on second function argument.
* - Style(9) changes.mdodd2003-03-151-4/+11
| | | | | | - Remove unneeded assignment. - Increment if_oerrors as per if_fddisubr.c. - Wrap ISO code with conditional.
* Stray } forgotten by manual merging.mdodd2003-03-151-1/+0
|
* - Remove stray ).mdodd2003-03-151-2/+6
| | | | | - Add missing breaks. - Add missing if_noproto++.
* Revert part of 1.37; use bcopy() like if_fddisubr.c.mdodd2003-03-151-3/+1
|
* - Increment ifp->if_noproto when appropriate.mdodd2003-03-151-11/+19
| | | | | - Use 'goto dropanyway' when appropriate. - Move dropanyway label out of switch for readability.
* - Adopt tests for (IFF_UP|IFF_RUNNING) and non local unicast packetsmdodd2003-03-151-5/+20
| | | | | in promiscuous mode from if_fddisubr.c. - Add comment to reduce diffs.
* Add MAC support.mdodd2003-03-151-0/+12
| | | | This is the same code that was added in 1.70 of if_fddisubr.c
* Use llc_control rather than llc_snap.control.mdodd2003-03-151-1/+1
|
* - Add comment.mdodd2003-03-151-2/+5
| | | | - Whitespace fixes.
* Reduce code differences.mdodd2003-03-151-7/+6
|
* Use ISO88025_ADDR_LEN where appropriate.mdodd2003-03-151-6/+6
|
* Don't use etherbroadcastaddr; use iso88025_broadcastaddr.mdodd2003-03-151-4/+6
|
* - Remove definition of senderr() from iso88025.h.mdodd2003-03-151-1/+2
| | | | - Use definition of senderr() from if_ethersubr.c.
* Some whitespace/style/readability changes.mdodd2003-03-151-16/+29
|
* Add iso88025_resolvemulti().mdodd2003-03-151-0/+87
| | | | Cribbed from net/if_fddisubr.c
* Fix formatting of iso88025_ifattach().mdodd2003-03-151-9/+9
|
* Re-order and prune includes.mdodd2003-03-151-16/+7
|
* Add module data and version.mdodd2003-03-151-0/+9
|
* s/llc_un.type_snap/llc_snap/gmdodd2003-03-151-9/+9
|
* Update netisr handling; Each SWI now registers its queue, and all queuejlemon2003-03-041-14/+7
| | | | | | | | | | 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
* sizeof(struct llc) -> LLC_SNAPFRAMELENmdodd2003-03-031-3/+3
| | | | | sizeof(struct ether_header) -> ETHER_HDR_LEN sizeof(struct fddi_header) -> FDDI_HDR_LEN
* Use IFP2AC() rather than casting to struct arpcom *mdodd2003-03-031-2/+2
|
* De-register.mdodd2003-03-031-5/+5
|
* Reduce code duplication. This adds the function rt_check() to route.c.mdodd2003-03-021-24/+3
| | | | Approved by: sam (in principle)
* Back out M_* changes, per decision of the TRB.imp2003-02-191-3/+3
| | | | Approved by: trb
* Remove M_TRYWAIT/M_WAITOK/M_WAIT. Callers should use 0.alfred2003-01-211-3/+3
| | | | Merge M_NOWAIT/M_DONTWAIT into a single flag M_NOWAIT.
OpenPOWER on IntegriCloud