uhttpd: fix TCP_FASTOPEN related compile error
PATCH v2 1/1 uhttpd: fix TCP_FASTOPEN related compile error
Fixes [1]:
.../uhttpd-a8bf9c00842224edb394e79909053f7628ee6a82/listen.c: In function 'uh_setup_listeners':
.../uhttpd-a8bf9c00842224edb394e79909053f7628ee6a82/listen.c:120:30: error: 'TCP_FASTOPEN' undeclared (first use in this function)
[1] http://autobuild.buildroot.net/results/56e/56e0727ccd1255b05e03d1b79dc238bd88701230
---
Changes v1 -> v2:
- use conditional define for TCP_FASTOPEN (Baruch Siach, Thomas Petazzoni)
- fix subject typo (Thomas Petazzoni)
--- ...02-Fix-TCP_FASTOPEN-related-compile-error.patch | 30 ++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 package/uhttpd/0002-Fix-TCP_FASTOPEN-related-compile-error.patch
package/uhttpd/0002-Fix-TCP_FASTOPEN-related-compile-error.patch new file +30 -0
@@ -0,0 +1,30 @@ +From adbab70d3602d77736781be344cfdc5508cb0600 Mon Sep 17 00:00:00 2001 +From: Peter Seiderer <[email protected]> +Date: Mon, 3 Apr 2017 19:22:30 +0200 +Subject: [PATCH] Fix TCP_FASTOPEN related compile error. + +Signed-off-by: Peter Seiderer <[email protected]> +--- + listen.c | 6 ++++++ + 1 file changed, 6 insertions(+) + +diff --git a/listen.c b/listen.c +index 2a54888..4dabe34 100644 +--- a/listen.c ++++ b/listen.c +@@ -96,6 +96,12 @@ static void listener_cb(struct uloop_fd *fd, unsigned int events) + uh_block_listener(l); + } + ++#ifdef linux ++#ifndef TCP_FASTOPEN ++#define TCP_FASTOPEN 23 ++#endif ++#endif ++ + void uh_setup_listeners(void) + { + struct listener *l; +-- +2.11.0 +
Signature · 1 line
2.11.0
PATCH v2 1/1 uhttpd: fix TCP_FASTOPEN related compile error
Hi Peter,
Quoted 32 lines · Peter Seiderer
Fixes [1]:
.../uhttpd-a8bf9c00842224edb394e79909053f7628ee6a82/listen.c: In function 'uh_setup_listeners':
.../uhttpd-a8bf9c00842224edb394e79909053f7628ee6a82/listen.c:120:30: error: 'TCP_FASTOPEN' undeclared (first use in this function)[1] http://autobuild.buildroot.net/results/56e/56e0727ccd1255b05e03d1b79dc238bd88701230
Signed-off-by Peter Seiderer <[email protected]>---
Changes v1 -> v2:
- use conditional define forTCP_FASTOPEN(Baruch Siach, Thomas Petazzoni)
- fix subject typo (Thomas Petazzoni)--- ...02-Fix-TCP_FASTOPEN-related-compile-error.patch | 30 ++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 package/uhttpd/0002-Fix-TCP_FASTOPEN-related-compile-error.patchpackage/uhttpd/0002-Fix-TCP_FASTOPEN-related-compile-error.patch new file +9
-0@@ -0,0 +1,30 @@ +From adbab70d3602d77736781be344cfdc5508cb0600 Mon Sep 17 00:00:00 2001 +From: Peter Seiderer <[email protected]> +Date: Mon, 3 Apr 2017 19:22:30 +0200 +Subject: [PATCH] Fix TCP_FASTOPEN related compile error. + +Signed-off-by: Peter Seiderer <[email protected]> +--- + listen.c | 6 ++++++ + 1 file changed, 6 insertions(+)
package/uhttpd/0002-Fix-TCP_FASTOPEN-related-compile-error.patch line 19
Quoted 10 lines
package/uhttpd/0002-Fix-TCP_FASTOPEN-related-compile-error.patch new file +10
-0+ +diff --git a/listen.c b/listen.c +index 2a54888..4dabe34 100644 +--- a/listen.c ++++ b/listen.c +@@ -96,6 +96,12 @@ static void listener_cb(struct uloop_fd *fd, unsigned int events) + uh_block_listener(l); + } + ++#ifdef linux
Why limit it to Linux? TCP_FASTOPEN does not conflict with anything else, as far as I can see.
package/uhttpd/0002-Fix-TCP_FASTOPEN-related-compile-error.patch line 23
Quoted 4 lines
package/uhttpd/0002-Fix-TCP_FASTOPEN-related-compile-error.patch new file +4
-0++#ifndef TCP_FASTOPEN ++#define TCP_FASTOPEN 23 ++#endif ++#endif
baruch
Signature · 3 lines
http://baruch.siach.name/blog/ ~. .~ Tk Open Systems
=}------------------------------------------------ooO--U--Ooo------------{=
- baruch at tkos.co.il - tel: +972.52.368.4656, http://www.tkos.co.il -PATCH v2 1/1 uhttpd: fix TCP_FASTOPEN related compile error
Hello Baruch,
Quoted 40 lines · Baruch Siach
Hi Peter,
Quoted 37 lines · Peter Seiderer
Fixes [1]:
.../uhttpd-a8bf9c00842224edb394e79909053f7628ee6a82/listen.c: In function 'uh_setup_listeners':
.../uhttpd-a8bf9c00842224edb394e79909053f7628ee6a82/listen.c:120:30: error: 'TCP_FASTOPEN' undeclared (first use in this function)[1] http://autobuild.buildroot.net/results/56e/56e0727ccd1255b05e03d1b79dc238bd88701230
Signed-off-by Peter Seiderer <[email protected]>---
Changes v1 -> v2:
- use conditional define forTCP_FASTOPEN(Baruch Siach, Thomas Petazzoni)
- fix subject typo (Thomas Petazzoni)--- ...02-Fix-TCP_FASTOPEN-related-compile-error.patch | 30 ++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 package/uhttpd/0002-Fix-TCP_FASTOPEN-related-compile-error.patchpackage/uhttpd/0002-Fix-TCP_FASTOPEN-related-compile-error.patch new file +14
-0@@ -0,0 +1,30 @@ +From adbab70d3602d77736781be344cfdc5508cb0600 Mon Sep 17 00:00:00 2001 +From: Peter Seiderer <[email protected]> +Date: Mon, 3 Apr 2017 19:22:30 +0200 +Subject: [PATCH] Fix TCP_FASTOPEN related compile error. + +Signed-off-by: Peter Seiderer <[email protected]> +--- + listen.c | 6 ++++++ + 1 file changed, 6 insertions(+) + +diff --git a/listen.c b/listen.c +index 2a54888..4dabe34 100644 +--- a/listen.c ++++ b/listen.c
Quoted 8 lines
package/uhttpd/0002-Fix-TCP_FASTOPEN-related-compile-error.patch line 19
Quoted 5 lines
package/uhttpd/0002-Fix-TCP_FASTOPEN-related-compile-error.patch new file +5
-0+@@ -96,6 +96,12 @@ static void listener_cb(struct uloop_fd *fd, unsigned int events) + uh_block_listener(l); + } + ++#ifdef linuxWhy limit it to Linux?
TCP_FASTOPENdoes not conflict with anything else, as far as I can see.
Because the setsockopt() call is limited by '#ifdef linux', see some lines below in the original listen.c file...
Regards,
Peter
Quoted 8 lines
package/uhttpd/0002-Fix-TCP_FASTOPEN-related-compile-error.patch line 23
Quoted 5 lines
package/uhttpd/0002-Fix-TCP_FASTOPEN-related-compile-error.patch new file +4
-0++#ifndef TCP_FASTOPEN ++#define TCP_FASTOPEN 23 ++#endif ++#endifbaruch
PATCH v2 1/1 uhttpd: fix TCP_FASTOPEN related compile error
Hi Peter,
Quoted 9 lines · Peter Seiderer
Quoted 5 lines · Baruch Siach
Quoted 1 line · Peter Seiderer
++#ifdef linux
Why limit it to Linux?
TCP_FASTOPENdoes not conflict with anything else, as far as I can see.Because the
setsockopt()call is limited by '#ifdef linux', see some lines below in the originallisten.cfile...
I'm aware of that. Still the TCP_FASTOPEN macro doesn't conflict with anything else, whether under #ifdef or not.
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
++#ifndef
TCP_FASTOPEN
++#defineTCP_FASTOPEN23
++#endif
++#endif
baruch
Signature · 3 lines
http://baruch.siach.name/blog/ ~. .~ Tk Open Systems
=}------------------------------------------------ooO--U--Ooo------------{=
- baruch at tkos.co.il - tel: +972.52.368.4656, http://www.tkos.co.il -PATCH v2 1/1 uhttpd: fix TCP_FASTOPEN related compile error
In reply to Peter SeidererHello,
Quoted 8 lines · Peter Seiderer
Fixes [1]:
.../uhttpd-a8bf9c00842224edb394e79909053f7628ee6a82/listen.c: In function 'uh_setup_listeners':
.../uhttpd-a8bf9c00842224edb394e79909053f7628ee6a82/listen.c:120:30: error: 'TCP_FASTOPEN' undeclared (first use in this function)[1] http://autobuild.buildroot.net/results/56e/56e0727ccd1255b05e03d1b79dc238bd88701230
Signed-off-by Peter Seiderer <[email protected]>
Quoted 8 lines
---
Changes v1 -> v2:
- use conditional define forTCP_FASTOPEN(Baruch Siach, Thomas Petazzoni)
- fix subject typo (Thomas Petazzoni)--- ...02-Fix-TCP_FASTOPEN-related-compile-error.patch | 30 ++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 package/uhttpd/0002-Fix-TCP_FASTOPEN-related-compile-error.patch
Applied to master, thanks. Baruch: I read your comment about whether the #ifndef TCP_FASTOPEN...#endif should be inside a #ifdef linux...#endif condition or not. I believe there are arguments both ways, so I'm not sure it's really worth to bikeshed on this too much.
Thanks!
Thomas
Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons Embedded Linux, Kernel and Android engineering http://free-electrons.com