aboutsummaryrefslogtreecommitdiff
path: root/lib/packets.c
AgeCommit message (Collapse)Author
2013-06-05packets: Fix typo in reserved multicast Ethernet addresses.Ben Pfaff
The reserved multicast Ethernet addresses begin with 01:80:c2, not 01:08:c2. Reported-by: Padmanabhan Krishnan <kprad1@yahoo.com> Signed-off-by: Ben Pfaff <blp@nicira.com> Acked-by: Ethan Jackson <ethan@nicira.com>
2013-01-28packets: Create global helper is_ip_any().Ethan Jackson
Used outside of meta-flow in future patches. Signed-off-by: Ethan Jackson <ethan@nicira.com>
2013-01-16Remove useless use of <assert.h>.Ben Pfaff
These files #included <assert.h> but didn't ever use assert. Signed-off-by: Ben Pfaff <blp@nicira.com> Acked-by: Ethan Jackson <ethan@nicira.com>
2012-12-12packets: Change IP_ARGS interface to take an ovs_be32 instead of a pointer.Ben Pfaff
An ovs_be32 is a more obvious way to represent an IP address than a pointer to one. It is also more type-safe, especially since "sparse" is able to check that the argument is in network byte order. Signed-off-by: Ben Pfaff <blp@nicira.com> Acked-by: Ethan Jackson <ethan@nicira.com>
2012-11-13datapath: add ipv6 'set' actionAnsis Atteka
This patch adds ipv6 set action functionality. It allows to change traffic class, flow label, hop-limit, ipv6 source and destination address fields. Acked-by: Jesse Gross <jesse@nicira.com> Signed-off-by: Ansis Atteka <aatteka@nicira.com>
2012-07-26packets: Remove redundant RARP header.Ethan Jackson
Rarp packets had their own header definition in the packets library. This doesn't make sense because they have the same packet format as arps. Signed-off-by: Ethan Jackson <ethan@nicira.com>
2012-07-26packets: First-hop router redundancy protocol MAC addresses are not BPDUs.Ben Pfaff
Commit c93f9a78c349 (packets: Update the reserved protocols list.) added a number of first-hop router redundancy protocol MAC addresses to the list of BPDU MAC addresses. This means that packets destined to those MAC addresses are dropped when other-config:forward-bpdu is set to false on a bridge (the default setting). However, this behavior is incorrect, because these MAC addresses are not special in the way that, say, STP frames are special. STP is a switch-to-switch protocol that end hosts have no use for, but end hosts do speak directly to routers on the MAC addresses assigned by VRRP and the other protocols in this category. Therefore, dropping packets in this category means that end hosts can no longer talk to their first-hop router, if that router is running one of these protocols. This commit also refines the match used for EDP and EAPS, and adds Cisco CFM to the protocols that are dropped. After this commit, the following destination MACs are dropped: - 01:08:c2:00:00:00 - 01:08:c2:00:00:01 - 01:08:c2:00:00:02 - 01:08:c2:00:00:03 - 01:08:c2:00:00:04 - 01:08:c2:00:00:05 - 01:08:c2:00:00:06 - 01:08:c2:00:00:07 - 01:08:c2:00:00:08 - 01:08:c2:00:00:09 - 01:08:c2:00:00:0a - 01:08:c2:00:00:0b - 01:08:c2:00:00:0c - 01:08:c2:00:00:0d - 01:08:c2:00:00:0e - 01:08:c2:00:00:0f - 00:e0:2b:00:00:00 - 00:e0:2b:00:00:04 - 00:e0:2b:00:00:06 - 01:00:0c:00:00:00 - 01:00:0c:cc:cc:cc - 01:00:0c:cc:cc:cd - 01:00:0c:cd:cd:cd - 01:00:0c:cc:cc:c0 - 01:00:0c:cc:cc:c1 - 01:00:0c:cc:cc:c2 - 01:00:0c:cc:cc:c3 - 01:00:0c:cc:cc:c4 - 01:00:0c:cc:cc:c5 - 01:00:0c:cc:cc:c6 - 01:00:0c:cc:cc:c7 Bug #12618. CC: Ben Basler <bbasler@nicira.com> Signed-off-by: Ben Pfaff <blp@nicira.com>
2012-06-12Allow general masking of IPv6 addresses rather than just CIDR masks.Ben Pfaff
OF1.2 and later make these fields fully maskable so we might as well also. Reviewed-by: Simon Horman <horms@verge.net.au> Signed-off-by: Ben Pfaff <blp@nicira.com>
2012-06-12Allow general masking of IPv4 addresses rather than just CIDR masks.Ben Pfaff
OF1.1 and later make these fields fully maskable so we might as well also. Reviewed-by: Simon Horman <horms@verge.net.au> Signed-off-by: Ben Pfaff <blp@nicira.com>
2012-06-07packets: Rename compose_benign_packet().Ethan Jackson
The name compose_rarp() more clearly describes what it's doing now. Requested-by: Justin Pettit <jpettit@nicira.com> Signed-off-by: Ethan Jackson <ethan@nicira.com>
2012-06-07packets: Use RARPs for learning packets.Ethan Jackson
Traditionally Open vSwitch had used 802.2 SNAP packets to update upstream switch learning tables when necessary. This approach had advantages in that debugging information could be embedded in the packet helping hapless admins figure out what's going on. However, since both qemu and VMware use RARP for this purpose, it seems appropriate to fall in line with the defacto standard. Requested-by: Ben Basler <bbasler@nicira.com> Signed-off-by: Ethan Jackson <ethan@nicira.com>
2012-06-06packets: Update the reserved protocols list.Ethan Jackson
The protocols added in this patch should be considered "reserved" and not forward when "forward-bpdu" is false, nor should they be mirrored. Bug #11755. Signed-off-by: Ethan Jackson <ethan@nicira.com>
2012-06-06packets: Generalize reserved RSPAN protocols.Ethan Jackson
Open vSwitch refuses to mirror certain destination addresses in addition to those classified by eth_addr_is_reserved(). Looking through the uses of eth_addr_is_reserved(), one finds that no callers should be using the additional addresses which mirroring drops. This patch folds the additional addresses dropped in the mirroring code, into the more general eth_addr_is_reserverd() function. This patch also changes the implementation in a way that is slightly less efficient, but much easier to read and extend int he future. Bug #11755. Signed-off-by: Ethan Jackson <ethan@nicira.com>
2012-05-29flow: Adds support for arbitrary ethernet maskingJoe Stringer
Arbitrary ethernet mask support is one step on the way to support for OpenFlow 1.1+. This patch set seeks to add this capability without breaking current protocol support. Signed-off-by: Joe Stringer <joe@wand.net.nz> [blp@nicira.com made some updates, see http://openvswitch.org/pipermail/dev/2012-May/017585.html] Signed-off-by: Ben Pfaff <blp@nicira.com>
2012-05-29packets: Adds ethernet-matching helper functionsJoe Stringer
With OpenFlow 1.1 requiring arbitrary ethernet match support, it simplifies other code if we have some extra helper functions. This patch adds eth_mask_is_exact(mask), eth_addr_bitand(src, mask, dst), eth_addr_equal_except(a, b, mask) and eth_format_masked(eth, mask, output). Signed-off-by: Joe Stringer <joe@wand.net.nz> Signed-off-by: Ben Pfaff <blp@nicira.com>
2012-05-02Global replace of Nicira Networks.Raju Subramanian
Replaced all instances of Nicira Networks(, Inc) to Nicira, Inc. Feature #10593 Signed-off-by: Raju Subramanian <rsubramanian@nicira.com> Signed-off-by: Ben Pfaff <blp@nicira.com>
2012-04-18dpif: Include TCP flags in "ovs-dpctl dump-flows" output.Ben Pfaff
Signed-off-by: Ben Pfaff <blp@nicira.com>
2012-03-26packet: Add additional TCP flags extraction on IPv6.Jesse Gross
Commit 11460e2316b88f0bd0ea0005d94338d800ea16bd (flow: Enable retrieval of TCP flags from IPv6 traffic.) updated one of the TCP flags extraction functions in userspace but missed the other. This updates that function and converts the other to use it to reduce duplication. Bug #10194 Signed-off-by: Jesse Gross <jesse@nicira.com>
2012-02-15packets: New function packet_get_tcp_flags(), factored out of dpif.Ben Pfaff
This will acquire a new user in an upcoming commit. Signed-off-by: Ben Pfaff <blp@nicira.com>
2012-01-10packets: New packet_set_*() helper functions.Ethan Jackson
This commit pulls code used to modify L3 and L4 header fields from dp_netdev into the packet library. An additional user will be added in a future commit. Signed-off-by: Ethan Jackson <ethan@nicira.com>
2012-01-10packets: Mask out CFI bit in eth_push_vlan().Ethan Jackson
We should never push a VLAN tag with the CFI bit set. This patch defensively enforces this invariant. Signed-off-by: Ethan Jackson <ethan@nicira.com>
2011-12-19packets: New function eth_from_hex().Ben Pfaff
An upcoming commit will add another user. Signed-off-by: Ben Pfaff <blp@nicira.com>
2011-11-23packets: New function eth_pop_vlan(), formerly dp_netdev_pop_vlan().Ben Pfaff
An upcoming commit will add a new user.
2011-11-03cfm: Support tagged CCM PDUs.Ethan Jackson
This patch also causes eth_compose() to set the l2 and l3 pointers of the packets which it modifies.
2011-11-01Fix build on FreeBSD.Edward Tomasz NapieraƂa
Patch below fixes build on FreeBSD; tested on 10.0-CURRENT. Signed-off-by: Edward Tomasz Napierala <trasz@FreeBSD.org> Signed-off-by: Ben Pfaff <blp@nicira.com>
2011-09-13packets: Add more utility functions for IPv4 and IPv6 addresses.Ben Pfaff
We had these functions scattered around the source tree anyway. packets.h is a good place to centralize them. I do plan to introduce some additional callers.
2011-09-09datapath: VLAN actions should use push/pop semanticsPravin Shelar
Currently the kernel vlan actions mirror those used by OpenFlow 1.0. i.e. MODIFY and STRIP. More flexible approach is to have an action to push a tag and pop a tag off, so that it can handle multiple levels of vlan tags. Plus it aligns with newer version of OpenFlow. As this patch replaces MODIFY with PUSH semantic, action mapping done in userpace is fixed accordingly. GSO handling for multiple levels of vlan tags is also added as Jesse suggested before. Signed-off-by: Pravin B Shelar <pshelar@nicira.com> Acked-by: Jesse Gross <jesse@nicira.com>
2011-04-19lacp: Move LACP packet data to lacp header file.Ethan Jackson
2011-04-01packets: Reserve headroom for VLAN header in eth_compose(), snap_compose().Ben Pfaff
This allows callers to add a VLAN header to the composed packet and send it out on a VLAN without copying the whole payload.
2011-04-01packets: New function eth_set_vlan_tci(), from dpif-netdev.Ben Pfaff
This will soon be used in the upcoming bond library.
2011-04-01packets: Fix potential use-after-free in compose_benign_packet().Ben Pfaff
The second call to ofpbuf_put_zeros() could cause the 'eth' pointer to be invalidated. It appears that this does not fix a real bug because the existing callers all preallocate 128 bytes of tailroom, but the interface doesn't document that requirement.
2011-04-01packets: New function snap_compose(); rename compose_packet() for consistency.Ben Pfaff
The following commit will introduce the first use of snap_compose().
2011-03-23packets: Create new compose_packet() function.Ethan Jackson
This commit generalizes compose_lacp_packet() into new compose_packet() function. This new function will be used to send CCM messages in future patches.
2011-03-17packets: create new compose_lacp_pdu() function.Ethan Jackson
Creates new compose_lacp_pdu() from the old compose_lacp_packet() function. This will allow a LACP PDU to be created without necessarily knowing the Ethernet Source Address required for generating the packet. Future patches rely on this functionality.
2011-02-07vswitchd: Tweak LACP values.Ethan Jackson
Hardware sets the default LACP partner information to 0 so this commit follows. The collector delay is a more interesting case. Hardware sets it to 32768 and Linux sets it to 0. The collector delay relates to a part of the LACP protocol which we don't implement so we follow Linux in this case.
2011-02-03vswitchd: Implement Link Aggregation Control Protocol.Ethan Jackson
This commit implements LACP, a protocol which allows directly connected switches to automatically negotiate which links may participate in bonds. This commit disables LACP by default. Once sufficiently tested, LACP will be enabled in "active" mode on bonded ports, and "passive" mode on all others. Bug #4213.
2011-02-02nicira-ext: Support matching IPv6 traffic.Justin Pettit
Provides ability to match over IPv6 traffic in the same manner as IPv4. Currently, the matching fields include: - IPv6 source and destination addresses (ipv6_src and ipv6_dst) - Traffic Class (nw_tos) - Next Header (nw_proto) - ICMPv6 Type and Code (icmp_type and icmp_code) - TCP and UDP Ports over IPv6 (tp_src and tp_dst) When defining IPv6 rules, the Nicira Extensible Match (NXM) extension to OVS must be used. Signed-off-by: Justin Pettit <jpettit@nicira.com> Acked-by: Ben Pfaff <blp@nicira.com>
2010-10-21Fix bug in parsing large datapath IDs.Ben Pfaff
Datapath IDs are unsigned, but dpid_from_string() was parsing them as signed integers, which caused high values to be capped at INT64_MAX. Also, document that datapath IDs may not be all-zero. Reported-by: Pankaj Thakkar <thakkar@nicira.com> Reported-by: Teemu Koponen <koponen@nicira.com>
2010-02-20ofproto: Use 64-bit datapath id and management id (OpenFlow 0.9)Justin Pettit
The length of a datapath was changed from 48 bits to 64 bits in OpenFlow 0.9. For parity, we increased the management id size to match. NOTE: This is the final commit in the OpenFlow 0.9 set. Starting with this commit, OVS is OpenFlow 0.9-compliant.
2009-12-03vswitchd: Initial conversion to database-based configuration.Ben Pfaff
This has seen very little testing, so some features are almost certainly busted. Port mirroring is not yet converted, so it will definitely not work.
2009-09-16Factor out code for composing benign packets.Ben Pfaff
The bonding code in vswitch sends out gratuitous learning packets that are supposed to teach switches but not cause anything else to happen on the network. Some upcoming code wants to synthesize packets with similar properties, so factor this code into a new function so that it can be used in both places.