Elements of concatenated range sets hold the upper boundary in an extra data_reg, print it using dash as a somewhat intuitive separator. Fixes: 04cc28d8d6923 ("set_elem: Introduce support for NFTNL_SET_ELEM_KEY_END") Signed-off-by: Phil Sutter <phil@xxxxxx> --- src/set_elem.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/set_elem.c b/src/set_elem.c index 51bf2c7b853bb..46bb0623a3bb3 100644 --- a/src/set_elem.c +++ b/src/set_elem.c @@ -634,6 +634,16 @@ static int nftnl_set_elem_snprintf_default(char *buf, size_t size, DATA_F_NOPFX, DATA_VALUE); SNPRINTF_BUFFER_SIZE(ret, remain, offset); + if (e->flags & (1 << NFTNL_SET_ELEM_KEY_END)) { + ret = snprintf(buf + offset, remain, " - "); + SNPRINTF_BUFFER_SIZE(ret, remain, offset); + + ret = nftnl_data_reg_snprintf(buf + offset, remain, &e->key_end, + NFTNL_OUTPUT_DEFAULT, + DATA_F_NOPFX, DATA_VALUE); + SNPRINTF_BUFFER_SIZE(ret, remain, offset); + } + ret = snprintf(buf + offset, remain, " : "); SNPRINTF_BUFFER_SIZE(ret, remain, offset); -- 2.28.0