Skip to content

Vorta did not respect metered network exclusion #1884

@jramnani

Description

@jramnani

Description

I was working through an internet outage at home. I connected my laptop to my phone as a mobile hotspot. Within 30-60 minutes I got a text from my wireless carrier that I had exhausted my network data plan for the month. After checking activity on my laptop, I found Vorta was in the middle of a backup.

  • In the Schedule -> Network settings I have "Run backups over metered networks" unchecked.
  • The Allowed Networks list automatically added my Wi-Fi hotspot and enabled it. I have since un-selected it.

It seems like the metered network setting did not work for me.

Digging around in Vorta's source code I learned how it detects metered networks on macOS here:
https://github.com/borgbase/vorta/blob/master/src/vorta/network_status/darwin.py#L50-L51

def is_network_metered(bsd_device) -> bool:
    return b'ANDROID_METERED' in call_ipconfig_getpacket(bsd_device)

However, when I run the underlying command, ipconfig getpacket en0 I get the following output, which does not include the text, ANDROID_METERED.

$ ipconfig getpacket en0
op = BOOTREPLY
htype = 1
flags = 0
hlen = 6
hops = 0
xid = 0x64757b68
secs = 0
ciaddr = 0.0.0.0
yiaddr = REDACTED
siaddr = REDACTED
giaddr = 0.0.0.0
chaddr = REDACTED
sname = My-Hotspot
file =
options:
Options count is 7
dhcp_message_type (uint8): ACK 0x5
server_identifier (ip): REDACTED
lease_time (uint32): 0x15180
subnet_mask (ip): 255.255.255.240
router (ip_mult): {REDACTED}
domain_name_server (ip_mult): {REDACTED}
end (none):

While doing some investigating on my own, I did find a network setting that was correlated to "Low Data Mode" on my WiFi network when connected to my mobile hotspot. I was able to find it using scutil like this:

scutil
> show State:/Network/Interface/en0/Link
<dictionary> {
  Active : TRUE
  Expensive : TRUE
}

I'm interested to know if anyone else is experiencing this? And whether it would be acceptable to submit a patch that changes the technique used to detect whether macOS is using a metered connection?

Reproduction

  • I tried to reproduce the issue.
  • I was able to reproduce the issue.

OS

macOS Sonoma 14.1.2

Version of Vorta

0.8.11

What did you install Vorta with?

Homebrew

Version of Borg

1.2.4

Logs

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    status:staleThis item will be closed soon due to inactivity

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions