Skip to content

Usage report transport type is wrong for QUIC #8274

Closed

Description

@calmh

Will over represent IPv6.

jb@ses:~ % syncthing cli show usage | grep -A2 transport
  "transportStats": {
    "quic6": 1
  },
jb@ses:~ % syncthing cli show connections | egrep 'address|type'
      ...
      "address": "83.233.124.224:22000",
      "type": "quic-client"

Activity

  1. added
    bug
    needs-triage
    on Apr 12, 2022
  2. removed
    needs-triage
    on Sep 21, 2022
  3. bt90 commented on Sep 8, 2023

    @bt90
    Contributor

    func (c internalConn) Transport() string {
    transport := c.connType.Transport()
    ip, err := osutil.IPFromAddr(c.LocalAddr())
    if err != nil {
    return transport
    }
    if ip.To4() != nil {
    return transport + "4"
    }
    return transport + "6"
    }

    I wonder if it's simply caused by the transport listening on [::] ? Switching to c.RemoteAddr() should solve that.

  4. bt90 commented on Sep 17, 2023

    @bt90
    Contributor

    It is.

    func (c internalConn) Transport() string {
    	transport := c.connType.Transport()
    	ip, err := osutil.IPFromAddr(c.LocalAddr())
    	fmt.Println("Local IP:", c.LocalAddr())
    	fmt.Println("Remote IP:", c.RemoteAddr())
    	if err != nil {
    		return transport
    	}
    	if ip.To4() != nil {
    		return transport + "4"
    	}
    	return transport + "6"
    }
    Local IP: [::]:22001
    Remote IP: 192.168.178.2:22000
    
  5. bt90 commented on Sep 17, 2023

    @bt90
    Contributor

    Looks like LocalAddr() provides only the unresolved address we're listening on?

  6. bt90 commented on Sep 19, 2023

    @bt90
    Contributor

    @marten-seemann we're using LocalAddr() as provided by quic-go's Connection interface as far as I can see.

  7. calmh commented on Sep 19, 2023

    @calmh
    MemberAuthor

    So we switch to using the remote address? No need to investigate much deeper, imho.

  8. bt90 commented on Sep 19, 2023

    @bt90
    Contributor

    From our project's perspective, yes. This still looks like a bug to me, which, if correct, should be fixed upstream.

  9. calmh commented on Sep 19, 2023

    @calmh
    MemberAuthor

    Maybe? Do other "regular" sockets behave differently? For UDP I think this might be expected regardless of what QUIC does.

  10. added a commit that references this issue on Sep 20, 2023
    cf46bf0
  11. added this to the v1.25.0 milestone on Sep 25, 2023
  12. added a commit that references this issue on Oct 15, 2023
    917698d
  13. added
    frozen-due-to-age
    on Sep 19, 2024
  14. locked and limited conversation to collaborators on Sep 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugfrozen-due-to-age

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions