0005-alfred-use-batman-adv-visdata.patch 2.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. From: Matthias Schiffer <mschiffer@universe-factory.net>
  2. Date: Mon, 14 Dec 2015 03:08:42 +0100
  3. Subject: alfred: use batman-adv-visdata
  4. diff --git a/alfred/Makefile b/alfred/Makefile
  5. index 8f49b5a..f1d7c6e 100644
  6. --- a/alfred/Makefile
  7. +++ b/alfred/Makefile
  8. @@ -28,7 +28,7 @@ define Package/alfred
  9. SECTION:=net
  10. CATEGORY:=Network
  11. TITLE:=A.L.F.R.E.D. - Almighty Lightweight Fact Remote Exchange Daemon
  12. - DEPENDS:= +libc +kmod-ipv6 +librt \
  13. + DEPENDS:= +libc +kmod-ipv6 +librt +batman-adv-visdata \
  14. +ALFRED_NEEDS_lua:lua \
  15. +ALFRED_NEEDS_libgps:libgps
  16. endef
  17. diff --git a/alfred/patches/0002-alfred-use-batman-adv-visdata.patch b/alfred/patches/0002-alfred-use-batman-adv-visdata.patch
  18. new file mode 100644
  19. index 0000000..a28b6a4
  20. --- /dev/null
  21. +++ b/alfred/patches/0002-alfred-use-batman-adv-visdata.patch
  22. @@ -0,0 +1,60 @@
  23. +--- a/batadv_query.c
  24. ++++ b/batadv_query.c
  25. +@@ -91,8 +91,10 @@ int ipv6_to_mac(const struct in6_addr *a
  26. + int batadv_interface_check(const char *mesh_iface)
  27. + {
  28. + char *debugfs_mnt;
  29. ++#if 0
  30. + char full_path[MAX_PATH + 1];
  31. + FILE *f;
  32. ++#endif
  33. +
  34. + debugfs_mnt = debugfs_mount(NULL);
  35. + if (!debugfs_mnt) {
  36. +@@ -100,6 +102,7 @@ int batadv_interface_check(const char *m
  37. + return -1;
  38. + }
  39. +
  40. ++#if 0
  41. + debugfs_make_path(DEBUG_BATIF_PATH_FMT "/" DEBUG_TRANSTABLE_GLOBAL,
  42. + mesh_iface, full_path, sizeof(full_path));
  43. + f = fopen(full_path, "r");
  44. +@@ -121,6 +124,7 @@ int batadv_interface_check(const char *m
  45. + return -1;
  46. + }
  47. + fclose(f);
  48. ++#endif
  49. +
  50. + return 0;
  51. + }
  52. +@@ -150,8 +154,7 @@ struct ether_addr *translate_mac(const c
  53. + if (!debugfs_mnt)
  54. + goto out;
  55. +
  56. +- debugfs_make_path(DEBUG_BATIF_PATH_FMT "/" DEBUG_TRANSTABLE_GLOBAL,
  57. +- mesh_iface, full_path, sizeof(full_path));
  58. ++ snprintf(full_path, sizeof(full_path), "/tmp/batman-adv-visdata/%s/transtable_global", mesh_iface);
  59. +
  60. + f = fopen(full_path, "r");
  61. + if (!f)
  62. +@@ -232,8 +235,7 @@ uint8_t get_tq(const char *mesh_iface, s
  63. + if (!debugfs_mnt)
  64. + goto out;
  65. +
  66. +- debugfs_make_path(DEBUG_BATIF_PATH_FMT "/" DEBUG_ORIGINATORS,
  67. +- mesh_iface, full_path, sizeof(full_path));
  68. ++ snprintf(full_path, sizeof(full_path), "/tmp/batman-adv-visdata/%s/originators", mesh_iface);
  69. +
  70. + f = fopen(full_path, "r");
  71. + if (!f)
  72. +--- a/vis/vis.c
  73. ++++ b/vis/vis.c
  74. +@@ -325,7 +325,7 @@ static int parse_orig_list(struct global
  75. + char path[1024];
  76. + struct vis_list_entry *v_entry;
  77. +
  78. +- snprintf(path, sizeof(path), "/sys/kernel/debug/batman_adv/%s/originators", globals->interface);
  79. ++ snprintf(path, sizeof(path), "/tmp/batman-adv-visdata/%s/originators", globals->interface);
  80. + fbuf = read_file(path);
  81. + if (!fbuf)
  82. + return -1;