Can configure network NAT settings from UI
This commit is contained in:
virtweb_backend/src
virtweb_frontend/src
@ -1,3 +1,4 @@
|
||||
use crate::constants;
|
||||
use crate::utils::net_utils;
|
||||
use std::net::{Ipv4Addr, Ipv6Addr};
|
||||
|
||||
@ -64,6 +65,12 @@ impl<IPv> Nat<IPv> {
|
||||
return Err(NatDefError::InvalidNatDef("Invalid guest port!").into());
|
||||
}
|
||||
|
||||
if let Some(comment) = &self.comment {
|
||||
if comment.len() > constants::NET_NAT_COMMENT_MAX_SIZE {
|
||||
return Err(NatDefError::InvalidNatDef("Comment is too large!").into());
|
||||
}
|
||||
}
|
||||
|
||||
Ok(())
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user