File tree 1 file changed +12
-14
lines changed
1 file changed +12
-14
lines changed Original file line number Diff line number Diff line change 1
- use std:: { net:: IpAddr , str :: FromStr } ;
1
+ use std:: net:: IpAddr ;
2
2
3
3
use crate :: {
4
4
netlink,
@@ -50,17 +50,15 @@ impl WireguardInterfaceApi for WGApi<Kernel> {
50
50
self . ifname
51
51
) ;
52
52
53
- // assign IP address to interface
54
- debug ! (
55
- "Assigning address {} to interface {}" ,
56
- config. address, self . ifname
57
- ) ;
58
- let address = IpAddrMask :: from_str ( & config. address ) ?;
59
- self . assign_address ( & address) ?;
60
- debug ! (
61
- "Address {} assigned to interface {} successfully" ,
62
- config. address, self . ifname
63
- ) ;
53
+ // Assign IP addresses to the interface.
54
+ for address in & config. addresses {
55
+ debug ! ( "Assigning address {address} to interface {}" , self . ifname) ;
56
+ self . assign_address ( & address) ?;
57
+ debug ! (
58
+ "Address {address} assigned to interface {} successfully" ,
59
+ self . ifname
60
+ ) ;
61
+ }
64
62
65
63
// configure interface
66
64
debug ! (
@@ -88,8 +86,8 @@ impl WireguardInterfaceApi for WGApi<Kernel> {
88
86
}
89
87
90
88
info ! (
91
- "Interface {} has been successfully configured. It has been assigned the following address: {} " ,
92
- self . ifname, address
89
+ "Interface {} has been successfully configured." ,
90
+ self . ifname
93
91
) ;
94
92
debug ! (
95
93
"Interface {} configured with config: {config:?}" ,
You can’t perform that action at this time.
0 commit comments