netperf-2.4.5-dccp.patch 1.4 KB

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