Skip to content

Commit

Permalink
Switched Google DNS IP addresses to RFC documentation prefix. Thanks to
Browse files Browse the repository at this point in the history
https://github.com/awlx for recommendation
  • Loading branch information
pavel-odintsov committed Jul 27, 2023
1 parent b55c701 commit 4d77cad
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions get_default_outgoing_ip.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,9 @@ int get_default_outgoing_ipv4_address(uint32_t* ipv4_address) {
// Do not worry. There are no connection expected to happen
unsigned short remote_port_dns = 53;

// We will use Google
char* remote_host = "8.8.8.8";
// We use IP address from special block TEST-NET-3 which is reserved only for documentation use
// https://datatracker.ietf.org/doc/html/rfc5737
char* remote_host = "203.0.113.1";

struct sockaddr_in serv_addr;
memset(&serv_addr, 0, sizeof(serv_addr));
Expand Down Expand Up @@ -90,8 +91,9 @@ int get_default_outgoing_ipv6_address(struct in6_addr* ipv6_address) {
// Do not worry. There are no connection expected to happen
unsigned short remote_port_dns = 53;

// We will use Google
char* remote_host = "2001:4860:4860::8888";
// We use IPv6 address reserved for documentation
// https://datatracker.ietf.org/doc/html/rfc3849
char* remote_host = "2001:db8::1";

struct sockaddr_in6 serv_addr;
memset(&serv_addr, 0, sizeof(serv_addr));
Expand Down

0 comments on commit 4d77cad

Please sign in to comment.