Opened 4 years ago

Closed 3 years ago

#53546 closed enhancement (wontfix)

Add IPv4 and IPv6 flag (-4, -6)

Reported by: l2dy (Zero King) Owned by:
Priority: Low Milestone:
Component: base Version:
Keywords: Cc:


Passed to curl and rsync, helpful under some circumstances:

  • one of IPv4 and IPv6 is metered.
  • one of them has better connectivity.

Change History (5)

comment:1 Changed 4 years ago by ryandesign (Ryan Schmidt)

Could you describe the problem and your proposed solution in more detail?

It sounds like you're talking about a client that has both IPv4 and IPv6 connectivity, but one of these connections is "better" for this client for some reason, but MacPorts picks the wrong one. What is your proposal for how MacPorts should pick the better one?

How do other network-enabled programs on this hypothetical client avoid the same problem?

You mention adding -4 and -6 flags. Reading the curl manpage, it seems these options force the use of IPv4 and IPv6, respectively, so they are effectively mutually exclusive. Are you suggesting that the user should be able to specify whether to use IPv4 or IPv6 connections, for example with a new setting in macports.conf?

Note that MacPorts doesn't run the curl program; it calls the libcurl library directly. So we wouldn't be using -4 or -6 flags; we'd be doing whatever the API equivalent of that is.

comment:2 Changed 4 years ago by l2dy (Zero King)

MacPorts could not magically pick the right stack so I have to manually specify that.

In my school, IPv6 is not metered while IPv4 is, so I'd prefer download only with IPv6 (use -6). However, only wired connection has IPv6 Internet access, the school Wi-Fi provides a global IPv6 address but only LAN access (use -4).

My proposal is to add the two global options to port(1) so I could pick the right stack manually. The expected behavior is the same as curl's.

An alternative is to implement the flags as prefering one over another, same as rsync's flags.

Last edited 4 years ago by l2dy (Zero King) (previous) (diff)

comment:3 Changed 4 years ago by l2dy (Zero King)

Priority: NormalLow

comment:4 Changed 3 years ago by raimue (Rainer Müller)

We are also running other tools such as git or svn that do not have flags to select the IP protocol version. Therefore these flags could be misleading, as they would only refer to the use of libcurl within MacPorts internally. Hosts like are well-known to only support IPv4 at the time of this writing, so with a -6 flag enabling IPv6 only, downloads would fail.

One option that could work for you would be to set up firewall rules with pfctl to block IPv4 access to MacPorts mirrors.

comment:5 Changed 3 years ago by l2dy (Zero King)

Resolution: wontfix
Status: newclosed

Closing as wontfix then. -6 and -4 in curl and rsync have different meaning and this option can't be applied to git, svn, etc.

Note: See TracTickets for help on using tickets.