• Skip to sidebar navigation
  • Skip to content

Bitbucket

  • More
    ProjectsRepositories
  • Help
    • Online help
    • Learn Git
    • Welcome to Bitbucket
    • Keyboard shortcuts
  • Log In
Alexander Dahl
  1. Alexander Dahl

buildroot

Public
Actions
  • Clone
  • Compare

Learn more about cloning repositories

You have read-only access

Navigation
  • Source
  • Commits
  • Branches
  • All Branches Graph
  • Forks
  1. Alexander Dahl
  2. buildroot

Source

buildroot/package/ndisc6/0001-trace-tcp-upd-uClibc-fix.patch
Gustavo ZacariasGustavo Zacarias committed 6ea07d5286c19 Nov 2014
Raw file
Source viewDiff to previous
 
1
From 0be2fe3a750b62cafca9794e37f040624d3a59de Mon Sep 17 00:00:00 2001
2
From: Peter Korsgaard <jacmet@sunsite.dk>
3
Date: Thu, 26 Apr 2012 23:45:25 +0200
4
Subject: [PATCH] trace-{tcp,udp}.c: fix build on uClibc
5
​
6
Selection of the BSD variant of struct tcphdr/udphdr on uClibc fails
7
because of config.h. This is caused by config.h setting _GNU_SOURCE
8
and the compat handling (uClibc doesn't have inet6_rth_*) including
9
sys/types.h which in term includes features.h, which figures out
10
what bsd/gnu/posix variant to use because of:
11
​
12
 /* If _BSD_SOURCE was defined by the user, favor BSD over POSIX.  */
13
 #if defined _BSD_SOURCE && \
14
    !(defined _POSIX_SOURCE || defined _POSIX_C_SOURCE || \
15
      defined _XOPEN_SOURCE || defined _XOPEN_SOURCE_EXTENDED || \
16
      defined _GNU_SOURCE || defined _SVID_SOURCE)
17
 # define __FAVOR_BSD    1
18
 #endif
19
​
20
The current workaround of undefining _GNU_SOURCE after config.h doesn't
21
work as features.h has already been evaluated by then. Instead, simply
22
don't include config.h as it isn't needed in these two files.
23
​
24
Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
25
---
26
 src/trace-tcp.c |    5 -----
27
 src/trace-udp.c |    5 -----
28
 2 files changed, 10 deletions(-)
29
​
30
diff --git a/src/trace-tcp.c b/src/trace-tcp.c
31
index 6a7732d..91b64c2 100644
32
--- a/src/trace-tcp.c
33
+++ b/src/trace-tcp.c
34
@@ -17,11 +17,6 @@
35
  *  along with this program. If not, see <http://www.gnu.org/licenses/>. *
36
  *************************************************************************/
37
 
38
-#ifdef HAVE_CONFIG_H
39
-# include <config.h>
40
-#endif
41
-
42
-#undef _GNU_SOURCE
43
 #define _BSD_SOURCE 1
44
 
45
 #include <string.h>
46
diff --git a/src/trace-udp.c b/src/trace-udp.c
47
index 821c24c..1754338 100644
48
--- a/src/trace-udp.c
49
+++ b/src/trace-udp.c
50
@@ -17,11 +17,6 @@
51
  *  along with this program. If not, see <http://www.gnu.org/licenses/>. *
52
  *************************************************************************/
53
 
54
-#ifdef HAVE_CONFIG_H
55
-# include <config.h>
56
-#endif
57
-
58
-#undef _GNU_SOURCE
59
 #define _BSD_SOURCE 1
60
 
61
 #include <string.h>
62
-- 
63
1.7.10
  • Git repository management for enterprise teams powered by Atlassian Bitbucket
  • Atlassian Bitbucket v6.7.2
  • Documentation
  • Request a feature
  • About
  • Contact Atlassian
Atlassian

Everything looks good. We'll let you know here if there's anything you should know about.