Here's an incremental.
---
NEWS | 4 +++-
lib/packets.c | 6 +++---
lib/packets.h | 5 ++---
3 files changed, 8 insertions(+), 7 deletions(-)
diff --git a/NEWS b/NEWS
index 5f6ae2c..8cd38dd 100644
--- a/NEWS
+++ b/NEWS
@@ -5,7 +5,9 @@ post-v1.7.0
- Added support for arbitrary ethernet masks
- Additional protocols are not mirrored and dropped when forward-bpdu is
false. For a full list, see the ovs-vswitchd.conf.db man page.
- - Learning packets are now RARPs making us consistent with qemu and VMware.
+ - Open vSwitch now sends RARP packets in situations where it previously
+ sent a custom protocol, making it consistent with behavior of QEMU and
+ VMware.
v1.7.0 - xx xxx xxxx
diff --git a/lib/packets.c b/lib/packets.c
index 6d7b99d..9b61d04 100644
--- a/lib/packets.c
+++ b/lib/packets.c
@@ -145,12 +145,12 @@ compose_benign_packet(struct ofpbuf *b, const uint8_t
eth_src[ETH_ADDR_LEN])
rarp->hw_addr_space = htons(ARP_HTYPE_ETH);
rarp->proto_addr_space = htons(ETH_TYPE_IP);
rarp->hw_addr_length = ETH_ADDR_LEN;
- rarp->proto_addr_length = IPV4_ADDR_LEN;
+ rarp->proto_addr_length = sizeof rarp->src_proto_addr;
rarp->opcode = htons(RARP_REQUEST_REVERSE);
memcpy(rarp->src_hw_addr, eth_src, ETH_ADDR_LEN);
- memset(rarp->src_proto_addr, 0, IPV4_ADDR_LEN);
+ rarp->src_proto_addr = htonl(0);
memcpy(rarp->target_hw_addr, eth_src, ETH_ADDR_LEN);
- memset(rarp->target_proto_addr, 0, IPV4_ADDR_LEN);
+ rarp->target_proto_addr = htonl(0);
}
/* Insert VLAN header according to given TCI. Packet passed must be Ethernet
diff --git a/lib/packets.h b/lib/packets.h
index eabc7bc..c1d404d 100644
--- a/lib/packets.h
+++ b/lib/packets.h
@@ -34,7 +34,6 @@ struct flow;
bool dpid_from_string(const char *s, uint64_t *dpidp);
#define ETH_ADDR_LEN 6
-#define IPV4_ADDR_LEN 4
static const uint8_t eth_addr_broadcast[ETH_ADDR_LEN] OVS_UNUSED
= { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff };
@@ -241,9 +240,9 @@ struct rarp_header {
uint8_t proto_addr_length; /* IPV4_ADDR_LEN. */
ovs_be16 opcode; /* RARP_REQUEST_REVERSE. */
uint8_t src_hw_addr[ETH_ADDR_LEN];
- uint8_t src_proto_addr[IPV4_ADDR_LEN];
+ ovs_be32 src_proto_addr;
uint8_t target_hw_addr[ETH_ADDR_LEN];
- uint8_t target_proto_addr[IPV4_ADDR_LEN];
+ ovs_be32 target_proto_addr;
} __attribute__((packed));
BUILD_ASSERT_DECL(RARP_HEADER_LEN == sizeof(struct rarp_header));
--
1.7.10.2
_______________________________________________
dev mailing list
[email protected]
http://openvswitch.org/mailman/listinfo/dev