Skip to content

Commit

Permalink
Make sure the wg interface is down when created
Browse files Browse the repository at this point in the history
  • Loading branch information
dtoubelis committed Aug 29, 2023
1 parent a7d4c51 commit c7d2c42
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/link/add.rs
Original file line number Diff line number Diff line change
Expand Up @@ -756,7 +756,9 @@ impl LinkAddRequest {
/// Create a wireguard link.
/// This is equivalent to `ip link add NAME type wireguard`.
pub fn wireguard(self, name: String) -> Self {
self.name(name).link_info(InfoKind::Wireguard, None)
let mut request = self.name(name).link_info(InfoKind::Wireguard, None);
request.message_mut().header.flags &= !IFF_UP;
request
}

/// Replace existing matching link.
Expand Down

0 comments on commit c7d2c42

Please sign in to comment.