mailing list of musl libc
 help / color / mirror / code / Atom feed
* [PATCH] nameser.h: explicitely include endian.h
@ 2017-12-04 11:13 Jo-Philipp Wich
  2017-12-15  4:38 ` Rich Felker
  0 siblings, 1 reply; 6+ messages in thread
From: Jo-Philipp Wich @ 2017-12-04 11:13 UTC (permalink / raw)
  To: musl; +Cc: Jo-Philipp Wich

As nameser.h itself uses endian macros to declare the proper layout of
the HEADER structure, it needs to include the endian.h header as well.

The issue was found while investigating iodine query packet corruption
on little endian musl systems [1].

1: http://lists.infradead.org/pipermail/lede-dev/2017-November/010085.html

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
---
 include/arpa/nameser.h | 1 +
 1 file changed, 1 insertion(+)

diff --git a/include/arpa/nameser.h b/include/arpa/nameser.h
index 581925a4..b315e0f3 100644
--- a/include/arpa/nameser.h
+++ b/include/arpa/nameser.h
@@ -7,6 +7,7 @@ extern "C" {
 
 #include <stddef.h>
 #include <stdint.h>
+#include <endian.h>
 
 #define __NAMESER	19991006
 #define NS_PACKETSZ	512
-- 
2.11.0



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] nameser.h: explicitely include endian.h
  2017-12-04 11:13 [PATCH] nameser.h: explicitely include endian.h Jo-Philipp Wich
@ 2017-12-15  4:38 ` Rich Felker
  2017-12-15 17:54   ` Bartosz Brachaczek
  0 siblings, 1 reply; 6+ messages in thread
From: Rich Felker @ 2017-12-15  4:38 UTC (permalink / raw)
  To: musl

On Mon, Dec 04, 2017 at 12:13:06PM +0100, Jo-Philipp Wich wrote:
> As nameser.h itself uses endian macros to declare the proper layout of
> the HEADER structure, it needs to include the endian.h header as well.
> 
> The issue was found while investigating iodine query packet corruption
> on little endian musl systems [1].
> 
> 1: http://lists.infradead.org/pipermail/lede-dev/2017-November/010085.html
> 
> Signed-off-by: Jo-Philipp Wich <jo@mein.io>
> ---
>  include/arpa/nameser.h | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/include/arpa/nameser.h b/include/arpa/nameser.h
> index 581925a4..b315e0f3 100644
> --- a/include/arpa/nameser.h
> +++ b/include/arpa/nameser.h
> @@ -7,6 +7,7 @@ extern "C" {
>  
>  #include <stddef.h>
>  #include <stdint.h>
> +#include <endian.h>
>  
>  #define __NAMESER	19991006
>  #define NS_PACKETSZ	512
> -- 
> 2.11.0

Thanks. Committing.

Rich


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] nameser.h: explicitely include endian.h
  2017-12-15  4:38 ` Rich Felker
@ 2017-12-15 17:54   ` Bartosz Brachaczek
  2017-12-15 17:57     ` Rich Felker
  0 siblings, 1 reply; 6+ messages in thread
From: Bartosz Brachaczek @ 2017-12-15 17:54 UTC (permalink / raw)
  To: musl

On 12/15/2017 5:38 AM, Rich Felker wrote:
> On Mon, Dec 04, 2017 at 12:13:06PM +0100, Jo-Philipp Wich wrote:
>> As nameser.h itself uses endian macros to declare the proper layout of
>> the HEADER structure, it needs to include the endian.h header as well.
>>
>> The issue was found while investigating iodine query packet corruption
>> on little endian musl systems [1].
>>
>> 1: http://lists.infradead.org/pipermail/lede-dev/2017-November/010085.html
>>
>> Signed-off-by: Jo-Philipp Wich <jo@mein.io>
>> ---
>>   include/arpa/nameser.h | 1 +
>>   1 file changed, 1 insertion(+)
>>
>> diff --git a/include/arpa/nameser.h b/include/arpa/nameser.h
>> index 581925a4..b315e0f3 100644
>> --- a/include/arpa/nameser.h
>> +++ b/include/arpa/nameser.h
>> @@ -7,6 +7,7 @@ extern "C" {
>>   
>>   #include <stddef.h>
>>   #include <stdint.h>
>> +#include <endian.h>
>>   
>>   #define __NAMESER	19991006
>>   #define NS_PACKETSZ	512
>> -- 
>> 2.11.0
> 
> Thanks. Committing.
> 
> Rich
> 

I believe include/netinet/icmp6.h suffers from the same issue (missing 
endian.h include directive).


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] nameser.h: explicitely include endian.h
  2017-12-15 17:54   ` Bartosz Brachaczek
@ 2017-12-15 17:57     ` Rich Felker
  2017-12-15 18:53       ` Rich Felker
  0 siblings, 1 reply; 6+ messages in thread
From: Rich Felker @ 2017-12-15 17:57 UTC (permalink / raw)
  To: musl

On Fri, Dec 15, 2017 at 06:54:10PM +0100, Bartosz Brachaczek wrote:
> On 12/15/2017 5:38 AM, Rich Felker wrote:
> >On Mon, Dec 04, 2017 at 12:13:06PM +0100, Jo-Philipp Wich wrote:
> >>As nameser.h itself uses endian macros to declare the proper layout of
> >>the HEADER structure, it needs to include the endian.h header as well.
> >>
> >>The issue was found while investigating iodine query packet corruption
> >>on little endian musl systems [1].
> >>
> >>1: http://lists.infradead.org/pipermail/lede-dev/2017-November/010085.html
> >>
> >>Signed-off-by: Jo-Philipp Wich <jo@mein.io>
> >>---
> >>  include/arpa/nameser.h | 1 +
> >>  1 file changed, 1 insertion(+)
> >>
> >>diff --git a/include/arpa/nameser.h b/include/arpa/nameser.h
> >>index 581925a4..b315e0f3 100644
> >>--- a/include/arpa/nameser.h
> >>+++ b/include/arpa/nameser.h
> >>@@ -7,6 +7,7 @@ extern "C" {
> >>  #include <stddef.h>
> >>  #include <stdint.h>
> >>+#include <endian.h>
> >>  #define __NAMESER	19991006
> >>  #define NS_PACKETSZ	512
> >>-- 
> >>2.11.0
> >
> >Thanks. Committing.
> 
> I believe include/netinet/icmp6.h suffers from the same issue
> (missing endian.h include directive).

Thanks. I'll check and fix if this is the case.

Rich


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] nameser.h: explicitely include endian.h
  2017-12-15 17:57     ` Rich Felker
