struct if_entry *tunnel_find_iface(struct netns_entry *ns, const char *addr) { struct search_arg data; struct if_entry *result; data.af = raw_addr(data.raw, addr); if (data.af < 0) return NULL; if (match_if_heur(&result, ns, 0, NULL, match_tunnel, &data)) return NULL; return result; }
static int link_patch(struct ovs_if *iface, struct netns_entry *root) { int err; struct if_entry *peer; err = match_if_heur(&peer, root, 1, NULL, link_patch_search, iface); if (err > 0) return err; if (err < 0) return if_add_warning(iface->link, "failed to find openvswitch patch port peer reliably"); if (peer) peer_set(iface->link, peer); /* Ignore case when the peer is not found, it will be found from the * other side. */ return 0; }
static int link_iface(struct ovs_if *iface, struct netns_entry *root, int required) { int err; if (iface->link) return 0; err = match_if_heur(&iface->link, root, 1, NULL, link_iface_search, iface); if (err > 0) return err; if (err < 0) return label_add(&root->warnings, "Failed to map openvswitch interface %s reliably", iface->name); if (required && !iface->link) return label_add(&root->warnings, "Failed to map openvswitch interface %s", iface->name); return 0; }