From 5874e91187b56525273f9c3e8ae732b824f44e20 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Sun, 12 Jan 2014 00:45:27 +0100 Subject: [PATCH] Add some patches to OpenWRT packages --- ...-and-add-patch-to-fix-race-condition.patch | 187 ++++++++++++++++++ ...-the-root-partition-has-been-mounted.patch | 17 ++ 2 files changed, 204 insertions(+) create mode 100644 patches/packages/openwrt/0001-radvd-update-to-1.9.8-and-add-patch-to-fix-race-condition.patch create mode 100644 patches/packages/openwrt/0002-haveged-start-directly-after-the-root-partition-has-been-mounted.patch diff --git a/patches/packages/openwrt/0001-radvd-update-to-1.9.8-and-add-patch-to-fix-race-condition.patch b/patches/packages/openwrt/0001-radvd-update-to-1.9.8-and-add-patch-to-fix-race-condition.patch new file mode 100644 index 00000000..4974f75c --- /dev/null +++ b/patches/packages/openwrt/0001-radvd-update-to-1.9.8-and-add-patch-to-fix-race-condition.patch @@ -0,0 +1,187 @@ +From: Matthias Schiffer +Date: Sun, 12 Jan 2014 00:42:43 +0100 +Subject: radvd: update to 1.9.8 and add patch to fix race condition + +diff --git a/ipv6/radvd/Makefile b/ipv6/radvd/Makefile +index 571d9de..b14c02b 100644 +--- a/ipv6/radvd/Makefile ++++ b/ipv6/radvd/Makefile +@@ -8,13 +8,13 @@ + include $(TOPDIR)/rules.mk + + PKG_NAME:=radvd +-PKG_VERSION:=1.9.1 +-PKG_RELEASE:=2 ++PKG_VERSION:=1.9.8 ++PKG_RELEASE:=1 + + PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz + PKG_SOURCE_URL:=http://v6web.litech.org/radvd/dist \ + http://download.sourcemage.org/mirror +-PKG_MD5SUM:=e807ad7e9a76d46b6133df391385cd31 ++PKG_MD5SUM:=7a96a38252c3964ee18bbc1fdeae25fa + + PKG_INSTALL:=1 + +diff --git a/ipv6/radvd/patches/100-silent-netlink-config-reload.patch b/ipv6/radvd/patches/100-silent-netlink-config-reload.patch +index 049d654..313b8cb 100644 +--- a/ipv6/radvd/patches/100-silent-netlink-config-reload.patch ++++ b/ipv6/radvd/patches/100-silent-netlink-config-reload.patch +@@ -1,26 +1,26 @@ + --- a/netlink.c + +++ b/netlink.c +-@@ -67,7 +67,7 @@ void process_netlink_msg(int sock) +- else { +- dlog(LOG_DEBUG, 3, "%s, ifindex %d, flags is *NOT* running", ifname, ifinfo->ifi_index); +- } +-- reload_config(); +-+ reload_config(LOG_DEBUG); +- } +- } +- ++@@ -75,7 +75,7 @@ void process_netlink_msg(int sock) ++ dlog(LOG_DEBUG, 3, "%s, ifindex %d, flags is *NOT* running", ifname, ifinfo->ifi_index); ++ } ++ if (!reloaded) { ++- reload_config(); +++ reload_config(LOG_DEBUG); ++ reloaded = 1; ++ } ++ } + --- a/radvd.c + +++ b/radvd.c + @@ -443,7 +443,7 @@ void main_loop(void) +- if (sighup_received) +- { ++ ++ if (sighup_received) { + dlog(LOG_INFO, 3, "sig hup received.\n"); + - reload_config(); + + reload_config(LOG_INFO); + sighup_received = 0; + } + +-@@ -552,11 +552,11 @@ stop_adverts(void) ++@@ -545,11 +545,11 @@ void stop_adverts(void) + } + } + +@@ -32,9 +32,9 @@ + - flog(LOG_INFO, "attempting to reread config file"); + + flog(loglevel, "attempting to reread config file"); + +- iface=IfaceList; +- while(iface) +-@@ -626,7 +626,7 @@ void reload_config(void) ++ iface = IfaceList; ++ while (iface) { ++@@ -614,7 +614,7 @@ void reload_config(void) + config_interface(); + kickoff_adverts(); + +@@ -42,10 +42,10 @@ + + flog(loglevel, "resuming normal operation"); + } + +- void ++ void sighup_handler(int sig) + --- a/radvd.h + +++ b/radvd.h +-@@ -185,7 +185,7 @@ int yylex(void); ++@@ -186,7 +186,7 @@ int yylex(void); + + /* radvd.c */ + int check_ip6_forwarding(void); +@@ -56,7 +56,7 @@ + /* timer.c */ + --- a/send.c + +++ b/send.c +-@@ -154,7 +154,7 @@ send_ra(struct Interface *iface, struct ++@@ -143,7 +143,7 @@ int send_ra(struct Interface *iface, str + * reload_config() will kick off new timers anyway. This avoids + * timer list corruption. + */ +diff --git a/ipv6/radvd/patches/200-handle-setup_linklocal_addr-failure.patch b/ipv6/radvd/patches/200-handle-setup_linklocal_addr-failure.patch +new file mode 100644 +index 0000000..3f22f76 +--- /dev/null ++++ b/ipv6/radvd/patches/200-handle-setup_linklocal_addr-failure.patch +@@ -0,0 +1,78 @@ ++diff --git a/device-linux.c b/device-linux.c ++index bbf508d..054937e 100644 ++--- a/device-linux.c +++++ b/device-linux.c ++@@ -141,7 +141,13 @@ int setup_linklocal_addr(struct Interface *iface) ++ } ++ } ++ ++- flog(LOG_ERR, "no linklocal address configured for %s", iface->Name); +++ if (iface->IgnoreIfMissing) +++ dlog(LOG_DEBUG, 4, "no linklocal address configured for %s", iface->Name); +++ else +++ flog(LOG_ERR, "no linklocal address configured for %s", iface->Name); +++ +++ iface->if_index = 0; +++ ++ fclose(fp); ++ return (-1); ++ } ++diff --git a/gram.y b/gram.y ++index 9b453a1..3239848 100644 ++--- a/gram.y +++++ b/gram.y ++@@ -176,19 +176,33 @@ ifacedef : ifacehead '{' ifaceparams '}' ';' ++ flog(LOG_ERR, "interface %s does not exist", iface->Name); ++ ABORT; ++ } +++ +++ iface->HasFailed = 1; ++ } ++- if (update_device_info(iface) < 0) +++ if (update_device_info(iface) < 0) { ++ if (!iface->IgnoreIfMissing) ++- ABORT; ++- if (check_iface(iface) < 0) +++ ABORT; +++ +++ iface->HasFailed = 1; +++ } +++ if (check_iface(iface) < 0) { ++ if (!iface->IgnoreIfMissing) ++- ABORT; ++- if (setup_linklocal_addr(iface) < 0) +++ ABORT; +++ +++ iface->HasFailed = 1; +++ } +++ if (setup_linklocal_addr(iface) < 0) { ++ if (!iface->IgnoreIfMissing) ++- ABORT; ++- if (setup_allrouters_membership(iface) < 0) +++ ABORT; +++ +++ iface->HasFailed = 1; +++ } +++ if (setup_allrouters_membership(iface) < 0) { ++ if (!iface->IgnoreIfMissing) ++- ABORT; +++ ABORT; +++ +++ iface->HasFailed = 1; +++ } ++ ++ dlog(LOG_DEBUG, 4, "interface definition for %s is ok", iface->Name); ++ ++diff --git a/send.c b/send.c ++index 0d7ed5b..d6a3da2 100644 ++--- a/send.c +++++ b/send.c ++@@ -124,7 +124,7 @@ int send_ra(struct Interface *iface, struct in6_addr *dest) ++ update_device_info(iface); ++ ++ /* First we need to check that the interface hasn't been removed or deactivated */ ++- if (check_device(iface) < 0) { +++ if (check_device(iface) < 0 || (iface->if_index == 0 && setup_linklocal_addr(iface) < 0)) { ++ if (iface->IgnoreIfMissing) /* a bit more quiet warning message.. */ ++ dlog(LOG_DEBUG, 4, "interface %s does not exist, ignoring the interface", iface->Name); ++ else { diff --git a/patches/packages/openwrt/0002-haveged-start-directly-after-the-root-partition-has-been-mounted.patch b/patches/packages/openwrt/0002-haveged-start-directly-after-the-root-partition-has-been-mounted.patch new file mode 100644 index 00000000..dd6fd5a5 --- /dev/null +++ b/patches/packages/openwrt/0002-haveged-start-directly-after-the-root-partition-has-been-mounted.patch @@ -0,0 +1,17 @@ +From: Matthias Schiffer +Date: Sun, 12 Jan 2014 00:44:29 +0100 +Subject: haveged: start directly after the root partition has been mounted + +diff --git a/utils/haveged/files/haveged.init b/utils/haveged/files/haveged.init +index 129d951..2c5be1d 100644 +--- a/utils/haveged/files/haveged.init ++++ b/utils/haveged/files/haveged.init +@@ -1,7 +1,7 @@ + #!/bin/sh /etc/rc.common + # Copyright (C) 2012 OpenWrt.org + +-START=98 ++START=11 + + HAVEGED_THRESHOLD=1024 + HAVEGED_DCACHE=32