Patchwork [for-1.1,v2] slirp: Avoid redefining MAX_TCPOPTLEN

login
register
mail settings
Submitter Andreas Färber
Date May 28, 2012, 5:52 p.m.
Message ID <1338227555-93380-1-git-send-email-andreas.faerber@web.de>
Download mbox | patch
Permalink /patch/161634/
State New
Headers show

Comments

Andreas Färber - May 28, 2012, 5:52 p.m.
MAX_TCPOPTLEN is being defined as 32. Darwin already has it as 40,
causing a warning. The value is only used to declare an array,
into which currently 4 bytes are written at most.

Therefore always override MAX_TCPOPTLEN for now.

Suggested-by: Jan Kiszka <jan.kiszka@web.de>
Signed-off-by: Andreas Färber <andreas.faerber@web.de>
---
 slirp/tcp_output.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
Stefan Weil - May 28, 2012, 8:35 p.m.
Am 28.05.2012 19:52, schrieb Andreas Färber:
> MAX_TCPOPTLEN is being defined as 32. Darwin already has it as 40,
> causing a warning. The value is only used to declare an array,
> into which currently 4 bytes are written at most.
>
> Therefore always override MAX_TCPOPTLEN for now.
>
> Suggested-by: Jan Kiszka<jan.kiszka@web.de>
> Signed-off-by: Andreas Färber<andreas.faerber@web.de>
> ---
>   slirp/tcp_output.c |    1 +
>   1 files changed, 1 insertions(+), 0 deletions(-)
>
> diff --git a/slirp/tcp_output.c b/slirp/tcp_output.c
> index 779314b..8aa3d90 100644
> --- a/slirp/tcp_output.c
> +++ b/slirp/tcp_output.c
> @@ -47,6 +47,7 @@ static const u_char  tcp_outflags[TCP_NSTATES] = {
>   };
>
>
> +#undef MAX_TCPOPTLEN
>   #define MAX_TCPOPTLEN	32	/* max # bytes that go in options */
>
>   /*


Reviewed-by: Stefan Weil <sw@weilnetz.de>
Jan Kiszka - May 28, 2012, 8:41 p.m.
On 2012-05-28 19:52, Andreas Färber wrote:
> MAX_TCPOPTLEN is being defined as 32. Darwin already has it as 40,
> causing a warning. The value is only used to declare an array,
> into which currently 4 bytes are written at most.
> 
> Therefore always override MAX_TCPOPTLEN for now.
> 
> Suggested-by: Jan Kiszka <jan.kiszka@web.de>
> Signed-off-by: Andreas Färber <andreas.faerber@web.de>
> ---
>  slirp/tcp_output.c |    1 +
>  1 files changed, 1 insertions(+), 0 deletions(-)
> 
> diff --git a/slirp/tcp_output.c b/slirp/tcp_output.c
> index 779314b..8aa3d90 100644
> --- a/slirp/tcp_output.c
> +++ b/slirp/tcp_output.c
> @@ -47,6 +47,7 @@ static const u_char  tcp_outflags[TCP_NSTATES] = {
>  };
>  
>  
> +#undef MAX_TCPOPTLEN
>  #define MAX_TCPOPTLEN	32	/* max # bytes that go in options */
>  
>  /*

Thanks, queued for 1.1.

Jan

Patch

diff --git a/slirp/tcp_output.c b/slirp/tcp_output.c
index 779314b..8aa3d90 100644
--- a/slirp/tcp_output.c
+++ b/slirp/tcp_output.c
@@ -47,6 +47,7 @@  static const u_char  tcp_outflags[TCP_NSTATES] = {
 };
 
 
+#undef MAX_TCPOPTLEN
 #define MAX_TCPOPTLEN	32	/* max # bytes that go in options */
 
 /*