libnids-1.24-inline.patch 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. Patch by Robert Scheck <robert@fedoraproject.org> for libnids <= 1.24 which
  2. avoids making the functions ip_fast_csum, ip_compute_csum, my_tcp_check and
  3. my_udp_check inline, see https://github.com/aol/moloch/issues/440 as well.
  4. --- libnids-1.24/src/checksum.c 2010-02-26 11:58:41.000000000 +0100
  5. +++ libnids-1.24/src/checksum.c.inline 2016-02-09 14:08:38.000000000 +0100
  6. @@ -120,7 +120,7 @@
  7. By Jorge Cwik <jorge@laser.satlink.net>, adapted for linux by Arnt
  8. Gulbrandsen.
  9. */
  10. -inline u_short ip_fast_csum(u_char * iph, u_int ihl)
  11. +u_short ip_fast_csum(u_char * iph, u_int ihl)
  12. {
  13. u_int sum;
  14. if (dontchksum(((struct ip*)iph)->ip_src.s_addr))
  15. @@ -191,13 +191,13 @@
  16. this routine is used for miscellaneous IP-like checksums, mainly in
  17. icmp.c
  18. */
  19. -inline u_short
  20. +u_short
  21. ip_compute_csum(u_char * buff, int len)
  22. {
  23. return (csum_fold(csum_partial(buff, len, 0)));
  24. }
  25. -inline u_short
  26. +u_short
  27. my_tcp_check(struct tcphdr *th, int len, u_int saddr, u_int daddr)
  28. {
  29. if (dontchksum(saddr))
  30. @@ -205,7 +205,7 @@
  31. return csum_tcpudp_magic(saddr, daddr, len, IPPROTO_TCP,
  32. csum_partial((u_char *)th, len, 0));
  33. }
  34. -inline u_short
  35. +u_short
  36. my_udp_check(void *u, int len, u_int saddr, u_int daddr)
  37. {
  38. if (dontchksum(saddr))