summaryrefslogtreecommitdiffstats
path: root/sys/netinet6/in6_ifattach.c
Commit message (Collapse)AuthorAgeFilesLines
* Clean up VCS Ids.obrien2007-12-101-3/+5
|
* ANSIfy[1] plus some style cleanup nearby.delphij2007-07-051-38/+30
| | | | | | Discussed with: gnn, rwatson Submitted by: Karl Sj?dahl - dunceor <dunceor gmail com> [1] Approved by: re (rwatson)
* Garbage collect unused variables.mjacob2007-06-151-1/+0
|
* Import rewrite of IPv4 socket multicast layer to support source-specificbms2007-06-121-10/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | and protocol-independent host mode multicast. The code is written to accomodate IPv6, IGMPv3 and MLDv2 with only a little additional work. This change only pertains to FreeBSD's use as a multicast end-station and does not concern multicast routing; for an IGMPv3/MLDv2 router implementation, consider the XORP project. The work is based on Wilbert de Graaf's IGMPv3 code drop for FreeBSD 4.6, which is available at: http://www.kloosterhof.com/wilbert/igmpv3.html Summary * IPv4 multicast socket processing is now moved out of ip_output.c into a new module, in_mcast.c. * The in_mcast.c module implements the IPv4 legacy any-source API in terms of the protocol-independent source-specific API. * Source filters are lazy allocated as the common case does not use them. They are part of per inpcb state and are covered by the inpcb lock. * struct ip_mreqn is now supported to allow applications to specify multicast joins by interface index in the legacy IPv4 any-source API. * In UDP, an incoming multicast datagram only requires that the source port matches the 4-tuple if the socket was already bound by source port. An unbound socket SHOULD be able to receive multicasts sent from an ephemeral source port. * The UDP socket multicast filter mode defaults to exclusive, that is, sources present in the per-socket list will be blocked from delivery. * The RFC 3678 userland functions have been added to libc: setsourcefilter, getsourcefilter, setipv4sourcefilter, getipv4sourcefilter. * Definitions for IGMPv3 are merged but not yet used. * struct sockaddr_storage is now referenced from <netinet/in.h>. It is therefore defined there if not already declared in the same way as for the C99 types. * The RFC 1724 hack (specify 0.0.0.0/8 addresses to IP_MULTICAST_IF which are then interpreted as interface indexes) is now deprecated. * A patch for the Rhyolite.com routed in the FreeBSD base system is available in the -net archives. This only affects individuals running RIPv1 or RIPv2 via point-to-point and/or unnumbered interfaces. * Make IPv6 detach path similar to IPv4's in code flow; functionally same. * Bump __FreeBSD_version to 700048; see UPDATING. This work was financially supported by another FreeBSD committer. Obtained from: p4://bms_netdev Submitted by: Wilbert de Graaf (original work) Reviewed by: rwatson (locking), silence from fenner, net@ (but with encouragement)
* fixed memory leak for IPv6 multicast membership information associatedjinmei2007-06-021-2/+10
| | | | | | | with interface addresses. Approved by: gnn (mentor) MFC after: 1 week
* Revert the default value of net.inet6.ip6.auto_linklocal to 1.ume2006-10-131-1/+1
| | | | | | | | If ipv6_enable is not set to "YES", net.inet6.ip6.auto_linklocal is turned to 0 at boot. Discussed with: re@, gnn@ MFC after: 3 days
* Turn off automatic link local address if ipv6_enable is not set to YESgnn2006-10-021-1/+1
| | | | | | | in rc.conf Reviewed by: KAME core team, cperciva MFC after: 3 days
* With exception of the if_name() macro, all definitions in net_osdep.hbrooks2006-08-041-2/+0
| | | | | | | | were unused or already in if_var.h so add if_name() to if_var.h and remove net_osdep.h along with all references to it. Longer term we may want to kill off if_name() entierly since all modern BSDs have if_xname variables rendering it unnecessicary.
* Modify in6_pcbpurgeif0() to accept a pcbinfo structure rather than a pcbrwatson2006-04-231-4/+2
| | | | | | | | | | list head structure; this improves congruence to IPv4, and also allows in6_pcbpurgeif0() to lock the pcbinfo. Modify in6_pcbpurgeif0() to lock the pcbinfo before iterating the pcb list, use queue(9)'s LIST_FOREACH() for the iteration, and to lock individual inpcb's while manipulating them. MFC after: 3 months
* sync with KAME regarding NDPsuz2005-10-211-21/+7
| | | | | | | | | | | | - introduced fine-grain-timer to manage ND-caches and IPv6 Multicast-Listeners - supports Router-Preference <draft-ietf-ipv6-router-selection-07.txt> - better prefix lifetime management - more spec-comformant DAD advertisement - updated RFC/internet-draft revisions Obtained from: KAME Reviewed by: ume, gnn MFC after: 2 month
* sync with KAME regarding the following clarification in RFC3542:suz2005-10-191-6/+5
| | | | | | | | | - disable IPv6 operation if DAD fails for some EUI-64 link-local addresses. - export get_hw_ifid() (and rename it) as a subroutine for this process. Obtained from: KAME Reviewd by: ume, gnn MFC after: 2 week
* sync with KAME in the following points:suz2005-10-191-10/+10
| | | | | | | | | | | | - fixed typos - improved some comment descriptions - use NULL, instead of 0, to denote a NULL pointer - avoid embedding a magic number in the code - use nd6log() instead of log() to record NDP-specific logs - nuked an unnecessay white space Obtained from: KAME MFC after: 1 day
* Add support for multicast to the bridge and allow inet6 addresses to bethompsa2005-09-061-4/+1
| | | | | | | | | | | | | | | | assigned to the interface. IPv6 auto-configuration is disabled. An IPv6 link-local address has a link-local scope within one link, the spec is unclear for the bridge case and it may cause scope violation. An address can be assigned in the usual way; ifconfig bridge0 inet6 xxxx:... Tested by: bmah Reviewed by: ume (netinet6) Approved by: mlaier (mentor) MFC after: 1 week
* scope cleanup. with this changeume2005-07-251-5/+8
| | | | | | | | | | | | | | | | | | | - most of the kernel code will not care about the actual encoding of scope zone IDs and won't touch "s6_addr16[1]" directly. - similarly, most of the kernel code will not care about link-local scoped addresses as a special case. - scope boundary check will be stricter. For example, the current *BSD code allows a packet with src=::1 and dst=(some global IPv6 address) to be sent outside of the node, if the application do: s = socket(AF_INET6); bind(s, "::1"); sendto(s, some_global_IPv6_addr); This is clearly wrong, since ::1 is only meaningful within a single node, but the current implementation of the *BSD kernel cannot reject this attempt. Submitted by: JINMEI Tatuya <jinmei__at__isl.rdc.toshiba.co.jp> Obtained from: KAME
* Add CARP (Common Address Redundancy Protocol), which allows multipleglebius2005-02-221-0/+1
| | | | | | | | | | | | | hosts to share an IP address, providing high availability and load balancing. Original work on CARP done by Michael Shalayeff, with many additions by Marco Pfatschbacher and Ryan McBride. FreeBSD port done solely by Max Laier. Patch by: mlaier Obtained from: OpenBSD (mickey, mcbride)
* /* -> /*- for license, minor formatting changes, separate for KAMEimp2005-01-071-1/+1
|
* Remove in6_prefix.[ch] and the contained router renumbering capability.rwatson2004-08-231-3/+0
| | | | | | | | | | | | The prefix management code currently resides in nd6, leaving only the unused router renumbering capability in the in6_prefix files. Removing it will make it easier for us to provide locking for the remainder of IPv6 by reducing the number of objects requiring synchronized access. This functionality has also been removed from NetBSD and OpenBSD. Submitted by: George Neville-Neil <gnn at neville-neil.com> Discussed with/approved by: suz, keiichi at kame.net, core at kame.net
* Tweak existing header and other build infrastructure to be able to buildmlaier2004-02-261-1/+3
| | | | | | | pf/pflog/pfsync as modules. Do not list them in NOTES or modules/Makefile (i.e. do not connect it to any (automatic) builds - yet). Approved by: bms(mentor)
* Don't execute the code in in6_ifdetach() that removes the link-localtruckman2004-01-101-7/+9
| | | | | | | | allnodes multicast route if the routing table has not been initialized. This avoids a panic during boot if an interface detaches before the routing table is initialized. Submitted by: sam
* use arc4random.ume2003-10-311-5/+2
| | | | Obtained from: KAME
* nuku unused functions in6_nigroup_attach() andume2003-10-311-59/+0
| | | | | | in6_nigroup_detach(). Obtained from: KAME
* Overhaul routing table entry cleanup by introducing a new rtexpungesam2003-10-301-7/+6
| | | | | | | | | | | | routine that takes a locked routing table reference and removes all references to the entry in the various data structures. This eliminates instances of recursive locking and also closes races where the lock on the entry had to be dropped prior to calling rtrequest(RTM_DELETE). This also cleans up confusion where the caller held a reference to an entry that might have been reclaimed (and in some cases used that reference). Supported by: FreeBSD Foundation
* - add dom_if{attach,detach} framework.ume2003-10-171-67/+4
| | | | | | - transition to use ifp->if_afdata. Obtained from: KAME
* nuke SCOPEDROUTING. Though it was there for a long time,ume2003-10-101-12/+0
| | | | it was never enabled.
* - fix typo in comments.ume2003-10-081-43/+33
| | | | | | | | | | - style. - NULL is not 0. - some variables were renamed. - nuke unused logic. (there is no functional change.) Obtained from: KAME
* return(code) -> return (code)ume2003-10-061-3/+3
| | | | (reduce diffs against KAME)
* Locking for updates to routing table entries. Each rtentry gets a mutexsam2003-10-041-4/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | that covers updates to the contents. Note this is separate from holding a reference and/or locking the routing table itself. Other/related changes: o rtredirect loses the final parameter by which an rtentry reference may be returned; this was never used and added unwarranted complexity for locking. o minor style cleanups to routing code (e.g. ansi-fy function decls) o remove the logic to bump the refcnt on the parent of cloned routes, we assume the parent will remain as long as the clone; doing this avoids a circularity in locking during delete o convert some timeouts to MPSAFE callouts Notes: 1. rt_mtx in struct rtentry is guarded by #ifdef _KERNEL as user-level applications cannot/do-no know about mutex's. Doing this requires that the mutex be the last element in the structure. A better solution is to introduce an externalized version of struct rtentry but this is a major task because of the intertwining of rtentry and other data structures that are visible to user applications. 2. There are known LOR's that are expected to go away with forthcoming work to eliminate many held references. If not these will be resolved prior to release. 3. ATM changes are untested. Sponsored by: FreeBSD Foundation Obtained from: BSD/OS (partly)
* Enable IPv6 for Token Ring.mdodd2003-09-141-0/+1
|
* The in6_ifattach() routine contains the following code:wpaul2003-09-131-2/+4
| | | | | | | | | | | | | | | | | | | | | | | in6_pcbpurgeif0(LIST_FIRST(udbinfo.listhead), ifp); in6_pcbpurgeif0(LIST_FIRST(ripcbinfo.listhead), ifp); The problem here is that udbinfo.listhead and ripcbinfo.listhead are not initialized during the device probe/attach phase of the kernel boot process. So if, for example, a network driver calls ether_ifattach() in its foo_attach() routine and then decides that something is wrong and calls ether_ifdetach() to reverse the process, we will panic trying to dereference the uninitialized list head pointers. (Though the same sequence of events performed after the kernel has come up works file, i.e. doing kldload if_foo from multiuser.) Change this to: if (udbinfo.listhead != NULL) in6_pcbpurgeif0(LIST_FIRST(udbinfo.listhead), ifp); if (ripcbinfo.listhead != NULL) in6_pcbpurgeif0(LIST_FIRST(ripcbinfo.listhead), ifp); to avoid the NULL pointer dereferences.
* Back out M_* changes, per decision of the TRB.imp2003-02-191-4/+4
| | | | Approved by: trb
* Remove M_TRYWAIT/M_WAITOK/M_WAIT. Callers should use 0.alfred2003-01-211-4/+4
| | | | Merge M_NOWAIT/M_DONTWAIT into a single flag M_NOWAIT.
* SMP locking for ifnet list.hsu2002-12-221-0/+7
|
* just merged cosmetic changes from KAME to ease sync between KAME and FreeBSD.suz2002-04-191-13/+17
| | | | | | | (based on freebsd4-snap-20020128) Reviewed by: ume MFC after: 1 week
* When running aplication joined multicast address,ume2001-08-041-0/+7
| | | | | | | | | | | | | | removing network card, and kill aplication. imo_membership[].inm_ifp refer interface pointer after removing interface. When kill aplication, release socket,and imo_membership. imo_membership use already not exist interface pointer. Then, kernel panic. PR: 29345 Submitted by: Inoue Yuichi <inoue@nd.net.fujitsu.co.jp> Obtained from: KAME MFC after: 3 days
* Sync with recent KAME.ume2001-06-111-367/+383
| | | | | | | | | | | | | | | | | | 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
* on in6_ifdetach(), do not remove default route mistakenlyume2001-01-221-2/+2
| | | | Obtained from: KAME
* add missing \n. sync with kame.itojun2000-10-011-3/+3
|
* sync with kame tree as of july00. tons of bug fixes/improvements.itojun2000-07-041-399/+727
| | | | | | | API changes: - additional IPv6 ioctls - IPsec PF_KEY API was changed, it is mandatory to upgrade setkey(8). (also syntax change)
* udp IPv6 support, IPv6/IPv4 tunneling support in kernel,shin1999-12-071-6/+4
| | | | | | | | | | 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-0/+690
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
OpenPOWER on IntegriCloud