summaryrefslogtreecommitdiff
path: root/sys/net
AgeCommit message (Collapse)Author
2016-11-03Fix debug message to print the presence of more flag correctly.Rafael Zalamena
ok mikeb@
2016-11-03Always call if_put() during the interface iteration on port status multipartRafael Zalamena
reply to avoid reference leaks. ok mikeb@
2016-11-03The networking code no longer runs off software interrupts.Martin Pieuchot
2016-10-31Improve ofp_error message accurateness: use parameterized error typeRafael Zalamena
instead of hardcoding it. With this we can change the error type to something else and get a more accurate description of what happened. ok reyk@
2016-10-31Change validation functions prototypes: use the parameter variable toRafael Zalamena
return the error code and the return value to signal if the validation was successful or not. With this we can signal some errors in the spec that uses the value 0 (zero). ok reyk@
2016-10-30add __BEGIN_DECLS/__END_DECLS to the public userland side of net/bpf.h,Peter Hessler
so c++ programs can use them. OK jca@
2016-10-28The function swofp_flow_entry_put_instructions() doesn't need to receiveRafael Zalamena
a pointer to a mbuf pointer, because it only uses the mbuf for reading. ok reyk@
2016-10-28Change swofp_flow_table_add() malloc() behaviour to be non-blocking likeRafael Zalamena
all others that we can find in switch(4). ok reyk@
2016-10-28Simplify the OFP_FLOW_MOD_MSG_INSTRUCTION_OFFSET() by using another macroRafael Zalamena
already does exactly what it wants to do. ok reyk@
2016-10-28Rename pad fields to have struct prefixes, remove useless whitespaces andRafael Zalamena
add missing action_set_queue struct. ok reyk@
2016-10-28Remove unused function, the code is already inlined in action_outputRafael Zalamena
function. ok reyk@
2016-10-28When doing pktout we must run the classifier again, because some action(s)Rafael Zalamena
might want to use it. For buffered packets we probably need to save that somehow else, but we don't support it now. ok reyk@
2016-10-28- once rule should not attempt to remove its parent rule.Alexandr Nedvedicky
(problem pointed out by Petr, fix proposed by Dilli) _at_ oracle
2016-10-27Pass a struct pf_pdesc to pf_route() like it is done in the otherAlexander Bluhm
pf functions. That means less parameters, more consistency and later we can call functions that need a pd from pf_route(). OK sashan@
2016-10-27Avoid a use after free in swofp_flow_timeout(). TheJonathan Gray
swofp_flow_entry_delete() call frees the memory pointed to by the swfe variable which was used later in the loop. ok rzalamena@
2016-10-27add a new pool for 2k + 2 byte (mcl2k2) clusters.David Gwynne
a certain vendor likes to make chips that specify the rx buffer sizes in kilobyte increments. unfortunately it places the ethernet header on the start of the rx buffer, which means if you give it a mcl2k cluster, the ethernet header will not be ETHER_ALIGNed cos mcl2k clusters are always allocated on 2k boundarys (cos they pack into pages well). that in turn means the ip header wont be aligned correctly. the current workaround on these chips has been to let non-strict alignment archs just use the normal 2k cluster, but use whatever cluster can fit 2k + 2 on strict archs. that turns out to be the 4k cluster, meaning we waste nearly 2k of space on every packet. properly aligning the ethernet header and ip headers gives a performance boost, even on non-strict archs.
2016-10-26Put union pf_headers and struct pf_pdesc into separate header fileAlexander Bluhm
pfvar_priv.h. The pf_headers had to be defined in multiple .c files before. In pfvar.h it would have unknown storage size, this file is included in too many places. The idea is to have a private pf header that is only included in the pf part of the kernel. For now it contains pf_pdesc and pf_headers, it may be extended later. discussion, input and OK henning@ procter@ sashan@
2016-10-25Make kernel without INET6 compile again.Alexander Bluhm
OK mikeb@
2016-10-23Don't free mbuf on error during swofp_flow_entry_put_instructions() parse,Rafael Zalamena
otherwise we won't have the request ofp_header to send in the error message. ok jca@
2016-10-21tag large constants as ULL to fix the build of switch(4) on ILP32 archsJonathan Gray
ok jca@ deraadt@
2016-10-20- PF should send a challenge ACK as response to SYN, which matches existingAlexandr Nedvedicky
state. Extra thanks goes to bluhm@ for careful testing and fixing patch I've sent to tech@ O.K. henning@ bluhm@
2016-10-19Lets just be safe and check M_PREPEND return values for functions thatRafael Zalamena
madj() and injects back the layer 2/3 contents. ok lteo@
2016-10-19Remove the if_input task from the correct taskq.YASUOKA Masahiko
ok bluhm henning
2016-10-18split pf_send_tcp() into the part that builds the mbuf and the actualHenning Brauer
sending, needed soon. ok sashan mikeb lteo
2016-10-18The variable dlen is always positive and d may be negative. SoAlexander Bluhm
declare both with the correct sign in pf_change_icmp_af(). OK henning@
2016-10-18The checksum of a ICMP "need to frag" packet for TCP was wrong whenAlexander Bluhm
created from a ICMP6 "too big" packet. The function pf_change_icmp_af() has code to adjust the pseudo-header checksum in the ICMP6 case, but pf_test_state_icmp() changed the proto before the case was entered. So call pf_change_icmp_af() before the pd->proto is converted in the TCP and UDP payload case like it was already done for ICMP and ICMP6 payload. Found by sys/net/pf_forward regress test; OK henning@
2016-10-18Place splsoftnet() in route_input() to shut up splassert warningsAlexander Bluhm
in sorwakeup(). Report from egorenar-dev at posteo.net; OK henning@
2016-10-16m_resethdr() clears information attached to a mbuf that has beenAlexander Bluhm
accumulated during processing, especially pf(4) data is removed. When a packet is reinserted to local input processing, we have to start from scratch with a clean mbuf header. Also the packet has to be in the routing doamin of the interface where it is inserted. Incoming packet with stale inp pointer seen by patrick@ on lo(4); OK sashan@ mpi@
2016-10-16Fix bpf_catchpacket comment.Jeremie Courreges-Anglas
2016-10-14Fulfil our contractual obligations with ether_inputMike Belopuhov
Since ether_input expects the m_data to point directly at the Ethernet header and most upper layer protocols immediately following Ethernet expect their headers to be aligned to the 4 byte boundary, we need to ensure that the decapsulated VXLAN packet payload satisfies these requirements. prompted by a diff by vgross@, with input from dlg@, ok yasuoka
2016-10-12When sending a action_output for a table-miss to the controller theRafael Zalamena
reason is always NO_MATCH. This fixes the compatibility with switchd(8) which already works with other switches. input from goda@ ok reyk@
2016-10-11Small code improvements:Rafael Zalamena
- use the same idiom as switchd(8) to calculate alignment; - use oxm_value instead of doing pointer arithmetic; - typo fix: 'recived' -> 'received'; - remove unused variable; - use definition instead of hardcoded value; ok reyk@
2016-10-11Strengthen Ethernet packet length checks on input; ok dlgMike Belopuhov
2016-10-10ensure prepended ethernet headers are placed on ETHER_ALIGN boundaries,David Gwynne
even if m_prepend allocates a new mbuf in front of the current one. this is done by asking M_PREPEND for ETHER_HDR_LEN + ETHER_ALIGN bytes, and then calling m_adj(ETHER_ALIGN) after. in the case M_PREPEND does not allocate a new mbuf and ends up with the same layout as before. in the allocation case, the requested length is provided on a long boundary. an ETHER_HDR_LEN request would therefore be 6 bytes allocated on a long boundary, when we want it to be at ETHER_ALIGN. by asking for ETHER_HDR_LEN plus ETHER_ALIGN, we can m_adj ETHER_ALIGN off to get us to the ETHER_ALIGN offset. ok yasuoka@ mikeb@
2016-10-09This needs radix.h because it uses rn_refines().Claudio Jeker
OK guenther@
2016-10-09formatting nit (a tab got lost somewhen)Henning Brauer
2016-10-08Add missing if_put() in the switch(4) destroy path.Rafael Zalamena
ok mikeb@
2016-10-08Check for the correct header length size. MINCLSIZE is used for cluster,Rafael Zalamena
instead we should use MHLEN for header size. ok mikeb@
2016-10-08Instead of setting errno and then doing a goto do a m_freem() and return error.Claudio Jeker
Same thing but nicer to read. OK henning@
2016-10-07Use detach hook to notify switch(4) about interface removals instead ofRafael Zalamena
adding code to if.c. ok mpi@
2016-10-07Fix vxlan_lookup() to comply the assumption of ether_input(). Put theYASUOKA Masahiko
entire ethernet header on first mbuf and align 32bit at the payload. Also fix the vxlan_output() not to cause an alignment fault. Use a new mbuf for VXLAN header instead of M_PREPEND to make sure that the mbuf is aligned 32bit. This is required to align 32 bit at the outer IP header. input vgross mikeb ok dlg
2016-10-06Remove redundant comments that say a function must be called atAlexander Bluhm
splsoftnet() if the function does a splsoftassert(IPL_SOFTNET) anyway.
2016-10-05rt_timer_timer() needs a process context because it messes with theMartin Pieuchot
routing table. Found the hardway by Chris Jackman.
2016-10-04Don't use padding for ofp_action_header when building the table propertyRafael Zalamena
response thus respecting what the OpenFlow 1.3.5 spec says. ok reyk@
2016-10-04Correct the flag checks inside rt_ifa_addlocal(9) and rt_ifa_dellocal(9).Martin Pieuchot
There's no need to insert an RTF_LOCAL route if it is already there, not if a route with the same destination exist. This fixes a KASSERT() triggered by adding an alias for an address already present in the ARP cache as reported by weerd@ and Peter J. Philipp. This should also fix a KASSERT() triggered by a NDP change reported by Sebastien Marie. ok bluhm@
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-10-03Use detach hook to notify bridge(4) about span port removals.Rafael Zalamena
ok mpi@
2016-10-03Use detach hook to notify bridge of interface removal instead of addingRafael Zalamena
code to if.c. ok mpi@
2016-09-30sync ofp.h from switchd, add missing commentsReyk Floeter
2016-09-30Accept a packet smaller than ETHERMIN.YASUOKA Masahiko
ok reyk