add packages_10.03.2 in preparation for the 10.03.2 interim release
[10.03/packages.git] / net / netperf / patches / 001-dccp.patch
1 [PATCH] fix build on systems where IPROTO_DCCP is defined, but SOCK_DCCP isn't
2
3 On some systems (E.G. uClibc 0.9.31) IPROTO_DCCP is defined, but SOCK_DCCP
4 isn't - Causing the build to break. Fix it by checking for both before
5 using.
6
7 Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
8 ---
9  src/netsh.c       |    2 +-
10  src/nettest_bsd.c |    2 +-
11  2 files changed, 2 insertions(+), 2 deletions(-)
12
13 Index: netperf-2.4.5/src/netsh.c
14 ===================================================================
15 --- netperf-2.4.5.orig/src/netsh.c
16 +++ netperf-2.4.5/src/netsh.c
17 @@ -452,7 +452,7 @@ parse_protocol(char protocol_string[])
18      return IPPROTO_SDP;
19    }
20  #endif
21 -#ifdef IPPROTO_DCCP
22 +#if defined(IPPROTO_DCCP) && defined(SOCK_DCCP)
23    if (!strcasecmp(temp,"dccp")) {
24      socket_type = SOCK_DCCP;
25      return IPPROTO_DCCP;
26 Index: netperf-2.4.5/src/nettest_bsd.c
27 ===================================================================
28 --- netperf-2.4.5.orig/src/nettest_bsd.c
29 +++ netperf-2.4.5/src/nettest_bsd.c
30 @@ -712,7 +712,7 @@ complete_addrinfo(char *controlhost, cha
31          that we did this so the code for the Solaris kludge can do
32          the fix-up for us.  also flip error over to EAI_AGAIN and
33          make sure we don't "count" this time around the loop. */
34 -#if defined(IPPROTO_DCCP)
35 +#if defined(IPPROTO_DCCP) && defined(SOCK_DCCP)
36        /* only tweak on this one the second time around, after we've
37          kludged the ai_protocol field */
38        if ((hints.ai_socktype == SOCK_DCCP) &&