0062-netifd-system-linux-VXLAN-add-options-to-enable-and-disable-UDP-checksums.patch 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. From: Matthias Schiffer <mschiffer@universe-factory.net>
  2. Date: Wed, 24 Jan 2018 20:53:32 +0100
  3. Subject: netifd: system-linux: VXLAN: add options to enable and disable UDP checksums
  4. diff --git a/package/network/config/netifd/patches/0002-system-linux-VXLAN-add-options-to-enable-and-disable.patch b/package/network/config/netifd/patches/0002-system-linux-VXLAN-add-options-to-enable-and-disable.patch
  5. new file mode 100644
  6. index 0000000000000000000000000000000000000000..67a8bb864be37fa97dfcce4dd841bacafefcd0fc
  7. --- /dev/null
  8. +++ b/package/network/config/netifd/patches/0002-system-linux-VXLAN-add-options-to-enable-and-disable.patch
  9. @@ -0,0 +1,65 @@
  10. +From af3cadb6a46ba93e8a729e71d82b176275931e62 Mon Sep 17 00:00:00 2001
  11. +Message-Id: <af3cadb6a46ba93e8a729e71d82b176275931e62.1516821520.git.mschiffer@universe-factory.net>
  12. +From: Matthias Schiffer <mschiffer@universe-factory.net>
  13. +Date: Wed, 24 Jan 2018 13:21:44 +0100
  14. +Subject: [PATCH] system-linux: VXLAN: add options to enable and disable UDP
  15. + checksums
  16. +
  17. +Signed-off-by: Matthias Schiffer <mschiffer@universe-factory.net>
  18. +---
  19. + system-linux.c | 11 +++++++++++
  20. + system.c | 2 ++
  21. + system.h | 2 ++
  22. + 3 files changed, 15 insertions(+)
  23. +
  24. +diff --git a/system-linux.c b/system-linux.c
  25. +index 32d6ffc..0277886 100644
  26. +--- a/system-linux.c
  27. ++++ b/system-linux.c
  28. +@@ -2841,6 +2841,17 @@ static int system_add_vxlan(const char *name, const unsigned int link, struct bl
  29. + }
  30. + nla_put_u16(msg, IFLA_VXLAN_PORT, htons(port));
  31. +
  32. ++ if ((cur = tb_data[VXLAN_DATA_ATTR_RXCSUM])) {
  33. ++ bool rxcsum = blobmsg_get_bool(cur);
  34. ++ nla_put_u8(msg, IFLA_VXLAN_UDP_ZERO_CSUM6_RX, !rxcsum);
  35. ++ }
  36. ++
  37. ++ if ((cur = tb_data[VXLAN_DATA_ATTR_TXCSUM])) {
  38. ++ bool txcsum = blobmsg_get_bool(cur);
  39. ++ nla_put_u8(msg, IFLA_VXLAN_UDP_CSUM, txcsum);
  40. ++ nla_put_u8(msg, IFLA_VXLAN_UDP_ZERO_CSUM6_TX, !txcsum);
  41. ++ }
  42. ++
  43. + if ((cur = tb[TUNNEL_ATTR_TOS])) {
  44. + char *str = blobmsg_get_string(cur);
  45. + unsigned tos = 1;
  46. +diff --git a/system.c b/system.c
  47. +index 5555272..e236e96 100644
  48. +--- a/system.c
  49. ++++ b/system.c
  50. +@@ -36,6 +36,8 @@ static const struct blobmsg_policy vxlan_data_attrs[__VXLAN_DATA_ATTR_MAX] = {
  51. + [VXLAN_DATA_ATTR_ID] = { .name = "id", .type = BLOBMSG_TYPE_INT32 },
  52. + [VXLAN_DATA_ATTR_PORT] = { .name = "port", .type = BLOBMSG_TYPE_INT32 },
  53. + [VXLAN_DATA_ATTR_MACADDR] = { .name = "macaddr", .type = BLOBMSG_TYPE_STRING },
  54. ++ [VXLAN_DATA_ATTR_RXCSUM] = { .name = "rxcsum", .type = BLOBMSG_TYPE_BOOL },
  55. ++ [VXLAN_DATA_ATTR_TXCSUM] = { .name = "txcsum", .type = BLOBMSG_TYPE_BOOL },
  56. + };
  57. +
  58. + const struct uci_blob_param_list vxlan_data_attr_list = {
  59. +diff --git a/system.h b/system.h
  60. +index 61c72c2..371a524 100644
  61. +--- a/system.h
  62. ++++ b/system.h
  63. +@@ -41,6 +41,8 @@ enum vxlan_data {
  64. + VXLAN_DATA_ATTR_ID,
  65. + VXLAN_DATA_ATTR_PORT,
  66. + VXLAN_DATA_ATTR_MACADDR,
  67. ++ VXLAN_DATA_ATTR_RXCSUM,
  68. ++ VXLAN_DATA_ATTR_TXCSUM,
  69. + __VXLAN_DATA_ATTR_MAX
  70. + };
  71. +
  72. +--
  73. +2.16.1
  74. +