Feat: OPENVPN_INTERFACE defaulting to tun0
- Fix: custom config with custom network interface name for firewall - Keep VPN tunnel interface in firewall state - Vul fix: only allow traffic through vpn interface when needed - Adapt code to adapt to network interface name - Remove outdated TUN and TAP constants
This commit is contained in:
@@ -33,18 +33,15 @@ func (c Connection) OpenVPNProtoLine() (line string) {
|
||||
}
|
||||
|
||||
// UpdateEmptyWith updates each field of the connection where the
|
||||
// value is not set using the value from the other connection.
|
||||
func (c *Connection) UpdateEmptyWith(connection Connection) {
|
||||
// value is not set using the value given as arguments.
|
||||
func (c *Connection) UpdateEmptyWith(ip net.IP, port uint16, protocol string) {
|
||||
if c.IP == nil {
|
||||
c.IP = connection.IP
|
||||
c.IP = ip
|
||||
}
|
||||
if c.Port == 0 {
|
||||
c.Port = connection.Port
|
||||
c.Port = port
|
||||
}
|
||||
if c.Protocol == "" {
|
||||
c.Protocol = connection.Protocol
|
||||
}
|
||||
if c.Hostname == "" {
|
||||
c.Hostname = connection.Hostname
|
||||
c.Protocol = protocol
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user