X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=vswitchd%2Fovs-brcompatd.c;h=c88684f94c3fb79ebbda7ed9055d0e04df8e927f;hb=3a48ace3e4799ce25099a8584372abe7a4d6d771;hp=4f35452156d9374fbf58c7d1c60c97cc89dde466;hpb=2b01925c18a52b2f7dbff5c70269a4b4d8aec027;p=openvswitch diff --git a/vswitchd/ovs-brcompatd.c b/vswitchd/ovs-brcompatd.c index 4f354521..c88684f9 100644 --- a/vswitchd/ovs-brcompatd.c +++ b/vswitchd/ovs-brcompatd.c @@ -363,25 +363,29 @@ handle_port_cmd(struct ofpbuf *buffer, bool add) } static char * -linux_bridge_to_ovs_bridge(const char *linux_name) +linux_bridge_to_ovs_bridge(const char *linux_name, int *br_vlanp) { char *save_ptr = NULL; - const char *br_name; + const char *br_name, *br_vlan; char *br_name_copy; char *output; - output = capture_vsctl(vsctl_program, VSCTL_OPTIONS, "br-to-parent", - linux_name, (char *) NULL); + output = capture_vsctl(vsctl_program, VSCTL_OPTIONS, + "--", "br-to-parent", linux_name, + "--", "br-to-vlan", linux_name, + (char *) NULL); if (!output) { return NULL; } br_name = strtok_r(output, " \t\r\n", &save_ptr); - if (!br_name) { + br_vlan = strtok_r(NULL, " \t\r\n", &save_ptr); + if (!br_name || !br_vlan) { free(output); return NULL; } br_name_copy = xstrdup(br_name); + *br_vlanp = atoi(br_vlan); free(output); @@ -458,7 +462,7 @@ handle_fdb_query_cmd(struct ofpbuf *buffer) } /* Figure out vswitchd bridge and VLAN. */ - br_name = linux_bridge_to_ovs_bridge(linux_name); + br_name = linux_bridge_to_ovs_bridge(linux_name, &br_vlan); if (!br_name) { error = EINVAL; send_simple_reply(seq, error); @@ -484,7 +488,7 @@ handle_fdb_query_cmd(struct ofpbuf *buffer) struct mac *mac = &local_macs[n_local_macs]; struct netdev *netdev; - error = netdev_open_default(iface_name, &netdev); + error = netdev_open(iface_name, "system", &netdev); if (!error) { if (!netdev_get_etheraddr(netdev, mac->addr)) { n_local_macs++; @@ -876,12 +880,11 @@ parse_options(int argc, char *argv[]) } switch (c) { - case 'H': case 'h': usage(); case 'V': - OVS_PRINT_VERSION(0, 0); + ovs_print_version(0, 0); exit(EXIT_SUCCESS); case OPT_APPCTL: