summaryrefslogtreecommitdiffstats
path: root/sys/net
Commit message (Collapse)AuthorAgeFilesLines
* 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()
* replace Bcopy with bcopy as in the rest of the file.luigi2004-04-181-3/+3
|
* replace Bcmp() with the same bcmp() used in the rest of the file.luigi2004-04-182-4/+4
|
* + rename and document an unused field in struct arpcom (field is stillluigi2004-04-185-4/+9
| | | | | | | | | | | | | | | | | | | | | | | | 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.)
* Minor changes to improve code readability (no actual code changes):luigi2004-04-181-60/+63
| | | | | | | | + replace 0 with NULL where appropriate (not complete) + remove register declaration while there + add argument names to function prototypes to have a better idea of what they are used for + add 'const' qualifiers in 3 places
* make route_init() staticluigi2004-04-172-3/+2
|
* misc cleanup in sysctl_ifmalist():luigi2004-04-171-27/+10
| | | | | | | | | | + remove a partly incorrect comment that i introduced in the last commit; + deal with the correct part of the above comment by cleaning up the updates of 'info' -- rti_addrs needd not to be updated, rti_info[RTAX_IFP] can be set once outside the loop. While at it, correct a few misspelling of NULL as 0, but there are way too many in this file, and i did not want to clutter the important part of this commit.
* Use if_link instead of the alias if_list, and change a for() intoluigi2004-04-161-1/+6
| | | | | | | | | | the TAILQ_FOREACH() form. Comment the need to store the same info (mac address for ethernet-type devices) in two different places. No functional changes. Even the compiler output should be unmodified by this change.
* Documented the intended usage of if_addrhead and ifaddr_byindex()luigi2004-04-161-3/+11
| | | | This commit only changes comments. Nothing to recompile.
* Consistently use ifaddr_byindex() to access the link-level addressluigi2004-04-163-19/+23
| | | | | | | of an interface. No functional change. On passing, comment a likely bug in net/rtsock.c:sysctl_ifmalist() which, if confirmed, would deserve to be fixed and MFC'ed
* Document the way if_addrhead and struct ifaddr are used.luigi2004-04-151-3/+11
| | | | | | | Remove a member from 'struct ifaddr' which has been in an #ifdef notdef block since rev 1.1 No ABI changes -- no need to recompile anything.
* If IF_HANDOFF() or netisr_queue() fail, they will free the mbuf. Whenrwatson2004-04-151-0/+1
| | | | | | | this happens, set (m) to NULL or we'll try to free it a second time on return. Submitted by: Pavel Gulchouck <gul@gul.kiev.ua>
* Staticize <if>_clone_{create,destroy} functions.brooks2004-04-144-16/+16
| | | | Reviewed by: mlaier
* Add Direct Sequence 354K and 512K (needed for arl(4)).fjoe2004-04-131-0/+8
|
* route.h: introduce a macro, SA_SIZE(struct sockaddr *) which returnsluigi2004-04-133-14/+19
| | | | | | | | | | the space occupied by a struct sockaddr when passed through a routing socket. Use it to replace the macro ROUNDUP(int), that does the same but is redefined by every file which uses it, courtesy of the School of Cut'n'Paste Programming(TM). (partial) userland changes to follow.
* remove an almost-duplicate piece of code by setting the loopluigi2004-04-121-16/+10
| | | | limits appropriately.
* in rtinit(), remove one useless variable, and move a few othersluigi2004-04-121-9/+9
| | | | within the block where they are used.
* Count outgoing link-level broadcast packets in if_omcasts.ru2004-04-121-1/+1
| | | | | | | | I'm not sure this is completely correct but at least this is consistent with the accounting of incoming broadcasts. PR: kern/65273 Submitted by: David J Duchscher <daved@tamu.edu>
OpenPOWER on IntegriCloud