You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

78 lines
2.4 KiB

  1. --- a/src/owniptc/libiptc.c
  2. +++ b/src/owniptc/libiptc.c
  3. @@ -81,11 +81,11 @@ static const char *hooknames[] = {
  4. };
  5. /* Convenience structures */
  6. -struct ipt_error_target
  7. + struct ipt_error_target2
  8. {
  9. STRUCT_ENTRY_TARGET t;
  10. char error[TABLE_MAXNAMELEN];
  11. -};
  12. +};
  13. struct chain_head;
  14. struct rule_head;
  15. @@ -1007,10 +1007,10 @@ static int parse_table(TC_HANDLE_T h)
  16. /* Convenience structures */
  17. struct iptcb_chain_start{
  18. STRUCT_ENTRY e;
  19. - struct ipt_error_target name;
  20. + struct ipt_error_target2 name;
  21. };
  22. #define IPTCB_CHAIN_START_SIZE (sizeof(STRUCT_ENTRY) + \
  23. - ALIGN(sizeof(struct ipt_error_target)))
  24. + ALIGN(sizeof(struct ipt_error_target2)))
  25. struct iptcb_chain_foot {
  26. STRUCT_ENTRY e;
  27. @@ -1021,10 +1021,10 @@ struct iptcb_chain_foot {
  28. struct iptcb_chain_error {
  29. STRUCT_ENTRY entry;
  30. - struct ipt_error_target target;
  31. + struct ipt_error_target2 target;
  32. };
  33. #define IPTCB_CHAIN_ERROR_SIZE (sizeof(STRUCT_ENTRY) + \
  34. - ALIGN(sizeof(struct ipt_error_target)))
  35. + ALIGN(sizeof(struct ipt_error_target2)))
  36. @@ -1069,7 +1069,7 @@ static int iptcc_compile_chain(TC_HANDLE
  37. head->e.next_offset = IPTCB_CHAIN_START_SIZE;
  38. strcpy(head->name.t.u.user.name, ERROR_TARGET);
  39. head->name.t.u.target_size =
  40. - ALIGN(sizeof(struct ipt_error_target));
  41. + ALIGN(sizeof(struct ipt_error_target2));
  42. strcpy(head->name.error, c->name);
  43. } else {
  44. repl->hook_entry[c->hooknum-1] = c->head_offset;
  45. @@ -1113,7 +1113,7 @@ static int iptcc_compile_chain_offsets(T
  46. if (!iptcc_is_builtin(c)) {
  47. /* Chain has header */
  48. *offset += sizeof(STRUCT_ENTRY)
  49. - + ALIGN(sizeof(struct ipt_error_target));
  50. + + ALIGN(sizeof(struct ipt_error_target2));
  51. (*num)++;
  52. }
  53. @@ -1153,7 +1153,7 @@ static int iptcc_compile_table_prep(TC_H
  54. /* Append one error rule at end of chain */
  55. num++;
  56. offset += sizeof(STRUCT_ENTRY)
  57. - + ALIGN(sizeof(struct ipt_error_target));
  58. + + ALIGN(sizeof(struct ipt_error_target2));
  59. /* ruleset size is now in offset */
  60. *size = offset;
  61. @@ -1177,7 +1177,7 @@ static int iptcc_compile_table(TC_HANDLE
  62. error->entry.target_offset = sizeof(STRUCT_ENTRY);
  63. error->entry.next_offset = IPTCB_CHAIN_ERROR_SIZE;
  64. error->target.t.u.user.target_size =
  65. - ALIGN(sizeof(struct ipt_error_target));
  66. + ALIGN(sizeof(struct ipt_error_target2));
  67. strcpy((char *)&error->target.t.u.user.name, ERROR_TARGET);
  68. strcpy((char *)&error->target.error, "ERROR");