0001-radvd-update-to-1.9.8-and-add-patch-to-fix-race-condition.patch 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187
  1. From: Matthias Schiffer <mschiffer@universe-factory.net>
  2. Date: Sun, 12 Jan 2014 00:42:43 +0100
  3. Subject: radvd: update to 1.9.8 and add patch to fix race condition
  4. diff --git a/ipv6/radvd/Makefile b/ipv6/radvd/Makefile
  5. index 571d9de..b14c02b 100644
  6. --- a/ipv6/radvd/Makefile
  7. +++ b/ipv6/radvd/Makefile
  8. @@ -8,13 +8,13 @@
  9. include $(TOPDIR)/rules.mk
  10. PKG_NAME:=radvd
  11. -PKG_VERSION:=1.9.1
  12. -PKG_RELEASE:=2
  13. +PKG_VERSION:=1.9.8
  14. +PKG_RELEASE:=1
  15. PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
  16. PKG_SOURCE_URL:=http://v6web.litech.org/radvd/dist \
  17. http://download.sourcemage.org/mirror
  18. -PKG_MD5SUM:=e807ad7e9a76d46b6133df391385cd31
  19. +PKG_MD5SUM:=7a96a38252c3964ee18bbc1fdeae25fa
  20. PKG_INSTALL:=1
  21. diff --git a/ipv6/radvd/patches/100-silent-netlink-config-reload.patch b/ipv6/radvd/patches/100-silent-netlink-config-reload.patch
  22. index 049d654..313b8cb 100644
  23. --- a/ipv6/radvd/patches/100-silent-netlink-config-reload.patch
  24. +++ b/ipv6/radvd/patches/100-silent-netlink-config-reload.patch
  25. @@ -1,26 +1,26 @@
  26. --- a/netlink.c
  27. +++ b/netlink.c
  28. -@@ -67,7 +67,7 @@ void process_netlink_msg(int sock)
  29. - else {
  30. - dlog(LOG_DEBUG, 3, "%s, ifindex %d, flags is *NOT* running", ifname, ifinfo->ifi_index);
  31. - }
  32. -- reload_config();
  33. -+ reload_config(LOG_DEBUG);
  34. - }
  35. - }
  36. -
  37. +@@ -75,7 +75,7 @@ void process_netlink_msg(int sock)
  38. + dlog(LOG_DEBUG, 3, "%s, ifindex %d, flags is *NOT* running", ifname, ifinfo->ifi_index);
  39. + }
  40. + if (!reloaded) {
  41. +- reload_config();
  42. ++ reload_config(LOG_DEBUG);
  43. + reloaded = 1;
  44. + }
  45. + }
  46. --- a/radvd.c
  47. +++ b/radvd.c
  48. @@ -443,7 +443,7 @@ void main_loop(void)
  49. - if (sighup_received)
  50. - {
  51. +
  52. + if (sighup_received) {
  53. dlog(LOG_INFO, 3, "sig hup received.\n");
  54. - reload_config();
  55. + reload_config(LOG_INFO);
  56. sighup_received = 0;
  57. }
  58. -@@ -552,11 +552,11 @@ stop_adverts(void)
  59. +@@ -545,11 +545,11 @@ void stop_adverts(void)
  60. }
  61. }
  62. @@ -32,9 +32,9 @@
  63. - flog(LOG_INFO, "attempting to reread config file");
  64. + flog(loglevel, "attempting to reread config file");
  65. - iface=IfaceList;
  66. - while(iface)
  67. -@@ -626,7 +626,7 @@ void reload_config(void)
  68. + iface = IfaceList;
  69. + while (iface) {
  70. +@@ -614,7 +614,7 @@ void reload_config(void)
  71. config_interface();
  72. kickoff_adverts();
  73. @@ -42,10 +42,10 @@
  74. + flog(loglevel, "resuming normal operation");
  75. }
  76. - void
  77. + void sighup_handler(int sig)
  78. --- a/radvd.h
  79. +++ b/radvd.h
  80. -@@ -185,7 +185,7 @@ int yylex(void);
  81. +@@ -186,7 +186,7 @@ int yylex(void);
  82. /* radvd.c */
  83. int check_ip6_forwarding(void);
  84. @@ -56,7 +56,7 @@
  85. /* timer.c */
  86. --- a/send.c
  87. +++ b/send.c
  88. -@@ -154,7 +154,7 @@ send_ra(struct Interface *iface, struct
  89. +@@ -143,7 +143,7 @@ int send_ra(struct Interface *iface, str
  90. * reload_config() will kick off new timers anyway. This avoids
  91. * timer list corruption.
  92. */
  93. diff --git a/ipv6/radvd/patches/200-handle-setup_linklocal_addr-failure.patch b/ipv6/radvd/patches/200-handle-setup_linklocal_addr-failure.patch
  94. new file mode 100644
  95. index 0000000..3f22f76
  96. --- /dev/null
  97. +++ b/ipv6/radvd/patches/200-handle-setup_linklocal_addr-failure.patch
  98. @@ -0,0 +1,78 @@
  99. +diff --git a/device-linux.c b/device-linux.c
  100. +index bbf508d..054937e 100644
  101. +--- a/device-linux.c
  102. ++++ b/device-linux.c
  103. +@@ -141,7 +141,13 @@ int setup_linklocal_addr(struct Interface *iface)
  104. + }
  105. + }
  106. +
  107. +- flog(LOG_ERR, "no linklocal address configured for %s", iface->Name);
  108. ++ if (iface->IgnoreIfMissing)
  109. ++ dlog(LOG_DEBUG, 4, "no linklocal address configured for %s", iface->Name);
  110. ++ else
  111. ++ flog(LOG_ERR, "no linklocal address configured for %s", iface->Name);
  112. ++
  113. ++ iface->if_index = 0;
  114. ++
  115. + fclose(fp);
  116. + return (-1);
  117. + }
  118. +diff --git a/gram.y b/gram.y
  119. +index 9b453a1..3239848 100644
  120. +--- a/gram.y
  121. ++++ b/gram.y
  122. +@@ -176,19 +176,33 @@ ifacedef : ifacehead '{' ifaceparams '}' ';'
  123. + flog(LOG_ERR, "interface %s does not exist", iface->Name);
  124. + ABORT;
  125. + }
  126. ++
  127. ++ iface->HasFailed = 1;
  128. + }
  129. +- if (update_device_info(iface) < 0)
  130. ++ if (update_device_info(iface) < 0) {
  131. + if (!iface->IgnoreIfMissing)
  132. +- ABORT;
  133. +- if (check_iface(iface) < 0)
  134. ++ ABORT;
  135. ++
  136. ++ iface->HasFailed = 1;
  137. ++ }
  138. ++ if (check_iface(iface) < 0) {
  139. + if (!iface->IgnoreIfMissing)
  140. +- ABORT;
  141. +- if (setup_linklocal_addr(iface) < 0)
  142. ++ ABORT;
  143. ++
  144. ++ iface->HasFailed = 1;
  145. ++ }
  146. ++ if (setup_linklocal_addr(iface) < 0) {
  147. + if (!iface->IgnoreIfMissing)
  148. +- ABORT;
  149. +- if (setup_allrouters_membership(iface) < 0)
  150. ++ ABORT;
  151. ++
  152. ++ iface->HasFailed = 1;
  153. ++ }
  154. ++ if (setup_allrouters_membership(iface) < 0) {
  155. + if (!iface->IgnoreIfMissing)
  156. +- ABORT;
  157. ++ ABORT;
  158. ++
  159. ++ iface->HasFailed = 1;
  160. ++ }
  161. +
  162. + dlog(LOG_DEBUG, 4, "interface definition for %s is ok", iface->Name);
  163. +
  164. +diff --git a/send.c b/send.c
  165. +index 0d7ed5b..d6a3da2 100644
  166. +--- a/send.c
  167. ++++ b/send.c
  168. +@@ -124,7 +124,7 @@ int send_ra(struct Interface *iface, struct in6_addr *dest)
  169. + update_device_info(iface);
  170. +
  171. + /* First we need to check that the interface hasn't been removed or deactivated */
  172. +- if (check_device(iface) < 0) {
  173. ++ if (check_device(iface) < 0 || (iface->if_index == 0 && setup_linklocal_addr(iface) < 0)) {
  174. + if (iface->IgnoreIfMissing) /* a bit more quiet warning message.. */
  175. + dlog(LOG_DEBUG, 4, "interface %s does not exist, ignoring the interface", iface->Name);
  176. + else {