Skip to contentSkip to conversation

ip/xfrm: all to set flag XFRM_SA_XFLAG_DONT_ENCAP_DSCP

PATCH New Nicolas Dichtel 1 participant 1 message May 17, 2013

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ip/xfrm: all to set flag XFRM_SA_XFLAG_DONT_ENCAP_DSCP

For the display part, we print extra-flags only if show_stats is set, like for standard flags.

---
 ip/ipxfrm.c     | 10 ++++++++++
 ip/xfrm_state.c | 45 ++++++++++++++++++++++++++++++++++++++++++++-
 2 files changed, 54 insertions(+), 1 deletion(-)
ip/ipxfrm.c +10 -0
index 0495ff4..0a3a9fb 100644
@@ -856,6 +856,16 @@ void xfrm_state_info_print(struct xfrm_usersa_info *xsinfo,
 		if (flags)
 			fprintf(fp, "%x", flags);
 	}
+	if (show_stats > 0 || tb[XFRMA_SA_EXTRA_FLAGS]) {
+		__u32 extra_flags = *(__u32 *)RTA_DATA(tb[XFRMA_SA_EXTRA_FLAGS]);
+
+		fprintf(fp, "extra_flag ");
+		XFRM_FLAG_PRINT(fp, extra_flags,
+				XFRM_SA_XFLAG_DONT_ENCAP_DSCP,
+				"dont-encap-dscp");
+		if (extra_flags)
+			fprintf(fp, "%x", extra_flags);
+	}
 	if (show_stats > 0)
 		fprintf(fp, " (0x%s)", strxf_mask8(xsinfo->flags));
 	fprintf(fp, "%s", _SL_);
ip/xfrm_state.c +44 -1

81 lines not on this page · raw message

Signature · 1 line
1.8.2.1