diff --git a/rust/src/dns/lua.rs b/rust/src/dns/lua.rs index bba1cbbfd7..99094ccba9 100644 --- a/rust/src/dns/lua.rs +++ b/rust/src/dns/lua.rs @@ -201,10 +201,14 @@ pub extern "C" fn SCDnsLuaGetAnswerTable(clua: &mut CLuaState, tx: &mut DNSTrans DNSRData::OPT(ref opt) => { if !opt.is_empty() { lua.pushstring("addr"); - for option in opt.iter() { - lua.pushstring(&String::from_utf8_lossy(&option.code.to_be_bytes())); - lua.pushstring(&String::from_utf8_lossy(&option.data)); - } + let combined = opt + .iter() + .map(|option| { + format!("{}:{}", option.code, String::from_utf8_lossy(&option.data)) + }) + .collect::>() + .join(" "); + lua.pushstring(&combined); lua.settable(-3); } }