Panic on missing IPv6 address #2

Closed
opened 2024-03-22 21:55:50 +01:00 by jeffbrl · 2 comments
jeffbrl commented 2024-03-22 21:55:50 +01:00 (Migrated from github.com)

The program panics if user configures RECORD_TYPES=* and program is unable to HTTP GET on ipv6.icanzip.com. In my case, the docker container had no IPv6 address.

Updating A and AAAA records of <redacted> every 5 minutes
2024/03/22 20:46:35 Failed to get public IP: Get "https://ipv6.icanhazip.com": dial tcp [2606:4700::6810:b8f1]:443: connect: cannot assign requested address
panic: Failed to get public IP: Get "https://ipv6.icanhazip.com": dial tcp [2606:4700::6810:b8f1]:443: connect: cannot assign requested address
goroutine 43 [running]:
log.Panic({0xc00004df68?, 0xc0001760a0?, 0xc000160788?})
	/usr/local/go/src/log/log.go:432 +0x5a
main.GetPublicIP(0x0?)
	/usr/src/app/public_ip.go:16 +0xe7
main.getPublicIP.func2()
	/usr/src/app/main.go:31 +0x2a
created by main.getPublicIP in goroutine 35
	/usr/src/app/main.go:30 +0x113

I am not sure if the IPv4 update is made prior to crash.

I believe the desired behavior in the case no IPv6 address is found would be to update IPv4 and perform no update for IPv6.

The program panics if user configures `RECORD_TYPES=*` and program is unable to HTTP GET on ipv6.icanzip.com. In my case, the docker container had no IPv6 address. ``` Updating A and AAAA records of <redacted> every 5 minutes 2024/03/22 20:46:35 Failed to get public IP: Get "https://ipv6.icanhazip.com": dial tcp [2606:4700::6810:b8f1]:443: connect: cannot assign requested address panic: Failed to get public IP: Get "https://ipv6.icanhazip.com": dial tcp [2606:4700::6810:b8f1]:443: connect: cannot assign requested address goroutine 43 [running]: log.Panic({0xc00004df68?, 0xc0001760a0?, 0xc000160788?}) /usr/local/go/src/log/log.go:432 +0x5a main.GetPublicIP(0x0?) /usr/src/app/public_ip.go:16 +0xe7 main.getPublicIP.func2() /usr/src/app/main.go:31 +0x2a created by main.getPublicIP in goroutine 35 /usr/src/app/main.go:30 +0x113 ``` I am not sure if the IPv4 update is made prior to crash. I believe the desired behavior in the case no IPv6 address is found would be to update IPv4 and perform no update for IPv6.
mxmlndml commented 2024-03-22 22:30:05 +01:00 (Migrated from github.com)

I believe the desired behavior in the case no IPv6 address is found would be to update IPv4 and perform no update for IPv6.

I don't want to overcomplicate things so if your host doesn't have an IPv6 address assigned, panicking seems like a valid option since it isn't able to update the AAAA records

I don't know how your network structure looks like and why you require IPv6. Although it is possible to assign an IPv6 address to a Docker container this might not produce your expected outcome. I assume this will store your container's IPv6 address in the DNS entries instead of the IPv6 address of your client or your NAT router. That should be rather pointless since the container doesn't listen to any incoming traffic.

The intention of this container is rather to keep track of the IP address of your NAT router if you don't have a static IP address.

> I believe the desired behavior in the case no IPv6 address is found would be to update IPv4 and perform no update for IPv6. I don't want to overcomplicate things so if your host doesn't have an IPv6 address assigned, panicking seems like a valid option since it isn't able to update the AAAA records I don't know how your network structure looks like and why you require IPv6. Although it is possible to [assign an IPv6 address to a Docker container](https://docs.docker.com/config/daemon/ipv6/) this might not produce your expected outcome. I assume this will store your container's IPv6 address in the DNS entries instead of the IPv6 address of your client or your NAT router. That should be rather pointless since the container doesn't listen to any incoming traffic. The intention of this container is rather to keep track of the IP address of your NAT router if you don't have a static IP address.
jeffbrl commented 2024-03-25 13:36:28 +01:00 (Migrated from github.com)

Fair enough :)

Thanks again for the feature enhancement.

Fair enough :) Thanks again for the feature enhancement.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: mxmlndml/cloudflare-dynamic-dns#2
No description provided.