summaryrefslogtreecommitdiffstats
path: root/sys/net
Commit message (Collapse)AuthorAgeFilesLines
* Close a race where we were releasing the unit resource at the startbrian2001-06-201-2/+4
| | | | | | | | | | | | of tunclose() rather than the end, and tunopen() grabbed that unit before tunclose() finished (one process is allocating it while another is freeing it!). It may be worth hanging some sort of rw mutex around all specinfo calls where d_close and the detach handler get a write lock and all other functions get a read lock. This would guarantee certain levels of ``atomicity'' (is that a word?) that people may expect (I believe Solaris does something like this).
* Suppress update ifnet.iflastchange when processing packets for SNMPsumikawa2001-06-191-1/+0
| | | | | | | | | | | | | requirements(RFC1573, interface MIB). This change for 4.4BSD was first introduced in if_ethersubr.c:1.17->1.18. BTW, iflastchange on all of IFs are inconsistent. e.g. ether, tun: update fddi, tokenring, ppp: not update I'll make patch later. Obtained from: KAME MFC after: 2 weeks
* Remove the SI_CHEAPCLONE flag when hanging resources off the dev_tbrian2001-06-181-0/+2
|
* This file was a horrible mixture of styles old and new.markm2001-06-161-27/+16
| | | | Apply style(9).
* Do not perform arp send/resolve on an interface marked NOARP.jlemon2001-06-153-5/+9
| | | | | PR: 25006 MFC after: 2 weeks
* Fix warning. s/char/unsigned char/ in "(char *)eth"peter2001-06-151-1/+1
| | | | 294: warning: ethernet address is not type unsigned char *
* Fix warning: 848: warning: label `nosupport' defined but not usedpeter2001-06-151-1/+0
|
* Fix warning; remove unused variablepeter2001-06-151-1/+1
|
* Remove unused variablepeter2001-06-151-1/+0
|
* Make compilable. addlog(...) was replaced with log(-1, ...)ume2001-06-131-18/+18
| | | | Reported by: peter
* Restore the code wrongly nuked by previous commit.ume2001-06-121-0/+1
| | | | | | | | Following changed was made by previous commit: - IPV6CP supporting in kernel level ppp from NetBSD. Submitted by: y.shirasaki@ntt.com
* Sync with recent KAME.ume2001-06-1114-177/+1435
| | | | | | | | | | | | | | | | | | This work was based on kame-20010528-freebsd43-snap.tgz and some critical problem after the snap was out were fixed. There are many many changes since last KAME merge. TODO: - The definitions of SADB_* in sys/net/pfkeyv2.h are still different from RFC2407/IANA assignment because of binary compatibility issue. It should be fixed under 5-CURRENT. - ip6po_m member of struct ip6_pktopts is no longer used. But, it is still there because of binary compatibility issue. It should be removed under 5-CURRENT. Reviewed by: itojun Obtained from: KAME MFC after: 3 weeks
* "Fix" the previous initial attempt at fixing TUNABLE_INT(). This timepeter2001-06-081-1/+1
| | | | | | | around, use a common function for looking up and extracting the tunables from the kernel environment. This saves duplicating the same function over and over again. This way typically has an overhead of 8 bytes + the path string, versus about 26 bytes + the path string.
* Back out part of my previous commit. This was a last minute changepeter2001-06-071-1/+1
| | | | | and I botched testing. This is a perfect example of how NOT to do this sort of thing. :-(
* Make the TUNABLE_*() macros look and behave more consistantly like thepeter2001-06-061-2/+2
| | | | | SYSCTL_*() macros. TUNABLE_INT_DECL() was an odd name because it didn't actually declare the int, which is what the name suggests it would do.
* When looking for an interface appropriate for the (new or changing)ru2001-06-041-1/+1
| | | | | | | | | route in ifa_ifwithroute(), as the last resort, look up the route to the gateway, not destination (to derive the interface from). PR: kern/27852 Submitted by: Iasen Kostoff <tbyte@tbyte.org> MFC after: 2 weeks
* First, wrap the if_up() call into splimp()/splx() becauseyar2001-06-031-2/+5
| | | | | | | | | | | if_up() must be called at splnet or higher. Second, set the IFF_RUNNING flag on an interface after its resources (i.e. tunnel source and destination addresses) have been set. Note that we don't set IFF_UP because it is if_up()'s job to do that. PR: kern/27851 Submitted by: Horacio J. PeÓa <horape@compendium.com.ar>
* Support /dev/tun cloning. Ansify if_tun.c while I'm there.brian2001-06-012-92/+130
| | | | | | | | | | | | | | Only tun0 -> tun32767 may now be opened as struct ifnet's if_unit is a short. It's now possible to open /dev/tun and get a handle back for an available tun device (use devname to find out what you got). The implementation uses rman by popular demand (and against my judgement) to track opened devices and uses the new dev_depends() to ensure that all make_dev()d devices go away before the module is unloaded. Reviewed by: phk
* Currently, each wireless networking driver has it's own control programphk2001-05-263-3/+100
| | | | | | | | | | | | despite the fact that most people want to set exactly the same settings regardless of which card they have. It has been repeatidly suggested that this configuration should be done via ifconfig. This patch implements the required functionality in ifconfig and add support to the wi and an drivers. It also provides partial, untested support for the awi driver. PR: 25577 Submitted by: Brooks Davis <brooks@one-eyed-alien.net>
* Make if_tun's clone create SI_CHEAPCLONE devices.phk2001-05-251-0/+1
|
* Add a couple more codes for upcoming raylink driver additions.dmlb2001-05-171-9/+70
| | | | MFC after: 3 days
* Get IP multicast working on VLAN devices:fenner2001-05-022-7/+6
| | | | | | | | | | | - Allocate zeroed memory in ether_resolvemulti() to prevent equal() from comparing garbage and determining that two otherwise-equal sockaddr_dls are different. - Fill in all required fields of the sockaddr_dl - Actually copy the multicast address into the sockaddr_dl when calling if_addmulti() - Don't claim that we don't have a way to resolve layer 3 addresses into layer 2 addresses; use the ethernet way.
* Undo part of the tangle of having sys/lock.h and sys/mutex.h included inmarkm2001-05-012-0/+6
| | | | | | | | | | | other "system" header files. Also help the deprecation of lockmgr.h by making it a sub-include of sys/lock.h and removing sys/lockmgr.h form kernel .c files. Sort sys/*.h includes where possible in affected files. OK'ed by: bde (with reservations)
* Better handling of ioctl(SIOCSIFFLAGS) failing in ifpromisc():fenner2001-04-271-7/+9
| | | | | - Don't print the "promiscuous mode (enabled|disabled)" on failure - Restore the reference count on failure
* Dont (ab)use drv2 to know if (si_flags & SI_NAMED) (pointed out by dd)brian2001-04-171-5/+3
| | | | Call cdevsw_remove when we unload.
* Move the decision whether we want to request authentication from ourjoerg2001-04-081-8/+8
| | | | | | | peer out from sppp_lcp_open() to sppp_lcp_up(). For one, this makes things look more symmetrical to sppp_lcp_close(), and somehow it also just occurred to me that an Up event following the open caused the value of the authentication option to be clobbered.
* Fix bpf devices so select() recognizes that they are always writable.gad2001-04-041-5/+8
| | | | | | PR: 9355 Submitted by: Bruce Evans <bde@zeta.org.au> Reviewed by: Garrett Rooney <rooneg@electricjellyfish.net> (see pr :-)
* Change the type of the VLAN interface from IFT_PROPVIRTUAL,yar2001-04-042-3/+3
| | | | | which was a temporary hack, to IFT_L2VLAN, which is the type assigned by IANA.
* Add recently assigned interface types.yar2001-04-041-0/+7
| | | | Obtained from: ftp://ftp.isi.edu/in-notes/iana/assignments/smi-numbers
* Sync up to NetBSD, Step 2:yar2001-04-041-0/+136
| | | | | | Add the interface types 0x37 through 0xbd. Obtained from: NetBSD
* Sync up to NetBSD again, Step 1:yar2001-04-041-5/+5
| | | | | | | | | * Set the CSRG SCCS ID to the revision this file is actually based on (the file itself has been updated to Lite2 in rev. 1.4). * Fix some typos in comments. * Add a comment to the trailing #endif according to style(9)
* Allow MOD_UNLOADs of if_tun, and handle event handler registrationbrian2001-04-032-10/+44
| | | | | | | | failures in MOD_LOAD. Dodge duplicate make_dev() calls by (ab)using dev->si_drv2 to remember if we created the device node via a dev_clone callback before the d_open call.
* If ifpromisc() fails the SIOCSIFFLAGS ioctl, put ifp->if_flagsbrian2001-04-021-0/+4
| | | | back the way we found them.
* Return 0 and do nothing when we get a SIOCSIFFLAGS.brian2001-04-021-0/+1
| | | | | | | Without this, ifpromisc() always fails (after setting the IFF_PROMISC bit in ifp->if_flags) and bpf never bothers to turn promiscuous mode off. PR: 20188
* Fix a number of minor bugs in the VLAN code:yar2001-03-281-6/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Initialize the "struct sockaddr_dl sdl" correctly in vlan_setmulti(). PR: kern/22181 * The driver used to call malloc(..., M_NOWAIT), but to not check the return value. Change malloc(..., M_NOWAIT) to malloc(..., M_WAITOK) because the corresponding part of code is called from the upper half of the kernel only. PR: kern/22181 * Make sure a parent interface is up and running before invoking its if_start() routine in order to avoid system panic. PR: kern/22179 kern/24741 i386/25478 * Do not copy all the flags from a parent mindlessly. PR: kern/22179 * Do not call if_down() on a parent interface if it's already down. Call if_down() at splimp because if_down() needs that. PR: kern/22179 Reviewed by: wollman
* Catch up to header include changes:jhb2001-03-281-1/+3
| | | | | - <sys/mutex.h> now requires <sys/systm.h> - <sys/mutex.h> and <sys/sx.h> now require <sys/lock.h>
* Use mtx_initiaalized() rather than violating the internals of the mutexjhb2001-03-281-2/+1
| | | | structure.
* Don't bypass notifying a corresponding interfaceyar2001-03-271-0/+6
| | | | | | | when leaving a link-layer multicast group. PR: kern/22176 Reviewed by: wollman
* Send the remains (such as I have located) of "block major numbers" tophk2001-03-263-3/+0
| | | | the bit-bucket.
* This is another MFC candidate.joerg2001-03-251-2/+2
| | | | | | | | | | | Fix a serious bug in sppp where anyone could obtain a successful PAP authentication by supplying a null password. I've only stumpled across the PR while browsing for all sppp-related PRs. Should we also file a security advisory for this? PR: 21592 Submitted by: <dli@3bc.de> Dirk Liebke
* (MFC candidate, see below).joerg2001-03-231-0/+14
| | | | | | | | | | | | | | | | | | | | When we get an Open event in stopped state, experience shows that this is usually means we've somehow missed a previous Down event. This has occasionally bitten people for the IPCP layer with ISDN, apparently a previously aborted IPCP negotiation must have caused this. As a bandaid, we quickly pretent a Down event by advancing to starting state; this effectively implements the `restart' option mentioned in RFC 1663. While i'm not yet fully convinced this is the best thing to do (and is fully compliant with RFC 1661), i've seen a number of reports here on the German mailing lists where people have been bitten by the previous behaviour which usually causes quickly looping ISDN reconnects (thus loss of money...), and where just this patch fixes the problem. For this, i'd even like to see it MFC'd if possible. Submitted by: Helmut Kreft <kreft@zeus.ai-lab.fh-furtwangen.de>
* - Add iso88025_ifdetach().mdodd2001-03-181-110/+276
| | | | | - Add support for 802.2 type IPX frames. - Cleanup iso88025_output() and iso88025_output() a bit.
* - Define payload length constants for 4Mbps and 16Mbps.mdodd2001-03-181-12/+22
| | | | | | | | - Use explicit sizes for header structure fields. - Use __attribute__ ((__packed__)) for header structures. - Define struct iso88025_rif; for future use. - Prototype upcoming iso88025_ifdetach() - Get rid of __P() constructs in prototypes.
* net/route.c:ru2001-03-151-3/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | A route generated from an RTF_CLONING route had the RTF_WASCLONED flag set but did not have a reference to the parent route, as documented in the rtentry(9) manpage. This prevented such routes from being deleted when their parent route is deleted. Now, for example, if you delete an IP address from a network interface, all ARP entries that were cloned from this interface route are flushed. This also has an impact on netstat(1) output. Previously, dynamically created ARP cache entries (RTF_STATIC flag is unset) were displayed as part of the routing table display (-r). Now, they are only printed if the -a option is given. netinet/in.c, netinet/in_rmx.c: When address is removed from an interface, also delete all routes that point to this interface and address. Previously, for example, if you changed the address on an interface, outgoing IP datagrams might still use the old address. The only solution was to delete and re-add some routes. (The problem is easily observed with the route(8) command.) Note, that if the socket was already bound to the local address before this address is removed, new datagrams generated from this socket will still be sent from the old address. PR: kern/20785, kern/21914 Reviewed by: wollman (the idea)
* This include file has no business being here.mdodd2001-03-151-2/+0
|
* Plug several mbuf leaks in error cases (in nd6)bmilekic2001-03-112-4/+2
| | | | Submitted by: jhay
* Protect against negative numbers as wellalfred2001-02-261-0/+3
|
* fix typo in commentalfred2001-02-261-1/+1
|
* Santize a size variable passed to kernel malloc.alfred2001-02-261-10/+20
| | | | | | | | | Since we know there's always an upper bound we force that bound, otherwise users can cause a panic via malloc getting hit with a odd (huge or negative) amount of memory to allocate. Tested by: kris Pointed out by: Andrey Valyaev <dron@infosec.ru>
* o Move per-process jail pointer (p->pr_prison) to inside of the subjectrwatson2001-02-213-4/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | credential structure, ucred (cr->cr_prison). o Allow jail inheritence to be a function of credential inheritence. o Abstract prison structure reference counting behind pr_hold() and pr_free(), invoked by the similarly named credential reference management functions, removing this code from per-ABI fork/exit code. o Modify various jail() functions to use struct ucred arguments instead of struct proc arguments. o Introduce jailed() function to determine if a credential is jailed, rather than directly checking pointers all over the place. o Convert PRISON_CHECK() macro to prison_check() function. o Move jail() function prototypes to jail.h. o Emulate the P_JAILED flag in fill_kinfo_proc() and no longer set the flag in the process flags field itself. o Eliminate that "const" qualifier from suser/p_can/etc to reflect mutex use. Notes: o Some further cleanup of the linux/jail code is still required. o It's now possible to consider resolving some of the process vs credential based permission checking confusion in the socket code. o Mutex protection of struct prison is still not present, and is required to protect the reference count plus some fields in the structure. Reviewed by: freebsd-arch Obtained from: TrustedBSD Project
OpenPOWER on IntegriCloud