summaryrefslogtreecommitdiffstats
path: root/sys/netinet/ip_mroute.c
Commit message (Collapse)AuthorAgeFilesLines
...
* Back out M_* changes, per decision of the TRB.imp2003-02-191-1/+1
| | | | Approved by: trb
* Remove M_TRYWAIT/M_WAITOK/M_WAIT. Callers should use 0.alfred2003-01-211-1/+1
| | | | Merge M_NOWAIT/M_DONTWAIT into a single flag M_NOWAIT.
* Massive cleanup of the ip_mroute code.luigi2002-11-151-864/+522
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | No functional changes, but: + the mrouting module now should behave the same as the compiled-in version (it did not before, some of the rsvp code was not loaded properly); + netinet/ip_mroute.c is now truly optional; + removed some redundant/unused code; + changed many instances of '0' to NULL and INADDR_ANY as appropriate; + removed several static variables to make the code more SMP-friendly; + fixed some minor bugs in the mrouting code (mostly, incorrect return values from functions). This commit is also a prerequisite to the addition of support for PIM, which i would like to put in before DP2 (it does not change any of the existing APIs, anyways). Note, in the process we found out that some device drivers fail to properly handle changes in IFF_ALLMULTI, leading to interesting behaviour when a multicast router is started. This bug is not corrected by this commit, and will be fixed with a separate commit. Detailed changes: -------------------- netinet/ip_mroute.c all the above. conf/files make ip_mroute.c optional net/route.c fix mrt_ioctl hook netinet/ip_input.c fix ip_mforward hook, move rsvp_input() here together with other rsvp code, and a couple of indentation fixes. netinet/ip_output.c fix ip_mforward and ip_mcast_src hooks netinet/ip_var.h rsvp function hooks netinet/raw_ip.c hooks for mrouting and rsvp functions, plus interface cleanup. netinet/ip_mroute.h remove an unused and optional field from a struct Most of the code is from Pavlin Radoslavov and the XORP project Reviewed by: sam MFC after: 1 week
* Cast a ptrdiff_t to an int to printf.jhb2002-11-081-1/+1
|
* When a packet is multicast encapsulated, give labeled policies therwatson2002-10-201-0/+5
| | | | | | | opportunity to preserve the label. Obtained from: TrustedBSD Project Sponsored by: DARPA, Network Associates Laboratories
* Replace aux mbufs with packet tags:sam2002-10-161-2/+2
| | | | | | | | | | | | | | | | | | | o instead of a list of mbufs use a list of m_tag structures a la openbsd o for netgraph et. al. extend the stock openbsd m_tag to include a 32-bit ABI/module number cookie o for openbsd compatibility define a well-known cookie MTAG_ABI_COMPAT and use this in defining openbsd-compatible m_tag_find and m_tag_get routines o rewrite KAME use of aux mbufs in terms of packet tags o eliminate the most heavily used aux mbufs by adding an additional struct inpcb parameter to ip_output and ip6_output to allow the IPsec code to locate the security policy to apply to outbound packets o bump __FreeBSD_version so code can be conditionalized o fixup ipfilter's call to ip_output based on __FreeBSD_version Reviewed by: julian, luigi (silent), -arch, -net, darren Approved by: julian, silence from everyone else Obtained from: openbsd (mostly) MFC after: 1 month
* Since from now on encap_input() also catches IPPROTO_MOBILE and IPPROTO_GREsobomax2002-09-091-1/+1
| | | | | | | | packets in addition to IPPROTO_IPV4 and IPPROTO_IPV6, explicitly specify IPPROTO_IPV4 or IPPROTO_IPV6 instead of -1 when calling encap_attach(). MFC after: 28 days (along with other if_gre changes)
* Replace various spelling with FALLTHROUGH which is lint()ablecharnier2002-08-251-1/+1
|
* Just a comment on some additional consistency checks that couldluigi2002-06-261-0/+5
| | | | be added here.
* Back out my lats commit of locking down a socket, it conflicts with hsu's work.tanimura2002-05-311-2/+0
| | | | Requested by: hsu
* Lock down a socket, milestone 1.tanimura2002-05-201-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | o Add a mutex (sb_mtx) to struct sockbuf. This protects the data in a socket buffer. The mutex in the receive buffer also protects the data in struct socket. o Determine the lock strategy for each members in struct socket. o Lock down the following members: - so_count - so_options - so_linger - so_state o Remove *_locked() socket APIs. Make the following socket APIs touching the members above now require a locked socket: - sodisconnect() - soisconnected() - soisconnecting() - soisdisconnected() - soisdisconnecting() - sofree() - soref() - sorele() - sorwakeup() - sotryfree() - sowakeup() - sowwakeup() Reviewed by: alfred
* Revert the change of #includes in sys/filedesc.h and sys/socketvar.h.tanimura2002-04-301-8/+11
| | | | | | | | | | Requested by: bde Since locking sigio_lock is usually followed by calling pgsigio(), move the declaration of sigio_lock and the definitions of SIGIO_*() to sys/signalvar.h. While I am here, sort include files alphabetically, where possible.
* Fixed some style bugs in the removal of __P(()). Continuation linesbde2002-03-241-2/+2
| | | | | were not outdented to preserve non-KNF lining up of code with parentheses. Switch to KNF formatting.
* Prevent icmp_reflect() from calling ip_output() with a NULL routeru2002-03-221-1/+2
| | | | | | | | | | | | | | pointer which will then result in the allocated route's reference count never being decremented. Just flood ping the localhost and watch refcnt of the 127.0.0.1 route with netstat(1). Submitted by: jayanth Back out ip_output.c,v 1.143 and ip_mroute.c,v 1.69 that allowed ip_output() to be called with a NULL route pointer. The previous paragraph shows why this was a bad idea in the first place. MFC after: 0 days
* Remove __P.alfred2002-03-191-14/+14
|
* o Move NTOHL() and associated macros into <sys/param.h>. These aremike2002-02-181-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | deprecated in favor of the POSIX-defined lowercase variants. o Change all occurrences of NTOHL() and associated marcros in the source tree to use the lowercase function variants. o Add missing license bits to sparc64's <machine/endian.h>. Approved by: jake o Clean up <machine/endian.h> files. o Remove unused __uint16_swap_uint32() from i386's <machine/endian.h>. o Remove prototypes for non-existent bswapXX() functions. o Include <machine/endian.h> in <arpa/inet.h> to define the POSIX-required ntohl() family of functions. o Do similar things to expose the ntohl() family in libstand, <netinet/in.h>, and <sys/param.h>. o Prepend underscores to the ntohl() family to help deal with complexities associated with having MD (asm and inline) versions, and having to prevent exposure of these functions in other headers that happen to make use of endian-specific defines. o Create weak aliases to the canonical function name to help deal with third-party software forgetting to include an appropriate header. o Remove some now unneeded pollution from <sys/types.h>. o Add missing <arpa/inet.h> includes in userland. Tested on: alpha, i386 Reviewed by: bde, jake, tmm
* Allow for ip_output() to be called with a NULL route pointer.ru2001-12-011-2/+1
| | | | This fixes a panic I introduced yesterday in ip_icmp.c,v 1.64.
* fix int argument used in printf w/ %ld (cast to long)dillon2001-10-291-2/+3
|
* Fixed comment: ipip_input -> mroute_encapcheck.sumikawa2001-09-201-1/+1
| | | | Reported by: bde
* Removed ipip_input(). No codes calls it anymore due to ip_encap.c'ssumikawa2001-09-181-4/+0
| | | | encapsulation support.
* Patches from Keiichi SHIMA <keiichi@iij.ad.jp>julian2001-09-031-11/+8
| | | | | | to make ip use the standard protosw structure again. Obtained from: Well, KAME I guess.
* Somewhat modernize ip_mroute.c:fenner2001-07-251-173/+160
| | | | | | | - Use sysctl to export stats - Use ip_encap.c's encapsulation support - Update lkm to kld (is 6 years a record for a broken module?) - Remove some unused cruft
* Add ``options RANDOM_IP_ID'' which randomizes the ID field of IP packets.kris2001-06-011-0/+5
| | | | | | | | | This closes a minor information leak which allows a remote observer to determine the rate at which the machine is generating packets, since the default behaviour is to increment a counter for each packet sent. Reviewed by: -net Obtained from: OpenBSD
* Fix typo: seperate -> separate.asmodai2001-02-061-1/+1
| | | | Seperate does not exist in the english language.
* Lock down the network interface queues. The queue mutex must be obtainedjlemon2000-11-251-11/+1
| | | | | | | | | | | | | | 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.
* change the evaluation order of the rsvp socket in rsvp_input()kjc2000-09-171-31/+19
| | | | | | | | | | | | | | | | in favor of the new-style per-vif socket. this does not affect the behavior of the ISI rsvpd but allows another rsvp implementation (e.g., KOM rsvp) to take advantage of the new style for particular sockets while using the old style for others. in the future, rsvp supporn should be replaced by more generic router-alert support. PR: kern/20984 Submitted by: Martin Karsten <Martin.Karsten@KOM.tu-darmstadt.de> Reviewed by: kjc
* Follow BSD/OS and NetBSD, keep the ip_id field in network order all the time.ru2000-09-141-2/+1
| | | | Requested by: wollman
* Fixed broken ICMP error generation, unified conversion of IP headerru2000-09-011-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | fields between host and network byte order. The details: o icmp_error() now does not add IP header length. This fixes the problem when icmp_error() is called from ip_forward(). In this case the ip_len of the original IP datagram returned with ICMP error was wrong. o icmp_error() expects all three fields, ip_len, ip_id and ip_off in host byte order, so DTRT and convert these fields back to network byte order before sending a message. This fixes the problem described in PR 16240 and PR 20877 (ip_id field was returned in host byte order). o ip_ttl decrement operation in ip_forward() was moved down to make sure that it does not corrupt the copy of original IP datagram passed later to icmp_error(). o A copy of original IP datagram in ip_forward() was made a read-write, independent copy. This fixes the problem I first reported to Garrett Wollman and Bill Fenner and later put in audit trail of PR 16240: ip_output() (not always) converts fields of original datagram to network byte order, but because copy (mcopy) and its original (m) most likely share the same mbuf cluster, ip_output()'s manipulations on original also corrupted the copy. o ip_output() now expects all three fields, ip_len, ip_off and (what is significant) ip_id in host byte order. It was a headache for years that ip_id was handled differently. The only compatibility issue here is the raw IP socket interface with IP_HDRINCL socket option set and a non-zero ip_id field, but ip.4 manual page was unclear on whether in this case ip_id field should be in host or network byte order.
* Include machine/in_cksum.h to unbreak options MROUTING.ken2000-05-081-0/+1
|
* IPSEC support in the kernel.shin1999-12-221-12/+15
| | | | | | | | pr_input() routines prototype is also changed to support IPSEC and IPV6 chained protocol headers. Reviewed by: freebsd-arch, cvs-committers Obtained from: KAME project
* $Id$ -> $FreeBSD$peter1999-08-281-1/+1
|
* Add sufficient braces to keep egcs happy about potentially ambiguouspeter1999-05-061-4/+5
| | | | if/else nesting.
* Use dynamic memory allocation instead of mbuf's for multicast routingfenner1999-01-181-102/+82
| | | | | | | | | | state. Note: this requires a recompilation of netstat (but netstat has been broken since rev 1.52 of ip_mroute.c anyway) Obtained from: Significantly based on Steve McCanne's <mccanne@cs.berkeley.edu> work for BSD/OS
* Remove unused statics.eivind1999-01-121-5/+1
|
* Add missing "break"s to allow multicast routing to work.fenner1998-12-161-1/+3
| | | | Submitted by: Amancio Hasty <hasty@rah.star-gate.com>
* The "easy" fixes for compiling the kernel -Wunused: remove unreferenced staticarchie1998-12-071-4/+1
| | | | and local variables, goto labels, and functions declared but not defined.
* Yow! Completely change the way socket options are handled, eliminatingwollman1998-08-231-146/+151
| | | | | | another specialized mbuf type in the process. Also clean up some of the cruft surrounding IPFW, multicast routing, RSVP, and other ill-explored corners.
* Fixed printf format errors.bde1998-08-171-34/+36
|
* Byte count statistics of multicast vifs are invalid.phk1998-06-301-2/+2
| | | | | | | The problem is caused by a wrong endianess in the sum. PR: 7115 Submitted by: Joao Carlos Mendes Luis <jonny@jonny.eng.br>
* Seventy-odd "its" / "it's" typos in comments fixed as per kern/6108.des1998-04-171-2/+2
|
* Staticize.eivind1998-02-091-3/+3
|
* Back out DIAGNOSTIC changes.eivind1998-02-061-2/+1
|
* Turn DIAGNOSTIC into a new-style option.eivind1998-02-041-1/+2
|
* Removed unused #includes.bde1997-10-281-5/+1
|
* Update for new callout interface.gibbs1997-09-211-4/+6
|
* Remove crufty LBL ifdef that only applies to Suns.fenner1997-07-191-5/+1
| | | | Submitted by: Craig Leres <leres@ee.lbl.gov>
* Don't include <sys/ioctl.h> in the kernel. Stage 2: includebde1997-03-241-2/+2
| | | | <sys/sockio.h> instead of <sys/ioctl.h> in network files.
* Properly notice error returns from if_allmulti().wollman1997-02-211-2/+2
|
* Make the long-awaited change from $Id$ to $FreeBSD$jkh1997-01-141-1/+1
| | | | | | | | This will make a number of things easier in the future, as well as (finally!) avoiding the Id-smashing problem which has plagued developers for so long. Boy, I'm glad we're not using sup anymore. This update would have been insane otherwise.
* Use the new if_multiaddrs list for multicast addresses rather than thewollman1997-01-131-6/+4
| | | | | | | previous hackery involving struct in_ifaddr and arpcom. Get rid of the abominable multi_kludge. Update all network interfaces to use the new machanism. Distressingly few Ethernet drivers program the multicast filter properly (assuming the hardware has one, which it usually does).
OpenPOWER on IntegriCloud