projects
/
openvswitch
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
ovs-vswitchd: Document "coverage/log" in man page.
[openvswitch]
/
vswitchd
/
ovs-brcompatd.c
diff --git
a/vswitchd/ovs-brcompatd.c
b/vswitchd/ovs-brcompatd.c
index 4f35452156d9374fbf58c7d1c60c97cc89dde466..41aabe48205c260f9d62ce60f3942cf3f5d23629 100644
(file)
--- a/
vswitchd/ovs-brcompatd.c
+++ b/
vswitchd/ovs-brcompatd.c
@@
-28,6
+28,7
@@
#include <stdlib.h>
#include <string.h>
#include <sys/types.h>
#include <stdlib.h>
#include <string.h>
#include <sys/types.h>
+#include <sys/wait.h>
#include <sys/stat.h>
#include <time.h>
#include <fcntl.h>
#include <sys/stat.h>
#include <time.h>
#include <fcntl.h>
@@
-43,13
+44,13
@@
#include "leak-checker.h"
#include "netdev.h"
#include "netlink.h"
#include "leak-checker.h"
#include "netdev.h"
#include "netlink.h"
+#include "netlink-notifier.h"
#include "netlink-socket.h"
#include "ofpbuf.h"
#include "openvswitch/brcompat-netlink.h"
#include "packets.h"
#include "poll-loop.h"
#include "process.h"
#include "netlink-socket.h"
#include "ofpbuf.h"
#include "openvswitch/brcompat-netlink.h"
#include "packets.h"
#include "poll-loop.h"
#include "process.h"
-#include "rtnetlink.h"
#include "rtnetlink-link.h"
#include "signals.h"
#include "sset.h"
#include "rtnetlink-link.h"
#include "signals.h"
#include "sset.h"
@@
-363,25
+364,29
@@
handle_port_cmd(struct ofpbuf *buffer, bool add)
}
static char *
}
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;
{
char *save_ptr = NULL;
- const char *br_name;
+ const char *br_name
, *br_vlan
;
char *br_name_copy;
char *output;
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 (!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);
free(output);
return NULL;
}
br_name_copy = xstrdup(br_name);
+ *br_vlanp = atoi(br_vlan);
free(output);
free(output);
@@
-458,7
+463,7
@@
handle_fdb_query_cmd(struct ofpbuf *buffer)
}
/* Figure out vswitchd bridge and VLAN. */
}
/* 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);
if (!br_name) {
error = EINVAL;
send_simple_reply(seq, error);
@@
-484,7
+489,7
@@
handle_fdb_query_cmd(struct ofpbuf *buffer)
struct mac *mac = &local_macs[n_local_macs];
struct netdev *netdev;
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++;
if (!error) {
if (!netdev_get_etheraddr(netdev, mac->addr)) {
n_local_macs++;
@@
-720,7
+725,7
@@
brc_recv_update(void)
* (XenServer Tools 5.5.0 does not exhibit this behavior, and neither does
* a VM without Tools installed at all.)
*/
* (XenServer Tools 5.5.0 does not exhibit this behavior, and neither does
* a VM without Tools installed at all.)
*/
- rtnetlink_link_
notifier_
run();
+ rtnetlink_link_run();
switch (genlmsghdr->cmd) {
case BRC_GENL_C_DP_ADD:
switch (genlmsghdr->cmd) {
case BRC_GENL_C_DP_ADD:
@@
-786,7
+791,7
@@
netdev_changed_cb(const struct rtnetlink_link_change *change,
port_name, br_name);
run_vsctl(vsctl_program, VSCTL_OPTIONS,
port_name, br_name);
run_vsctl(vsctl_program, VSCTL_OPTIONS,
- "--", "--if-exists", "del-port",
br_name,
port_name,
+ "--", "--if-exists", "del-port", port_name,
"--", "comment", "ovs-brcompatd:", port_name, "disappeared",
(char *) NULL);
}
"--", "comment", "ovs-brcompatd:", port_name, "disappeared",
(char *) NULL);
}
@@
-795,7
+800,7
@@
int
main(int argc, char *argv[])
{
extern struct vlog_module VLM_reconnect;
main(int argc, char *argv[])
{
extern struct vlog_module VLM_reconnect;
- struct
rtnetlink_notifier
link_notifier;
+ struct
nln_notifier *
link_notifier;
struct unixctl_server *unixctl;
int retval;
struct unixctl_server *unixctl;
int retval;
@@
-819,26
+824,25
@@
main(int argc, char *argv[])
"\"brcompat\" kernel module.");
}
"\"brcompat\" kernel module.");
}
-
- rtnetlink_link_notifier_register(&link_notifier, netdev_changed_cb, NULL);
+ link_notifier = rtnetlink_link_notifier_create(netdev_changed_cb, NULL);
daemonize_complete();
for (;;) {
unixctl_server_run(unixctl);
daemonize_complete();
for (;;) {
unixctl_server_run(unixctl);
- rtnetlink_link_
notifier_
run();
+ rtnetlink_link_run();
brc_recv_update();
netdev_run();
nl_sock_wait(brc_sock, POLLIN);
unixctl_server_wait(unixctl);
brc_recv_update();
netdev_run();
nl_sock_wait(brc_sock, POLLIN);
unixctl_server_wait(unixctl);
- rtnetlink_link_
notifier_
wait();
+ rtnetlink_link_wait();
netdev_wait();
poll_block();
}
netdev_wait();
poll_block();
}
- rtnetlink_link_notifier_
unregister(&
link_notifier);
+ rtnetlink_link_notifier_
destroy(
link_notifier);
return 0;
}
return 0;
}
@@
-876,12
+880,11
@@
parse_options(int argc, char *argv[])
}
switch (c) {
}
switch (c) {
- case 'H':
case 'h':
usage();
case 'V':
case 'h':
usage();
case 'V':
-
OVS_PRINT_VERSION
(0, 0);
+
ovs_print_version
(0, 0);
exit(EXIT_SUCCESS);
case OPT_APPCTL:
exit(EXIT_SUCCESS);
case OPT_APPCTL: