summaryrefslogtreecommitdiffstats
path: root/sys/net/if.c
Commit message (Collapse)AuthorAgeFilesLines
* Check retifma for NULL before using it.mini2002-07-021-1/+2
| | | | | | PR: kern/9391 Submitted by: Assar Westerlund <assar@sics.se> MFC after: 3 days
* Move all unit number management cloned interfaces into the cloningbrooks2002-05-251-4/+25
| | | | | | | | code. The reverts the API change which made the <if>_clone_destory() functions return an int instead of void bringing us into closer alignment with NetBSD. Reviewed by: net (a long time ago)
* just merged cosmetic changes from KAME to ease sync between KAME and FreeBSD.suz2002-04-191-1/+1
| | | | | | | (based on freebsd4-snap-20020128) Reviewed by: ume MFC after: 1 week
* Add missing 'struct ifreq ifr;' that was forgotten in the last commit.peter2002-04-101-0/+1
|
* fixed a kernel crash when enabling multicast on vlan interfacesuz2002-04-101-4/+9
| | | | | | | owing to a NULL argument to vlan_ioctl() at if_allmulti(). Reviewed by: ume MFC after: 1 week
* Change callers of mtx_init() to pass in an appropriate lock type name. Injhb2002-04-041-2/+3
| | | | | | | 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
* Change the suser() API to take advantage of td_ucred as well as do ajhb2002-04-011-9/+9
| | | | | | | | | | | | general cleanup of the API. The entire API now consists of two functions similar to the pre-KSE API. The suser() function takes a thread pointer as its only argument. The td_ucred member of this thread must be valid so the only valid thread pointers are curthread and a few kernel threads such as thread0. The suser_cred() function takes a pointer to a struct ucred as its first argument and an integer flag as its second argument. The flag is currently only used for the PRISON_ROOT flag. Discussed on: smp@
* Make `route add -inet6 default ::1 -ifp gif0' work actually.ume2002-04-011-5/+1
| | | | | | The change between 1.13 and 1.14 is specific to AF_INET. MFC after: 1 week
* Remove __P.alfred2002-03-191-1/+1
|
* Simplify the interface cloning framework by handling unitmux2002-03-111-4/+59
| | | | | | | | | unit allocation with a bitmap in the generic layer. This allows us to get rid of the duplicated rman code in every clonable interface. Reviewed by: brooks Approved by: phk
* Use revoke_and_destroy_dev() instead of destroy_dev() when removing /dev/netgreen2002-03-051-1/+1
| | | | | | | pseudo-devices when an interface goes away. Otherwise, an open /dev/net/foo0 when the interface is removed can cause a crash. Not objected to by: jlemon
* Change the network interface cloning API so the destroy function returnsbrooks2002-03-041-2/+1
| | | | | | | | an int errorcode instead of void in preperation for merging cloning of the loopback device. Submitted by: mux MFC after: 2 weeks
* Simple p_ucred -> td_ucred changes to start using the per-thread ucredjhb2002-02-271-2/+2
| | | | reference.
* Fix a warning by pulling prototype for arp_ifinit() into scope.peter2002-02-261-1/+4
| | | | | Then fix cast the correct value into an incorrect value, which was not detected due to the missing prototype (but was harmless anyway).
* When the local link address is changed, send out gratuitous ARPsluigi2002-02-181-0/+11
| | | | | | | | | | | to notify other nodes about the address change. Otherwise, they might try and keep using the old address until their arp table entry times out and the address is refreshed. Maybe this ought to be done for INET6 addresses as well but i have no idea how to do it. It should be pretty straightforward though. MFC-after: 10 days
* Introduce an interface announcement message for the routingru2002-01-181-0/+6
| | | | | | | | | socket so that routing daemons and other interested parties know when an interface is attached/detached. PR: kern/33747 Obtained from: NetBSD MFC after: 2 weeks
* Add a SIOCGIFINDEX ioctl, which returns the index of a named interface.jlemon2001-10-171-0/+4
| | | | This will be used to more efficiently support if_nametoindex(3).
* Cleanup ifunit(), so it uses the dev_named() function to map an interfacejlemon2001-10-171-29/+11
| | | | name into a device.
* Pull post-4.4BSD change to sys/net/route.c from BSD/OS 4.2.ru2001-10-171-4/+4
| | | | | | | | | | | | | | | | | | | | Have sys/net/route.c:rtrequest1(), which takes ``rt_addrinfo *'' as the argument. Pass rt_addrinfo all the way down to rtrequest1 and ifa->ifa_rtrequest. 3rd argument of ifa->ifa_rtrequest is now ``rt_addrinfo *'' instead of ``sockaddr *'' (almost noone is using it anyways). Benefit: the following command now works. Previously we needed two route(8) invocations, "add" then "change". # route add -inet6 default ::1 -ifp gif0 Remove unsafe typecast in rtrequest(), from ``rtentry *'' to ``sockaddr *''. It was introduced by 4.3BSD-Reno and never corrected. Obtained from: BSD/OS, NetBSD MFC after: 1 month PR: kern/28360
* Revision 1.13 corresponded to CSRG revision 8.4.ru2001-10-171-1/+1
| | | | Revision 1.59 corresponded to CSRG revision 8.5.
* if_index is the highest interface index in the system, not the nextfenner2001-10-171-3/+3
| | | | available index.
* bring in ARP support for variable length link level addressesfjoe2001-10-141-0/+1
| | | | | | | Reviewed by: jdp Approved by: jdp Obtained from: NetBSD MFC after: 6 weeks
* Fix the ``WARNING: Driver mistake: repeat make_dev'', caused by usingjlemon2001-10-111-2/+3
| | | | | | | the wrong index variable within a loop. I have no idea how this managed to work on my test box. Spotted by: fenner
* Move device nodes into a /dev/net/ directory, to avoid conflict withjlemon2001-10-111-8/+61
| | | | | | | | | | existing devices (e.g.: tunX). This may need a little more thought. Create a /dev/netX alias for devices. net0 is reserved. Allow wiring of net aliases in /boot/device.hints of the form: hint.net.1.dev="lo0" hint.net.12.ether="00:a0:c9:c9:9d:63"
* Add ability to attach knotes to network devices.jlemon2001-09-291-1/+73
| | | | Introduce EVFILT_NETDEV to report network device changes.
* Introduce network device nodes. Network devices will now automaticallyjlemon2001-09-291-63/+157
| | | | | | appear in /dev. Interface hardware ioctls (not protocol or routing) can be performed on the descriptor. The SIOCGIFCONF ioctl may be performed on the special /dev/network node.
* Add two fields to the ifnet structure indicating what extra capabilitiesjlemon2001-09-181-0/+14
| | | | a network device has, and which ones are enabled.
* KSE Milestone 2julian2001-09-121-12/+12
| | | | | | | | | | | | | | Note ALL MODULES MUST BE RECOMPILED make the kernel aware that there are smaller units of scheduling than the process. (but only allow one thread per process at this time). This is functionally equivalent to teh previousl -current except that there is a thread associated with each process. Sorry john! (your next MFC will be a doosie!) Reviewed by: peter@freebsd.org, dillon@freebsd.org X-MFC after: ha ha ha ha
* Fix another shortcircuit return() statement that I missed.jlemon2001-09-071-1/+1
|
* Fix sense of comparison in space test. Also eliminate a compilejlemon2001-09-071-8/+8
| | | | warning and remove a previously existing off-by-one error.
* Wrap array accesses in macros, which also happen to be lvalues:jlemon2001-09-061-40/+49
| | | | | | | ifnet_addrs[i - 1] -> ifaddr_byindex(i) ifindex2ifnet[i] -> ifnet_byindex(i) This is intended to ease the conversion to SMPng.
* Cosmetic cleanups and rearrangement for code to come. There should bejlemon2001-09-061-63/+68
| | | | no functional change in this commit.
* Add kernel infrastructure for network device cloning.brooks2001-07-021-2/+195
| | | | | | Reviewed by: ru, ume Obtained from: NetBSD MFC after: 1 week
* Sync with recent KAME.ume2001-06-111-6/+15
| | | | | | | | | | | | | | | | | | 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
* 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
* Change the type of the VLAN interface from IFT_PROPVIRTUAL,yar2001-04-041-1/+1
| | | | | which was a temporary hack, to IFT_L2VLAN, which is the type assigned by IANA.
* If ifpromisc() fails the SIOCSIFFLAGS ioctl, put ifp->if_flagsbrian2001-04-021-0/+4
| | | | back the way we found them.
* 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
* o Move per-process jail pointer (p->pr_prison) to inside of the subjectrwatson2001-02-211-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Convert if_multiaddrs from LIST to TAILQ so that it can be traversedphk2001-02-061-10/+10
| | | | | | backwards in the three drivers which want to do that. Reviewed by: mikeh
* Another round of the <sys/queue.h> FOREACH transmogriffer.phk2001-02-041-18/+9
| | | | | Created with: sed(1) Reviewed by: md5(1)
* Mechanical change to use <sys/queue.h> macro API instead ofphk2001-02-041-6/+6
| | | | | | | fondling implementation details. Created with: sed(1) Reviewed by: md5(1)
* Use <sys/queue.h> macro api rather than fondle its implementation detals.phk2001-02-031-28/+28
| | | | | Created with: /usr/bin/sed Reviewed by: /sbin/md5
* Revert mutex initialization check to look at mtx_description.jasone2001-01-301-1/+1
| | | | Pointed out by: jlemon, jhb
* Move most of sys/mutex.h into kern/kern_mutex.c, thereby making the mutexjasone2001-01-211-1/+2
| | | | | | | | | | | inline functions non-inlined. Hide parts of the mutex implementation that should not be exposed. Make sure that WITNESS code is not executed during boot until the mutexes are fully initialized by SI_SUB_MUTEX (the original motivation for this commit). Submitted by: peter
* Convert more malloc+bzero to malloc+M_ZERO.dwmalone2000-12-081-6/+3
| | | | | Submitted by: josh@zipperup.org Submitted by: Robert Drehmel <robd@gmx.net>
* Lock down the network interface queues. The queue mutex must be obtainedjlemon2000-11-251-1/+10
| | | | | | | | | | | | | | before adding/removing packets from the queue. Also, the if_obytes and if_omcasts fields should only be manipulated under protection of the mutex. IF_ENQUEUE, IF_PREPEND, and IF_DEQUEUE perform all necessary locking on the queue. An IF_LOCK macro is provided, as well as the old (mutex-less) versions of the macros in the form _IF_ENQUEUE, _IF_QFULL, for code which needs them, but their use is discouraged. Two new macros are introduced: IF_DRAIN() to drain a queue, and IF_HANDOFF, which takes care of locking/enqueue, and also statistics updating/start if necessary.
* Remove unneeded #include <machine/clock.h>phk2000-10-151-1/+0
|
* make sure we have root priv on SIOCSIFPHY*. from thorpej@netbsditojun2000-10-041-0/+5
|
OpenPOWER on IntegriCloud