summaryrefslogtreecommitdiffstats
path: root/sys/net/if.c
Commit message (Collapse)AuthorAgeFilesLines
...
* 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
|
* Export the functionality of SIOCSIFLLADDR with if_setlladdr()archie2000-08-151-25/+50
| | | | | | and add some more rigorous sanity checking in the process. Reviewed by: freebsd-net
* improve route/nd cache cleanup on interface removal.itojun2000-07-161-12/+10
| | | | CAVEAT: haven't really tested it yet, please report
* Previous commit didn't work; this time really fix it.archie2000-06-301-14/+0
|
* Fix kernel build breakage when 'device ether' was not included.archie2000-06-291-1/+3
|
* Make the ng_ether(4) node type dynamically loadable like the rest.archie2000-06-261-0/+12
| | | | | | | | | | | | | This means 'options NETGRAPH' is no longer necessary in order to get netgraph-enabled Ethernet interfaces. This supports loading/unloading the ng_ether.ko and attaching/detaching the Ethernet interface in any order. Add two new hooks 'upper' and 'lower' to allow access to the protocol demux engine and the raw device, respectively. This enables bridging to be defined as a netgraph node, if so desired. Reviewed by: freebsd-net@freebsd.org
* Implement SIOCSIFLLADDR, which allows you to change the link-levelwpaul2000-06-161-0/+30
| | | | | | | | | | | | | | | | | | | | | | | | | | address on an interface. This basically allows you to do what my little setmac module/utility does via ifconfig. This involves the following changes: socket.h: define SIOCSIFLLADDR if.c: add support for SIOCSIFLLADDR, which resets the values in the arpcom struct and sockaddr_dl for the specified interface. Note that if the interface is already up, we need to down/up it in order to program the underlying hardware's receive filter. ifconfig.c: add lladdr command ifconfig.8: document lladdr command You can now force the MAC address on any ethernet interface to be whatever you want. (The change is not sticky across reboots of course: we don't actually reprogram the EEPROM or anything.) Actually, you can reprogram the MAC address on other kinds of interfaces too; this shouldn't be ethernet-specific (though at the moment it's limited to 6 bytes of address data). Nobody ran up to me and said "this is the politically correct way to do this!" so I don't want to hear any complaints from people who think I could have done it more elegantly. Consider yourselves lucky I didn't do it by having ifconfig tread all over /dev/kmem.
* IOCGIFCONF once and for all. Sometimes the ifc_len variableguido2000-04-211-5/+2
| | | | | | | | | would be returned with a wrong value. While we're here, get rid of unnecessary panic call. PR: 17311, 12996, 14457 Submitted by: Patrick Bihan-Faou <patrick@mindstep.com>, Kris Kennaway <kris@FreeBSD.org>
* This fixes a problem where the SIOCGIFCONF ioctl goes wrong. Thisguido2000-02-281-1/+9
| | | | | | | | | | | | is triggered when qmail is used with INET6 enabled. The bug manifests itself in that the space variable can become negative and that in the comparison in the guards of the 2 loops, this was not noticed because sizeof() returns an unsigned and thus the signed variable gets promoted to unsigned. I decided not to make space unsigned because I think we should guard against this from happening. Thus panic() in case space becomes negative. Approved by: jkh
* Add workaround for fxp issue at interface initialization with IPv6.shin2000-02-011-0/+4
| | | | | | | | | | | | | | | | | | | | | Some LAN card chip for fxp is known to cause problem at interface initialization with IPv6 enabled. It happens at some delicate timing. And also, just adding some DELAY before IPv6 address autoconfiguration is known to avoid the problem. Complete fix is changing the driver not to use interrupt at multicast filter initialization, but trying such change in this stage will be dangerous. So I add some DELAY() only inside #ifdef INET6 part, as temporal workaround only for 4.0. Approbed by: jkh Noticed by: Mattias Pantzare <pantzer@ludd.luth.se> Obtained from: openbsd-tech mailing list
* Notify user processes about interface's MTU change.ru2000-01-241-1/+3
| | | | Reviewed by: wollman, freebsd-net
* Prevent kernel panic at ifconfig up after Note PC resume.shin1999-12-301-3/+22
| | | | | Submitted by: imp, kuriyama Reviewed by: imp
* Two more fixes to if_detach. These are generic to all interfaces andimp1999-12-171-2/+63
| | | | | | | | | do not pollute the interface further. o Run if_detach at splnet(). o Creatively swipe the relevant parts of the netatm atm_nif_detach which will delete the relevant references to the interface going away.
* Allow ifunit() routine to understand names like ed0f2. Alsobp1999-12-131-31/+26
| | | | | | fix a bug caused by using bcmp() instead of strcmp(). Reviewed by: Garrett Wollman <wollman@khavrinen.lcs.mit.edu>
* Add some gross ad-hock hacks to increase stability of if_detach:imp1999-12-101-2/+17
| | | | | | | | | | | | | o be more careful about clearing addresses (this isn't a kludge) o For AF_INET interfaces, call SIOCDIFFADDR to remove last(?) bit of cruft. Special cases for AF_INET shouldn't be here, but I didn't see a good generic way of doing this. If I missed something, please let me know. This gross hack makes pccard ejection stable for ethernet cards. Submitted by: Atushi Onoe-san
* udp IPv6 support, IPv6/IPv4 tunneling support in kernel,shin1999-12-071-1/+1
| | | | | | | | | | packet divert at kernel for IPv6/IPv4 translater daemon This includes queue related patch submitted by jburkhol@home.com. Submitted by: queue related patch from jburkhol@home.com Reviewed by: freebsd-arch, cvs-committers Obtained from: KAME project
* KAME netinet6 basic part(no IPsec,no V6 Multicast Forwarding, no UDP/TCPshin1999-11-221-24/+115
| | | | | | | | | | for IPv6 yet) With this patch, you can assigne IPv6 addr automatically, and can reply to IPv6 ping. Reviewed by: freebsd-arch, cvs-committers Obtained from: KAME project
* For every "promiscuous mode enabled" message printed for an interface,sheldonh1999-08-301-0/+2
| | | | | | | print a matching "disabled" message when we drop out of promiscuous mode for that interface. Discussed on the freebsd-hackers mailing list.
* $Id$ -> $FreeBSD$peter1999-08-281-1/+1
|
* Define IF_MAXMTU and IF_MINMTU and don't allow MTUs withbrian1999-08-061-6/+2
| | | | | | | | | out-of-range values. ``comparison is always 0'' warnings are silly ! Ok'd by: wollman, dg Advised by: bde
* Add a new interface ioctl, to return "aux status".phk1999-06-191-1/+6
| | | | | | | | | | | | | | | | | | | This is inteded for to allow ifconfig to print various unstructured information from an interface. The data is returned from the kernel in ASCII form, see the comment in if.h for some technicalities. Canonical cut&paste example to be found in if_tun.c Initial use: Now tun* interfaces tell the PID of the process which opened them. Future uses could be (volounteers welcome!): Have ppp/slip interfaces tell which tty they use. Make sync interfaces return their media state: red/yellow/blue alarm, timeslot assignment and so on. Make ethernets warn about missing heartbeats and/or cables
* typo in previous commitphk1999-06-061-2/+2
|
* Introduce IFF_SMART bit.phk1999-06-061-4/+7
| | | | | | | | This means that the driver will add/delete routes when it knows it is up/down, rather than have the generic code belive it is up if configured. This is probably most useful for serial lines, although many PHY chips could probably tell us if we're connected to the cable/hub as well.
OpenPOWER on IntegriCloud