Skip to content

Commit

Permalink
fix: interface name error
Browse files Browse the repository at this point in the history
  • Loading branch information
TimothyYe committed Mar 5, 2024
1 parent 40d6a95 commit c4d79f3
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion knockd/src/config/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ pub struct Rule {
pub command: String,
}

#[derive(Debug, Serialize, Deserialize)]
#[derive(Debug, Serialize, Deserialize, Clone)]
pub struct Config {
pub interface: String,
pub timeout: u64,
Expand Down
4 changes: 2 additions & 2 deletions knockd/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@ fn main() -> Result<()> {
// Load the configuration
let config = config::load_config(&args.config)?;
// Create the sequence detector
let detector = PortSequenceDetector::new(config);
let detector = PortSequenceDetector::new(config.clone());

let mut server = Server::new("enp3s0".to_string(), Box::new(detector));
let mut server = Server::new(config.interface, Box::new(detector));
server.start();

Ok(())
Expand Down

0 comments on commit c4d79f3

Please sign in to comment.