Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
Signed-off-by: zhangzujian <[email protected]>
  • Loading branch information
zhangzujian committed Nov 4, 2024
1 parent 091b424 commit 249a6a2
Showing 1 changed file with 36 additions and 0 deletions.
36 changes: 36 additions & 0 deletions controller/physical.c
Original file line number Diff line number Diff line change
Expand Up @@ -1603,6 +1603,42 @@ consider_port_binding(struct ovsdb_idl_index *sbrec_port_binding_by_name,
binding->header_.uuid.parts[0],
&match, ofpacts_p, &binding->header_.uuid);

if (smap_get_bool(&binding->options, "bfd-only", false)) {
match_set_nw_proto(&match, IPPROTO_UDP);
match_set_tp_dst(m, htons(BFD_DEST_PORT));
ofpbuf_clear(ofpacts_p);
encode_controller_op(ACTION_OPCODE_BFD_MSG, 0, ofpacts_p);

for (size_t i = 0; i < binding->n_mac; i++) {
struct lport_addresses laddrs;
if (!extract_lsp_addresses(binding->mac[i], &laddrs)) {
continue;
}

for (size_t j = 0; j < laddrs.n_ipv4_addrs; j++) {
match_set_nw_dst(&match, laddrs.ipv4_addrs[j].addr);
ofctrl_add_flow(flow_table, OFTABLE_LOCAL_OUTPUT, 110,
binding->header_.uuid.parts[0],
&match, ofpacts_p, &binding->header_.uuid);
}
match_set_nw_dst(&match, 0);

for (size_t j = 0; j < laddrs.n_ipv6_addrs; j++) {
if (IN6_ARE_ADDR_EQUAL(&ip_addr,
&laddrs.ipv6_addrs[j].addr)) {
ea = laddrs.ea;
mac_found = true;
break;
}
match_set_ipv6_dst(&match, &laddrs.ipv6_addrs[j].addr);
ofctrl_add_flow(flow_table, OFTABLE_LOCAL_OUTPUT, 110,
binding->header_.uuid.parts[0],
&match, ofpacts_p, &binding->header_.uuid);
}

destroy_lport_addresses(&laddrs);
}
}
return;
}

Expand Down

0 comments on commit 249a6a2

Please sign in to comment.