Origin: upstream, https://git.kernel.org/pub/scm/network/iproute2/iproute2.git/commit/?id=fe9322781e6351b5572cbaa8df4dd0e5ec96398a
Bug-Ubuntu: https://bugs.launchpad.net/bugs/1800877
From: Phil Sutter <phil@nwl.cc>
Date: Thu, 31 Mar 2016 14:43:32 +0200
Subject: [PATCH] ip-link: Support printing VF trust setting

This adds a new item to VF lines of a PF, stating whether the VF is
trusted or not.

Signed-off-by: Phil Sutter <phil@nwl.cc>
---
 ip/ipaddress.c | 7 +++++++
 1 file changed, 7 insertions(+)

Index: iproute2-4.3.0/ip/ipaddress.c
===================================================================
--- iproute2-4.3.0.orig/ip/ipaddress.c
+++ iproute2-4.3.0/ip/ipaddress.c
@@ -378,6 +378,13 @@ static void print_vfinfo(FILE *fp, struc
 		else
 			fprintf(fp, ", link-state disable");
 	}
+	if (vf[IFLA_VF_TRUST]) {
+		struct ifla_vf_trust *vf_trust = RTA_DATA(vf[IFLA_VF_TRUST]);
+
+		if (vf_trust->setting != -1)
+			fprintf(fp, ", trust %s",
+			        vf_trust->setting ? "on" : "off");
+	}
 	if (vf[IFLA_VF_STATS] && show_stats)
 		print_vf_stats64(fp, vf[IFLA_VF_STATS]);
 }
