Skip to content

Commit

Permalink
Panic on invalid 0.0.0.0 RTP_IPS entries
Browse files Browse the repository at this point in the history
  • Loading branch information
fatalerrorcoded committed Oct 6, 2021
1 parent 682b44c commit a631730
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/util/variables.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 27,16 @@ lazy_static! {
if let Some(ip) = iter.next() {
let ip = IpAddr::from_str(&ip).expect("Not a valid listen IP");
let announced_ip = iter.next().map(|ip| IpAddr::from_str(&ip).expect("Not a valid announcement IP"));
if ip.is_unspecified() && announced_ip.is_none() {
panic!("RTC announcement IP must be specified when listen IP is 0.0.0.0");
}

if let Some(announced_ip) = announced_ip {
if announced_ip.is_unspecified() {
panic!("RTC announcement IP must not be 0.0.0.0");
}
}

ip_vec.push(TransportListenIp {
ip, announced_ip,
});
Expand Down

0 comments on commit a631730

Please sign in to comment.