summaryrefslogtreecommitdiffstats
path: root/sys/netinet/ip_output.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
...
* upgrade tcp/ip to use the latest in C89 technology: memcpy.tedu2015-12-051-8/+8
| | | | ok henning
* deleting ip_insertoptions() prototype, which is no longer neededsashan2015-12-031-2/+1
| | | | | | (follow up on my earlier commit) OK bluhm@
* add ifdef IPSEC for protoypes; requested by mpi@markus2015-12-031-1/+3
|
* Remove broadcast matching from ifa_ifwithaddr(), use in_broadcast() wherevgross2015-12-031-8/+6
| | | | | | required. ok bluhm@ mpi@.
* factor out ip_output_ipsec_{lookup,send}(); with & ok claudio@markus2015-12-021-165/+146
|
* Kill the RT_REPORT flag to rtalloc() and stop sending RTM_MISS messagesclaudio2015-12-021-5/+4
| | | | | | for failed route lookups. This is something that was maybe useful in the 90is but in this modern times it is just annoying and nothing expect it anyway. OK mpi@, sthen@
* typo in commentmmcc2015-12-011-2/+2
|
* Use rtalloc(9) to look for a local address (RTF_LOCAL) in ip_setmoptions().mpi2015-11-261-7/+17
| | | | | | This simplifies the if_get()/if_put() dance. Tested by jasper@
* Grab the KERNEL_LOCK around ip_mforward(), in preparation for unlockingmpi2015-11-191-2/+7
| | | | | | ip_output(). Note that ipmforwarding is not enabled by default.
* Store the index of the lo0 interface instead of a pointer to itsmpi2015-11-111-2/+2
| | | | | | | | descriptor. Allow to get rid of two if_ref() in the output paths. ok dlg@
* Disable TCP/UDP TX hardware checksumming if an IPv4 packet containsnaddy2015-11-031-5/+5
| | | | | | IP options or if an IPv6 packet contains header extensions. Required by cnmac(4) and a sensible precautionary measure in general. ok visa@, mikeb@
* Convert some if_ref() to if_get().mpi2015-10-241-2/+2
| | | | ok claudio@
* add a new getsockopt option IP_IPDEFTTL to retrieve the default ttl.benno2015-10-201-1/+6
| | | | | | this can be used as an alternative to sysctl net.inet.ip.ttl, in programs that use pledge(). ok reyk@, "Like this" deraadt@
* Stop checking for RTF_UP directly, call rtisvalid(9) instead.mpi2015-10-191-3/+3
| | | | | | While here add a missing ``rtableid'' check in in_selectsrc(). ok bluhm@
* Use rtisivalid(9) to check if the given (cached) route can be used.mpi2015-10-131-3/+3
| | | | | | | | | | | | | | | | | | Note that after calling rtalloc(9) we only check if a route has been returned or not and do not check for its validity. This cannot be improved without a massive refactoring. The kernel currently *do* use !RTF_UP route due to a mismatch between the value of ifp->if_link_state and the IFF_UP|IFF_RUNNING code. I'd explain the RTF_UP flag as follow: . If a cached route entry w/o RTF_UP is passed to ip{6,}_output(), . call rtalloc(9) to see if a better entry is present in the tree. This is enough to support MPATH and route cache invalidation. ok bluhm@
* easy size for free(); ok mpideraadt2015-10-071-2/+4
|
* Always increment rt_use inside rtalloc(9) instead of doing it in somempi2015-09-231-2/+1
| | | | | | specific places. ok claudio@, benno@
* There's no point in abstracting ifp->if_output() as long as pf_test()mpi2015-09-131-3/+3
| | | | | | needs to see lo0 in the output path. ok claudio@
* Get the default loopback interface pointer just after doing a routempi2015-09-131-2/+5
| | | | | | | | | lookup to ensure pf_test() is called with the same interface in the input annd output path for local traffic. Fix a regression reported by Heiko Zimmermann on bugs@, thanks! ok mikeb@, claudio@
* Stop overwriting the rt_ifp pointer of RTF_LOCAL routes with lo0ifp.mpi2015-09-121-7/+4
| | | | | | | | | Use instead the RTF_LOCAL flag to loop local traffic back to the corresponding protocol queue. With this change rt_ifp is now always the same as rt_ifa->ifa_ifp. ok claudio@
* Introduce if_input_local() a function to feed local traffic back tompi2015-09-121-2/+2
| | | | | | | | | | the protocol queues. It basically does what looutput() was doing but having a generic function will allow us to get rid of the loopback hack overwwritting the rt_ifp field of RTF_LOCAL routes. ok mikeb@, dlg@, claudio@
* Fix two cases where it was possible to call if_put with an uninitialized ifpclaudio2015-09-121-3/+3
| | | | Found by jsg@ with clang
* if_put() after if_get for ip_output. This became suddenly super trivial.claudio2015-09-111-2/+6
| | | | OK dlg@
* There is no need to do the route lookups twice just because of IPSec.claudio2015-09-111-114/+50
| | | | | Merge the two blocks into one that is executed before the IPSec tdb lookup. OK mpi@ which had a sent out a similar diff around 3 years ago.
* Revert (again!) the two uses of rtisvalid(9), they break NFS!mpi2015-09-031-17/+11
| | | | Found the hardway by naddy@
* Convert ip{,6}_output() (cached) route entry checks to rtisvalid(9).mpi2015-09-031-11/+17
| | | | | | | | | This introduces a behavior change as we now reject !RTF_UP routes to output packets. This stricter check exposed a bug in the setup of new routes and was the reason for the previous revert. This should be now fixed by r1.229 of sys/net/route.c . ok bluhm@
* Revert the two uses of rtisvalid(9) for the moment, it breaks dhclient(8)mpi2015-09-021-17/+11
| | | | | | | | configured networks on RAMDISK kernels. The problem is that the default route installed by dhclient(8) does not have the RTF_UP flag in this environement and rtisvalid(9) doesn't allow you to use a RTF_DOWN route.
* Convert ip{,6}_output() (cached) route entry checks to rtisvalid(9).mpi2015-09-011-11/+17
| | | | ok bluhm@
* `encif' should only be used under #ifdef NPF.mpi2015-08-311-2/+2
| | | | Reported by jsg@, ok deraadt@
* Kill IP_ROUTETOETHER.mpi2015-07-161-13/+4
| | | | | | | | | This pseudo-option is a hack to support return-rst on bridge(4). It passes Ethernet information via a "struct route" through ip_output(). "struct route" is slowly dying... ok claudio@, benno@
* m_freem() can handle NULL, do not check for this condition beforehands.deraadt2015-07-151-2/+2
| | | | ok stsp mpi
* Get rid of the undocumented & temporary* m_copy() macro added formpi2015-06-301-2/+2
| | | | | | | | compatibility with 4.3BSD in September 1989. *Pick your own definition for "temporary". ok bluhm@, claudio@, dlg@
* Store a unique ID, an interface index, rather than a pointer to thempi2015-06-161-2/+2
| | | | | | | | | | | | | | | receiving interface in the packet header of every mbuf. The interface pointer should now be retrieved when necessary with if_get(). If a NULL pointer is returned by if_get(), the interface has probably been destroy/removed and the mbuf should be freed. Such mechanism will simplify garbage collection of mbufs and limit problems with dangling ifp pointers. Tested by jmatthew@ and krw@, discussed with many. ok mikeb@, bluhm@, dlg@
* Replace a bunch of == 0 with == NULL in pointer tests. Nuke somekrw2015-06-071-11/+11
| | | | | | | annoying trailing, leading and embedded whitespace. No change to .o files. ok deraadt@
* remove PACKET_TAG_IPSEC_PENDING_TDB, it is never set; ok mikeb@markus2015-05-231-18/+3
|
* test mbuf pointers against NULL not 0jsg2015-05-131-6/+6
| | | | ok krw@ miod@
* Stubs and support code for NIC-enabled IPsec bite the dust.mikeb2015-04-171-16/+2
| | | | No objection from reyk@, OK markus, hshoexer
* remove unfinished/unused support for socket-attached ipsec-policiesmarkus2015-04-161-172/+1
| | | | ok mikeb
* Remove support for storing credentials and auth information in the kernel.mikeb2015-04-141-70/+1
| | | | | | | | | This code is largely unfinished and is not used for anything. The change leaves identities as only objects referenced by ipsec_ref structure and their handling requires some changes to support more advanced matching of IPsec connections. No objections from reyk and hshoexer, with and OK markus.
* Remove the "multicast_" prefix from the fields a multicast-only struct.mpi2014-12-171-11/+11
| | | | Prodded by claudio@ and mikeb@
* Use an interface index instead of a pointer for multicast options.mpi2014-12-171-11/+10
| | | | | | | | | | | | Output interface (port) selection for multicast traffic is not done via route lookups. Instead the output ifp is registred when setsockopt(2) is called with the IP{V6,}_MULTICAST_IF option. But since there is no mechanism to invalidate such pointer stored in a pcb when an interface is destroyed/removed, it might lead your kernel to fault. Prevent a fault upon resume reported by frantisek holop, thanks! ok mikeb@, claudio@
* Do not use a "struct route" when a "struct rtentry" is enough.mpi2014-12-081-15/+12
| | | | ok millert@, bluhm@
* Explicitly include <net/if_var.h> instead of pulling it in <net/if.h>.mpi2014-12-051-1/+2
| | | | ok mikeb@, krw@, bluhm@, tedu@
* sizes for simple free cases. sizeof(*) and one case where len is clear.tedu2014-11-201-11/+11
|
* Kill in_iawithaddr() and use ifa_ifwithaddr() directly.mpi2014-11-051-12/+24
| | | | | | | Note that ifa_ifwithaddr() might return a broadcast address, so if you don't want one make sure to filter them out. ok mikeb@
* Rename rtalloc1() into rtalloc(9) and convert its flags to only enablempi2014-11-011-4/+5
| | | | | | functionnality instead of a mix of enable/disable. ok bluhm@, jca@
* Use rtfree() instead of RTFREE(), NULLify some free'd route pointers andmpi2014-10-141-7/+7
| | | | | | kill the macro. ok mikeb@, henning@
* Check if the outgoing route is associated to a broadcast address insteadmpi2014-10-081-3/+3
| | | | | | of doing a lookup on all the addresses of the outgoing interface. ok henning@
* Kill rtalloc() and update rtalloc1() and rtalloc_mpath() to no longermpi2014-09-271-3/+5
| | | | | | rely on "struct route" that should die. ok claudio@
* Fewer <netinet/in_systm.h> !mpi2014-07-221-2/+1
|