From a404826e90632541d50f58d651271e7a8752cc1f Mon Sep 17 00:00:00 2001 From: Andrew Evans Date: Wed, 19 Jan 2011 14:50:01 -0800 Subject: [PATCH] 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. --- lib/netdev-vport.c | 9 +++++++++ vswitchd/vswitch.xml | 6 ++++++ 2 files changed, 15 insertions(+) diff --git a/lib/netdev-vport.c b/lib/netdev-vport.c index 2d0d9845a..864945337 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 d92489ced..dfa3f20a0 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.
+
-- 2.43.0