@ 2017-12-15 18:53       ` Rich Felker
  0 siblings, 0 replies; 6+ messages in thread
From: Rich Felker @ 2017-12-15 18:53 UTC (permalink / raw)
  To: musl

On Fri, Dec 15, 2017 at 12:57:21PM -0500, Rich Felker wrote:
> On Fri, Dec 15, 2017 at 06:54:10PM +0100, Bartosz Brachaczek wrote:
> > On 12/15/2017 5:38 AM, Rich Felker wrote:
> > >On Mon, Dec 04, 2017 at 12:13:06PM +0100, Jo-Philipp Wich wrote:
> > >>As nameser.h itself uses endian macros to declare the proper layout of
> > >>the HEADER structure, it needs to include the endian.h header as well.
> > >>
> > >>The issue was found while investigating iodine query packet corruption
> > >>on little endian musl systems [1].
> > >>
> > >>1: http://lists.infradead.org/pipermail/lede-dev/2017-November/010085.html
> > >>
> > >>Signed-off-by: Jo-Philipp Wich <jo@mein.io>
> > >>---
> > >>  include/arpa/nameser.h | 1 +
> > >>  1 file changed, 1 insertion(+)
> > >>
> > >>diff --git a/include/arpa/nameser.h b/include/arpa/nameser.h
> > >>index 581925a4..b315e0f3 100644
> > >>--- a/include/arpa/nameser.h
> > >>+++ b/include/arpa/nameser.h
> > >>@@ -7,6 +7,7 @@ extern "C" {
> > >>  #include <stddef.h>
> > >>  #include <stdint.h>
> > >>+#include <endian.h>
> > >>  #define __NAMESER	19991006
> > >>  #define NS_PACKETSZ	512
> > >>-- 
> > >>2.11.0
> > >
> > >Thanks. Committing.
> > 
> > I believe include/netinet/icmp6.h suffers from the same issue
> > (missing endian.h include directive).
> 
> Thanks. I'll check and fix if this is the case.

Fixed (pending push). I also grepped and didn't find any other headers
that include "BYTE_ORDER" but not "endian.h".

Rich


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH] nameser.h: explicitely include endian.h
@ 2017-12-04 10:55 Jo-Philipp Wich
  0 siblings, 0 replies; 6+ messages in thread
From: Jo-Philipp Wich @ 2017-12-04 10:55 UTC (permalink / raw)
  To: musl; +Cc: Jo-Philipp Wich

As nameser.h itself uses endian macros to declare the proper layout of
the HEADER structure, it needs to include the endian.h header as well.

The issue was found while investigating iodine query packet corruption
on little endian musl systems [1].

1: http://lists.infradead.org/pipermail/lede-dev/2017-November/010085.html

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
---
 include/arpa/nameser.h | 1 +
 1 file changed, 1 insertion(+)

diff --git a/include/arpa/nameser.h b/include/arpa/nameser.h
index 581925a4..b315e0f3 100644
--- a/include/arpa/nameser.h
+++ b/include/arpa/nameser.h
@@ -7,6 +7,7 @@ extern "C" {
 
 #include <stddef.h>
 #include <stdint.h>
+#include <endian.h>
 
 #define __NAMESER	19991006
 #define NS_PACKETSZ	512
-- 
2.11.0



^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2017-12-15 18:53 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-12-04 11:13 [PATCH] nameser.h: explicitely include endian.h Jo-Philipp Wich
2017-12-15  4:38 ` Rich Felker
2017-12-15 17:54   ` Bartosz Brachaczek
2017-12-15 17:57     ` Rich Felker
2017-12-15 18:53       ` Rich Felker
  -- strict thread matches above, loose matches on Subject: below --
2017-12-04 10:55 Jo-Philipp Wich

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/musl/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).