2
0
mirror of https://github.com/openvswitch/ovs synced 2025-08-31 22:35:15 +00:00

Process RARP packets with ethertype 0x8035 similar to ARP packets.

With this commit, OVS will match the data in the RARP packets having
ethertype 0x8035, in the same way as the data in the ARP packets.

Signed-off-by: Mehak Mahajan <mmahajan@nicira.com>
This commit is contained in:
Mehak Mahajan
2012-11-02 11:43:46 -07:00
parent c2f0373a82
commit 8087f5ff82
15 changed files with 137 additions and 32 deletions

View File

@@ -305,7 +305,7 @@ ofputil_match_from_ofp11_match(const struct ofp11_match *ofmatch,
uint16_t wc = ntohl(ofmatch->wildcards);
uint8_t dl_src_mask[ETH_ADDR_LEN];
uint8_t dl_dst_mask[ETH_ADDR_LEN];
bool ipv4, arp;
bool ipv4, arp, rarp;
int i;
match_init_catchall(match);
@@ -370,6 +370,7 @@ ofputil_match_from_ofp11_match(const struct ofp11_match *ofmatch,
ipv4 = match->flow.dl_type == htons(ETH_TYPE_IP);
arp = match->flow.dl_type == htons(ETH_TYPE_ARP);
rarp = match->flow.dl_type == htons(ETH_TYPE_RARP);
if (ipv4 && !(wc & OFPFW11_NW_TOS)) {
if (ofmatch->nw_tos & ~IP_DSCP_MASK) {
@@ -380,7 +381,7 @@ ofputil_match_from_ofp11_match(const struct ofp11_match *ofmatch,
match_set_nw_dscp(match, ofmatch->nw_tos);
}
if (ipv4 || arp) {
if (ipv4 || arp || rarp) {
if (!(wc & OFPFW11_NW_PROTO)) {
match_set_nw_proto(match, ofmatch->nw_proto);
}
@@ -3789,7 +3790,8 @@ ofputil_normalize_match__(struct match *match, bool may_log)
may_match |= MAY_ND_TARGET | MAY_ARP_THA;
}
}
} else if (match->flow.dl_type == htons(ETH_TYPE_ARP)) {
} else if (match->flow.dl_type == htons(ETH_TYPE_ARP) ||
match->flow.dl_type == htons(ETH_TYPE_RARP)) {
may_match = MAY_NW_PROTO | MAY_NW_ADDR | MAY_ARP_SHA | MAY_ARP_THA;
} else {
may_match = 0;