From: Andrew Evans Date: Wed, 19 Jan 2011 22:50:01 +0000 (-0800) Subject: netdev-vport: Report carrier state of tunnel egress interfaces. X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a404826e90632541d50f58d651271e7a8752cc1f;p=openvswitch netdev-vport: Report carrier state of tunnel egress interfaces. Record carrier state of tunnel egress interface in "tunnel_egress_iface_carrier" key in "status" map of Interface table. --- diff --git a/lib/netdev-vport.c b/lib/netdev-vport.c index 2d0d9845..86494533 100644 --- a/lib/netdev-vport.c +++ b/lib/netdev-vport.c @@ -362,7 +362,16 @@ netdev_vport_get_status(const struct netdev *netdev, struct shash *sh) const char *iface = netdev_vport_get_tnl_iface(netdev); if (iface) { + struct netdev *egress_netdev; + shash_add(sh, "tunnel_egress_iface", xstrdup(iface)); + + if (!netdev_open_default(iface, &egress_netdev)) { + shash_add(sh, "tunnel_egress_iface_carrier", + xstrdup(netdev_get_carrier(egress_netdev) + ? "up" : "down")); + netdev_close(egress_netdev); + } } return 0; diff --git a/vswitchd/vswitch.xml b/vswitchd/vswitch.xml index d92489ce..dfa3f20a 100644 --- a/vswitchd/vswitch.xml +++ b/vswitchd/vswitch.xml @@ -1062,6 +1062,12 @@ traffic destined for the configured remote_ip. This could be an internal interface such as a bridge port. +
+
tunnel_egress_iface_carrier
+
Whether a carrier is detected on . Valid values are down + and up.
+