From 490971e8e5bffb1094ca6b5740df4c1c6e3659ef Mon Sep 17 00:00:00 2001 From: John Crispin Date: Wed, 5 Jun 2019 20:30:54 +0200 Subject: [PATCH 01/35] mcproxy: fix block/filtering code MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit mcproxy supports a generic filtering/blacklisting mechanism but it’s currently broken. In the case of routed video (e.g. mcproxy routing video from WAN -> LAN), it will forward multicast between the LAN and WAN. There are perfectly valid use cases for this like reporting but other less-appropriate things like mDNS and SSDP leak through from LAN -> WAN which is bad. Signed-off-by: Sukru Senli Signed-off-by: Chad Monroe Signed-off-by: John Crispin --- mcproxy/files/mcproxy.config | 8 ++ .../patches/0005-fix-match-filter-calls.patch | 46 ++++++++ mcproxy/patches/0006-block-ingress.patch | 104 ++++++++++++++++++ 3 files changed, 158 insertions(+) create mode 100644 mcproxy/patches/0005-fix-match-filter-calls.patch create mode 100644 mcproxy/patches/0006-block-ingress.patch diff --git a/mcproxy/files/mcproxy.config b/mcproxy/files/mcproxy.config index 10cc410..e80b602 100644 --- a/mcproxy/files/mcproxy.config +++ b/mcproxy/files/mcproxy.config @@ -229,3 +229,11 @@ config behaviour option direction 'out' option whitelist '1' option table '{(*|*)}' + +config blocks + # mDNS + list entries '(*|239.255.255.0/24)' + # SSDP + list entries '(*|224.0.0.0/24)' + # SLP + list entries '(*|239.192.0.0/16)' diff --git a/mcproxy/patches/0005-fix-match-filter-calls.patch b/mcproxy/patches/0005-fix-match-filter-calls.patch new file mode 100644 index 0000000..c6956e0 --- /dev/null +++ b/mcproxy/patches/0005-fix-match-filter-calls.patch @@ -0,0 +1,46 @@ +--- a/mcproxy/src/proxy/simple_mc_proxy_routing.cpp ++++ b/mcproxy/src/proxy/simple_mc_proxy_routing.cpp +@@ -118,13 +118,13 @@ void interface_memberships::process_upst + for (auto source_it = cs.first.m_source_list.begin(); source_it != cs.first.m_source_list.end();) { + + //downstream out +- if (!cs.second->match_output_filter(interfaces::get_if_name(upstr_e.m_if_index), gaddr, source_it->saddr)) { ++ if (!cs.second->match_output_filter(interfaces::get_if_name(upstr_e.m_if_index), source_it->saddr, gaddr)) { + source_it = cs.first.m_source_list.erase(source_it); + continue; + } + + //upstream in +- if (!upstr_e.m_interface->match_input_filter(interfaces::get_if_name(upstr_e.m_if_index), gaddr, source_it->saddr)) { ++ if (!upstr_e.m_interface->match_input_filter(interfaces::get_if_name(upstr_e.m_if_index), source_it->saddr, gaddr)) { + tmp_sstate.m_source_list.insert(*source_it); + source_it = cs.first.m_source_list.erase(source_it); + continue; +@@ -175,13 +175,13 @@ void interface_memberships::process_upst + for (auto source_it = cs_it->first.m_source_list.begin(); source_it != cs_it->first.m_source_list.end();) { + + //downstream out +- if (!cs_it->second->match_output_filter(interfaces::get_if_name(upstr_e.m_if_index), gaddr, source_it->saddr)) { ++ if (!cs_it->second->match_output_filter(interfaces::get_if_name(upstr_e.m_if_index), source_it->saddr, gaddr)) { + ++source_it; + continue; + } + + //upstream in +- if (!upstr_e.m_interface->match_input_filter(interfaces::get_if_name(upstr_e.m_if_index), gaddr, source_it->saddr)) { ++ if (!upstr_e.m_interface->match_input_filter(interfaces::get_if_name(upstr_e.m_if_index), source_it->saddr, gaddr)) { + ++source_it; + continue; + } +@@ -619,9 +619,9 @@ bool simple_mc_proxy_routing::check_inte + std::string input_if_index_name = interfaces::get_if_name(input_if_index); + if (!input_if_index_name.empty()) { + if (interface_direction == ID_IN) { +- return interf->match_input_filter(input_if_index_name, gaddr, saddr); ++ return interf->match_input_filter(input_if_index_name, saddr, gaddr); + } else if (interface_direction == ID_OUT) { +- return interf->match_output_filter(input_if_index_name, gaddr, saddr); ++ return interf->match_output_filter(input_if_index_name, saddr, gaddr); + } else { + HC_LOG_ERROR("unkown interface direction"); + return false; diff --git a/mcproxy/patches/0006-block-ingress.patch b/mcproxy/patches/0006-block-ingress.patch new file mode 100644 index 0000000..c8bcdb3 --- /dev/null +++ b/mcproxy/patches/0006-block-ingress.patch @@ -0,0 +1,104 @@ +--- a/mcproxy/src/proxy/proxy_instance.cpp ++++ b/mcproxy/src/proxy/proxy_instance.cpp +@@ -171,6 +171,9 @@ void proxy_instance::worker_thread() + HC_LOG_TRACE(""); + while (m_running) { + auto msg = m_job_queue.dequeue(); ++ ++ HC_LOG_DEBUG("Proxy Message: " << msg->get_message_type_name(msg->get_type()) ); ++ + switch (msg->get_type()) { + case proxy_msg::TEST_MSG: + (*msg)(); +@@ -190,28 +193,80 @@ void proxy_instance::worker_thread() + } else { + HC_LOG_DEBUG("failed to find querier of interface: " << interfaces::get_if_name(std::static_pointer_cast(msg)->get_if_index())); + } +- } ++ } + break; + case proxy_msg::GROUP_RECORD_MSG: { +- auto r = std::static_pointer_cast(msg); ++ auto gr = std::static_pointer_cast(msg); + + if (m_in_debug_testing_mode) { + std::cout << "!!--ACTION: receive record" << std::endl; +- std::cout << *r << std::endl; ++ std::cout << *gr << std::endl; + std::cout << std::endl; + } + +- auto it = m_downstreams.find(r->get_if_index()); ++ auto slist = gr->get_slist(); ++ addr_storage saddr; ++ if ( slist.empty() ) ++ { ++ saddr = "0.0.0.0"; ++ } ++ else ++ { ++ saddr = slist.begin()->saddr; ++ } ++ auto it = m_downstreams.find(gr->get_if_index()); + if (it != std::end(m_downstreams)) { +- it->second.m_querier->receive_record(msg); ++ // Check for input filters ++ if ( ! it->second.m_interface->match_input_filter( interfaces::get_if_name( gr->get_if_index() ), ++ saddr, ++ gr->get_gaddr() ) ++ ) ++ { ++ HC_LOG_DEBUG("group report " << gr->get_gaddr() << " filtered"); ++ } ++ else ++ { ++ it->second.m_querier->receive_record(msg); ++ } + } else { +- HC_LOG_DEBUG("failed to find querier of interface: " << interfaces::get_if_name(std::static_pointer_cast(msg)->get_if_index())); ++ HC_LOG_DEBUG("failed to find querier of interface: " << interfaces::get_if_name( gr->get_if_index() )); + } +- } ++ } ++ break; ++ case proxy_msg::NEW_SOURCE_MSG: { ++ auto sm = std::static_pointer_cast(msg); ++ // Find the interface ++ std::shared_ptr interf; ++ auto it = m_downstreams.find(sm->get_if_index()); ++ if (it != std::end(m_downstreams)) { ++ interf = it->second.m_interface; ++ } else { ++ for (auto & e : m_upstreams) { ++ if (e.m_if_index == sm->get_if_index()) { ++ interf = e.m_interface; ++ break; ++ } ++ } ++ } ++ if ( !interf ) ++ { ++ HC_LOG_DEBUG("failed to find interface: " << interfaces::get_if_name( sm->get_if_index() ) << " for Source message " << sm->get_saddr() << " | " << sm->get_gaddr() ); ++ break; ++ } ++ // Check for input filters ++ if ( ! interf->match_input_filter( interfaces::get_if_name( sm->get_if_index() ), ++ sm->get_saddr(), ++ sm->get_gaddr() ) ++ ) ++ { ++ HC_LOG_DEBUG("source " << sm->get_saddr() << " | " << sm->get_gaddr() << " filtered"); ++ } ++ else ++ { ++ m_routing_management->event_new_source(msg); ++ } ++ } + break; +- case proxy_msg::NEW_SOURCE_MSG: +- m_routing_management->event_new_source(msg); +- break; + case proxy_msg::NEW_SOURCE_TIMER_MSG: + m_routing_management->timer_triggerd_maintain_routing_table(msg); + break; + return false; From a56d996b94682c90729ad9b561168635b857649c Mon Sep 17 00:00:00 2001 From: John Crispin Date: Wed, 5 Jun 2019 20:33:42 +0200 Subject: [PATCH 02/35] mcproxy: add igmpV2 reply support mcproxy has no way to send an IGMPv2 query today. If you force IGMPv2 (by setting the protocol in the mcproxy config and setting the force_igmp_version flag on all interfaces) the bridge will send v2 queries but if mcproxy takes over as the querier it will send v3 queries. The patch below adds support for sending v2 queries so everyone stays in sync: Signed-off-by: Sukru Senli Signed-off-by: Chad Monroe Signed-off-by: John Crispin --- mcproxy/files/mcproxy.config | 2 +- mcproxy/patches/0006-block-ingress.patch | 114 ++++++++++----------- mcproxy/patches/0007-igmpv2-queries.patch | 116 ++++++++++++++++++++++ 3 files changed, 167 insertions(+), 65 deletions(-) create mode 100644 mcproxy/patches/0007-igmpv2-queries.patch diff --git a/mcproxy/files/mcproxy.config b/mcproxy/files/mcproxy.config index e80b602..f028795 100644 --- a/mcproxy/files/mcproxy.config +++ b/mcproxy/files/mcproxy.config @@ -230,7 +230,7 @@ config behaviour option whitelist '1' option table '{(*|*)}' -config blocks +config blocks blocks # mDNS list entries '(*|239.255.255.0/24)' # SSDP diff --git a/mcproxy/patches/0006-block-ingress.patch b/mcproxy/patches/0006-block-ingress.patch index c8bcdb3..5998741 100644 --- a/mcproxy/patches/0006-block-ingress.patch +++ b/mcproxy/patches/0006-block-ingress.patch @@ -1,25 +1,23 @@ ---- a/mcproxy/src/proxy/proxy_instance.cpp -+++ b/mcproxy/src/proxy/proxy_instance.cpp +Index: mcproxy-2017-08-24-93b5ace42268160ebbfff4c61818fb15fa2d9b99/mcproxy/src/proxy/proxy_instance.cpp +=================================================================== +--- mcproxy-2017-08-24-93b5ace42268160ebbfff4c61818fb15fa2d9b99.orig/mcproxy/src/proxy/proxy_instance.cpp ++++ mcproxy-2017-08-24-93b5ace42268160ebbfff4c61818fb15fa2d9b99/mcproxy/src/proxy/proxy_instance.cpp @@ -171,6 +171,9 @@ void proxy_instance::worker_thread() HC_LOG_TRACE(""); while (m_running) { auto msg = m_job_queue.dequeue(); + -+ HC_LOG_DEBUG("Proxy Message: " << msg->get_message_type_name(msg->get_type()) ); ++ HC_LOG_DEBUG("Proxy Message: " << msg->get_message_type_name(msg->get_type()) ); + switch (msg->get_type()) { case proxy_msg::TEST_MSG: (*msg)(); -@@ -190,28 +193,80 @@ void proxy_instance::worker_thread() - } else { - HC_LOG_DEBUG("failed to find querier of interface: " << interfaces::get_if_name(std::static_pointer_cast(msg)->get_if_index())); - } -- } -+ } +@@ -193,25 +196,66 @@ void proxy_instance::worker_thread() + } break; case proxy_msg::GROUP_RECORD_MSG: { - auto r = std::static_pointer_cast(msg); -+ auto gr = std::static_pointer_cast(msg); ++ auto gr = std::static_pointer_cast(msg); if (m_in_debug_testing_mode) { std::cout << "!!--ACTION: receive record" << std::endl; @@ -29,31 +27,25 @@ } - auto it = m_downstreams.find(r->get_if_index()); -+ auto slist = gr->get_slist(); -+ addr_storage saddr; -+ if ( slist.empty() ) -+ { -+ saddr = "0.0.0.0"; -+ } -+ else -+ { -+ saddr = slist.begin()->saddr; -+ } ++ auto slist = gr->get_slist(); ++ addr_storage saddr; ++ if (slist.empty()) { ++ saddr = "0.0.0.0"; ++ } else { ++ saddr = slist.begin()->saddr; ++ } + auto it = m_downstreams.find(gr->get_if_index()); if (it != std::end(m_downstreams)) { - it->second.m_querier->receive_record(msg); -+ // Check for input filters -+ if ( ! it->second.m_interface->match_input_filter( interfaces::get_if_name( gr->get_if_index() ), -+ saddr, -+ gr->get_gaddr() ) -+ ) -+ { -+ HC_LOG_DEBUG("group report " << gr->get_gaddr() << " filtered"); -+ } -+ else -+ { -+ it->second.m_querier->receive_record(msg); -+ } ++ // Check for input filters ++ if (!it->second.m_interface->match_input_filter(interfaces::get_if_name(gr->get_if_index()), saddr, gr->get_gaddr())) ++ { ++ HC_LOG_DEBUG("group report " << gr->get_gaddr() << " filtered"); ++ } ++ else ++ { ++ it->second.m_querier->receive_record(msg); ++ } } else { - HC_LOG_DEBUG("failed to find querier of interface: " << interfaces::get_if_name(std::static_pointer_cast(msg)->get_if_index())); + HC_LOG_DEBUG("failed to find querier of interface: " << interfaces::get_if_name( gr->get_if_index() )); @@ -62,37 +54,32 @@ + } + break; + case proxy_msg::NEW_SOURCE_MSG: { -+ auto sm = std::static_pointer_cast(msg); -+ // Find the interface -+ std::shared_ptr interf; -+ auto it = m_downstreams.find(sm->get_if_index()); -+ if (it != std::end(m_downstreams)) { -+ interf = it->second.m_interface; -+ } else { -+ for (auto & e : m_upstreams) { -+ if (e.m_if_index == sm->get_if_index()) { -+ interf = e.m_interface; -+ break; -+ } -+ } -+ } -+ if ( !interf ) -+ { -+ HC_LOG_DEBUG("failed to find interface: " << interfaces::get_if_name( sm->get_if_index() ) << " for Source message " << sm->get_saddr() << " | " << sm->get_gaddr() ); -+ break; -+ } -+ // Check for input filters -+ if ( ! interf->match_input_filter( interfaces::get_if_name( sm->get_if_index() ), -+ sm->get_saddr(), -+ sm->get_gaddr() ) -+ ) -+ { -+ HC_LOG_DEBUG("source " << sm->get_saddr() << " | " << sm->get_gaddr() << " filtered"); -+ } -+ else -+ { -+ m_routing_management->event_new_source(msg); -+ } ++ auto sm = std::static_pointer_cast(msg); ++ // Find the interface ++ std::shared_ptr interf; ++ auto it = m_downstreams.find(sm->get_if_index()); ++ if (it != std::end(m_downstreams)) { ++ interf = it->second.m_interface; ++ } else { ++ for (auto & e : m_upstreams) { ++ if (e.m_if_index == sm->get_if_index()) { ++ interf = e.m_interface; ++ break; ++ } ++ } ++ } ++ if ( !interf ) ++ { ++ HC_LOG_DEBUG("failed to find interface: " << interfaces::get_if_name( sm->get_if_index() ) << " for Source message " << sm->get_saddr() << " | " << sm->get_gaddr() ); ++ break; ++ } ++ // Check for input filters ++ if (!interf->match_input_filter(interfaces::get_if_name(sm->get_if_index()), sm->get_saddr(), sm->get_gaddr())) ++ { ++ HC_LOG_DEBUG("source " << sm->get_saddr() << " | " << sm->get_gaddr() << " filtered"); ++ } else { ++ m_routing_management->event_new_source(msg); ++ } + } break; - case proxy_msg::NEW_SOURCE_MSG: @@ -101,4 +88,3 @@ case proxy_msg::NEW_SOURCE_TIMER_MSG: m_routing_management->timer_triggerd_maintain_routing_table(msg); break; - return false; diff --git a/mcproxy/patches/0007-igmpv2-queries.patch b/mcproxy/patches/0007-igmpv2-queries.patch new file mode 100644 index 0000000..005b56d --- /dev/null +++ b/mcproxy/patches/0007-igmpv2-queries.patch @@ -0,0 +1,116 @@ +--- a/mcproxy/include/proxy/igmp_sender.hpp ++++ b/mcproxy/include/proxy/igmp_sender.hpp +@@ -37,9 +37,10 @@ class igmp_sender : public sender + { + private: + bool send_igmpv3_query(unsigned int if_index, const timers_values& tv, const addr_storage& gaddr, bool s_flag, const source_list& slist) const; ++ bool send_igmpv2_query(unsigned int if_index, const timers_values& tv, const addr_storage& gaddr ) const; + + public: +- igmp_sender(const std::shared_ptr& interfaces); ++ igmp_sender(const std::shared_ptr& interfaces, const group_mem_protocol gmp); + + bool send_record(unsigned int if_index, mc_filter filter_mode, const addr_storage& gaddr, const source_list& slist) const override; + +--- a/mcproxy/src/proxy/igmp_sender.cpp ++++ b/mcproxy/src/proxy/igmp_sender.cpp +@@ -32,7 +32,7 @@ + + #include + +-igmp_sender::igmp_sender(const std::shared_ptr& interfaces): sender(interfaces, IGMPv3) ++igmp_sender::igmp_sender(const std::shared_ptr& interfaces, const group_mem_protocol gmp): sender(interfaces, gmp) + { + HC_LOG_TRACE(""); + +@@ -119,10 +119,79 @@ bool igmp_sender::send_mc_addr_and_src_s + return rc; + } + ++bool igmp_sender::send_igmpv2_query(unsigned int if_index, const timers_values& tv, const addr_storage& gaddr ) const ++{ ++ HC_LOG_TRACE(""); ++ ++ std::unique_ptr packet; ++ unsigned int size; ++ ++ size = sizeof(ip) + sizeof(router_alert_option) + sizeof(igmp); ++ packet.reset(new unsigned char[size]); ++ ++ addr_storage dst_addr; ++ ++ if (gaddr == addr_storage(AF_INET)) { //is general query ++ dst_addr = IPV4_ALL_HOST_ADDR; ++ } else { ++ dst_addr = gaddr; ++ } ++ ++ //------------------------------------------------------------------- ++ //fill ip header ++ ip* ip_hdr = reinterpret_cast(packet.get()); ++ ++ ip_hdr->ip_v = 4; ++ ip_hdr->ip_hl = (sizeof(ip) + sizeof(router_alert_option)) / 4; ++ ip_hdr->ip_tos = 0; ++ ip_hdr->ip_len = htons(size); ++ ip_hdr->ip_id = 0; ++ ip_hdr->ip_off = htons(0 | IP_DF); //dont fragment flag ++ ip_hdr->ip_ttl = 1; ++ ip_hdr->ip_p = IPPROTO_IGMP; ++ ip_hdr->ip_sum = 0; ++ ip_hdr->ip_src = m_interfaces->get_saddr(interfaces::get_if_name(if_index)).get_in_addr(); ++ ip_hdr->ip_dst = dst_addr.get_in_addr(); ++ ++ //------------------------------------------------------------------- ++ //fill router_alert_option header ++ router_alert_option* ra_hdr = reinterpret_cast(reinterpret_cast(ip_hdr) + sizeof(ip)); ++ *ra_hdr = router_alert_option(); ++ ++ ip_hdr->ip_sum = m_sock.calc_checksum(reinterpret_cast(ip_hdr), sizeof(ip) + sizeof(router_alert_option)); ++ ++ //------------------------------------------------------------------- ++ //fill igmpv3 query ++ igmp* query = reinterpret_cast(reinterpret_cast(ra_hdr) + sizeof(router_alert_option)); ++ ++ query->igmp_type = IGMP_MEMBERSHIP_QUERY; ++ ++ if (gaddr == addr_storage(AF_INET)) { //general query ++ query->igmp_code = tv.maxrespi_to_maxrespc_igmpv3(tv.get_query_response_interval()); ++ } else { ++ query->igmp_code = tv.maxrespi_to_maxrespc_igmpv3(tv.get_last_listener_query_time()); ++ } ++ ++ query->igmp_cksum = 0; ++ query->igmp_group = gaddr.get_in_addr(); ++ ++ query->igmp_cksum = m_sock.calc_checksum(reinterpret_cast(query), (sizeof(igmp) )); ++ ++ if (!m_sock.choose_if(if_index)) { ++ return false; ++ } ++ ++ return m_sock.send_packet(dst_addr, reinterpret_cast(ip_hdr), size); ++} ++ + bool igmp_sender::send_igmpv3_query(unsigned int if_index, const timers_values& tv, const addr_storage& gaddr, bool s_flag, const source_list& slist) const + { + HC_LOG_TRACE(""); + ++ if ( (m_group_mem_protocol & IGMPv3) == 0 ) { ++ return send_igmpv2_query( if_index, tv, gaddr ); ++ } ++ + std::unique_ptr packet; + unsigned int size; + +--- a/mcproxy/src/proxy/proxy_instance.cpp ++++ b/mcproxy/src/proxy/proxy_instance.cpp +@@ -119,7 +119,7 @@ bool proxy_instance::init_sender() + { + HC_LOG_TRACE(""); + if (is_IPv4(m_group_mem_protocol)) { +- m_sender = std::make_shared(m_interfaces); ++ m_sender = std::make_shared(m_interfaces, m_group_mem_protocol ); + } else if (is_IPv6(m_group_mem_protocol)) { + m_sender = std::make_shared(m_interfaces); + } else { From ff7c509caa61e41b4a740c30384cf3290124d9bd Mon Sep 17 00:00:00 2001 From: John Crispin Date: Sun, 30 Jun 2019 13:03:23 +0200 Subject: [PATCH 03/35] mcproxy: fix up sourcefilter patch this spewed out 2 compile warnings In file included from build_dir/target-mipsel_24kc_musl/mcproxy-2017-08-24-93b5ace42268160ebbfff4c61818fb15fa2d9b99/mcproxy/src/utils/mc_socket.cpp:43:0: build_dir/target-mipsel_24kc_musl/mcproxy-2017-08-24-93b5ace42268160ebbfff4c61818fb15fa2d9b99/mcproxy/src/utils/sourcefilter.cpp: In function 'int setsourcefilter(int, uint32_t, const sockaddr*, socklen_t, uint32_t, uint32_t, const sockaddr_storage*)': build_dir/target-mipsel_24kc_musl/mcproxy-2017-08-24-93b5ace42268160ebbfff4c61818fb15fa2d9b99/mcproxy/src/utils/sourcefilter.cpp:157:3: warning: this 'else' clause does not guard... [-Wmisleading-indentation] else ^~~~ build_dir/target-mipsel_24kc_musl/mcproxy-2017-08-24-93b5ace42268160ebbfff4c61818fb15fa2d9b99/mcproxy/src/utils/sourcefilter.cpp:160:5: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'else' int save_errno = errno; ^~~ Signed-off-by: John Crispin --- mcproxy/patches/0003-add-sourcefilter.patch | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/mcproxy/patches/0003-add-sourcefilter.patch b/mcproxy/patches/0003-add-sourcefilter.patch index 2f64975..cf67411 100644 --- a/mcproxy/patches/0003-add-sourcefilter.patch +++ b/mcproxy/patches/0003-add-sourcefilter.patch @@ -1,5 +1,7 @@ ---- a/mcproxy/src/utils/mc_socket.cpp -+++ b/mcproxy/src/utils/mc_socket.cpp +Index: mcproxy-2017-08-24-93b5ace42268160ebbfff4c61818fb15fa2d9b99/mcproxy/src/utils/mc_socket.cpp +=================================================================== +--- mcproxy-2017-08-24-93b5ace42268160ebbfff4c61818fb15fa2d9b99.orig/mcproxy/src/utils/mc_socket.cpp ++++ mcproxy-2017-08-24-93b5ace42268160ebbfff4c61818fb15fa2d9b99/mcproxy/src/utils/mc_socket.cpp @@ -37,6 +37,10 @@ #include #include @@ -11,8 +13,10 @@ std::string ipAddrResolver(std::string ipAddr) { std::string str[][2] = { +Index: mcproxy-2017-08-24-93b5ace42268160ebbfff4c61818fb15fa2d9b99/mcproxy/src/utils/sourcefilter.cpp +=================================================================== --- /dev/null -+++ b/mcproxy/src/utils/sourcefilter.cpp ++++ mcproxy-2017-08-24-93b5ace42268160ebbfff4c61818fb15fa2d9b99/mcproxy/src/utils/sourcefilter.cpp @@ -0,0 +1,165 @@ +/* Get source filter. Linux version. + Copyright (C) 2004-2014 Free Software Foundation, Inc. @@ -173,9 +177,9 @@ + else + result = setsockopt (s, sol, MCAST_MSFILTER, gf, needed); + -+ int save_errno = errno; -+ free (gf); -+ errno = save_errno; ++ int save_errno = errno; ++ free (gf); ++ errno = save_errno; + + return result; +} From c953099d065a487c4da2f265757d79b45746f088 Mon Sep 17 00:00:00 2001 From: Rob White Date: Tue, 30 Jul 2019 16:22:39 +0100 Subject: [PATCH 04/35] nodogsplash: Release 4.0.1 (#492) Maintainer: Moritz Warning Compiled and tested on snapshot SDK mips_24kc * Make debuglevel platform independent [mwarning] * Add/move/reword some debug output lines [mwarning] * Numerous code cleanups [mwarning] * Put fas code into block [mwarning] * Fix coding error in fas-aes.php incorrectly passing redir back to NDS [bluewavenet] * Numerous documentation updates [bluewavenet] Signed-off-by: Rob White --- nodogsplash/Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/nodogsplash/Makefile b/nodogsplash/Makefile index d56aa11..cd4e0a2 100644 --- a/nodogsplash/Makefile +++ b/nodogsplash/Makefile @@ -7,12 +7,12 @@ include $(TOPDIR)/rules.mk PKG_NAME:=nodogsplash PKG_FIXUP:=autoreconf -PKG_VERSION:=4.0.0 +PKG_VERSION:=4.0.1 PKG_RELEASE:=1 PKG_SOURCE_URL:=https://codeload.github.com/nodogsplash/nodogsplash/tar.gz/v$(PKG_VERSION)? PKG_SOURCE:=nodogsplash-$(PKG_VERSION).tar.gz -PKG_HASH:=4cc3a9200380f03c8c3a71afc1fda0006b8e7bf70129f2419768a767b734da21 +PKG_HASH:=b6787d042ab65f8cdc6982bd083a28a85ac3494896ae5c97e9de9b216585b1e7 PKG_BUILD_DIR:=$(BUILD_DIR)/nodogsplash-$(PKG_VERSION) PKG_MAINTAINER:=Moritz Warning From 89bcb4b22f0eb8f4eef87cd66d6f3507e7ef832a Mon Sep 17 00:00:00 2001 From: Sven Eckelmann Date: Thu, 1 Aug 2019 16:39:32 +0200 Subject: [PATCH 05/35] batman-adv: Drop compat-hacks for unsupported kernel versions OpenWrt only supports kernel 4.9, 4.14 and 4.19. Older kernel versions than 4.9 therefore don't require support. Signed-off-by: Sven Eckelmann --- batman-adv/Makefile | 2 +- batman-adv/src/compat-hacks.h | 92 ++--------------------------------- 2 files changed, 5 insertions(+), 89 deletions(-) diff --git a/batman-adv/Makefile b/batman-adv/Makefile index a7c6a79..e689d72 100644 --- a/batman-adv/Makefile +++ b/batman-adv/Makefile @@ -10,7 +10,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=batman-adv PKG_VERSION:=2019.2 -PKG_RELEASE:=4 +PKG_RELEASE:=5 PKG_HASH:=70c3f6a6cf88d2b25681a76768a52ed92d9fe992ba8e358368b6a8088757adc8 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz diff --git a/batman-adv/src/compat-hacks.h b/batman-adv/src/compat-hacks.h index d8de483..9dd4597 100644 --- a/batman-adv/src/compat-hacks.h +++ b/batman-adv/src/compat-hacks.h @@ -5,24 +5,7 @@ #include /* LINUX_VERSION_CODE */ #include -#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 1, 0) - -#define dev_get_iflink(_net_dev) ((_net_dev)->iflink) - -#endif /* < KERNEL_VERSION(4, 1, 0) */ - -#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 5, 0) - -#include - -#define netdev_master_upper_dev_link(dev, upper_dev, upper_priv, upper_info, extack) ({\ - BUILD_BUG_ON(upper_priv != NULL); \ - BUILD_BUG_ON(upper_info != NULL); \ - BUILD_BUG_ON(extack != NULL); \ - netdev_master_upper_dev_link(dev, upper_dev); \ -}) - -#elif LINUX_VERSION_CODE < KERNEL_VERSION(4, 15, 0) +#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 15, 0) #include @@ -31,27 +14,10 @@ netdev_master_upper_dev_link(dev, upper_dev, upper_priv, upper_info); \ }) -#endif /* < KERNEL_VERSION(4, 5, 0) */ +#endif /* < KERNEL_VERSION(4, 15, 0) */ -#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 0, 0) - -/* wild hack for batadv_getlink_net only */ -#define get_link_net get_xstats_size || 1 ? fallback_net : (struct net*)netdev->rtnl_link_ops->get_xstats_size - -#endif /* < KERNEL_VERSION(4, 0, 0) */ - - -#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 2, 0) - -struct sk_buff *skb_checksum_trimmed(struct sk_buff *skb, - unsigned int transport_len, - __sum16(*skb_chkf)(struct sk_buff *skb)); - -int ip_mc_check_igmp(struct sk_buff *skb); -int ipv6_mc_check_mld(struct sk_buff *skb); - -#elif LINUX_VERSION_CODE < KERNEL_VERSION(5, 1, 0) +#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 1, 0) #include_next #include_next @@ -86,57 +52,7 @@ static inline int batadv_ip_mc_check_igmp2(struct sk_buff *skb, #define ip_mc_check_igmp(...) \ ip_mc_check_igmp_get(__VA_ARGS__, batadv_ip_mc_check_igmp2, batadv_ip_mc_check_igmp1)(__VA_ARGS__) -#endif /* < KERNEL_VERSION(4, 2, 0) */ - -#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 3, 0) - -#define IFF_NO_QUEUE 0; dev->tx_queue_len = 0 - -static inline bool hlist_fake(struct hlist_node *h) -{ - return h->pprev == &h->next; -} - -#endif /* < KERNEL_VERSION(4, 3, 0) */ - -#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 6, 0) - -#include - -#define ethtool_link_ksettings batadv_ethtool_link_ksettings - -struct batadv_ethtool_link_ksettings { - struct { - __u32 speed; - __u8 duplex; - __u8 autoneg; - } base; -}; - -#define __ethtool_get_link_ksettings(__dev, __link_settings) \ - batadv_ethtool_get_link_ksettings(__dev, __link_settings) - -static inline int -batadv_ethtool_get_link_ksettings(struct net_device *dev, - struct ethtool_link_ksettings *link_ksettings) -{ - struct ethtool_cmd cmd; - int ret; - - memset(&cmd, 0, sizeof(cmd)); - ret = __ethtool_get_settings(dev, &cmd); - - if (ret != 0) - return ret; - - link_ksettings->base.duplex = cmd.duplex; - link_ksettings->base.speed = ethtool_cmd_speed(&cmd); - link_ksettings->base.autoneg = cmd.autoneg; - - return 0; -} - -#endif /* < KERNEL_VERSION(4, 6, 0) */ +#endif /* < KERNEL_VERSION(5, 1, 0) */ #if LINUX_VERSION_CODE < KERNEL_VERSION(4, 10, 0) From a74938ea46b5d9959de63e20c0356acca50a0426 Mon Sep 17 00:00:00 2001 From: Sven Eckelmann Date: Thu, 1 Aug 2019 17:37:03 +0200 Subject: [PATCH 06/35] alfred: upgrade package to latest release 2019.3 * avoid some kernel deprecation warning by using more generic netlink over sysfs Signed-off-by: Sven Eckelmann --- alfred/Makefile | 4 ++-- ...is-Add-missing-include-for-ifinfomsg.patch | 21 +++++++++++++++++++ 2 files changed, 23 insertions(+), 2 deletions(-) create mode 100644 alfred/patches/0001-alfred-vis-Add-missing-include-for-ifinfomsg.patch diff --git a/alfred/Makefile b/alfred/Makefile index 2982265..aa43b67 100644 --- a/alfred/Makefile +++ b/alfred/Makefile @@ -8,9 +8,9 @@ include $(TOPDIR)/rules.mk PKG_NAME:=alfred -PKG_VERSION:=2019.2 +PKG_VERSION:=2019.3 PKG_RELEASE:=0 -PKG_HASH:=b656f0e9a97a99c7531b6d49ebfd663451c16cdd275bbf7d48ff8daed3880bf2 +PKG_HASH:=a4c37920de497701680abb55c49cdcd11e4e7135e0e7e79259c35492a3df4766 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_SOURCE_URL:=https://downloads.open-mesh.org/batman/releases/batman-adv-$(PKG_VERSION) diff --git a/alfred/patches/0001-alfred-vis-Add-missing-include-for-ifinfomsg.patch b/alfred/patches/0001-alfred-vis-Add-missing-include-for-ifinfomsg.patch new file mode 100644 index 0000000..3a982b8 --- /dev/null +++ b/alfred/patches/0001-alfred-vis-Add-missing-include-for-ifinfomsg.patch @@ -0,0 +1,21 @@ +From: Sven Eckelmann +Date: Thu, 1 Aug 2019 15:54:32 +0200 +Subject: alfred: vis: Add missing include for ifinfomsg + +Fixes: 0fc6e6674428 ("alfred: vis: Retrieve hardif status via generic netlink") +Signed-off-by: Sven Eckelmann + +Origin: upstream, https://git.open-mesh.org/alfred.git/commit/ce26453bd72829ac9561acd8d3a06a3937341687 + +diff --git a/vis/vis.c b/vis/vis.c +index 947456343125458845f26dc38b53f18d6fd42d75..8df3056612d5da3678603a6e6430923c0c86cde0 100644 +--- a/vis/vis.c ++++ b/vis/vis.c +@@ -10,6 +10,7 @@ + #include + #include + #include ++#include + #include + #include + #include From a03d1985166efd91164ae95b5dfed20e59739b66 Mon Sep 17 00:00:00 2001 From: Sven Eckelmann Date: Thu, 1 Aug 2019 17:44:55 +0200 Subject: [PATCH 07/35] batctl: upgrade package to latest release 2019.3 * add tcpdump support for MCAST TVLV, unicast fragments and coded packets * implement support for multicast RTR flags * avoid some kernel deprecation warning by using more generic netlink over sysfs * use type specific prefixes to select mesh interface or vlan instead of '-m' * add support for hardif specific settings Signed-off-by: Sven Eckelmann --- batctl/Makefile | 6 +- ...01-batctl-Make-vlan-setting-explicit.patch | 324 ------------------ ...l-Integrate-hardif-setting-framework.patch | 183 ---------- ...ctl-Add-elp_interval-setting-command.patch | 183 ---------- ...-throughput_override-setting-command.patch | 189 ---------- 5 files changed, 3 insertions(+), 882 deletions(-) delete mode 100644 batctl/patches/0001-batctl-Make-vlan-setting-explicit.patch delete mode 100644 batctl/patches/0002-batctl-Integrate-hardif-setting-framework.patch delete mode 100644 batctl/patches/0003-batctl-Add-elp_interval-setting-command.patch delete mode 100644 batctl/patches/0004-batctl-Add-throughput_override-setting-command.patch diff --git a/batctl/Makefile b/batctl/Makefile index 25eff7d..168b17f 100644 --- a/batctl/Makefile +++ b/batctl/Makefile @@ -9,9 +9,9 @@ include $(TOPDIR)/rules.mk PKG_NAME:=batctl -PKG_VERSION:=2019.2 -PKG_RELEASE:=1 -PKG_HASH:=fb656208ff7d4cd8b1b422f60c9e6d8747302a347cbf6c199d7afa9b80f80ea3 +PKG_VERSION:=2019.3 +PKG_RELEASE:=0 +PKG_HASH:=2bd93fa14925a8dc63a67e64266c8ccd2fa3ac44b10253d93e6f8a630350070c PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_SOURCE_URL:=https://downloads.open-mesh.org/batman/releases/batman-adv-$(PKG_VERSION) diff --git a/batctl/patches/0001-batctl-Make-vlan-setting-explicit.patch b/batctl/patches/0001-batctl-Make-vlan-setting-explicit.patch deleted file mode 100644 index e63c3dd..0000000 --- a/batctl/patches/0001-batctl-Make-vlan-setting-explicit.patch +++ /dev/null @@ -1,324 +0,0 @@ -From: Sven Eckelmann -Date: Thu, 13 Jun 2019 21:12:14 +0200 -Subject: batctl: Make vlan setting explicit - -The requirement to have a VLAN master device on top of the batadv mesh -interface is artificially limiting the capabilities of batctl. Not all -master devices in linux which register a VLAN are from type "vlan" and are -only registering a single VLAN. - -For example VLAN aware bridges can create multiple VLANs. These require -that the VLAN is identified using the VID and not the vlan device. - -Signed-off-by: Sven Eckelmann - -Forwarded: https://patchwork.open-mesh.org/patch/17947/ - -diff --git a/ap_isolation.c b/ap_isolation.c -index 71dcd00eac845d488c4969b17e1339f181c6c913..7c34649225dcc9cc557cc5bb4cbfa2343f8c0763 100644 ---- a/ap_isolation.c -+++ b/ap_isolation.c -@@ -81,3 +81,8 @@ COMMAND_NAMED(SUBCOMMAND, ap_isolation, "ap", handle_sys_setting, - COMMAND_FLAG_MESH_IFACE | COMMAND_FLAG_NETLINK, - &batctl_settings_ap_isolation, - "[0|1] \tdisplay or modify ap_isolation setting"); -+ -+COMMAND_NAMED(SUBCOMMAND_VID, ap_isolation, "ap", handle_sys_setting, -+ COMMAND_FLAG_MESH_IFACE | COMMAND_FLAG_NETLINK, -+ &batctl_settings_ap_isolation, -+ "[0|1] \tdisplay or modify ap_isolation setting for vlan device or id"); -diff --git a/main.c b/main.c -index 278683c6080e3ff4a9f3225931d0c5eb44f89595..6ca13ac0ec4c82ee969be04737a339fd702b52bd 100644 ---- a/main.c -+++ b/main.c -@@ -28,48 +28,75 @@ extern const struct command *__stop___command[]; - - static void print_usage(void) - { -- enum command_type type[] = { -- SUBCOMMAND, -- DEBUGTABLE, -+ struct { -+ const char *label; -+ uint32_t types; -+ } type[] = { -+ { -+ .label = "commands:\n", -+ .types = BIT(SUBCOMMAND) | -+ BIT(SUBCOMMAND_VID), -+ }, -+ { -+ .label = "debug tables: \tdisplay the corresponding debug table\n", -+ .types = BIT(DEBUGTABLE), -+ }, -+ }; -+ const char *default_prefixes[] = { -+ "", -+ NULL, -+ }; -+ const char *vlan_prefixes[] = { -+ "vlan ", -+ "vid ", -+ NULL, - }; - const struct command **p; -- char buf[32]; -+ const char **prefixes; -+ const char **prefix; -+ char buf[64]; - size_t i; - - fprintf(stderr, "Usage: batctl [options] command|debug table [parameters]\n"); - fprintf(stderr, "options:\n"); -- fprintf(stderr, " \t-m mesh interface or VLAN created on top of a mesh interface (default 'bat0')\n"); -+ fprintf(stderr, " \t-m mesh interface (default 'bat0')\n"); - fprintf(stderr, " \t-h print this help (or 'batctl -h' for the parameter help)\n"); - fprintf(stderr, " \t-v print version\n"); - - for (i = 0; i < sizeof(type) / sizeof(*type); i++) { - fprintf(stderr, "\n"); - -- switch (type[i]) { -- case SUBCOMMAND: -- fprintf(stderr, "commands:\n"); -- break; -- case DEBUGTABLE: -- fprintf(stderr, "debug tables: \tdisplay the corresponding debug table\n"); -- break; -- } -+ fprintf(stderr, "%s", type[i].label); - - for (p = __start___command; p < __stop___command; p++) { - const struct command *cmd = *p; - -- if (cmd->type != type[i]) -+ if (!(BIT(cmd->type) & type[i].types)) - continue; - - if (!cmd->usage) - continue; - -- if (strcmp(cmd->name, cmd->abbr) == 0) -- snprintf(buf, sizeof(buf), "%s", cmd->name); -- else -- snprintf(buf, sizeof(buf), "%s|%s", cmd->name, -- cmd->abbr); -+ switch (cmd->type) { -+ case SUBCOMMAND_VID: -+ prefixes = vlan_prefixes; -+ break; -+ default: -+ prefixes = default_prefixes; -+ break; -+ } - -- fprintf(stderr, " \t%-27s%s\n", buf, cmd->usage); -+ for (prefix = &prefixes[0]; *prefix; prefix++) { -+ if (strcmp(cmd->name, cmd->abbr) == 0) -+ snprintf(buf, sizeof(buf), "%s%s", -+ *prefix, cmd->name); -+ else -+ snprintf(buf, sizeof(buf), "%s%s|%s", -+ *prefix, cmd->name, cmd->abbr); -+ -+ fprintf(stderr, " \t%-35s%s\n", buf, -+ cmd->usage); -+ } - } - } - } -@@ -93,13 +120,19 @@ static void version(void) - exit(EXIT_SUCCESS); - } - --static const struct command *find_command(const char *name) -+static const struct command *find_command(struct state *state, const char *name) - { - const struct command **p; - - for (p = __start___command; p < __stop___command; p++) { - const struct command *cmd = *p; - -+ if (state->vid >= 0 && cmd->type != SUBCOMMAND_VID) -+ continue; -+ -+ if (state->vid < 0 && cmd->type == SUBCOMMAND_VID) -+ continue; -+ - if (strcmp(cmd->name, name) == 0) - return cmd; - -@@ -110,6 +143,51 @@ static const struct command *find_command(const char *name) - return NULL; - } - -+static int parse_dev_args(struct state *state, int argc, char *argv[]) -+{ -+ unsigned long vid; -+ char *endptr; -+ -+ /* not enough arguments to parse */ -+ if (argc < 2) { -+ translate_mesh_iface(state); -+ return 0; -+ } -+ -+ if (strcmp(argv[0], "vid") == 0) { -+ if (argv[1] == '\0') { -+ fprintf(stderr, "Error - unparsable vid\n"); -+ return -EINVAL; -+ } -+ -+ vid = strtoul(argv[1], &endptr, 0); -+ if (!endptr || *endptr != '\0') { -+ fprintf(stderr, "Error - unparsable vid\n"); -+ return -EINVAL; -+ } -+ -+ if (vid > 4095) { -+ fprintf(stderr, "Error - too large vid (max 4095)\n"); -+ return -ERANGE; -+ } -+ -+ /* get mesh interface and overwrite vid afterwards */ -+ translate_mesh_iface(state); -+ state->vid = vid; -+ -+ return 2; -+ } else if (strcmp(argv[0], "vlan") == 0) { -+ state->arg_iface = argv[1]; -+ translate_mesh_iface(state); -+ -+ return 2; -+ } else { -+ /* parse vlan as part of -m parameter */ -+ translate_mesh_iface(state); -+ return 0; -+ } -+} -+ - int main(int argc, char **argv) - { - const struct command *cmd; -@@ -117,6 +195,7 @@ int main(int argc, char **argv) - .arg_iface = mesh_dfl_iface, - .cmd = NULL, - }; -+ int dev_arguments; - int opt; - int ret; - -@@ -152,7 +231,15 @@ int main(int argc, char **argv) - argc -= optind; - optind = 0; - -- cmd = find_command(argv[0]); -+ /* parse arguments to identify vlan, ... */ -+ dev_arguments = parse_dev_args(&state, argc, argv); -+ if (dev_arguments < 0) -+ goto err; -+ -+ argv += dev_arguments; -+ argc -= dev_arguments; -+ -+ cmd = find_command(&state, argv[0]); - if (!cmd) { - fprintf(stderr, - "Error - no valid command or debug table specified: %s\n", -@@ -162,8 +249,6 @@ int main(int argc, char **argv) - - state.cmd = cmd; - -- translate_mesh_iface(&state); -- - if (cmd->flags & COMMAND_FLAG_MESH_IFACE && - check_mesh_iface(&state) < 0) { - fprintf(stderr, -diff --git a/main.h b/main.h -index 1a4701513c49ad8974b9c9189619f5dde622acd4..1d952610aefb8367bd52e24bea8c04c3d70b94ea 100644 ---- a/main.h -+++ b/main.h -@@ -58,6 +58,7 @@ enum command_flags { - - enum command_type { - SUBCOMMAND, -+ SUBCOMMAND_VID, - DEBUGTABLE, - }; - -@@ -84,7 +85,7 @@ struct command { - }; - - #define COMMAND_NAMED(_type, _name, _abbr, _handler, _flags, _arg, _usage) \ -- static const struct command command_ ## _name = { \ -+ static const struct command command_ ## _name ## _ ## _type = { \ - .type = (_type), \ - .name = (#_name), \ - .abbr = _abbr, \ -@@ -93,8 +94,8 @@ struct command { - .arg = (_arg), \ - .usage = (_usage), \ - }; \ -- static const struct command *__command_ ## _name \ -- __attribute__((__used__)) __attribute__ ((__section__ ("__command"))) = &command_ ## _name -+ static const struct command *__command_ ## _name ## _ ## _type \ -+ __attribute__((__used__)) __attribute__ ((__section__ ("__command"))) = &command_ ## _name ## _ ## _type - - #define COMMAND(_type, _handler, _abbr, _flags, _arg, _usage) \ - COMMAND_NAMED(_type, _handler, _abbr, _handler, _flags, _arg, _usage) -diff --git a/man/batctl.8 b/man/batctl.8 -index 0b430313075b5a7a4c796eba0867954e10061002..acb4288c4e6f59b322d20631ef8e3aee6f2215e5 100644 ---- a/man/batctl.8 -+++ b/man/batctl.8 -@@ -68,7 +68,7 @@ free all attached interfaces and remove batman-adv interface. - If no parameter is given the current originator interval setting is displayed otherwise the parameter is used to set the - originator interval. The interval is in units of milliseconds. - .br --.IP "\fBap_isolation\fP|\fBap\fP [\fB0\fP|\fB1\fP]" -+.IP "[\fBvlan \fP|\fBvid \fP] \fBap_isolation\fP|\fBap\fP [\fB0\fP|\fB1\fP]" - If no parameter is given the current ap isolation setting is displayed. Otherwise the parameter is used to enable or - disable ap isolation. This command can be used in conjunction with "\-m" option to target per VLAN configurations. - .br -diff --git a/sys.c b/sys.c -index 39123db87d391b8898b7454eba7708515bfb3c78..f19719cfad61f36f2a5c1078305de83eb5be142a 100644 ---- a/sys.c -+++ b/sys.c -@@ -141,9 +141,35 @@ int sys_simple_print_boolean(struct nl_msg *msg, void *arg, - - static void settings_usage(struct state *state) - { -- fprintf(stderr, "Usage: batctl [options] %s|%s [parameters] %s\n", -- state->cmd->name, state->cmd->abbr, -- state->cmd->usage ? state->cmd->usage : ""); -+ const char *default_prefixes[] = { -+ "", -+ NULL, -+ }; -+ const char *vlan_prefixes[] = { -+ "vlan ", -+ "vid ", -+ NULL, -+ }; -+ const char *linestart = "Usage:"; -+ const char **prefixes; -+ const char **prefix; -+ -+ switch (state->cmd->type) { -+ case SUBCOMMAND_VID: -+ prefixes = vlan_prefixes; -+ break; -+ default: -+ prefixes = default_prefixes; -+ break; -+ } -+ -+ for (prefix = &prefixes[0]; *prefix; prefix++) { -+ fprintf(stderr, "%s batctl [options] %s%s|%s [parameters] %s\n", -+ linestart, *prefix, state->cmd->name, state->cmd->abbr, -+ state->cmd->usage ? state->cmd->usage : ""); -+ -+ linestart = " "; -+ } - - fprintf(stderr, "parameters:\n"); - fprintf(stderr, " \t -h print this help\n"); diff --git a/batctl/patches/0002-batctl-Integrate-hardif-setting-framework.patch b/batctl/patches/0002-batctl-Integrate-hardif-setting-framework.patch deleted file mode 100644 index 1224b5f..0000000 --- a/batctl/patches/0002-batctl-Integrate-hardif-setting-framework.patch +++ /dev/null @@ -1,183 +0,0 @@ -From: Sven Eckelmann -Date: Thu, 13 Jun 2019 21:12:15 +0200 -Subject: batctl: Integrate hardif setting framework - -batctl currently supports settings which are either mesh interface or vlan -specific. But B.A.T.M.A.N. V introduced two additional settings which are -hard (slave) interface specific. - -To support these, an additional command prefix called hardif is implemented -for some sysfs commands: - - $ batctl -m bat0 hardif eth0 ... - -Signed-off-by: Sven Eckelmann - -Forwarded: https://patchwork.open-mesh.org/patch/17948/ - -diff --git a/main.c b/main.c -index 6ca13ac0ec4c82ee969be04737a339fd702b52bd..c806dbf4373fd082ff368cba391bdf14eebf4eae 100644 ---- a/main.c -+++ b/main.c -@@ -35,7 +35,8 @@ static void print_usage(void) - { - .label = "commands:\n", - .types = BIT(SUBCOMMAND) | -- BIT(SUBCOMMAND_VID), -+ BIT(SUBCOMMAND_VID) | -+ BIT(SUBCOMMAND_HIF), - }, - { - .label = "debug tables: \tdisplay the corresponding debug table\n", -@@ -51,6 +52,10 @@ static void print_usage(void) - "vid ", - NULL, - }; -+ const char *hardif_prefixes[] = { -+ "hardif ", -+ NULL, -+ }; - const struct command **p; - const char **prefixes; - const char **prefix; -@@ -81,6 +86,9 @@ static void print_usage(void) - case SUBCOMMAND_VID: - prefixes = vlan_prefixes; - break; -+ case SUBCOMMAND_HIF: -+ prefixes = hardif_prefixes; -+ break; - default: - prefixes = default_prefixes; - break; -@@ -133,6 +141,12 @@ static const struct command *find_command(struct state *state, const char *name) - if (state->vid < 0 && cmd->type == SUBCOMMAND_VID) - continue; - -+ if (state->hif > 0 && cmd->type != SUBCOMMAND_HIF) -+ continue; -+ -+ if (state->hif == 0 && cmd->type == SUBCOMMAND_HIF) -+ continue; -+ - if (strcmp(cmd->name, name) == 0) - return cmd; - -@@ -180,6 +194,18 @@ static int parse_dev_args(struct state *state, int argc, char *argv[]) - state->arg_iface = argv[1]; - translate_mesh_iface(state); - -+ return 2; -+ } else if (strcmp(argv[0], "hardif") == 0) { -+ state->hif = if_nametoindex(argv[1]); -+ if (state->hif == 0) { -+ fprintf(stderr, "Error - hard interface not found\n"); -+ return -ENODEV; -+ } -+ -+ snprintf(state->hard_iface, sizeof(state->hard_iface), "%s", -+ argv[1]); -+ -+ translate_mesh_iface(state); - return 2; - } else { - /* parse vlan as part of -m parameter */ -@@ -193,6 +219,7 @@ int main(int argc, char **argv) - const struct command *cmd; - struct state state = { - .arg_iface = mesh_dfl_iface, -+ .hif = 0, - .cmd = NULL, - }; - int dev_arguments; -diff --git a/main.h b/main.h -index 1d952610aefb8367bd52e24bea8c04c3d70b94ea..a27d8486ef689206b27b1b50cb017b1b740e91c9 100644 ---- a/main.h -+++ b/main.h -@@ -59,6 +59,7 @@ enum command_flags { - enum command_type { - SUBCOMMAND, - SUBCOMMAND_VID, -+ SUBCOMMAND_HIF, - DEBUGTABLE, - }; - -@@ -66,6 +67,8 @@ struct state { - char *arg_iface; - char mesh_iface[IF_NAMESIZE]; - unsigned int mesh_ifindex; -+ char hard_iface[IF_NAMESIZE]; -+ unsigned int hif; - int vid; - const struct command *cmd; - -diff --git a/sys.c b/sys.c -index f19719cfad61f36f2a5c1078305de83eb5be142a..fd34b2fa3bcf168a32bd53fc0df3f35d5532433f 100644 ---- a/sys.c -+++ b/sys.c -@@ -150,6 +150,10 @@ static void settings_usage(struct state *state) - "vid ", - NULL, - }; -+ const char *hardif_prefixes[] = { -+ "hardif ", -+ NULL, -+ }; - const char *linestart = "Usage:"; - const char **prefixes; - const char **prefix; -@@ -158,6 +162,9 @@ static void settings_usage(struct state *state) - case SUBCOMMAND_VID: - prefixes = vlan_prefixes; - break; -+ case SUBCOMMAND_HIF: -+ prefixes = hardif_prefixes; -+ break; - default: - prefixes = default_prefixes; - break; -@@ -259,15 +266,23 @@ int handle_sys_setting(struct state *state, int argc, char **argv) - return EXIT_FAILURE; - } - -- /* if the specified interface is a VLAN then change the path to point -- * to the proper "vlan%{vid}" subfolder in the sysfs tree. -- */ -- if (state->vid >= 0) -+ if (state->hif > 0) { -+ /* if a hard interface was specified then change the path to -+ * point to the proper ${hardif}/batman-adv path in the sysfs -+ * tree. -+ */ -+ snprintf(path_buff, PATH_BUFF_LEN, SYS_HARDIF_PATH, -+ state->hard_iface); -+ } else if (state->vid >= 0) { -+ /* if the specified interface is a VLAN then change the path to -+ * point to the proper "vlan%{vid}" subfolder in the sysfs tree. -+ */ - snprintf(path_buff, PATH_BUFF_LEN, SYS_VLAN_PATH, - state->mesh_iface, state->vid); -- else -+ } else { - snprintf(path_buff, PATH_BUFF_LEN, SYS_BATIF_PATH_FMT, - state->mesh_iface); -+ } - - if (argc == 1) { - res = sys_read_setting(state, path_buff, settings->sysfs_name); -diff --git a/sys.h b/sys.h -index d4f2fcf542bc66b2b1c6ec55a9ac16e10fdc5cac..b6f0f9043a9af8e3c4d4f8bf7e4af4cab0aa5df9 100644 ---- a/sys.h -+++ b/sys.h -@@ -21,8 +21,9 @@ - #define SYS_BATIF_PATH_FMT "/sys/class/net/%s/mesh/" - #define SYS_IFACE_PATH "/sys/class/net" - #define SYS_IFACE_DIR SYS_IFACE_PATH"/%s/" --#define SYS_MESH_IFACE_FMT SYS_IFACE_PATH"/%s/batman_adv/mesh_iface" --#define SYS_IFACE_STATUS_FMT SYS_IFACE_PATH"/%s/batman_adv/iface_status" -+#define SYS_HARDIF_PATH SYS_IFACE_DIR "batman_adv/" -+#define SYS_MESH_IFACE_FMT SYS_HARDIF_PATH "mesh_iface" -+#define SYS_IFACE_STATUS_FMT SYS_HARDIF_PATH "iface_status" - #define SYS_VLAN_PATH SYS_IFACE_PATH"/%s/mesh/vlan%d/" - #define SYS_ROUTING_ALGO_FMT SYS_IFACE_PATH"/%s/mesh/routing_algo" - #define VLAN_ID_MAX_LEN 4 diff --git a/batctl/patches/0003-batctl-Add-elp_interval-setting-command.patch b/batctl/patches/0003-batctl-Add-elp_interval-setting-command.patch deleted file mode 100644 index bef7327..0000000 --- a/batctl/patches/0003-batctl-Add-elp_interval-setting-command.patch +++ /dev/null @@ -1,183 +0,0 @@ -From: Sven Eckelmann -Date: Thu, 13 Jun 2019 21:12:16 +0200 -Subject: batctl: Add elp_interval setting command - -B.A.T.M.A.N. V introduced a hard interface specific setting called -elp_interval. It defines the interval in milliseconds in which batman-adv -emits probing packets for neighbor sensing (ELP). - -Signed-off-by: Sven Eckelmann - -Forwarded: https://patchwork.open-mesh.org/patch/17949/ - -diff --git a/Makefile b/Makefile -index b7bd545e92963c62128efe60c0dc401bdd9fa023..f071da20f866bff6c162d697d2e43fa9d68ee08d 100755 ---- a/Makefile -+++ b/Makefile -@@ -45,6 +45,7 @@ $(eval $(call add_command,bridge_loop_avoidance,y)) - $(eval $(call add_command,claimtable,y)) - $(eval $(call add_command,dat_cache,y)) - $(eval $(call add_command,distributed_arp_table,y)) -+$(eval $(call add_command,elp_interval,y)) - $(eval $(call add_command,event,y)) - $(eval $(call add_command,fragmentation,y)) - $(eval $(call add_command,gateways,y)) -diff --git a/README.rst b/README.rst -index bc54412bc77dae1889d4f05298c34efc1966776b..92983aa6030e2a890283bca448b9203cd4d56b51 100644 ---- a/README.rst -+++ b/README.rst -@@ -386,6 +386,22 @@ Example:: - 1000 - - -+batctl elp interval -+=================== -+ -+display or modify the elp interval in ms for hard interface -+ -+Usage:: -+ -+ batctl hardif $hardif elp_interval|et [interval] -+ -+Example:: -+ -+ $ batctl hardif eth0 elp_interval 200 -+ $ batctl hardif eth0 elp_interval -+ 200 -+ -+ - batctl loglevel - =============== - -diff --git a/elp_interval.c b/elp_interval.c -new file mode 100644 -index 0000000000000000000000000000000000000000..0a5e98923a622f52e523696b1ec1bfb856eeca9f ---- /dev/null -+++ b/elp_interval.c -@@ -0,0 +1,111 @@ -+// SPDX-License-Identifier: GPL-2.0 -+/* Copyright (C) 2009-2019 B.A.T.M.A.N. contributors: -+ * -+ * Marek Lindner -+ * -+ * License-Filename: LICENSES/preferred/GPL-2.0 -+ */ -+ -+#include -+#include -+#include -+#include -+ -+#include "main.h" -+#include "sys.h" -+ -+static struct elp_interval_data { -+ uint32_t elp_interval; -+} elp_interval; -+ -+static int parse_elp_interval(struct state *state, int argc, char *argv[]) -+{ -+ struct settings_data *settings = state->cmd->arg; -+ struct elp_interval_data *data = settings->data; -+ char *endptr; -+ -+ if (argc != 2) { -+ fprintf(stderr, "Error - incorrect number of arguments (expected 1)\n"); -+ return -EINVAL; -+ } -+ -+ data->elp_interval = strtoul(argv[1], &endptr, 0); -+ if (!endptr || *endptr != '\0') { -+ fprintf(stderr, "Error - the supplied argument is invalid: %s\n", argv[1]); -+ return -EINVAL; -+ } -+ -+ return 0; -+} -+ -+static int print_elp_interval(struct nl_msg *msg, void *arg) -+{ -+ struct nlattr *attrs[BATADV_ATTR_MAX + 1]; -+ struct nlmsghdr *nlh = nlmsg_hdr(msg); -+ struct genlmsghdr *ghdr; -+ int *result = arg; -+ -+ if (!genlmsg_valid_hdr(nlh, 0)) -+ return NL_OK; -+ -+ ghdr = nlmsg_data(nlh); -+ -+ if (nla_parse(attrs, BATADV_ATTR_MAX, genlmsg_attrdata(ghdr, 0), -+ genlmsg_len(ghdr), batadv_netlink_policy)) { -+ return NL_OK; -+ } -+ -+ if (!attrs[BATADV_ATTR_ELP_INTERVAL]) -+ return NL_OK; -+ -+ printf("%u\n", nla_get_u32(attrs[BATADV_ATTR_ELP_INTERVAL])); -+ -+ *result = 0; -+ return NL_STOP; -+} -+ -+static int get_attrs_elp_interval(struct nl_msg *msg, void *arg) -+{ -+ struct state *state = arg; -+ -+ nla_put_u32(msg, BATADV_ATTR_HARD_IFINDEX, state->hif); -+ -+ return 0; -+} -+ -+static int get_elp_interval(struct state *state) -+{ -+ return sys_simple_nlquery(state, BATADV_CMD_GET_HARDIF, -+ get_attrs_elp_interval, print_elp_interval); -+} -+ -+static int set_attrs_elp_interval(struct nl_msg *msg, void *arg) -+{ -+ struct state *state = arg; -+ struct settings_data *settings = state->cmd->arg; -+ struct elp_interval_data *data = settings->data; -+ -+ nla_put_u32(msg, BATADV_ATTR_HARD_IFINDEX, state->hif); -+ nla_put_u32(msg, BATADV_ATTR_ELP_INTERVAL, data->elp_interval); -+ -+ return 0; -+} -+ -+static int set_elp_interval(struct state *state) -+{ -+ return sys_simple_nlquery(state, BATADV_CMD_SET_HARDIF, -+ set_attrs_elp_interval, NULL); -+} -+ -+static struct settings_data batctl_settings_elp_interval = { -+ .sysfs_name = "elp_interval", -+ .data = &elp_interval, -+ .parse = parse_elp_interval, -+ .netlink_get = get_elp_interval, -+ .netlink_set = set_elp_interval, -+}; -+ -+COMMAND_NAMED(SUBCOMMAND_HIF, elp_interval, "et", handle_sys_setting, -+ COMMAND_FLAG_MESH_IFACE | COMMAND_FLAG_NETLINK, -+ &batctl_settings_elp_interval, -+ "[interval] \tdisplay or modify elp_interval setting"); -diff --git a/man/batctl.8 b/man/batctl.8 -index acb4288c4e6f59b322d20631ef8e3aee6f2215e5..690da023fd1ac6f51915a9167e92030a650fe1bd 100644 ---- a/man/batctl.8 -+++ b/man/batctl.8 -@@ -93,6 +93,10 @@ the bonding mode. - batctl will monitor for events from the netlink kernel interface of batman-adv. The local timestamp of the event will be printed - when parameter \fB\-t\fP is specified. Parameter \fB\-r\fP will do the same but with relative timestamps. - .br -+.IP "\fBhardif \fP \fBelp_interval\fP|\fBet\fP [\fBinterval\fP]" -+If no parameter is given the current ELP interval setting of the hard interface is displayed otherwise the parameter is used to set the -+ELP interval. The interval is in units of milliseconds. -+.br - .IP "\fBfragmentation\fP|\fBf\fP [\fB0\fP|\fB1\fP]" - If no parameter is given the current fragmentation mode setting is displayed. Otherwise the parameter is used to enable or - disable fragmentation. diff --git a/batctl/patches/0004-batctl-Add-throughput_override-setting-command.patch b/batctl/patches/0004-batctl-Add-throughput_override-setting-command.patch deleted file mode 100644 index 7982cef..0000000 --- a/batctl/patches/0004-batctl-Add-throughput_override-setting-command.patch +++ /dev/null @@ -1,189 +0,0 @@ -From: Sven Eckelmann -Date: Thu, 13 Jun 2019 21:12:17 +0200 -Subject: batctl: Add throughput_override setting command - -B.A.T.M.A.N. V introduced a hard interface specific setting called -throughput. It defines the throughput value to be used by B.A.T.M.A.N. V -when estimating the link throughput using this interface. If the value is -set to 0 then batman-adv will try to estimate the throughput by itself. - -Signed-off-by: Sven Eckelmann - -Forwarded: https://patchwork.open-mesh.org/patch/17950/ - -diff --git a/Makefile b/Makefile -index f071da20f866bff6c162d697d2e43fa9d68ee08d..e3747a2a28eb34323e34a1e22f5507dd1d7cd0f6 100755 ---- a/Makefile -+++ b/Makefile -@@ -67,6 +67,7 @@ $(eval $(call add_command,ping,y)) - $(eval $(call add_command,routing_algo,y)) - $(eval $(call add_command,statistics,y)) - $(eval $(call add_command,tcpdump,y)) -+$(eval $(call add_command,throughput_override,y)) - $(eval $(call add_command,throughputmeter,y)) - $(eval $(call add_command,traceroute,y)) - $(eval $(call add_command,transglobal,y)) -diff --git a/README.rst b/README.rst -index 92983aa6030e2a890283bca448b9203cd4d56b51..128f539852fa085d023fb6d26ae436e76b617bb6 100644 ---- a/README.rst -+++ b/README.rst -@@ -402,6 +402,23 @@ Example:: - 200 - - -+batctl throughput override -+========================== -+ -+display or modify the throughput override in kbit/s for hard interface -+ -+Usage:: -+ -+ batctl hardif $hardif throughput_override|to [kbit] -+ -+Example:: -+ -+ $ batctl hardif eth0 throughput_override 15000 -+ $ batctl hardif eth0 throughput_override 15mbit -+ $ batctl hardif eth0 throughput_override -+ 15.0 MBit -+ -+ - batctl loglevel - =============== - -diff --git a/man/batctl.8 b/man/batctl.8 -index 690da023fd1ac6f51915a9167e92030a650fe1bd..b8218963712bbf0cc9470459896fc904cd393748 100644 ---- a/man/batctl.8 -+++ b/man/batctl.8 -@@ -203,6 +203,12 @@ supported routing algorithms are displayed. - Otherwise the parameter is used to select the routing algorithm for the following - batX interface to be created. - .br -+.IP "\fBhardif \fP \fBthroughput_override|to\fP [\fBbandwidth\fP]\fP" -+If no parameter is given the current througput override is displayed otherwise -+the parameter is used to set the throughput override for the specified hard -+interface. -+Just enter any number (optionally followed by "kbit" or "mbit"). -+.br - .IP "\fBisolation_mark\fP|\fBmark\fP" - If no parameter is given the current isolation mark value is displayed. - Otherwise the parameter is used to set or unset the isolation mark used by the -diff --git a/throughput_override.c b/throughput_override.c -new file mode 100644 -index 0000000000000000000000000000000000000000..28a6588b9417cca213ebde3545a3eb425592ad89 ---- /dev/null -+++ b/throughput_override.c -@@ -0,0 +1,113 @@ -+// SPDX-License-Identifier: GPL-2.0 -+/* Copyright (C) 2009-2019 B.A.T.M.A.N. contributors: -+ * -+ * Marek Lindner -+ * -+ * License-Filename: LICENSES/preferred/GPL-2.0 -+ */ -+ -+#include -+#include -+#include -+#include -+ -+#include "functions.h" -+#include "main.h" -+#include "sys.h" -+ -+static struct throughput_override_data { -+ uint32_t throughput_override; -+} throughput_override; -+ -+static int parse_throughput_override(struct state *state, int argc, char *argv[]) -+{ -+ struct settings_data *settings = state->cmd->arg; -+ struct throughput_override_data *data = settings->data; -+ bool ret; -+ -+ if (argc != 2) { -+ fprintf(stderr, "Error - incorrect number of arguments (expected 1)\n"); -+ return -EINVAL; -+ } -+ -+ ret = parse_throughput(argv[1], "throughput override", -+ &data->throughput_override); -+ if (!ret) -+ return -EINVAL; -+ -+ return 0; -+} -+ -+static int print_throughput_override(struct nl_msg *msg, void *arg) -+{ -+ struct nlattr *attrs[BATADV_ATTR_MAX + 1]; -+ struct nlmsghdr *nlh = nlmsg_hdr(msg); -+ struct genlmsghdr *ghdr; -+ int *result = arg; -+ uint32_t mbit; -+ -+ if (!genlmsg_valid_hdr(nlh, 0)) -+ return NL_OK; -+ -+ ghdr = nlmsg_data(nlh); -+ -+ if (nla_parse(attrs, BATADV_ATTR_MAX, genlmsg_attrdata(ghdr, 0), -+ genlmsg_len(ghdr), batadv_netlink_policy)) { -+ return NL_OK; -+ } -+ -+ if (!attrs[BATADV_ATTR_THROUGHPUT_OVERRIDE]) -+ return NL_OK; -+ -+ mbit = nla_get_u32(attrs[BATADV_ATTR_THROUGHPUT_OVERRIDE]); -+ printf("%u.%u MBit\n", mbit / 10, mbit % 10); -+ -+ *result = 0; -+ return NL_STOP; -+} -+ -+static int get_attrs_elp_isolation(struct nl_msg *msg, void *arg) -+{ -+ struct state *state = arg; -+ -+ nla_put_u32(msg, BATADV_ATTR_HARD_IFINDEX, state->hif); -+ -+ return 0; -+} -+ -+static int get_throughput_override(struct state *state) -+{ -+ return sys_simple_nlquery(state, BATADV_CMD_GET_HARDIF, -+ get_attrs_elp_isolation, print_throughput_override); -+} -+ -+static int set_attrs_throughput_override(struct nl_msg *msg, void *arg) -+{ -+ struct state *state = arg; -+ struct settings_data *settings = state->cmd->arg; -+ struct throughput_override_data *data = settings->data; -+ -+ nla_put_u32(msg, BATADV_ATTR_HARD_IFINDEX, state->hif); -+ nla_put_u32(msg, BATADV_ATTR_THROUGHPUT_OVERRIDE, data->throughput_override); -+ -+ return 0; -+} -+ -+static int set_throughput_override(struct state *state) -+{ -+ return sys_simple_nlquery(state, BATADV_CMD_SET_HARDIF, -+ set_attrs_throughput_override, NULL); -+} -+ -+static struct settings_data batctl_settings_throughput_override = { -+ .sysfs_name = "throughput_override", -+ .data = &throughput_override, -+ .parse = parse_throughput_override, -+ .netlink_get = get_throughput_override, -+ .netlink_set = set_throughput_override, -+}; -+ -+COMMAND_NAMED(SUBCOMMAND_HIF, throughput_override, "to", handle_sys_setting, -+ COMMAND_FLAG_MESH_IFACE | COMMAND_FLAG_NETLINK, -+ &batctl_settings_throughput_override, -+ "[mbit] \tdisplay or modify throughput_override setting"); From 34b730e6aba5cbbe35c0facee59158de70706f17 Mon Sep 17 00:00:00 2001 From: Sven Eckelmann Date: Thu, 1 Aug 2019 16:22:00 +0200 Subject: [PATCH 08/35] batman-adv: Switch proto scripts to new prefixes The '-m' option to select the mesh interface or vlan interfaces was replaced with device type specific subcommand prefixes: * meshif * vlan * meshif vid * hardif This change should also be made in the proto script to allow batctl to drop the support of '-m' completely in the future. Signed-off-by: Sven Eckelmann --- batman-adv/Makefile | 2 +- batman-adv/files/lib/netifd/proto/batadv.sh | 40 +++++++++---------- .../files/lib/netifd/proto/batadv_hardif.sh | 8 ++-- .../files/lib/netifd/proto/batadv_vlan.sh | 2 +- 4 files changed, 26 insertions(+), 26 deletions(-) diff --git a/batman-adv/Makefile b/batman-adv/Makefile index e689d72..6b831c7 100644 --- a/batman-adv/Makefile +++ b/batman-adv/Makefile @@ -10,7 +10,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=batman-adv PKG_VERSION:=2019.2 -PKG_RELEASE:=5 +PKG_RELEASE:=6 PKG_HASH:=70c3f6a6cf88d2b25681a76768a52ed92d9fe992ba8e358368b6a8088757adc8 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz diff --git a/batman-adv/files/lib/netifd/proto/batadv.sh b/batman-adv/files/lib/netifd/proto/batadv.sh index a7fe63c..edc14f4 100755 --- a/batman-adv/files/lib/netifd/proto/batadv.sh +++ b/batman-adv/files/lib/netifd/proto/batadv.sh @@ -72,42 +72,42 @@ proto_batadv_setup() { set_default routing_algo 'BATMAN_IV' batctl routing_algo "$routing_algo" - batctl -m "$iface" interface create + batctl meshif "$iface" interface create - [ -n "$aggregated_ogms" ] && batctl -m "$iface" aggregation "$aggregated_ogms" - [ -n "$ap_isolation" ] && batctl -m "$iface" ap_isolation "$ap_isolation" - [ -n "$bonding" ] && batctl -m "$iface" bonding "$bonding" - [ -n "$bridge_loop_avoidance" ] && batctl -m "$iface" bridge_loop_avoidance "$bridge_loop_avoidance" 2>&- - [ -n "$distributed_arp_table" ] && batctl -m "$iface" distributed_arp_table "$distributed_arp_table" 2>&- - [ -n "$fragmentation" ] && batctl -m "$iface" fragmentation "$fragmentation" + [ -n "$aggregated_ogms" ] && batctl meshif "$iface" aggregation "$aggregated_ogms" + [ -n "$ap_isolation" ] && batctl meshif "$iface" ap_isolation "$ap_isolation" + [ -n "$bonding" ] && batctl meshif "$iface" bonding "$bonding" + [ -n "$bridge_loop_avoidance" ] && batctl meshif "$iface" bridge_loop_avoidance "$bridge_loop_avoidance" 2>&- + [ -n "$distributed_arp_table" ] && batctl meshif "$iface" distributed_arp_table "$distributed_arp_table" 2>&- + [ -n "$fragmentation" ] && batctl meshif "$iface" fragmentation "$fragmentation" case "$gw_mode" in server) if [ -n "$gw_bandwidth" ]; then - batctl -m "$iface" gw_mode "server" "$gw_bandwidth" + batctl meshif "$iface" gw_mode "server" "$gw_bandwidth" else - batctl -m "$iface" gw_mode "server" + batctl meshif "$iface" gw_mode "server" fi ;; client) if [ -n "$gw_sel_class" ]; then - batctl -m "$iface" gw_mode "client" "$gw_sel_class" + batctl meshif "$iface" gw_mode "client" "$gw_sel_class" else - batctl -m "$iface" gw_mode "client" + batctl meshif "$iface" gw_mode "client" fi ;; *) - batctl -m "$iface" gw_mode "off" + batctl meshif "$iface" gw_mode "off" ;; esac - [ -n "$hop_penalty" ] && batctl -m "$iface" hop_penalty "$hop_penalty" - [ -n "$isolation_mark" ] && batctl -m "$iface" isolation_mark "$isolation_mark" - [ -n "$multicast_fanout" ] && batctl -m "$iface" multicast_fanout "$multicast_fanout" - [ -n "$multicast_mode" ] && batctl -m "$iface" multicast_mode "$multicast_mode" 2>&- - [ -n "$network_coding" ] && batctl -m "$iface" network_coding "$network_coding" 2>&- - [ -n "$log_level" ] && batctl -m "$iface" loglevel "$log_level" 2>&- - [ -n "$orig_interval" ] && batctl -m "$iface" orig_interval "$orig_interval" + [ -n "$hop_penalty" ] && batctl meshif "$iface" hop_penalty "$hop_penalty" + [ -n "$isolation_mark" ] && batctl meshif "$iface" isolation_mark "$isolation_mark" + [ -n "$multicast_fanout" ] && batctl meshif "$iface" multicast_fanout "$multicast_fanout" + [ -n "$multicast_mode" ] && batctl meshif "$iface" multicast_mode "$multicast_mode" 2>&- + [ -n "$network_coding" ] && batctl meshif "$iface" network_coding "$network_coding" 2>&- + [ -n "$log_level" ] && batctl meshif "$iface" loglevel "$log_level" 2>&- + [ -n "$orig_interval" ] && batctl meshif "$iface" orig_interval "$orig_interval" proto_init_update "$iface" 1 proto_send_update "$config" @@ -117,7 +117,7 @@ proto_batadv_teardown() { local config="$1" local iface="$config" - batctl -m "$iface" interface destroy + batctl meshif "$iface" interface destroy } add_protocol batadv diff --git a/batman-adv/files/lib/netifd/proto/batadv_hardif.sh b/batman-adv/files/lib/netifd/proto/batadv_hardif.sh index 76ccd81..6eb597f 100755 --- a/batman-adv/files/lib/netifd/proto/batadv_hardif.sh +++ b/batman-adv/files/lib/netifd/proto/batadv_hardif.sh @@ -26,10 +26,10 @@ proto_batadv_hardif_setup() { ( proto_add_host_dependency "$config" '' "$master" ) - batctl -m "$master" interface -M add "$iface" + batctl meshif "$master" interface -M add "$iface" - [ -n "$elp_interval" ] && batctl -m "$master" hardif "$iface" elp_interval "$elp_interval" - [ -n "$throughput_override" ] && batctl -m "$master" hardif "$iface" throughput_override "$throughput_override" + [ -n "$elp_interval" ] && batctl hardif "$iface" elp_interval "$elp_interval" + [ -n "$throughput_override" ] && batctl hardif "$iface" throughput_override "$throughput_override" proto_init_update "$iface" 1 proto_send_update "$config" @@ -43,7 +43,7 @@ proto_batadv_hardif_teardown() { json_get_vars master - batctl -m "$master" interface -M del "$iface" || true + batctl meshif "$master" interface -M del "$iface" || true } add_protocol batadv_hardif diff --git a/batman-adv/files/lib/netifd/proto/batadv_vlan.sh b/batman-adv/files/lib/netifd/proto/batadv_vlan.sh index b4835f6..115e61c 100755 --- a/batman-adv/files/lib/netifd/proto/batadv_vlan.sh +++ b/batman-adv/files/lib/netifd/proto/batadv_vlan.sh @@ -17,7 +17,7 @@ proto_batadv_vlan_setup() { json_get_vars ap_isolation - [ -n "$ap_isolation" ] && batctl -m "$iface" ap_isolation "$ap_isolation" + [ -n "$ap_isolation" ] && batctl vlan "$iface" ap_isolation "$ap_isolation" proto_init_update "$iface" 1 proto_send_update "$config" } From ce3569e1593676dcf1f08bd20be5e3cab5a8e079 Mon Sep 17 00:00:00 2001 From: Sven Eckelmann Date: Thu, 1 Aug 2019 17:53:51 +0200 Subject: [PATCH 09/35] batman-adv: upgrade package to latest release 2019.3 * support latest kernels (3.16 - 5.3) * coding style cleanups and refactoring * add routable multicast optimizations * bugs squashed: - fix duplicated OGMs on NETDEV_UP - fix dumping of multicast flags Signed-off-by: Sven Eckelmann --- batman-adv/Makefile | 6 +- ...adv-Fix-duplicated-OGMs-on-NETDEV_UP.patch | 77 ------------------- 2 files changed, 3 insertions(+), 80 deletions(-) delete mode 100644 batman-adv/patches/0001-batman-adv-Fix-duplicated-OGMs-on-NETDEV_UP.patch diff --git a/batman-adv/Makefile b/batman-adv/Makefile index 6b831c7..dd4e9b1 100644 --- a/batman-adv/Makefile +++ b/batman-adv/Makefile @@ -9,9 +9,9 @@ include $(TOPDIR)/rules.mk PKG_NAME:=batman-adv -PKG_VERSION:=2019.2 -PKG_RELEASE:=6 -PKG_HASH:=70c3f6a6cf88d2b25681a76768a52ed92d9fe992ba8e358368b6a8088757adc8 +PKG_VERSION:=2019.3 +PKG_RELEASE:=0 +PKG_HASH:=3454dc8bd6cb264e2decda1b99ef3f837535ed33802abc6c39551c181d3984ce PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_SOURCE_URL:=https://downloads.open-mesh.org/batman/releases/batman-adv-$(PKG_VERSION) diff --git a/batman-adv/patches/0001-batman-adv-Fix-duplicated-OGMs-on-NETDEV_UP.patch b/batman-adv/patches/0001-batman-adv-Fix-duplicated-OGMs-on-NETDEV_UP.patch deleted file mode 100644 index 2fc0e19..0000000 --- a/batman-adv/patches/0001-batman-adv-Fix-duplicated-OGMs-on-NETDEV_UP.patch +++ /dev/null @@ -1,77 +0,0 @@ -From: Sven Eckelmann -Date: Sun, 2 Jun 2019 10:57:31 +0200 -Subject: batman-adv: Fix duplicated OGMs on NETDEV_UP - -The state of slave interfaces are handled differently depending on whether -the interface is up or not. All active interfaces (IFF_UP) will transmit -OGMs. But for B.A.T.M.A.N. IV, also non-active interfaces are scheduling -(low TTL) OGMs on active interfaces. The code which setups and schedules -the OGMs must therefore already be called when the interfaces gets added as -slave interface and the transmit function must then check whether it has to -send out the OGM or not on the specific slave interface. - -But the commit 0d8468553c3c ("batman-adv: remove ogm_emit and ogm_schedule -API calls") moved the setup code from the enable function to the activate -function. The latter is called either when the added slave was already up -when batadv_hardif_enable_interface processed the new interface or when a -NETDEV_UP event was received for this slave interfac. As result, each -NETDEV_UP would schedule a new OGM worker for the interface and thus OGMs -would be send a lot more than expected. - -Fixes: 0d8468553c3c ("batman-adv: remove ogm_emit and ogm_schedule API calls") -Reported-by: Linus Lüssing -Signed-off-by: Sven Eckelmann - -Origin: upstream, https://git.open-mesh.org/batman-adv.git/commit/c92331e0df3c0c5645ee5a897eb018c5da5e4aa5 - -diff --git a/net/batman-adv/bat_iv_ogm.c b/net/batman-adv/bat_iv_ogm.c -index bd4138ddf7e09a0020d9842d603dc98f21e225c7..240ed70912d6a014c0a48280741989133034396c 100644 ---- a/net/batman-adv/bat_iv_ogm.c -+++ b/net/batman-adv/bat_iv_ogm.c -@@ -2337,7 +2337,7 @@ batadv_iv_ogm_neigh_is_sob(struct batadv_neigh_node *neigh1, - return ret; - } - --static void batadv_iv_iface_activate(struct batadv_hard_iface *hard_iface) -+static void batadv_iv_iface_enabled(struct batadv_hard_iface *hard_iface) - { - /* begin scheduling originator messages on that interface */ - batadv_iv_ogm_schedule(hard_iface); -@@ -2683,8 +2683,8 @@ static void batadv_iv_gw_dump(struct sk_buff *msg, struct netlink_callback *cb, - static struct batadv_algo_ops batadv_batman_iv __read_mostly = { - .name = "BATMAN_IV", - .iface = { -- .activate = batadv_iv_iface_activate, - .enable = batadv_iv_ogm_iface_enable, -+ .enabled = batadv_iv_iface_enabled, - .disable = batadv_iv_ogm_iface_disable, - .update_mac = batadv_iv_ogm_iface_update_mac, - .primary_set = batadv_iv_ogm_primary_iface_set, -diff --git a/net/batman-adv/hard-interface.c b/net/batman-adv/hard-interface.c -index 79d1731b83066c60f9aef958d2bc343233bce67a..3719cfd026f04093f5d86ffe1b41a41849b2af62 100644 ---- a/net/batman-adv/hard-interface.c -+++ b/net/batman-adv/hard-interface.c -@@ -795,6 +795,9 @@ int batadv_hardif_enable_interface(struct batadv_hard_iface *hard_iface, - - batadv_hardif_recalc_extra_skbroom(soft_iface); - -+ if (bat_priv->algo_ops->iface.enabled) -+ bat_priv->algo_ops->iface.enabled(hard_iface); -+ - out: - return 0; - -diff --git a/net/batman-adv/types.h b/net/batman-adv/types.h -index 74b644738a36bfe063eef6df016278b45a1a0256..e0b25104cbfa9f715df364658621c29faa7ad637 100644 ---- a/net/batman-adv/types.h -+++ b/net/batman-adv/types.h -@@ -2129,6 +2129,9 @@ struct batadv_algo_iface_ops { - /** @enable: init routing info when hard-interface is enabled */ - int (*enable)(struct batadv_hard_iface *hard_iface); - -+ /** @enabled: notification when hard-interface was enabled (optional) */ -+ void (*enabled)(struct batadv_hard_iface *hard_iface); -+ - /** @disable: de-init routing info when hard-interface is disabled */ - void (*disable)(struct batadv_hard_iface *hard_iface); - From 157da8c4ee189764c43b6ce40613e248a15362dc Mon Sep 17 00:00:00 2001 From: Sven Eckelmann Date: Thu, 1 Aug 2019 20:58:41 +0200 Subject: [PATCH 10/35] alfred: Support multiple listening interfaces The alfred daemon allows to be started with multiple interfaces. The first interface is used for communication and to calculate the source mac address. The rest of the interfaces are only used for communication. Signed-off-by: Sven Eckelmann --- alfred/Makefile | 2 +- alfred/files/alfred.config | 2 +- alfred/files/alfred.init | 17 +++++++++++++---- 3 files changed, 15 insertions(+), 6 deletions(-) diff --git a/alfred/Makefile b/alfred/Makefile index aa43b67..9bc1f73 100644 --- a/alfred/Makefile +++ b/alfred/Makefile @@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=alfred PKG_VERSION:=2019.3 -PKG_RELEASE:=0 +PKG_RELEASE:=1 PKG_HASH:=a4c37920de497701680abb55c49cdcd11e4e7135e0e7e79259c35492a3df4766 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz diff --git a/alfred/files/alfred.config b/alfred/files/alfred.config index 9d3fff6..704adf1 100644 --- a/alfred/files/alfred.config +++ b/alfred/files/alfred.config @@ -1,5 +1,5 @@ config 'alfred' 'alfred' - option interface 'br-lan' + list interface 'br-lan' option mode 'master' option batmanif 'bat0' option start_vis '1' diff --git a/alfred/files/alfred.init b/alfred/files/alfred.init index 89e33ab..e5d2006 100755 --- a/alfred/files/alfred.init +++ b/alfred/files/alfred.init @@ -54,10 +54,17 @@ wait_for_ll_address() { exit 1 } +append_interface() +{ + append "interfaces" "$1" "," + wait_for_ll_address "$1" +} + alfred_start() { local args="" local section="$1" local disabled interface mode + local interfaces # check if section is disabled config_get_bool disabled "$section" disabled 0 @@ -65,8 +72,12 @@ alfred_start() { args="" - config_get interface "$section" interface - append args "-i $interface" + config_list_foreach "$section" "interface" append_interface + if [ -z "$interfaces" ]; then + config_get interface "$section" interface + append_interface "$interface" + fi + append args "-i $interfaces" config_get mode "$section" mode [ "$mode" = "master" ] && append args "-m" @@ -78,8 +89,6 @@ alfred_start() { wait_for_dir "$batmanif" "/sys/class/net/$batmanif/mesh" fi - wait_for_ll_address "$interface" - append alfred_args "$args" enable=1 From cf802f86073e0055c8b2d01faa271d6f7dfe4f1f Mon Sep 17 00:00:00 2001 From: Sven Eckelmann Date: Thu, 1 Aug 2019 21:22:21 +0200 Subject: [PATCH 11/35] alfred: Allow startup without batman-adv sysfs support The batman-adv kernel module can be build without sysfs support. This will stop the kernel module from creating the "mesh" directory. The alfred init script must not depend on this folder to start the daemon up. Signed-off-by: Sven Eckelmann --- alfred/Makefile | 2 +- alfred/files/alfred.init | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/alfred/Makefile b/alfred/Makefile index 9bc1f73..c135508 100644 --- a/alfred/Makefile +++ b/alfred/Makefile @@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=alfred PKG_VERSION:=2019.3 -PKG_RELEASE:=1 +PKG_RELEASE:=2 PKG_HASH:=a4c37920de497701680abb55c49cdcd11e4e7135e0e7e79259c35492a3df4766 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz diff --git a/alfred/files/alfred.init b/alfred/files/alfred.init index e5d2006..0c35e65 100755 --- a/alfred/files/alfred.init +++ b/alfred/files/alfred.init @@ -86,7 +86,7 @@ alfred_start() { append args "-b $batmanif" if [ "$batmanif" != "none" ]; then - wait_for_dir "$batmanif" "/sys/class/net/$batmanif/mesh" + wait_for_dir "$batmanif" "/sys/devices/virtual/net/$batmanif" fi append alfred_args "$args" From c1a41b1740472ae9a73b1fe35d63f5068e1006bd Mon Sep 17 00:00:00 2001 From: Russell Senior Date: Sun, 11 Aug 2019 01:33:49 -0700 Subject: [PATCH 12/35] olsrd: update to 0.9.8 Allows building against gpsd-3.19. Signed-off-by: Russell Senior --- olsrd/Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/olsrd/Makefile b/olsrd/Makefile index 85f2a75..5f4e1e3 100644 --- a/olsrd/Makefile +++ b/olsrd/Makefile @@ -8,13 +8,13 @@ include $(TOPDIR)/rules.mk PKG_NAME:=olsrd -PKG_VERSION:=0.9.7 +PKG_VERSION:=0.9.8 PKG_RELEASE=$(PKG_SOURCE_VERSION) PKG_SOURCE_PROTO:=git PKG_SOURCE_URL:=https://github.com/OLSR/olsrd.git PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION) -PKG_SOURCE_VERSION:=v0.9.7 +PKG_SOURCE_VERSION:=v0.9.8 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz PKG_BUILD_PARALLEL:=0 From 5d7f4af534b43b16453e6df71869e3db41e92dea Mon Sep 17 00:00:00 2001 From: Rob White Date: Fri, 16 Aug 2019 00:45:52 +0100 Subject: [PATCH 13/35] nodogsplash: Release 4.0.2 (#500) Maintainer: Moritz Warning Compiled and tested on snapshot SDK mips_24kc This release has numerous bug fixes and enhancements: * Fix bug - fas_remotefqdn not supported with option fas_secure_enabled 0 [bluewavenet] * Fix bug - prevent deadlock causing ndsctl to hang and NDS to become unresponsive [bluewavenet] * PreAuth - Override FAS settings making configuration foolproof [bluewavenet] * ndsctl - make json parsing consistent for all client variables [bluewavenet] * Fix memory leak in template generation [lynxis] * When executing the ndsctl stop command, cleanup all structures [lynxis] * Check for positive errno in thread_ndsctl [lynxis] Signed-off-by: Rob White --- nodogsplash/Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/nodogsplash/Makefile b/nodogsplash/Makefile index cd4e0a2..e6201d3 100644 --- a/nodogsplash/Makefile +++ b/nodogsplash/Makefile @@ -7,12 +7,12 @@ include $(TOPDIR)/rules.mk PKG_NAME:=nodogsplash PKG_FIXUP:=autoreconf -PKG_VERSION:=4.0.1 +PKG_VERSION:=4.0.2 PKG_RELEASE:=1 PKG_SOURCE_URL:=https://codeload.github.com/nodogsplash/nodogsplash/tar.gz/v$(PKG_VERSION)? PKG_SOURCE:=nodogsplash-$(PKG_VERSION).tar.gz -PKG_HASH:=b6787d042ab65f8cdc6982bd083a28a85ac3494896ae5c97e9de9b216585b1e7 +PKG_HASH:=43761b3637742ad22a7f7a8900cb200c133d7ea0c78530014688c5dc7eb6d3c1 PKG_BUILD_DIR:=$(BUILD_DIR)/nodogsplash-$(PKG_VERSION) PKG_MAINTAINER:=Moritz Warning From c687bd3055d08c6914f53f2042d1aed316dbaae5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Toke=20H=C3=B8iland-J=C3=B8rgensen?= Date: Mon, 19 Aug 2019 12:34:05 +0200 Subject: [PATCH 14/35] bird2: Bump to v2.0.5 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Toke Høiland-Jørgensen --- bird2/Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bird2/Makefile b/bird2/Makefile index f14b77c..045213d 100644 --- a/bird2/Makefile +++ b/bird2/Makefile @@ -7,12 +7,12 @@ include $(TOPDIR)/rules.mk PKG_NAME:=bird2 -PKG_VERSION:=2.0.4 +PKG_VERSION:=2.0.5 PKG_RELEASE:=1 PKG_SOURCE:=bird-$(PKG_VERSION).tar.gz PKG_SOURCE_URL:=ftp://bird.network.cz/pub/bird -PKG_HASH:=676010b7517d4159b9af37401c26185f561ffcffeba73690a2ef2fad984714de +PKG_HASH:=4e4b736fd26579823a728be6a7746b3f525206e3c9a4a21fccb302cffd3029d3 PKG_BUILD_DEPENDS:=ncurses readline PKG_MAINTAINER:=Toke Høiland-Jørgensen PKG_BUILD_DIR:=$(BUILD_DIR)/bird-$(PKG_VERSION) From 559619d9d9014dc8894166731a935758558e42f0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Toke=20H=C3=B8iland-J=C3=B8rgensen?= Date: Mon, 19 Aug 2019 12:34:49 +0200 Subject: [PATCH 15/35] bird1: Bump to v1.6.7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Toke Høiland-Jørgensen --- bird1/Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bird1/Makefile b/bird1/Makefile index 123a5e8..a9c7c9e 100644 --- a/bird1/Makefile +++ b/bird1/Makefile @@ -7,12 +7,12 @@ include $(TOPDIR)/rules.mk PKG_NAME:=bird1 -PKG_VERSION:=1.6.6 +PKG_VERSION:=1.6.7 PKG_RELEASE:=1 PKG_SOURCE:=bird-$(PKG_VERSION).tar.gz PKG_SOURCE_URL:=ftp://bird.network.cz/pub/bird -PKG_HASH:=975b3b7aefbe1e0dc9c11e55517f0ca2d82cca1d544e2e926f78bc843aaf2d70 +PKG_HASH:=7eab27ff4b0117a33d20f61b161b647e1fd354b9303c4ed4d3f99260b2173dc9 PKG_BUILD_DEPENDS:=ncurses readline PKG_MAINTAINER:=Álvaro Fernández Rojas PKG_BUILD_DIR:=$(BUILD_DIR)/bird-$(PKG_VERSION) From 6a92b45fac111880c3f2cb2240da40cb529ecdce Mon Sep 17 00:00:00 2001 From: Baptiste Jonglez Date: Mon, 26 Aug 2019 18:39:37 +0200 Subject: [PATCH 16/35] babeld: Don't kill -9 on stop Killing anything with -9 is a bad idea. When killed this way, babeld won't be able to properly disassociate from its neighbours, withdraw its announced routes or remove routes from the kernel. This got introduced in bab933d4cad8 ("babeld: Update to version 1.8.3 + fix init") with an unrelated change. The purpose of the change is unclear because stopping and restarting babeld worked fine without this change. Signed-off-by: Baptiste Jonglez --- babeld/files/babeld.init | 4 ---- 1 file changed, 4 deletions(-) diff --git a/babeld/files/babeld.init b/babeld/files/babeld.init index 7b25ef4..378a8ab 100755 --- a/babeld/files/babeld.init +++ b/babeld/files/babeld.init @@ -197,10 +197,6 @@ start_service() { procd_close_instance } -stop_service() { - killall -9 babeld -} - service_triggers() { procd_add_reload_trigger babeld } From 5a7cf37dc0c63009620668426b753a830b1bdcce Mon Sep 17 00:00:00 2001 From: Adrian Schmutzler Date: Wed, 21 Aug 2019 15:45:50 +0200 Subject: [PATCH 17/35] babeld: Update to version 1.8.5 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Changes: * Fixed a bug that caused confustion between learned routes and imported routes (thanks to Fabian Bläse). * Fixed a bug that prevented install filters from being evaluated (thanks to Killian Lufau). Signed-off-by: Adrian Schmutzler --- babeld/Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/babeld/Makefile b/babeld/Makefile index 870f175..972862c 100644 --- a/babeld/Makefile +++ b/babeld/Makefile @@ -8,12 +8,12 @@ include $(TOPDIR)/rules.mk PKG_NAME:=babeld -PKG_VERSION:=1.8.4 +PKG_VERSION:=1.8.5 PKG_RELEASE:=1 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_SOURCE_URL:=https://www.irif.fr/~jch/software/files/ -PKG_HASH:=98070dc418c190f047b8d69eb47987df30ded8f0fca353c49427d3137ad08b87 +PKG_HASH:=202d99c275604507c6ce133710522f1ddfb62cb671c26f1ac2d3ab44af3d5bc4 PKG_LICENSE:=MIT include $(INCLUDE_DIR)/package.mk From 7eeee8124a6b0cda97ab03f023b24f006bfa88bf Mon Sep 17 00:00:00 2001 From: Adrian Schmutzler Date: Wed, 21 Aug 2019 15:56:50 +0200 Subject: [PATCH 18/35] babeld: Improve Makefile formatting This applies some style improvements to make this ready for migration to openwrt/packages. Signed-off-by: Adrian Schmutzler --- babeld/Makefile | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/babeld/Makefile b/babeld/Makefile index 972862c..8e7f589 100644 --- a/babeld/Makefile +++ b/babeld/Makefile @@ -14,7 +14,11 @@ PKG_RELEASE:=1 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_SOURCE_URL:=https://www.irif.fr/~jch/software/files/ PKG_HASH:=202d99c275604507c6ce133710522f1ddfb62cb671c26f1ac2d3ab44af3d5bc4 + +PKG_MAINTAINER:=Gabriel Kerneis , \ + Baptiste Jonglez PKG_LICENSE:=MIT +PKG_LICENSE_FILES:=LICENSE include $(INCLUDE_DIR)/package.mk @@ -24,19 +28,17 @@ define Package/babeld SUBMENU:=Routing and Redirection TITLE:=A loop-free distance-vector routing protocol URL:=https://www.irif.fr/~jch/software/babel/ - MAINTAINER:=Gabriel Kerneis , \ - Baptiste Jonglez DEPENDS:=@IPV6 endef define Package/babeld/description - Babel is a loop-avoiding distance-vector routing protocol roughly based - on DSDV and AODV, but with provisions for link cost estimation and - redistribution of routes from other routing protocols. - While it is optimised for wireless mesh networks, Babel will also work - efficiently on wired networks. It will generate between 1.2 and 2.4 times - the amount of routing traffic that RIPng would generate, while - never counting to infinity. + Babel is a loop-avoiding distance-vector routing protocol roughly based + on DSDV and AODV, but with provisions for link cost estimation and + redistribution of routes from other routing protocols. + While it is optimised for wireless mesh networks, Babel will also work + efficiently on wired networks. It will generate between 1.2 and 2.4 times + the amount of routing traffic that RIPng would generate, while + never counting to infinity. endef define Package/babeld/conffiles From 4d62e08852434b08bd27cbdea035de3b0e931819 Mon Sep 17 00:00:00 2001 From: Adrian Schmutzler Date: Wed, 21 Aug 2019 16:09:18 +0200 Subject: [PATCH 19/35] babeld: Update to version 1.9.1 20 August 2019: babeld-1.9.1 * Fixed a crash that could happen when unicast and RTT estimation are both enabled on an interface. Thanks to Dave Taht. * Fixed compilation under BSD. Thanks to Dave Taht. 4 August 2019: babeld-1.9.0 * Reworked buffering of unicast packets to use a per-neighbour buffer rather than a single buffer per interface. This makes unicast as efficient as multicast, at the cost of slightly higher memory usage. * Added option "unicast" that allows sending most TLVs over unicast. This is necessary for the DTLS extension. * Implemented parsing of unicast Hellos. This makes it possible to interoperate with neighbours that only speak unicast (e.g. over some kinds of tunnels that only do unicast). * Implemented sending of unscheduled unicast Hellos. This makes the RTT extension work over unicast too. * Reworked the xroute data structures to use binary search and linear-time comparison. * Don't attempt to modify the rp_filter sysctl if it already has the desired value; this makes it possible to run babeld in an unpriviledged container. Thanks to Christof Schulze. * Reinstated logging of late hellos. Thanks to Dave Taht. * Don't send wildcard requests or Hellos to newish nodes. This makes acquisition of new neighbours slower, but drastically reduces noise at startup. Thanks to Teco Boot. * Remove an arbitrary limit on the number of interfaces. Thanks to Christof Schulze. * Removed class E from martian filter. Thanks to Dave Taht. * Added the ability to set the preferred source address in install filters. Thanks to Killian Lufau. * Fixed a number of read-only buffer overflows. Thanks to Leo Stefanesco. Signed-off-by: Adrian Schmutzler --- babeld/Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/babeld/Makefile b/babeld/Makefile index 8e7f589..d419e04 100644 --- a/babeld/Makefile +++ b/babeld/Makefile @@ -8,12 +8,12 @@ include $(TOPDIR)/rules.mk PKG_NAME:=babeld -PKG_VERSION:=1.8.5 +PKG_VERSION:=1.9.1 PKG_RELEASE:=1 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_SOURCE_URL:=https://www.irif.fr/~jch/software/files/ -PKG_HASH:=202d99c275604507c6ce133710522f1ddfb62cb671c26f1ac2d3ab44af3d5bc4 +PKG_HASH:=1e1b3c01dd929177bc8d027aff1494da75e1e567e1f60df3bb45a78d5f1ca0b4 PKG_MAINTAINER:=Gabriel Kerneis , \ Baptiste Jonglez From 06f821adc14c2c85ddf2011631729e08a01e9581 Mon Sep 17 00:00:00 2001 From: Baptiste Jonglez Date: Mon, 26 Aug 2019 18:12:50 +0200 Subject: [PATCH 20/35] babeld: Update description in Makefile and fix license path Signed-off-by: Baptiste Jonglez --- babeld/Makefile | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/babeld/Makefile b/babeld/Makefile index d419e04..022d0b8 100644 --- a/babeld/Makefile +++ b/babeld/Makefile @@ -18,7 +18,7 @@ PKG_HASH:=1e1b3c01dd929177bc8d027aff1494da75e1e567e1f60df3bb45a78d5f1ca0b4 PKG_MAINTAINER:=Gabriel Kerneis , \ Baptiste Jonglez PKG_LICENSE:=MIT -PKG_LICENSE_FILES:=LICENSE +PKG_LICENSE_FILES:=LICENCE include $(INCLUDE_DIR)/package.mk @@ -26,19 +26,17 @@ define Package/babeld SECTION:=net CATEGORY:=Network SUBMENU:=Routing and Redirection - TITLE:=A loop-free distance-vector routing protocol + TITLE:=A loop-avoiding distance-vector routing protocol URL:=https://www.irif.fr/~jch/software/babel/ DEPENDS:=@IPV6 endef define Package/babeld/description - Babel is a loop-avoiding distance-vector routing protocol roughly based - on DSDV and AODV, but with provisions for link cost estimation and - redistribution of routes from other routing protocols. - While it is optimised for wireless mesh networks, Babel will also work - efficiently on wired networks. It will generate between 1.2 and 2.4 times - the amount of routing traffic that RIPng would generate, while - never counting to infinity. + Babel is a loop-avoiding distance-vector routing protocol for IPv6 and IPv4 + with fast convergence properties. It is based on the ideas in DSDV, AODV and + Cisco's EIGRP, but is designed to work well not only in wired networks but + also in wireless mesh networks, and has been extended with support for + overlay networks. Babel is in the process of becoming an IETF Standard. endef define Package/babeld/conffiles From 3e3d16338dbb02753e3df35b4e34d03a139e59ff Mon Sep 17 00:00:00 2001 From: Baptiste Jonglez Date: Mon, 26 Aug 2019 18:25:32 +0200 Subject: [PATCH 21/35] babeld: Update example configuration file More example filters are provided, and new options such as "type" or "pref_src" are given as example. Signed-off-by: Baptiste Jonglez --- babeld/files/babeld.config | 49 +++++++++++++++++++++++++++++--------- 1 file changed, 38 insertions(+), 11 deletions(-) diff --git a/babeld/files/babeld.config b/babeld/files/babeld.config index 0073f73..a02f202 100644 --- a/babeld/files/babeld.config +++ b/babeld/files/babeld.config @@ -1,5 +1,7 @@ package babeld +# Detailed documentation: https://openwrt.org/docs/guide-user/services/babeld + # Babeld reads options from the following files (the last one takes precedence # if an option is defined in several places): # - the file defined by the option conf_file (default: /etc/babeld.conf), @@ -39,7 +41,10 @@ config interface option 'ignore' 'true' ## Physical interface name option 'ifname' 'tun-example' - # option 'max_rtt_penalty' '90' + ## Specify the type of interface: tunnels use the RTT-based metric. + option 'type' 'tunnel' + ## Other options that can be overriden. + # option 'max_rtt_penalty' '96' # A config interface without "option ifname" will set default options # for all interfaces. Interface-specific configuration always overrides @@ -49,27 +54,49 @@ config interface # option 'update_interval' '30' -# A filter consists of a type ('in', 'out' or 'redistribute'), an action -# ('allow', 'deny' or 'metric xxx') and a set of selectors ('ip', 'eq', -# etc.). See babeld man page ("Filtering rules") for more details. -# Here is a sample filter wich redistributes the default route if its -# protocol number is "boot", e.g. when it installed by dhcp. It is -# disabled by default. +# A filter consists of a type ('in', 'out', 'redistribute' or 'install'), +# a set of selectors ('ip', 'eq', etc.) and a set of actions to perform +# ('allow', 'deny', 'metric xxx', 'src-prefix xxx', 'table xxx', 'pref-src xxx'). +# See babeld man page ("Filtering rules") for more details. + +# Below is a sample filter that redistributes the default route if its +# protocol number is "boot", e.g. when it is installed by dhcp (see +# /etc/iproute2/rt_protos). This filter is disabled thanks to the 'ignore' +# setting. config filter option 'ignore' 'true' - # Type + # Type of filter option 'type' 'redistribute' # Selectors: ip, eq, le, ge, src_ip, src_eq, src_le, src_ge, neigh, id, # proto, local, if. option 'ip' '0.0.0.0/0' option 'eq' '0' option 'proto' '3' - # Action (one of: allow, deny, metric XXX, src-prefix XXX). + # Action, which can be any of: allow, deny, metric , src-prefix , + # table , pref-src . + # The action defaults to "allow" if not specified. Here, we specify a higher + # redistribution metric than the default (0). option 'action' 'metric 128' -# Notice that the 'local' selector is a boolean. +# Another example filter: don't redistribute local addresses in a certain IP prefix. +# By default, babeld redistributes *all* local addresses. config filter option 'ignore' 'true' option 'type' 'redistribute' + # Only apply to routes/addresses within this prefix. + option 'ip' '198.51.100.0/24' + # Notice that the 'local' selector is a boolean. option 'local' 'true' - # No action means "allow" + # Don't redistribute. + option 'action' 'deny' + +# Example install filter, to change or filter routes before they are inserted +# into the kernel. +config filter + option 'ignore' 'true' + option 'type' 'install' + # Optional: only apply to routes within 2001:db8:cafe::/48 + option 'ip' '2001:db8:cafe::/48' + # We specify the kernel routing table and the preferred source address to use for these routes. + # "Allow" is implicit. + option 'action' 'table 200 pref-src 2001:db8:ba:be1::42' From 76a5139334109b527726feacd603f1b29eaf490c Mon Sep 17 00:00:00 2001 From: Paul Spooren Date: Mon, 26 Aug 2019 22:03:09 -1000 Subject: [PATCH 22/35] bmx7: update to 7.1.1 Also clean up the Makefile Signed-off-by: Paul Spooren --- bmx7/Makefile | 56 ++++++++++---------------------------- bmx7/files/etc/config/bmx7 | 16 ++--------- bmx7/files/etc/init.d/bmx7 | 2 +- 3 files changed, 19 insertions(+), 55 deletions(-) diff --git a/bmx7/Makefile b/bmx7/Makefile index 7eca2b2..aa73ff2 100644 --- a/bmx7/Makefile +++ b/bmx7/Makefile @@ -1,44 +1,20 @@ -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License along -# with this program; if not, write to the Free Software Foundation, Inc., -# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -# -# The full GNU General Public License is included in this distribution in -# the file called "COPYING". -# -# Contibutors: -# Axel Neumann, Simó Albert i Beltran, Pau Escrich -# - - include $(TOPDIR)/rules.mk PKG_NAME:=bmx7 - -PKG_SOURCE_PROTO:=git - -PKG_SOURCE_URL:=https://github.com/bmx-routing/bmx7.git - -PKG_REV:=cc245a22e54b5e110384485f18d9b805c91d8b71 -PKG_MIRROR_HASH:=378228450b7790bb07b1d478f123e9196c1040d9f55ec42e83090249574a3d6b -PKG_VERSION:=r2019030802 +PKG_VERSION:=7.1.1 PKG_RELEASE:=1 -PKG_LICENSE:=GPL-2.0 -PKG_SOURCE_VERSION:=$(PKG_REV) -PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION) -PKG_SOURCE:=$(PKG_SOURCE_SUBDIR).tar.gz -PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_SOURCE_SUBDIR) +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=https://codeload.github.com/bmx-routing/bmx7/tar.gz/v$(PKG_VERSION)? +PKG_HASH:=5f88df1c95e5cb842a6016bb1604e3e7f6097c63c5c9916edc3c84e96d4f5f65 +PKG_UNPACK:=$(TAR) -C $(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION) \ + --strip-components=2 -xzf $(DL_DIR)/$(PKG_SOURCE) $(PKG_NAME)-$(PKG_VERSION)/src + +PKG_MAINTAINER:=Axel Neumann +PKG_LICENSE:=GPL-2.0-or-later +PKG_LICENSE_FILES:=LICENSE + +PKG_BUILD_PARALLEL:=1 include $(INCLUDE_DIR)/package.mk @@ -58,13 +34,12 @@ define Package/bmx7/Default CATEGORY:=Network SUBMENU:=Routing and Redirection TITLE:=BMX7 layer 3 routing daemon - URL:=http://github.com/bmx-routing/bmx7 - MAINTAINER:=Axel Neumann + URL:=https://github.com/bmx-routing/bmx7 DEPENDS:=+zlib +libmbedtls +libiwinfo endef define Package/bmx7/description -BMX7 routing daemon supporting securely-entrusted IPv6 (and IPv4in6) routing + BMX7 routing daemon supporting securely-entrusted IPv6 (and IPv4in6) routing endef define Package/bmx7 @@ -81,7 +56,7 @@ endef define Package/bmx7-iwinfo $(call Package/bmx7/Default) DEPENDS:=bmx7 +libiwinfo - TITLE:=link characteristics plugin based on libiwinfo (recommended!) + TITLE:=link characteristics plugin via libiwinfo (recommended!) endef define Package/bmx7-topology @@ -180,7 +155,6 @@ define Package/bmx7-table/install $(INSTALL_BIN) $(PKG_BUILD_DIR)/lib/bmx7_table/bmx7_table.so $(1)/usr/lib/bmx7_table.so endef - $(eval $(call BuildPackage,bmx7)) $(eval $(call BuildPackage,bmx7-uci-config)) $(eval $(call BuildPackage,bmx7-iwinfo)) diff --git a/bmx7/files/etc/config/bmx7 b/bmx7/files/etc/config/bmx7 index b92f525..648c913 100644 --- a/bmx7/files/etc/config/bmx7 +++ b/bmx7/files/etc/config/bmx7 @@ -1,11 +1,10 @@ - # for more information: -# http://bmx6.net/projects/bmx6/wiki +# https://github.com/bmx-routing/bmx7/ # options execute: bmx7 --help config 'bmx7' 'general' -# option 'runtimeDir' '/var/run/bmx7' -# option 'trustedNodesDir' '/etc/bmx7/trustedNodes' +# option 'runtimeDir' '/var/run/bmx7' +# option 'trustedNodesDir' '/etc/bmx7/trustedNodes' #config 'plugin' # option 'plugin' 'bmx7_config.so' @@ -19,22 +18,18 @@ config 'bmx7' 'general' #config 'plugin' # option 'plugin' 'bmx7_iwinfo.so' - config 'dev' 'mesh_1' option 'dev' 'br-lan' config 'dev' 'mesh_2' option 'dev' 'wlan0' - - #config 'plugin' # option 'plugin' 'bmx7_tun.so' #config 'plugin' # option 'plugin' 'bmx7_table.so' - #config 'tunDev' default # option 'tunDev' 'default' # option 'tun6Address' '2012:0:0:6666::1/64' @@ -50,8 +45,3 @@ config 'dev' 'mesh_2' # option 'tunOut' 'ip4' # option 'network' '10.0.0.0/9' # option 'minPrefixLen' '27' - - - - - diff --git a/bmx7/files/etc/init.d/bmx7 b/bmx7/files/etc/init.d/bmx7 index 74f8966..2fb3a55 100755 --- a/bmx7/files/etc/init.d/bmx7 +++ b/bmx7/files/etc/init.d/bmx7 @@ -6,7 +6,7 @@ BIN=/usr/sbin/bmx7 CONF=/etc/config/bmx7 start_service() { - cd /root/ + cd /root/ || return while pgrep -f mac80211.sh ; do sleep 1; done procd_open_instance "bmx7" From 2fd125f516ab32902513ddfa625e28fbc8914be7 Mon Sep 17 00:00:00 2001 From: Paul Spooren Date: Fri, 6 Sep 2019 11:15:04 -1000 Subject: [PATCH 23/35] bmx7: fixup Makefile The extra MAKE_ARGS were no longer taken into account resulting in erros. Also more path fixes and some longline splitting. Signed-off-by: Paul Spooren --- bmx7/Makefile | 70 +++++++++++++++++++++++++-------------------------- 1 file changed, 34 insertions(+), 36 deletions(-) diff --git a/bmx7/Makefile b/bmx7/Makefile index aa73ff2..62cc16b 100644 --- a/bmx7/Makefile +++ b/bmx7/Makefile @@ -2,13 +2,11 @@ include $(TOPDIR)/rules.mk PKG_NAME:=bmx7 PKG_VERSION:=7.1.1 -PKG_RELEASE:=1 +PKG_RELEASE:=2 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_SOURCE_URL:=https://codeload.github.com/bmx-routing/bmx7/tar.gz/v$(PKG_VERSION)? PKG_HASH:=5f88df1c95e5cb842a6016bb1604e3e7f6097c63c5c9916edc3c84e96d4f5f65 -PKG_UNPACK:=$(TAR) -C $(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION) \ - --strip-components=2 -xzf $(DL_DIR)/$(PKG_SOURCE) $(PKG_NAME)-$(PKG_VERSION)/src PKG_MAINTAINER:=Axel Neumann PKG_LICENSE:=GPL-2.0-or-later @@ -20,14 +18,22 @@ include $(INCLUDE_DIR)/package.mk TARGET_CFLAGS += $(FPIC) -MAKE_ARGS += EXTRA_CFLAGS="$(TARGET_CFLAGS) -I. -I$(STAGING_DIR)/usr/include -DCRYPTLIB=MBEDTLS_2_8_0 -DCORE_LIMIT=20000 -DTRAFFIC_DUMP -DNO_TRACE_FUNCTION_CALLS -DBMX7_LIB_IWINFO" +MAKE_ARGS += EXTRA_CFLAGS="$(TARGET_CFLAGS) \ + -I. \ + -I$(STAGING_DIR)/usr/include \ + -DCRYPTLIB=MBEDTLS_2_8_0 \ + -DCORE_LIMIT=20000 \ + -DTRAFFIC_DUMP \ + -DNO_TRACE_FUNCTION_CALLS \ + -DBMX7_LIB_IWINFO" \ + EXTRA_LDFLAGS="$(TARGET_LDFLAGS) \ + -L$(STAGING_DIR)/usr/lib -liwinfo" \ + GIT_REV="$(PKG_REV)" \ + CC="$(TARGET_CC)" \ + INSTALL_DIR="$(PKG_INSTALL_DIR)" \ + build_all -MAKE_ARGS += \ - EXTRA_LDFLAGS="$(TARGET_LDFLAGS) -L$(STAGING_DIR)/usr/lib -liwinfo" \ - GIT_REV="$(PKG_REV)" \ - CC="$(TARGET_CC)" \ - INSTALL_DIR="$(PKG_INSTALL_DIR)" \ - build_all +MAKE_PATH:=src define Package/bmx7/Default SECTION:=net @@ -89,30 +95,15 @@ define Package/bmx7-table TITLE:=plugin to announce routes from tables via tunnels endef -define Build/Configure - mkdir -p $(PKG_INSTALL_DIR) +define Package/bmx7/install + $(INSTALL_DIR) $(1)/usr/sbin $(1)/etc/config $(1)/etc/init.d + $(INSTALL_BIN) $(PKG_BUILD_DIR)/$(MAKE_PATH)/bmx7 $(1)/usr/sbin/bmx7 endef define Build/Compile - $(MAKE) -C $(PKG_BUILD_DIR) $(MAKE_ARGS) + $(MAKE) -C $(PKG_BUILD_DIR)/$(MAKE_PATH) $(MAKE_ARGS) endef -define Package/bmx7/install - $(INSTALL_DIR) $(1)/usr/sbin $(1)/etc/config $(1)/etc/init.d - $(INSTALL_BIN) $(PKG_BUILD_DIR)/bmx7 $(1)/usr/sbin/bmx7 -endef - -define Package/bmx7/postinst -#!/bin/sh -# # check if we are on real system -if [ -z "$${IPKG_INSTROOT}" ]; then - if [ -f /etc/sysupgrade.conf ] && ! grep bmx7 /etc/sysupgrade.conf; then - echo /etc/bmx7 >> /etc/sysupgrade.conf - fi -fi -endef - - define Package/bmx7-uci-config/conffiles /etc/config/bmx7 /etc/bmx7 @@ -120,39 +111,46 @@ endef define Package/bmx7-uci-config/install $(INSTALL_DIR) $(1)/usr/lib $(1)/etc/config $(1)/etc/init.d - $(INSTALL_BIN) $(PKG_BUILD_DIR)/lib/bmx7_uci_config/bmx7_config.so $(1)/usr/lib/bmx7_config.so + $(INSTALL_BIN) $(PKG_BUILD_DIR)/$(MAKE_PATH)/lib/bmx7_uci_config/bmx7_config.so \ + $(1)/usr/lib/bmx7_config.so $(INSTALL_BIN) ./files/etc/init.d/bmx7 $(1)/etc/init.d/bmx7 $(INSTALL_DATA) ./files/etc/config/bmx7 $(1)/etc/config/bmx7 endef define Package/bmx7-iwinfo/install $(INSTALL_DIR) $(1)/usr/lib - $(INSTALL_BIN) $(PKG_BUILD_DIR)/lib/bmx7_iwinfo/bmx7_iwinfo.so $(1)/usr/lib/bmx7_iwinfo.so + $(INSTALL_BIN) $(PKG_BUILD_DIR)/$(MAKE_PATH)/lib/bmx7_iwinfo/bmx7_iwinfo.so \ + $(1)/usr/lib/bmx7_iwinfo.so endef define Package/bmx7-topology/install $(INSTALL_DIR) $(1)/usr/lib - $(INSTALL_BIN) $(PKG_BUILD_DIR)/lib/bmx7_topology/bmx7_topology.so $(1)/usr/lib/bmx7_topology.so + $(INSTALL_BIN) $(PKG_BUILD_DIR)/$(MAKE_PATH)/lib/bmx7_topology/bmx7_topology.so \ + $(1)/usr/lib/bmx7_topology.so endef define Package/bmx7-json/install $(INSTALL_DIR) $(1)/usr/lib - $(INSTALL_BIN) $(PKG_BUILD_DIR)/lib/bmx7_json/bmx7_json.so $(1)/usr/lib/bmx7_json.so + $(INSTALL_BIN) $(PKG_BUILD_DIR)/$(MAKE_PATH)/lib/bmx7_json/bmx7_json.so \ + $(1)/usr/lib/bmx7_json.so endef define Package/bmx7-sms/install $(INSTALL_DIR) $(1)/usr/lib - $(INSTALL_BIN) $(PKG_BUILD_DIR)/lib/bmx7_sms/bmx7_sms.so $(1)/usr/lib/bmx7_sms.so + $(INSTALL_BIN) $(PKG_BUILD_DIR)/$(MAKE_PATH)/lib/bmx7_sms/bmx7_sms.so \ + $(1)/usr/lib/bmx7_sms.so endef define Package/bmx7-tun/install $(INSTALL_DIR) $(1)/usr/lib - $(INSTALL_BIN) $(PKG_BUILD_DIR)/lib/bmx7_tun/bmx7_tun.so $(1)/usr/lib/bmx7_tun.so + $(INSTALL_BIN) $(PKG_BUILD_DIR)/$(MAKE_PATH)/lib/bmx7_tun/bmx7_tun.so \ + $(1)/usr/lib/bmx7_tun.so endef define Package/bmx7-table/install $(INSTALL_DIR) $(1)/usr/lib - $(INSTALL_BIN) $(PKG_BUILD_DIR)/lib/bmx7_table/bmx7_table.so $(1)/usr/lib/bmx7_table.so + $(INSTALL_BIN) $(PKG_BUILD_DIR)/$(MAKE_PATH)/lib/bmx7_table/bmx7_table.so \ + $(1)/usr/lib/bmx7_table.so endef $(eval $(call BuildPackage,bmx7)) From def3cd50d88b514cdafb8f956b228afdd8bdef08 Mon Sep 17 00:00:00 2001 From: Rob White Date: Sat, 14 Sep 2019 21:21:11 +0100 Subject: [PATCH 24/35] nodogsplash: Release 4.2.0 (#513) Maintainer: Moritz Warning Compiled and tested on snapshot SDK mips_24kc and arm_cortex-a7_neon-vfpv4 This release adds significant functionality in the form of capturing the client User-Agent string and passing to both PreAuth and BinAuth scripts. Compatibility is maintained with previous versions. Changelog since last OpenWrt release: * BinAuth - Send User Agent string and client-ip to the binauth script [bluewavenet] * BinAuth - Update the two example BinAuth scripts showing use of passed arguments [bluewavenet] * Documentation - Update BinAuth section [bluewavenet] * PreAuth - Send User Agent string to the preauth script [bluewavenet] * PreAuth - Update the example PreAuth script showing use of passed arguments [bluewavenet] * Documentation - Update PreAuth section [bluewavenet] * BinAuth - Send redir variable to the binauth script, allow passing of custom variable payload [bluewavenet] * BinAuth - Provide two example BinAuth scripts [bluewavenet] * Documentation - Rework Binauth section plus numerous minor updates [bluewavenet] * Deprecate RedirectURL config option as it is rendered obsolete by many CPD implementations, use FAS instead [bluewavenet] * Numerous minor updates to html, css and script files [bluewavenet] * Fix bug - faskey, exit gracefully if not set and fas_secure_enabled = 2 [bluewavenet] * Fix bug - Systemd, Do not set debug level in nodogsplash.service [bluewavenet] * Fix bug - ndsctl, delete lock file if NDS is not started [bluewavenet] Signed-off-by: Rob White --- nodogsplash/Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/nodogsplash/Makefile b/nodogsplash/Makefile index e6201d3..78f4e46 100644 --- a/nodogsplash/Makefile +++ b/nodogsplash/Makefile @@ -7,12 +7,12 @@ include $(TOPDIR)/rules.mk PKG_NAME:=nodogsplash PKG_FIXUP:=autoreconf -PKG_VERSION:=4.0.2 +PKG_VERSION:=4.2.0 PKG_RELEASE:=1 PKG_SOURCE_URL:=https://codeload.github.com/nodogsplash/nodogsplash/tar.gz/v$(PKG_VERSION)? PKG_SOURCE:=nodogsplash-$(PKG_VERSION).tar.gz -PKG_HASH:=43761b3637742ad22a7f7a8900cb200c133d7ea0c78530014688c5dc7eb6d3c1 +PKG_HASH:=75f559b28a1443b2ecaa95c0cb98610372d558324c8d2f003a8ebe22185b81c0 PKG_BUILD_DIR:=$(BUILD_DIR)/nodogsplash-$(PKG_VERSION) PKG_MAINTAINER:=Moritz Warning From 97ffe0b5de2e83af43f448a7392b3dfd85a7e046 Mon Sep 17 00:00:00 2001 From: Josef Schlehofer Date: Sun, 29 Sep 2019 20:35:10 +0200 Subject: [PATCH 25/35] bird1: Update to version 1.6.8 Signed-off-by: Josef Schlehofer --- bird1/Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bird1/Makefile b/bird1/Makefile index a9c7c9e..4e7542e 100644 --- a/bird1/Makefile +++ b/bird1/Makefile @@ -7,12 +7,12 @@ include $(TOPDIR)/rules.mk PKG_NAME:=bird1 -PKG_VERSION:=1.6.7 +PKG_VERSION:=1.6.8 PKG_RELEASE:=1 PKG_SOURCE:=bird-$(PKG_VERSION).tar.gz PKG_SOURCE_URL:=ftp://bird.network.cz/pub/bird -PKG_HASH:=7eab27ff4b0117a33d20f61b161b647e1fd354b9303c4ed4d3f99260b2173dc9 +PKG_HASH:=6c61ab5d2ef59d2559a8735b8252b5a0238013b43e5fb8a96c5d9d06e7bc00b2 PKG_BUILD_DEPENDS:=ncurses readline PKG_MAINTAINER:=Álvaro Fernández Rojas PKG_BUILD_DIR:=$(BUILD_DIR)/bird-$(PKG_VERSION) From 534121e1fe2f1ff069c657730fe4afc565ebd6f3 Mon Sep 17 00:00:00 2001 From: Josef Schlehofer Date: Sun, 29 Sep 2019 20:35:35 +0200 Subject: [PATCH 26/35] bird2: Update to version 2.0.6 Signed-off-by: Josef Schlehofer --- bird2/Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bird2/Makefile b/bird2/Makefile index 045213d..a01025a 100644 --- a/bird2/Makefile +++ b/bird2/Makefile @@ -7,12 +7,12 @@ include $(TOPDIR)/rules.mk PKG_NAME:=bird2 -PKG_VERSION:=2.0.5 +PKG_VERSION:=2.0.6 PKG_RELEASE:=1 PKG_SOURCE:=bird-$(PKG_VERSION).tar.gz PKG_SOURCE_URL:=ftp://bird.network.cz/pub/bird -PKG_HASH:=4e4b736fd26579823a728be6a7746b3f525206e3c9a4a21fccb302cffd3029d3 +PKG_HASH:=90934cce6ae90039ab1e58ade223935f9221a7e5eac05df6fb53045b77bfd3aa PKG_BUILD_DEPENDS:=ncurses readline PKG_MAINTAINER:=Toke Høiland-Jørgensen PKG_BUILD_DIR:=$(BUILD_DIR)/bird-$(PKG_VERSION) From 08ba5e50aabed46ae05f74fee028773b7eea58c3 Mon Sep 17 00:00:00 2001 From: Rob White Date: Tue, 8 Oct 2019 21:10:04 +0100 Subject: [PATCH 27/35] nodogsplash: Version 4.3.0 (#515) Maintainer: Moritz Warning Compiled and tested on snapshot SDK mips_24kc and arm_cortex-a7_neon-vfpv4 This release has major new functionality in the form of token hashing, (extension to fas_secure level 1) mitigating the problems with remote FAS where access to the local ndsctl would be otherwise required. Although not as flexible as level 2, this extension has much smaller memory and storage requirements so is ideal for implementation on legacy hardware. There are also numerous enhancements, updates and fixes. All changes are compatible with the previous release. Latest changelog: * Create switch option to select preinstalled templated splash or preauth login [bluewavenet] * Limit PreAuth and BinAuth log size in example scripts [bluewavenet] * Reduce memory requirements and autoselect logfile location [bluewavenet] * Create fas-hid example script [bluewavenet] * Update FAS, PreAuth and BinAuth example scripts [bluewavenet] * Hash client token (hid) for remote FAS enabling secure FAS for legacy/low-flash/low-ram hardware [bluewavenet] * Fix NDS Uptime if NTP client is enabled [bluewavenet] * Documentation updates for this release [bluewavenet] * Fix numerous compiler warnings [mwarning] * Fix openwrt fw_mark option type [mwarning] Signed-off-by: Rob White rob@blue-wave.net --- nodogsplash/Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/nodogsplash/Makefile b/nodogsplash/Makefile index 78f4e46..367959f 100644 --- a/nodogsplash/Makefile +++ b/nodogsplash/Makefile @@ -7,12 +7,12 @@ include $(TOPDIR)/rules.mk PKG_NAME:=nodogsplash PKG_FIXUP:=autoreconf -PKG_VERSION:=4.2.0 +PKG_VERSION:=4.3.0 PKG_RELEASE:=1 PKG_SOURCE_URL:=https://codeload.github.com/nodogsplash/nodogsplash/tar.gz/v$(PKG_VERSION)? PKG_SOURCE:=nodogsplash-$(PKG_VERSION).tar.gz -PKG_HASH:=75f559b28a1443b2ecaa95c0cb98610372d558324c8d2f003a8ebe22185b81c0 +PKG_HASH:=9a3fa68f154627169832aa986ba32ca6a25f345d7e81737835b0044764cd670b PKG_BUILD_DIR:=$(BUILD_DIR)/nodogsplash-$(PKG_VERSION) PKG_MAINTAINER:=Moritz Warning From face529e095e27a62eb0d34fc414e3602ecb0689 Mon Sep 17 00:00:00 2001 From: Rob White Date: Sun, 20 Oct 2019 13:32:24 +0100 Subject: [PATCH 28/35] nodogsplash: Version 4.3.3 release (#517) Maintainer: Moritz Warning Compiled and tested on snapshot SDK mips_24kc and arm_cortex-a7_neon-vfpv4 This version fixes two issues that can cause NDS to lock or crash, one, a coding error that leads to memory corruption and two, deadlocks in iptables and ndsctl. Both of these issues occur at high loads and/or at high CPD detection rates. In addition, in some circumstances, a deauthenticated client running a vpn may have suffered from querystring truncation causing vpn failure. Some minor updates are also included. Extract from changelog: * Fix Memory corruption at high loads [bluewavenet] * Prevent iptables and ndsctl deadlocks [lynxis] * Prevent query string truncation for deauthenticated client when client is using some types of vpn software [bluewavenet] * Add debuglevel logging in the case of a firewall restart in OpenWrt [bluewavenet] * Return error 403(forbidden) when client attempts to use a forbidden http method [bluewavenet] Signed-off-by: Rob White --- nodogsplash/Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/nodogsplash/Makefile b/nodogsplash/Makefile index 367959f..4441121 100644 --- a/nodogsplash/Makefile +++ b/nodogsplash/Makefile @@ -7,12 +7,12 @@ include $(TOPDIR)/rules.mk PKG_NAME:=nodogsplash PKG_FIXUP:=autoreconf -PKG_VERSION:=4.3.0 +PKG_VERSION:=4.3.3 PKG_RELEASE:=1 PKG_SOURCE_URL:=https://codeload.github.com/nodogsplash/nodogsplash/tar.gz/v$(PKG_VERSION)? PKG_SOURCE:=nodogsplash-$(PKG_VERSION).tar.gz -PKG_HASH:=9a3fa68f154627169832aa986ba32ca6a25f345d7e81737835b0044764cd670b +PKG_HASH:=dac942123dc8d3e9295c7f1c18974245fdaffdf694ef03ee0a21187b6d11b31e PKG_BUILD_DIR:=$(BUILD_DIR)/nodogsplash-$(PKG_VERSION) PKG_MAINTAINER:=Moritz Warning From 82191689948a4b7aa98ba82349d649d2d66d4b47 Mon Sep 17 00:00:00 2001 From: Sven Eckelmann Date: Mon, 2 Sep 2019 15:50:22 +0200 Subject: [PATCH 29/35] alfred: Extend PKG_LICENSE* information Signed-off-by: Sven Eckelmann --- alfred/Makefile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/alfred/Makefile b/alfred/Makefile index c135508..ef6d810 100644 --- a/alfred/Makefile +++ b/alfred/Makefile @@ -14,7 +14,8 @@ PKG_HASH:=a4c37920de497701680abb55c49cdcd11e4e7135e0e7e79259c35492a3df4766 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_SOURCE_URL:=https://downloads.open-mesh.org/batman/releases/batman-adv-$(PKG_VERSION) -PKG_LICENSE:=GPL-2.0 +PKG_LICENSE:=GPL-2.0-only MIT +PKG_LICENSE_FILES:=LICENSES/preferred/GPL-2.0 LICENSES/preferred/MIT include $(INCLUDE_DIR)/package.mk From 23ecedee926e9bbf69ef59d339b9b4eef0eb353f Mon Sep 17 00:00:00 2001 From: Sven Eckelmann Date: Mon, 2 Sep 2019 15:50:22 +0200 Subject: [PATCH 30/35] batctl: Extend PKG_LICENSE* information Signed-off-by: Sven Eckelmann --- batctl/Makefile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/batctl/Makefile b/batctl/Makefile index 168b17f..5081cf9 100644 --- a/batctl/Makefile +++ b/batctl/Makefile @@ -15,7 +15,8 @@ PKG_HASH:=2bd93fa14925a8dc63a67e64266c8ccd2fa3ac44b10253d93e6f8a630350070c PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_SOURCE_URL:=https://downloads.open-mesh.org/batman/releases/batman-adv-$(PKG_VERSION) -PKG_LICENSE:=GPL-2.0 +PKG_LICENSE:=GPL-2.0-only ISC MIT +PKG_LICENSE_FILES:=LICENSES/preferred/GPL-2.0 LICENSES/preferred/MIT LICENSES/deprecated/ISC PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSION) From 366c9e0078661ac3cd17c6029c55113f9c903e09 Mon Sep 17 00:00:00 2001 From: Sven Eckelmann Date: Mon, 2 Sep 2019 15:50:22 +0200 Subject: [PATCH 31/35] batman-adv: Extend PKG_LICENSE* information Signed-off-by: Sven Eckelmann --- batman-adv/Makefile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/batman-adv/Makefile b/batman-adv/Makefile index dd4e9b1..84d1e7a 100644 --- a/batman-adv/Makefile +++ b/batman-adv/Makefile @@ -15,7 +15,8 @@ PKG_HASH:=3454dc8bd6cb264e2decda1b99ef3f837535ed33802abc6c39551c181d3984ce PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_SOURCE_URL:=https://downloads.open-mesh.org/batman/releases/batman-adv-$(PKG_VERSION) -PKG_LICENSE:=GPL-2.0 +PKG_LICENSE:=GPL-2.0-only MIT +PKG_LICENSE_FILES:=LICENSES/preferred/GPL-2.0 LICENSES/preferred/MIT PKG_EXTMOD_SUBDIRS=net/batman-adv STAMP_CONFIGURED_DEPENDS := $(STAGING_DIR)/usr/include/mac80211-backport/backport/autoconf.h From bb8a0621c6a682e136cb424804e7fbb3d4a238e4 Mon Sep 17 00:00:00 2001 From: Sven Eckelmann Date: Fri, 25 Oct 2019 23:29:06 +0200 Subject: [PATCH 32/35] alfred: upgrade package to latest release 2019.4 * fix build with musl Signed-off-by: Sven Eckelmann --- alfred/Makefile | 6 +++--- ...is-Add-missing-include-for-ifinfomsg.patch | 21 ------------------- 2 files changed, 3 insertions(+), 24 deletions(-) delete mode 100644 alfred/patches/0001-alfred-vis-Add-missing-include-for-ifinfomsg.patch diff --git a/alfred/Makefile b/alfred/Makefile index ef6d810..0786b2b 100644 --- a/alfred/Makefile +++ b/alfred/Makefile @@ -8,9 +8,9 @@ include $(TOPDIR)/rules.mk PKG_NAME:=alfred -PKG_VERSION:=2019.3 -PKG_RELEASE:=2 -PKG_HASH:=a4c37920de497701680abb55c49cdcd11e4e7135e0e7e79259c35492a3df4766 +PKG_VERSION:=2019.4 +PKG_RELEASE:=0 +PKG_HASH:=b5525b396595004654335ac1ebf9de1aab90263e66d5bcc43fc8a708b56a18ea PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_SOURCE_URL:=https://downloads.open-mesh.org/batman/releases/batman-adv-$(PKG_VERSION) diff --git a/alfred/patches/0001-alfred-vis-Add-missing-include-for-ifinfomsg.patch b/alfred/patches/0001-alfred-vis-Add-missing-include-for-ifinfomsg.patch deleted file mode 100644 index 3a982b8..0000000 --- a/alfred/patches/0001-alfred-vis-Add-missing-include-for-ifinfomsg.patch +++ /dev/null @@ -1,21 +0,0 @@ -From: Sven Eckelmann -Date: Thu, 1 Aug 2019 15:54:32 +0200 -Subject: alfred: vis: Add missing include for ifinfomsg - -Fixes: 0fc6e6674428 ("alfred: vis: Retrieve hardif status via generic netlink") -Signed-off-by: Sven Eckelmann - -Origin: upstream, https://git.open-mesh.org/alfred.git/commit/ce26453bd72829ac9561acd8d3a06a3937341687 - -diff --git a/vis/vis.c b/vis/vis.c -index 947456343125458845f26dc38b53f18d6fd42d75..8df3056612d5da3678603a6e6430923c0c86cde0 100644 ---- a/vis/vis.c -+++ b/vis/vis.c -@@ -10,6 +10,7 @@ - #include - #include - #include -+#include - #include - #include - #include From ca06c3fc17eb3db6bd8021a8b44991693d0db05e Mon Sep 17 00:00:00 2001 From: Sven Eckelmann Date: Fri, 25 Oct 2019 23:29:37 +0200 Subject: [PATCH 33/35] batctl: upgrade package to latest release 2019.4 * fix deprecation warning for option '-m' Signed-off-by: Sven Eckelmann --- batctl/Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/batctl/Makefile b/batctl/Makefile index 5081cf9..6aebebb 100644 --- a/batctl/Makefile +++ b/batctl/Makefile @@ -9,9 +9,9 @@ include $(TOPDIR)/rules.mk PKG_NAME:=batctl -PKG_VERSION:=2019.3 +PKG_VERSION:=2019.4 PKG_RELEASE:=0 -PKG_HASH:=2bd93fa14925a8dc63a67e64266c8ccd2fa3ac44b10253d93e6f8a630350070c +PKG_HASH:=a3564eb9727335352dc0cfa2f2b29474c2c837384689ac5fcb387784a56e7685 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_SOURCE_URL:=https://downloads.open-mesh.org/batman/releases/batman-adv-$(PKG_VERSION) From 87d0884fa5141f2cb9ce91f5b69f72b1b39f39e9 Mon Sep 17 00:00:00 2001 From: Sven Eckelmann Date: Fri, 25 Oct 2019 23:29:49 +0200 Subject: [PATCH 34/35] batman-adv: upgrade package to latest release 2019.4 * support latest kernels (3.16 - 5.4) * coding style cleanups and refactoring * implement aggregation of OGM2 packets * bugs squashed: - fix length validation in netlink messages - fix out of buffer read when parsing aggregated packets - avoid race condition in OGM(2) packet modification and submission Signed-off-by: Sven Eckelmann --- batman-adv/Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/batman-adv/Makefile b/batman-adv/Makefile index 84d1e7a..c59ebce 100644 --- a/batman-adv/Makefile +++ b/batman-adv/Makefile @@ -9,9 +9,9 @@ include $(TOPDIR)/rules.mk PKG_NAME:=batman-adv -PKG_VERSION:=2019.3 +PKG_VERSION:=2019.4 PKG_RELEASE:=0 -PKG_HASH:=3454dc8bd6cb264e2decda1b99ef3f837535ed33802abc6c39551c181d3984ce +PKG_HASH:=de07be3f46dddadc3f9608ca11814ecae534c65ccd7cbfeb9762f8e90a17f660 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_SOURCE_URL:=https://downloads.open-mesh.org/batman/releases/batman-adv-$(PKG_VERSION) From f75b19d42fa43502b1f247e233016f362a8e406d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michal=20Hru=C5=A1eck=C3=BD?= Date: Sun, 3 Nov 2019 18:34:43 +0100 Subject: [PATCH 35/35] cjdns: Update to the latest version (#523) Signed-off-by: Michal Hrusecky --- cjdns/Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cjdns/Makefile b/cjdns/Makefile index e957b55..267c4af 100644 --- a/cjdns/Makefile +++ b/cjdns/Makefile @@ -17,12 +17,12 @@ include $(TOPDIR)/rules.mk PKG_NAME:=cjdns -PKG_VERSION:=20.2 +PKG_VERSION:=20.4 PKG_RELEASE:=1 PKG_SOURCE_URL:=https://github.com/cjdelisle/cjdns.git PKG_SOURCE_PROTO:=git -PKG_SOURCE_VERSION:=77259a49e5bc7ca7bc6dca5bd423e02be563bdc5 +PKG_SOURCE_VERSION:=45cdd8b3eebb18b6239feeef3b787e40d773edfb PKG_LICENSE:=GPL-3.0 PKG_SOURCE:=$(PKG_NAME)-$(PKG_SOURCE_VERSION).tar.bz2 PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_SOURCE_VERSION)