summaryrefslogtreecommitdiff
path: root/sys/net/if_pflow.c
AgeCommit message (Collapse)Author
2016-10-04Convert timeouts that need a process context to timeout_set_proc(9).Martin Pieuchot
The current reason is that rtalloc_mpath(9) inside ip_output() might end up inserting a RTF_CLONED route and that require a write lock. ok kettenis@, bluhm@
2016-04-29Make if_output() return EAFNOSUPPORT instead of just dropping packetsKenneth R Westerback
and pretending the output succeeded. Packets are still dropped! Idea from jsg@ following same change to bridge(4). ok mpi@
2015-10-03IPv6 transport for pflow data.Florian Obser
Input deraadt@ Bug fix & OK benno@
2015-09-12Call socreate(9) only when we have a destination ip and port.Florian Obser
Call sobind(9) only when we have a source ip. With this we can treat sc->so != NULL as a flag if the interface is in state IFF_RUNNING. Input & OK bluhm@, OK benno@
2015-09-09size for free()Florian Obser
OK semarie@, deraadt@
2015-09-04pflow_flush() still needs sc->send_nam; free it later.Florian Obser
2015-09-04Fix an mbuf use-after-fruit in pflow_clone_create().Martin Pieuchot
Issue reported by semarie@ on bugs@ who also isolated the use-after-fruit to pflow(4) using dlg@'s tracing mbuf diff. Inputs from and ok florian@, semarie@, benno@
2015-07-21We don't do 'ARGSUSED' anymoreFlorian Obser
2015-07-21use curproc instead of proc0Florian Obser
pointed out by and OK bluhm@
2015-07-20Use the kernel socket interface (sosend(9) etc) instead of shovingFlorian Obser
packets directly into the network stack with ip_output(). The locking is intentionally left as is and will be improved in another commit. Input / OK bluhm@, OK benno@
2015-07-16add missing malloc checkFlorian Obser
OK benno@
2015-06-16Store a unique ID, an interface index, rather than a pointer to theMartin Pieuchot
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@
2015-06-07Introduce unhandled_af() for cases where code conditionally doesJonathan Gray
something based on an address family and later assumes one of the paths was taken. This was initially just calls to panic until guenther suggested a function to reduce the amount of strings needed. This reduces the amount of noise with static analysers and acts as a sanity check. ok guenther@ bluhm@
2014-12-19unifdef INET in net code as a precursor to removing the pretend option.Ted Unangst
long live the one true internet. ok henning mikeb
2014-11-20Yet more #include de-duplication.Kenneth R Westerback
ok deraadt@ tedu@
2014-11-18move arc4random prototype to systm.h. more appropriate for most codeTed Unangst
to include that than rdnvar.h. ok deraadt dlg
2014-08-13Bring IPFIX sequence numbers in line with the RFC; originalBret Lambert
diff from benno@. ok benno@, florian@
2014-07-22Fewer <netinet/in_systm.h> !Martin Pieuchot
2014-07-12add a size argument to free. will be used soon, but for now default to 0.Ted Unangst
after discussions with beck deraadt kettenis.
2014-04-21ip_output() using varargs always struck me as bizarre, esp since it's onlyHenning Brauer
ever used to pass on uint32 (for ipsec). stop that madness and just pass the uint32, 0 in all cases but the two that pass the ipsec flowinfo. ok deraadt reyk guenther
2014-04-14"struct pkthdr" holds a routing table ID, not a routing domain one.Martin Pieuchot
Avoid the confusion by using an appropriate name for the variable. Note that since routing domain IDs are a subset of the set of routing table IDs, the following idiom is correct: rtableid = rdomain But to get the routing domain ID corresponding to a given routing table ID, you must call rtable_l2(9). claudio@ likes it, ok mikeb@
2014-03-29Kill pflowproto 9, it's unfixable post 2038, a better, standardizedFlorian Obser
option is pflowproto 10. Also it duplicates a lot of code from pflowproto 10 and will get in the way in the future. OK benno@
2014-01-24computing the ip csum just before the bpf mtap and only if there is aHenning Brauer
consumer just to please tcpdump is stupid and not done anywhere else. kill with fire. ok benno
2014-01-21allow pflow(4) to determine the src IP address based on the routeSebastian Benoit
table if flowsrc is not set. Now works with new udp checksum code. From Nathanael Rensen (nathanael.openbsd AT list DOT polymorpheus DOT com), tweak and ok florian@
2013-11-01Send pflow(4) packets in the correct rdomain.Florian Obser
From Anders Berggren (anders AT halon DOT se), thanks. OK henning, benno
2013-10-19simplify: no need to muck with the pseudo hdr cksum any moreHenning Brauer
ok lteo florian
2013-10-17The header file netinet/in_var.h included netinet6/in6_var.h. ThisAlexander Bluhm
created a bunch of useless dependencies. Remove this implicit inclusion and do an explicit #include <netinet6/in6_var.h> when it is needed. OK mpi@ henning@
2013-09-13Don't send flows if flowsrc is not set. Packages had a brokenFlorian Obser
checksum. Since no one seems to have a use case for sending flows from INADDR_ANY disallow this. Pointed out by Nathanael Rensen on tech@, thanks. While there make the SIOCSIFFLAGS and SIOCSETPFLOW cases symmetric by only sending templates if the interface is running. OK benno@
2013-08-13Split pflow version 9 and version 10 to be able to send 64 bitFlorian Obser
time values for version 10. While there mark places which will blow up in 2038. OK benno@
2013-08-10Cancel timeouts on pflow interface destruction.Florian Obser
OK benno@
2013-07-05bring back pflow v10; broken in previous commit, sorry.Florian Obser
ok benno@
2013-05-31export the original aka untranslated address for af-to in pflowFlorian Obser
inspired by benno@'s previous diff for nat-to tests/ok benno@
2013-05-30export the original aka untranslated address in pflowSebastian Benoit
ok florian@ henning@
2013-05-03Export ingress/egress interface index in pflow(4).Florian Obser
Report that this is needed for some netflow collector and tests by Chris Ivancic & Colin Ligertwood. OK mikeb@, benno@
2013-04-10Remove various external variable declaration from sources files andMartin Pieuchot
move them to the corresponding header with an appropriate comment if necessary. ok guenther@
2013-03-28code that calls timeout functions should include timeout.hTed Unangst
slipped by on i386, but the zaurus doesn't automagically pick it up. spotted by patrick
2013-03-28no need for a lot of code to include proc.hTed Unangst
2013-03-26Remove various read-only *maxlen variables and use IFQ_MAXLEN directly.Martin Pieuchot
ok beck@, mikeb@
2013-02-05netflow v10 omitted the sysUpTime flow set header field fromFlorian Obser
v9. Without it it's not possible to find out at what time a flow started/ended with only flowStartSysUpTime/flowEndSysUpTime. Fix this by using flowStartSeconds/flowEndSeconds for v10. Problem reported by Chris Ivancic and Colin Ligertwood, analyzed by benno@ Tested by benno@ against nprobe (which doesn't care that much one way or the other) Tested by Chris Ivancic against solarwinds collector. OK benno@
2013-01-16switch from using softclock ticks to getnanotime when putting time on theDavid Gwynne
wire for v5 packets. ok (and lots of gentle prodding from) florian@
2012-11-08wrap bpfilter portion with #if NBPFILTER > 0.Gleydson Soares
fix kernel builds without bpfilter. OK sthen@ mikeb@ deraadt@ henning@
2012-10-30Use time_uptime for expiration values as time_second can be skewed atFlorian Obser
runtime while time_uptime is monotonic. Prevent underflows in pfsync(4) and pflow(4) by using signed variables. pfsync(4) problem pointed out by camield. Diff originally by dlg, frag and pflow bits by me. feedback dlg man page tweak jmc Various versions of the pflow bits tested by Hrvoje Popovski (hrvoje AT srce DOT hr), thanks! ok benno, henning, dlg
2012-04-11fix all the suser calls which pass an incorrect p_acflag argument;Mike Belopuhov
figured out by and ok guenther
2012-02-02add netflow v9/ipfix support to pflow(4).Sebastian Benoit
large parts written by Florian Obser (florian -at- narrans -dot- de). feedback from sperreault@ gollo@ sthen@ ok from gollo@ dlg@ henning@
2011-11-25use time_uptime to set state creation values as time_second can beDavid Gwynne
skewed at runtime by things like date(1) and ntpd. time_uptime is monotonic and therefore more useful to compare against. ok deraadt@ mikeb@
2011-07-09honor the net.inet.udp.checksum setting.David Hill
ok claudio henning yasuoka
2011-07-06cosnistently use IFQ_SET_MAXLEN, surfaced in a discussion with + ok bluhmHenning Brauer
2011-04-05mechanic rename M_{TCP|UDP}V4_CSUM_OUT -> M_{TCP|UDP}_CSUM_OUTHenning Brauer
ok claudio krw
2010-07-02m_copyback can fail to allocate memory, but is a void fucntion so gymnasticsBret Lambert
are required to detect that. Change the function to take a wait argument (used in nfs server, but M_NOWAIT everywhere else for now) and to return an error ok claudio@ henning@ krw@
2010-04-20remove proc.h include from uvm_map.h. This has far reaching effects, asTed Unangst
sysctl.h was reliant on this particular include, and many drivers included sysctl.h unnecessarily. remove sysctl.h or add proc.h as needed. ok deraadt