aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMatthias P. Braendli <matthias.braendli@mpb.li>2025-07-11 10:23:43 +0200
committerMatthias P. Braendli <matthias.braendli@mpb.li>2025-07-11 10:23:43 +0200
commit41a417bee0a55712a23a7a4bc080a021fe84ad51 (patch)
treef1a7ca7dbbc5f5c95639f42340eb143f9d4ec276 /src
parent53bc9d56c02397c01505beee090851ed40e6f8c6 (diff)
downloaddabmux-41a417bee0a55712a23a7a4bc080a021fe84ad51.tar.gz
dabmux-41a417bee0a55712a23a7a4bc080a021fe84ad51.tar.bz2
dabmux-41a417bee0a55712a23a7a4bc080a021fe84ad51.zip
common 3849213: allow setting TTL without UDP sourcenext
Diffstat (limited to 'src')
-rw-r--r--src/DabMux.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/DabMux.cpp b/src/DabMux.cpp
index bf525c1..75788d8 100644
--- a/src/DabMux.cpp
+++ b/src/DabMux.cpp
@@ -352,10 +352,9 @@ int main(int argc, char *argv[])
pft_settings.enable_pft = pt.get<bool>("enable_pft", default_enable_pft);
pft_settings.fec = pt.get<unsigned int>("fec", default_fec);
pft_settings.fragment_spreading_factor = default_spreading_factor;
- auto override_spread_percent = pt.get_optional<int>("packet_spread");
- if (override_spread_percent) {
+ if (auto override_spread_percent = pt.get_optional<int>("packet_spread"))
pft_settings.fragment_spreading_factor = check_spreading_factor(*override_spread_percent);
- }
+
pft_settings.verbose = pt.get<bool>("verbose", edi_conf.verbose);
};
@@ -364,7 +363,8 @@ int main(int argc, char *argv[])
if (proto == "udp") {
auto dest = make_shared<edi::udp_destination_t>();
dest->dest_addr = pt_edi_dest.second.get<string>("destination");
- dest->ttl = pt_edi_dest.second.get<unsigned int>("ttl", 1);
+ if (auto ttl = pt_edi_dest.second.get_optional<unsigned int>("ttl"))
+ dest->ttl = *ttl;
dest->source_addr = pt_edi_dest.second.get<string>("source", "");
dest->source_port = pt_edi_dest.second.get<unsigned int>("sourceport");