patch-traceroute_extension_c 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. --- traceroute-2.0.19.orig/traceroute/extension.c 2010-07-14 16:29:08.000000000 +0200
  2. +++ traceroute-2.0.19/traceroute/extension.c 2013-12-29 20:01:35.000000000 +0100
  3. @@ -14,16 +14,16 @@ struct icmp_ext_header {
  4. unsigned int reserved:4;
  5. unsigned int version:4;
  6. #endif
  7. - u_int8_t reserved1;
  8. - u_int16_t checksum;
  9. + uint8_t reserved1;
  10. + uint16_t checksum;
  11. } __attribute__ ((packed));
  12. struct icmp_ext_object {
  13. - u_int16_t length;
  14. - u_int8_t class;
  15. - u_int8_t c_type;
  16. - u_int8_t data[0];
  17. + uint16_t length;
  18. + uint8_t class;
  19. + uint8_t c_type;
  20. + uint8_t data[0];
  21. };
  22. #define MPLS_CLASS 1
  23. @@ -49,7 +49,7 @@ static int try_extension (probe *pb, cha
  24. if (iext->version != 2) return -1;
  25. if (iext->checksum &&
  26. - in_csum (iext, len) != (u_int16_t) ~0
  27. + in_csum (iext, len) != (uint16_t) ~0
  28. ) return -1;
  29. buf += sizeof (*iext);
  30. @@ -60,7 +60,7 @@ static int try_extension (probe *pb, cha
  31. struct icmp_ext_object *obj = (struct icmp_ext_object *) buf;
  32. size_t objlen = ntohs (obj->length);
  33. size_t data_len;
  34. - u_int32_t *ui = (u_int32_t *) obj->data;
  35. + uint32_t *ui = (uint32_t *) obj->data;
  36. int i, n;
  37. if (objlen < sizeof (*obj) ||
  38. @@ -68,7 +68,7 @@ static int try_extension (probe *pb, cha
  39. ) return -1;
  40. data_len = objlen - sizeof (*obj);
  41. - if (data_len % sizeof (u_int32_t))
  42. + if (data_len % sizeof (uint32_t))
  43. return -1; /* must be 32bit rounded... */
  44. n = data_len / sizeof (*ui);
  45. @@ -85,7 +85,7 @@ static int try_extension (probe *pb, cha
  46. do_snprintf (curr, end, "MPLS:");
  47. for (i = 0; i < n; i++, ui++) {
  48. - u_int32_t mpls = ntohl (*ui);
  49. + uint32_t mpls = ntohl (*ui);
  50. do_snprintf (curr, end, "%sL=%u,E=%u,S=%u,T=%u",
  51. i ? "/" : "",