From 7f00146d0098e585727a219d4835800bc862b31d Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Thu, 4 Oct 2018 11:57:29 +0200 Subject: doh: keep the IPv4 address in (original) network byte order Ideally this will fix the reversed order shown in SPARC tests: resp 8: Expected 127.0.0.1 got 1.0.0.127 Closes #3091 --- lib/doh.h | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) (limited to 'lib/doh.h') diff --git a/lib/doh.h b/lib/doh.h index 96c1fa7c1..5f879e50e 100644 --- a/lib/doh.h +++ b/lib/doh.h @@ -67,10 +67,6 @@ typedef enum { #define DOH_MAX_ADDR 24 #define DOH_MAX_CNAME 4 -struct addr6 { - unsigned char byte[16]; -}; - struct cnamestore { size_t len; /* length of cname */ char *alloc; /* allocated pointer */ @@ -80,8 +76,8 @@ struct cnamestore { struct dohaddr { int type; union { - unsigned int v4; - struct addr6 v6; + unsigned char v4[4]; /* network byte order */ + unsigned char v6[16]; } ip; }; -- cgit v1.2.3