Merge pull request #5224 from diizzyy/patch-109
authorJo-Philipp Wich <jo@mein.io>
Wed, 6 Dec 2017 11:49:20 +0000 (12:49 +0100)
committerGitHub <noreply@github.com>
Wed, 6 Dec 2017 11:49:20 +0000 (12:49 +0100)
libs/libgd: Update to 2.2.5

25 files changed:
libs/expat/Makefile
net/openconnect/README
net/pixiewps/Makefile [new file with mode: 0644]
net/reaver/Makefile
net/reaver/patches/0001-wpscrack-big-endian-fixes.patch [deleted file]
net/reaver/patches/0002-Use-the-current-directory-for-storing-and-loading-se.patch [deleted file]
net/reaver/patches/0003-wash-wpsmon-use-less-useless-spaces-in-output-to-fit.patch [deleted file]
net/reaver/patches/0004-Fixed-probe-request-bug-in-wash.patch [deleted file]
net/reaver/patches/0100-Include-sys-types.h-for-definition-of-u_char.patch [deleted file]
net/reaver/patches/0101-pcap-use-65536-as-snaplen.patch [deleted file]
net/reaver/patches/0102-wps-cflags.patch [deleted file]
utils/collectd/Makefile
utils/collectd/patches/100-rrdtool-add-rrasingle-option.patch
utils/collectd/patches/300-delay-first-read-cycle.patch
utils/collectd/patches/400-fix-olsrd-get-all.patch
utils/collectd/patches/500-fix-uptime-reading.patch [deleted file]
utils/collectd/patches/600-fix-libmodbus-detection.patch
utils/collectd/patches/700-disable-sys-capability-check.patch
utils/collectd/patches/900-add-iwinfo-plugin.patch
utils/hd-idle/Makefile
utils/rpcd-mod-lxc/files/lxc.c
utils/sysstat/Makefile
utils/sysstat/patches/110-remove-sccsid.patch [new file with mode: 0644]
utils/vim/Makefile
utils/vim/patches/001-support-defining-compilation-date-in-SOURCE_DATE_EPOCH.patch [new file with mode: 0644]

index f57c5a429616c84c4d804a7eadd34d16495644dc..9ac94b26230de9659e2bc6c53bb06b2d3cc329be 100644 (file)
@@ -6,12 +6,12 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=expat
-PKG_VERSION:=2.2.4
+PKG_VERSION:=2.2.5
 PKG_RELEASE:=1
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
 PKG_SOURCE_URL:=@SF/expat
-PKG_HASH:=03ad85db965f8ab2d27328abcf0bc5571af6ec0a414874b2066ee3fdd372019e
+PKG_HASH:=d9dc32efba7e74f788fcc4f212a43216fc37cf5f23f4c2339664d473353aedf6
 PKG_MAINTAINER:=Steven Barth <cyrus@openwrt.org>, \
                Ted Hess <thess@kitschensync.net>
 
index 050c75c026d0b07df2b25ace59e6c566056cf5d0..019058ce505e3f304cd4d4399d9285eb1e474916 100644 (file)
@@ -3,15 +3,15 @@ The openconnect client expects to be configured using the uci interface.
 To setup a VPN connection, add the following to /etc/config/network:
 
 config interface 'MYVPN'
-        option proto 'openconnect'
-        option interface 'wan'
-        option server 'vpn.example.com'
-        option port '4443'
-        option username 'test'
-        option password 'secret'
-        option serverhash 'AE7FF6A0426F0A0CD0A02EB9EC3C5066FAEB0B25'
+       option proto 'openconnect'
+       option interface 'wan'
+       option server 'vpn.example.com'
+       option port '4443'
+       option username 'test'
+       option password 'secret'
+       option serverhash 'AE7FF6A0426F0A0CD0A02EB9EC3C5066FAEB0B25'
        option defaultroute '0'
-        option authgroup 'DEFAULT'
+       option authgroup 'DEFAULT'
 
        # For second factor auth:
 
@@ -19,12 +19,12 @@ config interface 'MYVPN'
        #option password2 'my-fixed-2fa-password'
 
        # RSA tokens, must be built with stoken support
-        #option token_mode 'rsa'
-        #option token_secret 'secret'
+       #option token_mode 'rsa'
+       #option token_secret 'secret'
 
        # HOTP/TOTP tokens
-        #option token_mode 'hotp'
-        #option token_secret '00'
+       #option token_mode 'hotp'
+       #option token_secret '00'
 
        # tokens from script
        #option token_mode 'script'
@@ -45,6 +45,5 @@ deinitialize it using ifdown. You may also use the luci web interface
 Note that you need to configure the firewall to allow communication between
 the MYVPN interface and lan.
 
-
 There is a luci plugin to allow configuring an openconnect interface from
 the web environment; see the luci-proto-openconnect package.
diff --git a/net/pixiewps/Makefile b/net/pixiewps/Makefile
new file mode 100644 (file)
index 0000000..86cc942
--- /dev/null
@@ -0,0 +1,44 @@
+# Copyright (C) 2017 Yousong Zhou
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=pixiewps
+PKG_VERSION:=1.4.1
+PKG_RELEASE:=1
+PKG_MAINTAINER:=Yousong Zhou <yszhou4tech@gmail.com>
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
+PKG_SOURCE_URL:=https://github.com/wiire-a/pixiewps/releases/download/v$(PKG_VERSION)
+PKG_HASH:=8b61b9d94e26c07ab08a01eacd200576375c08139f9d781b5fdbb587ddd33528
+
+PKG_LICENSE:=GPL-3.0
+PKG_LICENSE_FILES:=LICENSE.md
+
+include $(INCLUDE_DIR)/package.mk
+MAKE_PATH:=src
+
+define Package/pixiewps
+  SECTION:=net
+  CATEGORY:=Network
+  SUBMENU:=wireless
+  TITLE:=An offline WPS bruteforce utility
+  URL:=https://github.com/wiire-a/pixiewps
+  DEPENDS:=+libpthread
+endef
+
+define Package/pixiewps/description
+  Pixiewps is a tool written in C used to bruteforce offline the WPS PIN
+  exploiting the low or non-existing entropy of some Access Points, the so-called
+  "pixie-dust attack" discovered by Dominique Bongard in summer 2014.  It is
+  meant for educational purposes only.
+endef
+
+define Package/pixiewps/install
+       $(INSTALL_DIR) $(1)/usr/bin
+       $(INSTALL_BIN) $(PKG_BUILD_DIR)/src/pixiewps $(1)/usr/bin/
+endef
+
+$(eval $(call BuildPackage,pixiewps))
index a0b2b0c740e0901dd9ba551a027111d62a7b8b41..137aaeae3273f64bac4771d140c924b6bcf3ea4b 100644 (file)
@@ -1,5 +1,6 @@
 #
 # Copyright (C) 2012-2015 OpenWrt.org
+# Copyright (C) 2017 Yousong Zhou
 #
 # This is free software, licensed under the GNU General Public License v2.
 # See /LICENSE for more information.
@@ -8,47 +9,48 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=reaver
-PKG_VERSION:=1.4
-PKG_RELEASE:=3
+PKG_VERSION:=1.6.3
+PKG_RELEASE:=1
 PKG_MAINTAINER:=Yousong Zhou <yszhou4tech@gmail.com>
 
-PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
-PKG_SOURCE_URL:=https://storage.googleapis.com/google-code-archive-downloads/v2/code.google.com/reaver-wps
-PKG_HASH:=add3050a4a05fe0ab6bfb291ee2de8e9b8a85f1e64ced93ee27a75744954b22d
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
+PKG_SOURCE_URL:=https://github.com/t6x/reaver-wps-fork-t6x/releases/download/v$(PKG_VERSION)
+PKG_HASH:=191f785f53030e4803260ada1a29ca4b42c848d56f6f3982e320d03b6117aaf2
+
 PKG_LICENSE:=GPL-2.0
+PKG_LICENSE_FILES:=docs/LICENSE
 
 PKG_USE_MIPS16:=0
 PKG_AUTOMAKE_PATHS:=src
 PKG_FIXUP:=autoreconf
 
 include $(INCLUDE_DIR)/package.mk
-
 CONFIGURE_PATH:=src
 MAKE_PATH:=src
-EXTRA_CFLAGS=$(TARGET_CPPFLAGS)
 
 define Package/reaver
   SECTION:=net
   CATEGORY:=Network
   SUBMENU:=wireless
   TITLE:=Efficient brute force attack against Wifi Protected Setup
-  URL:=https://code.google.com/p/reaver-wps/
-  DEPENDS:=+libpcap +libsqlite3
+  URL:=https://github.com/t6x/reaver-wps-fork-t6x
+  DEPENDS:=+libpcap
 endef
 
 define Package/reaver/description
-  Reaver targets the external registrar functionality mandated by the WiFi
-  Protected Setup specification.
-  Access points will provide authenticated registrars with their current
-  wireless configuration (including the WPA PSK), and also accept a new
-  configuration from the registrar.
+  Reaver has been designed to be a robust and practical attack against Wi-Fi
+  Protected Setup (WPS) registrar PINs in order to recover WPA/WPA2
+  passphrases. It has been tested against a wide variety of access points and
+  WPS implementations.
+
+  This is reaver-wps-fork-t6x, a community forked version, which has included
+  various bug fixes and additional attack method (the offline Pixie Dust
+  attack).
 endef
 
 define Package/reaver/install
        $(INSTALL_DIR) $(1)/usr/bin
        $(INSTALL_BIN) $(PKG_BUILD_DIR)/src/{reaver,wash} $(1)/usr/bin/
-       $(INSTALL_DIR) $(1)/etc/reaver
-       $(INSTALL_DATA) $(PKG_BUILD_DIR)/src/reaver.db $(1)/etc/reaver/
 endef
 
 $(eval $(call BuildPackage,reaver))
diff --git a/net/reaver/patches/0001-wpscrack-big-endian-fixes.patch b/net/reaver/patches/0001-wpscrack-big-endian-fixes.patch
deleted file mode 100644 (file)
index da76c2e..0000000
+++ /dev/null
@@ -1,565 +0,0 @@
-From 4e7af9f022996cb0a03b30f6af265b757807dfa2 Mon Sep 17 00:00:00 2001
-From: Paul Fertser <fercerpav@gmail.com>
-Date: Wed, 27 Jun 2012 17:44:55 +0400
-Subject: [PATCH 1/3] wpscrack: big-endian fixes
-
-This should fix access to the radiotap, 802.11, LLC/SNAP and WFA
-headers' fields. Run-time tested on an ar71xx BE system.
-
-Signed-off-by: Paul Fertser <fercerpav@gmail.com>
----
- src/80211.c    |   65 +++++++++++++++++++------------
- src/builder.c  |   23 +++++------
- src/defs.h     |  116 +++++++++++++++++++++++++++++++++++++++-----------------
- src/exchange.c |   23 ++++++-----
- src/wpsmon.c   |   13 ++++--
- 5 files changed, 151 insertions(+), 89 deletions(-)
-
-diff --git a/src/80211.c b/src/80211.c
-index c2aff59..19f1e92 100644
---- a/src/80211.c
-+++ b/src/80211.c
-@@ -90,17 +90,19 @@ void read_ap_beacon()
-                 if(header.len >= MIN_BEACON_SIZE)
-                 {
-                         rt_header = (struct radio_tap_header *) radio_header(packet, header.len);
--                        frame_header = (struct dot11_frame_header *) (packet + rt_header->len);
--
-+                      size_t rt_header_len = __le16_to_cpu(rt_header->len);
-+                      frame_header = (struct dot11_frame_header *) (packet + rt_header_len);
-+                      
-                       if(is_target(frame_header))
-                       {
--                                if(frame_header->fc.type == MANAGEMENT_FRAME && frame_header->fc.sub_type == SUBTYPE_BEACON)
-+                                if((frame_header->fc & __cpu_to_le16(IEEE80211_FCTL_FTYPE | IEEE80211_FCTL_STYPE)) ==
-+                                 __cpu_to_le16(IEEE80211_FTYPE_MGMT | IEEE80211_STYPE_BEACON))
-                                 {
--                                              beacon = (struct beacon_management_frame *) (packet + rt_header->len + sizeof(struct dot11_frame_header));
-+                                              beacon = (struct beacon_management_frame *) (packet + rt_header_len + sizeof(struct dot11_frame_header));
-                                               set_ap_capability(beacon->capability);
-                                       /* Obtain the SSID and channel number from the beacon packet */
--                                      tag_offset = rt_header->len + sizeof(struct dot11_frame_header) + sizeof(struct beacon_management_frame);
-+                                      tag_offset = rt_header_len + sizeof(struct dot11_frame_header) + sizeof(struct beacon_management_frame);
-                                       channel = parse_beacon_tags(packet, header.len);
-                                       
-                                       /* If no channel was manually specified, switch to the AP's current channel */
-@@ -135,29 +137,31 @@ int8_t signal_strength(const u_char *packet, size_t len)
-       {
-               header = (struct radio_tap_header *) packet;
--              if((header->flags & SSI_FLAG) == SSI_FLAG)
-+              uint32_t flags = __le32_to_cpu(header->flags);
-+              
-+              if((flags & SSI_FLAG) == SSI_FLAG)
-               {
--                      if((header->flags & TSFT_FLAG) == TSFT_FLAG)
-+                      if((flags & TSFT_FLAG) == TSFT_FLAG)
-                       {
-                               offset += TSFT_SIZE;
-                       }
--                      if((header->flags & FLAGS_FLAG) == FLAGS_FLAG)
-+                      if((flags & FLAGS_FLAG) == FLAGS_FLAG)
-                       {
-                               offset += FLAGS_SIZE;
-                       }
-       
--                      if((header->flags & RATE_FLAG) == RATE_FLAG)
-+                      if((flags & RATE_FLAG) == RATE_FLAG)
-                       {
-                               offset += RATE_SIZE;
-                       }
--                      if((header->flags & CHANNEL_FLAG) == CHANNEL_FLAG)
-+                      if((flags & CHANNEL_FLAG) == CHANNEL_FLAG)
-                       {
-                               offset += CHANNEL_SIZE;
-                       }
--                      if((header->flags & FHSS_FLAG) == FHSS_FLAG)
-+                      if((flags & FHSS_FLAG) == FHSS_FLAG)
-                       {
-                               offset += FHSS_FLAG;
-                       }
-@@ -196,11 +200,13 @@ int is_wps_locked()
-               if(header.len >= MIN_BEACON_SIZE)
-               {
-                       rt_header = (struct radio_tap_header *) radio_header(packet, header.len);
--                      frame_header = (struct dot11_frame_header *) (packet + rt_header->len);
-+                      size_t rt_header_len = __le16_to_cpu(rt_header->len);
-+                      frame_header = (struct dot11_frame_header *) (packet + rt_header_len);
-                       if(memcmp(frame_header->addr3, get_bssid(), MAC_ADDR_LEN) == 0)
-                       {
--                              if(frame_header->fc.type == MANAGEMENT_FRAME && frame_header->fc.sub_type == SUBTYPE_BEACON)
-+                                if((frame_header->fc & __cpu_to_le16(IEEE80211_FCTL_FTYPE | IEEE80211_FCTL_STYPE)) ==
-+                                 __cpu_to_le16(IEEE80211_FTYPE_MGMT | IEEE80211_STYPE_BEACON))
-                               {
-                                       if(parse_wps_parameters(packet, header.len, &wps))
-                                       {
-@@ -411,24 +417,30 @@ int associate_recv_loop()
-                 if(header.len >= MIN_AUTH_SIZE)
-                 {
-                       rt_header = (struct radio_tap_header *) radio_header(packet, header.len);
--                        dot11_frame = (struct dot11_frame_header *) (packet + rt_header->len);
-+                      size_t rt_header_len = __le16_to_cpu(rt_header->len);
-+                      dot11_frame = (struct dot11_frame_header *) (packet + rt_header_len);
-                         if((memcmp(dot11_frame->addr3, get_bssid(), MAC_ADDR_LEN) == 0) &&
-                            (memcmp(dot11_frame->addr1, get_mac(), MAC_ADDR_LEN) == 0))
-                         {
--                              if(dot11_frame->fc.type == MANAGEMENT_FRAME)
-+                                if((dot11_frame->fc & __cpu_to_le16(IEEE80211_FCTL_FTYPE)) ==
-+                                 __cpu_to_le16(IEEE80211_FTYPE_MGMT))
-                               {
--                                      auth_frame = (struct authentication_management_frame *) (packet + sizeof(struct dot11_frame_header) + rt_header->len);
--                                      assoc_frame = (struct association_response_management_frame *) (packet + sizeof(struct dot11_frame_header) + rt_header->len);
-+                                      auth_frame = (struct authentication_management_frame *) (packet + sizeof(struct dot11_frame_header) + rt_header_len);
-+                                      assoc_frame = (struct association_response_management_frame *) (packet + sizeof(struct dot11_frame_header) + rt_header_len);
-                                       /* Did we get an authentication packet with a successful status? */
--                                      if((dot11_frame->fc.sub_type == SUBTYPE_AUTHENTICATION) && (auth_frame->status == AUTHENTICATION_SUCCESS))
-+                                      if((dot11_frame->fc & __cpu_to_le16(IEEE80211_FCTL_STYPE)) ==
-+                                         __cpu_to_le16(IEEE80211_STYPE_AUTH)
-+                                         && (auth_frame->status == __cpu_to_le16(AUTHENTICATION_SUCCESS)))
-                                               {
-                                                       ret_val = AUTH_OK;
-                                                       break;
-                                               }
-                                       /* Did we get an association packet with a successful status? */
--                                              else if((dot11_frame->fc.sub_type == SUBTYPE_ASSOCIATION) && (assoc_frame->status == ASSOCIATION_SUCCESS))
-+                                              else if((dot11_frame->fc & __cpu_to_le16(IEEE80211_FCTL_STYPE)) ==
-+                                              __cpu_to_le16(IEEE80211_STYPE_ASSOC_RESP)
-+                                              && (assoc_frame->status == __cpu_to_le16(ASSOCIATION_SUCCESS)))
-                                       {
-                                               ret_val = ASSOCIATE_OK;
-                                               break;
-@@ -455,13 +467,14 @@ enum encryption_type supported_encryption(const u_char *packet, size_t len)
-       if(len > MIN_BEACON_SIZE)
-       {
-               rt_header = (struct radio_tap_header *) radio_header(packet, len);
--              beacon = (struct beacon_management_frame *) (packet + rt_header->len + sizeof(struct dot11_frame_header));
--              offset = tag_offset = rt_header->len + sizeof(struct dot11_frame_header) + sizeof(struct beacon_management_frame);
-+              size_t rt_header_len = __le16_to_cpu(rt_header->len);
-+              beacon = (struct beacon_management_frame *) (packet + rt_header_len + sizeof(struct dot11_frame_header));
-+              offset = tag_offset = rt_header_len + sizeof(struct dot11_frame_header) + sizeof(struct beacon_management_frame);
-               
-               tag_len = len - tag_offset;
-               tag_data = (const u_char *) (packet + tag_offset);
--              if((beacon->capability & CAPABILITY_WEP) == CAPABILITY_WEP)
-+              if((__le16_to_cpu(beacon->capability) & CAPABILITY_WEP) == CAPABILITY_WEP)
-               {
-                       enc = WEP;
-@@ -509,7 +522,7 @@ int parse_beacon_tags(const u_char *packet, size_t len)
-       struct radio_tap_header *rt_header = NULL;
-       rt_header = (struct radio_tap_header *) radio_header(packet, len);
--      tag_offset = rt_header->len + sizeof(struct dot11_frame_header) + sizeof(struct beacon_management_frame);
-+      tag_offset = __le16_to_cpu(rt_header->len) + sizeof(struct dot11_frame_header) + sizeof(struct beacon_management_frame);
-       if(tag_offset < len)
-       {
-@@ -548,7 +561,7 @@ int parse_beacon_tags(const u_char *packet, size_t len)
-               {
-                       if(ie_len  == 1)
-                       {
--                              memcpy((int *) &channel, channel_data, ie_len);
-+                              channel = *(uint8_t*)channel_data;
-                       }
-                       free(channel_data);
-               }
-@@ -603,13 +616,13 @@ int check_fcs(const u_char *packet, size_t len)
-       if(len > 4)
-       {
-               /* Get the packet's reported FCS (last 4 bytes of the packet) */
--              memcpy((uint32_t *) &fcs, (packet + (len-4)), 4);
-+              fcs = __le32_to_cpu(*(uint32_t*)(packet + (len-4)));
-               /* FCS is not calculated over the radio tap header */
-               if(has_rt_header())
-               {
-                       rt_header = (struct radio_tap_header *) packet;
--                      offset += rt_header->len;
-+                      offset += __le16_to_cpu(rt_header->len);
-               }
-               if(len > offset)
-diff --git a/src/builder.c b/src/builder.c
-index 37f2de7..6bf89e7 100644
---- a/src/builder.c
-+++ b/src/builder.c
-@@ -44,9 +44,8 @@ const void *build_radio_tap_header(size_t *len)
-               memset((void *) buf, 0, sizeof(struct radio_tap_header));
-               rt_header = (struct radio_tap_header *) buf;
--              rt_header->len = sizeof(struct radio_tap_header);
--      
--              *len = rt_header->len;
-+              *len = sizeof(struct radio_tap_header);
-+              rt_header->len = __cpu_to_le16(*len);
-       }
-       
-       return buf;
-@@ -67,9 +66,9 @@ const void *build_dot11_frame_header(uint16_t fc, size_t *len)
-       
-               frag_seq += SEQ_MASK;
--              header->duration = DEFAULT_DURATION;
--              memcpy((void *) &header->fc, (void *) &fc, sizeof(struct frame_control));
--              header->frag_seq = frag_seq;
-+              header->duration = __cpu_to_le16(DEFAULT_DURATION);
-+              header->fc = __cpu_to_le16(fc);
-+              header->frag_seq = __cpu_to_le16(frag_seq);
-               memcpy((void *) header->addr1, get_bssid(), MAC_ADDR_LEN);
-               memcpy((void *) header->addr2, get_mac(), MAC_ADDR_LEN);
-@@ -91,8 +90,8 @@ const void *build_authentication_management_frame(size_t *len)
-               memset((void *) buf, 0, *len);
-               frame = (struct authentication_management_frame *) buf;
--              frame->algorithm = OPEN_SYSTEM;
--              frame->sequence = 1;
-+              frame->algorithm = __cpu_to_le16(OPEN_SYSTEM);
-+              frame->sequence = __cpu_to_le16(1);
-               frame->status = 0;
-       }
-       
-@@ -111,8 +110,8 @@ const void *build_association_management_frame(size_t *len)
-               memset((void *) buf, 0, *len);
-               frame = (struct association_request_management_frame *) buf;
--              frame->capability = get_ap_capability();
--              frame->listen_interval = LISTEN_INTERVAL;
-+              frame->capability = __cpu_to_le16(get_ap_capability());
-+              frame->listen_interval = __cpu_to_le16(LISTEN_INTERVAL);
-       }
-       return buf;
-@@ -133,7 +132,7 @@ const void *build_llc_header(size_t *len)
-               header->dsap = LLC_SNAP;
-               header->ssap = LLC_SNAP;
-               header->control_field = UNNUMBERED_FRAME;
--              header->type = DOT1X_AUTHENTICATION;
-+              header->type = __cpu_to_be16(DOT1X_AUTHENTICATION);
-       }
-@@ -279,7 +278,7 @@ const void *build_wfa_header(uint8_t op_code, size_t *len)
-               header = (struct wfa_expanded_header *) buf;
-       
-               memcpy(header->id, WFA_VENDOR_ID, sizeof(header->id));
--              header->type = SIMPLE_CONFIG;
-+              header->type = __cpu_to_be32(SIMPLE_CONFIG);
-               header->opcode = op_code;
-       }
-       
-diff --git a/src/defs.h b/src/defs.h
-index b2f45ea..0c628e7 100644
---- a/src/defs.h
-+++ b/src/defs.h
-@@ -41,6 +41,7 @@
- #include <string.h>
- #include <time.h>
- #include <pcap.h>
-+#include <asm/byteorder.h>
- #include "wps.h"
-@@ -65,10 +66,10 @@
- #define MANAGEMENT_FRAME      0x00
- #define SUBTYPE_BEACON                0x08
--#define DOT1X_AUTHENTICATION  0x8E88
-+#define DOT1X_AUTHENTICATION  0x888E
- #define DOT1X_EAP_PACKET      0x00
--#define SIMPLE_CONFIG         0x01000000
-+#define SIMPLE_CONFIG         0x00000001
- #define P1_SIZE                       10000
- #define P2_SIZE                       1000
-@@ -282,66 +283,111 @@ enum wfa_elements
-       WEP_TRANSMIT_KEY = 0x10064
- };
-+#define IEEE80211_FCTL_VERS           0x0003
-+#define IEEE80211_FCTL_FTYPE          0x000c
-+#define IEEE80211_FCTL_STYPE          0x00f0
-+#define IEEE80211_FCTL_TODS           0x0100
-+#define IEEE80211_FCTL_FROMDS         0x0200
-+#define IEEE80211_FCTL_MOREFRAGS      0x0400
-+#define IEEE80211_FCTL_RETRY          0x0800
-+#define IEEE80211_FCTL_PM             0x1000
-+#define IEEE80211_FCTL_MOREDATA               0x2000
-+#define IEEE80211_FCTL_PROTECTED      0x4000
-+#define IEEE80211_FCTL_ORDER          0x8000
-+
-+#define IEEE80211_SCTL_FRAG           0x000F
-+#define IEEE80211_SCTL_SEQ            0xFFF0
-+
-+#define IEEE80211_FTYPE_MGMT          0x0000
-+#define IEEE80211_FTYPE_CTL           0x0004
-+#define IEEE80211_FTYPE_DATA          0x0008
-+
-+/* management */
-+#define IEEE80211_STYPE_ASSOC_REQ     0x0000
-+#define IEEE80211_STYPE_ASSOC_RESP    0x0010
-+#define IEEE80211_STYPE_REASSOC_REQ   0x0020
-+#define IEEE80211_STYPE_REASSOC_RESP  0x0030
-+#define IEEE80211_STYPE_PROBE_REQ     0x0040
-+#define IEEE80211_STYPE_PROBE_RESP    0x0050
-+#define IEEE80211_STYPE_BEACON                0x0080
-+#define IEEE80211_STYPE_ATIM          0x0090
-+#define IEEE80211_STYPE_DISASSOC      0x00A0
-+#define IEEE80211_STYPE_AUTH          0x00B0
-+#define IEEE80211_STYPE_DEAUTH                0x00C0
-+#define IEEE80211_STYPE_ACTION                0x00D0
-+
-+/* control */
-+#define IEEE80211_STYPE_BACK_REQ      0x0080
-+#define IEEE80211_STYPE_BACK          0x0090
-+#define IEEE80211_STYPE_PSPOLL                0x00A0
-+#define IEEE80211_STYPE_RTS           0x00B0
-+#define IEEE80211_STYPE_CTS           0x00C0
-+#define IEEE80211_STYPE_ACK           0x00D0
-+#define IEEE80211_STYPE_CFEND         0x00E0
-+#define IEEE80211_STYPE_CFENDACK      0x00F0
-+
-+/* data */
-+#define IEEE80211_STYPE_DATA                  0x0000
-+#define IEEE80211_STYPE_DATA_CFACK            0x0010
-+#define IEEE80211_STYPE_DATA_CFPOLL           0x0020
-+#define IEEE80211_STYPE_DATA_CFACKPOLL                0x0030
-+#define IEEE80211_STYPE_NULLFUNC              0x0040
-+#define IEEE80211_STYPE_CFACK                 0x0050
-+#define IEEE80211_STYPE_CFPOLL                        0x0060
-+#define IEEE80211_STYPE_CFACKPOLL             0x0070
-+#define IEEE80211_STYPE_QOS_DATA              0x0080
-+#define IEEE80211_STYPE_QOS_DATA_CFACK                0x0090
-+#define IEEE80211_STYPE_QOS_DATA_CFPOLL               0x00A0
-+#define IEEE80211_STYPE_QOS_DATA_CFACKPOLL    0x00B0
-+#define IEEE80211_STYPE_QOS_NULLFUNC          0x00C0
-+#define IEEE80211_STYPE_QOS_CFACK             0x00D0
-+#define IEEE80211_STYPE_QOS_CFPOLL            0x00E0
-+#define IEEE80211_STYPE_QOS_CFACKPOLL         0x00F0
-+
- #pragma pack(1)
- struct radio_tap_header
- {
-       uint8_t revision;       
-       uint8_t pad;
--      uint16_t len;
--      uint32_t flags;
--};
--
--struct frame_control
--{
--        unsigned version : 2;
--        unsigned type : 2;
--        unsigned sub_type : 4;
--
--        unsigned to_ds : 1;
--        unsigned from_ds : 1;
--        unsigned more_frag : 1;
--        unsigned retry : 1;
--        unsigned pwr_mgt : 1;
--        unsigned more_data : 1;
--        unsigned protected_frame : 1;
--        unsigned order : 1;
-+      __le16 len;
-+      __le32 flags;
- };
- struct dot11_frame_header
- {
--      struct frame_control fc;
--        uint16_t duration;
-+      __le16 fc;
-+      __le16 duration;
-       unsigned char addr1[MAC_ADDR_LEN];
-       unsigned char addr2[MAC_ADDR_LEN];
-       unsigned char addr3[MAC_ADDR_LEN];
--      uint16_t frag_seq;
-+      __le16 frag_seq;
- };
- struct authentication_management_frame
- {
--      uint16_t algorithm;
--      uint16_t sequence;
--      uint16_t status;
-+      __le16 algorithm;
-+      __le16 sequence;
-+      __le16 status;
- };
- struct association_request_management_frame
- {
--      uint16_t capability;
--      uint16_t listen_interval;
-+      __le16 capability;
-+      __le16 listen_interval;
- };
- struct association_response_management_frame
- {
--      uint16_t capability;
--      uint16_t status;
--      uint16_t id;
-+      __le16 capability;
-+      __le16 status;
-+      __le16 id;
- };
- struct beacon_management_frame
- {
-       unsigned char timestamp[TIMESTAMP_LEN];
--      uint16_t beacon_interval;
--      uint16_t capability;
-+      __le16 beacon_interval;
-+      __le16 capability;
- };
- struct llc_header
-@@ -350,7 +396,7 @@ struct llc_header
-       uint8_t ssap;
-       uint8_t control_field;
-       unsigned char org_code[3];
--      uint16_t type;
-+      __be16 type;
- };
- struct dot1X_header
-@@ -371,7 +417,7 @@ struct eap_header
- struct wfa_expanded_header
- {
-       unsigned char id[3];
--      uint32_t type;
-+      __be32 type;
-       uint8_t opcode;
-       uint8_t flags;
- };
-diff --git a/src/exchange.c b/src/exchange.c
-index 23c87e9..4f9a82b 100644
---- a/src/exchange.c
-+++ b/src/exchange.c
-@@ -306,26 +306,27 @@ enum wps_type process_packet(const u_char *packet, struct pcap_pkthdr *header)
-       /* Cast the radio tap and 802.11 frame headers and parse out the Frame Control field */
-       rt_header = (struct radio_tap_header *) packet;
--      frame_header = (struct dot11_frame_header *) (packet+rt_header->len);
-+      size_t rt_header_len = __le16_to_cpu(rt_header->len);
-+      frame_header = (struct dot11_frame_header *) (packet+rt_header_len);
-       /* Does the BSSID/source address match our target BSSID? */
-       if(memcmp(frame_header->addr3, get_bssid(), MAC_ADDR_LEN) == 0)
-       {
-               /* Is this a data packet sent to our MAC address? */
--              if(frame_header->fc.type == DATA_FRAME && 
--                      frame_header->fc.sub_type == SUBTYPE_DATA && 
--                      (memcmp(frame_header->addr1, get_mac(), MAC_ADDR_LEN) == 0)) 
-+              if (((frame_header->fc & __cpu_to_le16(IEEE80211_FCTL_FTYPE | IEEE80211_FCTL_STYPE)) ==
-+                   __cpu_to_le16(IEEE80211_FTYPE_DATA | IEEE80211_STYPE_DATA)) &&
-+                  (memcmp(frame_header->addr1, get_mac(), MAC_ADDR_LEN) == 0)) 
-               {
-                       llc = (struct llc_header *) (packet +
--                                                      rt_header->len +
-+                                                      rt_header_len +
-                                                       sizeof(struct dot11_frame_header)
-                       );
-                       /* All packets in our exchanges will be 802.1x */
--                      if(llc->type == DOT1X_AUTHENTICATION)
-+                      if(llc->type == __cpu_to_be16(DOT1X_AUTHENTICATION))
-                       {
-                               dot1x = (struct dot1X_header *) (packet +
--                                                              rt_header->len +
-+                                                              rt_header_len +
-                                                               sizeof(struct dot11_frame_header) +
-                                                               sizeof(struct llc_header)
-                               );
-@@ -334,7 +335,7 @@ enum wps_type process_packet(const u_char *packet, struct pcap_pkthdr *header)
-                               if(dot1x->type == DOT1X_EAP_PACKET && (header->len >= EAP_PACKET_SIZE))
-                               {
-                                       eap = (struct eap_header *) (packet +
--                                                                      rt_header->len +
-+                                                                      rt_header_len +
-                                                                       sizeof(struct dot11_frame_header) +
-                                                                       sizeof(struct llc_header) +
-                                                                       sizeof(struct dot1X_header)
-@@ -366,7 +367,7 @@ enum wps_type process_packet(const u_char *packet, struct pcap_pkthdr *header)
-                                               else if((eap->type == EAP_EXPANDED) && (header->len > WFA_PACKET_SIZE))
-                                               {
-                                                       wfa = (struct wfa_expanded_header *) (packet +
--                                                                                      rt_header->len +
-+                                                                                      rt_header_len +
-                                                                                       sizeof(struct dot11_frame_header) +
-                                                                                       sizeof(struct llc_header) +
-                                                                                       sizeof(struct dot1X_header) +
-@@ -374,14 +375,14 @@ enum wps_type process_packet(const u_char *packet, struct pcap_pkthdr *header)
-                                                       );
-                                               
-                                                       /* Verify that this is a WPS message */
--                                                      if(wfa->type == SIMPLE_CONFIG)
-+                                                      if(wfa->type == __cpu_to_be32(SIMPLE_CONFIG))
-                                                       {
-                                                               wps_msg_len =   (size_t) ntohs(eap->len) - 
-                                                                               sizeof(struct eap_header) - 
-                                                                               sizeof(struct wfa_expanded_header);
-                                                               wps_msg = (const void *) (packet +
--                                                                                      rt_header->len +
-+                                                                                      rt_header_len +
-                                                                                               sizeof(struct dot11_frame_header) +
-                                                                                               sizeof(struct llc_header) +
-                                                                                               sizeof(struct dot1X_header) +
-diff --git a/src/wpsmon.c b/src/wpsmon.c
-index d976924..22a394f 100644
---- a/src/wpsmon.c
-+++ b/src/wpsmon.c
-@@ -295,7 +295,8 @@ void parse_wps_settings(const u_char *packet, struct pcap_pkthdr *header, char *
-         }
-       rt_header = (struct radio_tap_header *) radio_header(packet, header->len);
--      frame_header = (struct dot11_frame_header *) (packet + rt_header->len);
-+      size_t rt_header_len = __le16_to_cpu(rt_header->len);
-+      frame_header = (struct dot11_frame_header *) (packet + rt_header_len);
-       /* If a specific BSSID was specified, only parse packets from that BSSID */
-       if(!is_target(frame_header))
-@@ -323,15 +324,17 @@ void parse_wps_settings(const u_char *packet, struct pcap_pkthdr *header, char *
-                               channel_changed = 1;
-                       }
--                      if(frame_header->fc.sub_type == PROBE_RESPONSE ||
--                                   frame_header->fc.sub_type == SUBTYPE_BEACON)
-+                      unsigned fsub_type = frame_header->fc & __cpu_to_le16(IEEE80211_FCTL_STYPE);
-+
-+                      if(fsub_type == __cpu_to_le16(IEEE80211_STYPE_PROBE_RESP) ||
-+                         fsub_type == __cpu_to_le16(IEEE80211_STYPE_BEACON))
-                       {
-                               wps_parsed = parse_wps_parameters(packet, header->len, wps);
-                       }
-       
-                       if(!is_done(bssid) && (get_channel() == channel || source == PCAP_FILE))
-                       {
--                              if(frame_header->fc.sub_type == SUBTYPE_BEACON && 
-+                              if(fsub_type == __cpu_to_le16(IEEE80211_STYPE_BEACON) && 
-                                  mode == SCAN && 
-                                  !passive && 
-                                  should_probe(bssid))
-@@ -369,7 +372,7 @@ void parse_wps_settings(const u_char *packet, struct pcap_pkthdr *header, char *
-                                * If there was no WPS information, then the AP does not support WPS and we should ignore it from here on.
-                                * If this was a probe response, then we've gotten all WPS info we can get from this AP and should ignore it from here on.
-                                */
--                              if(!wps_parsed || frame_header->fc.sub_type == PROBE_RESPONSE)
-+                              if(!wps_parsed || fsub_type == __cpu_to_le16(IEEE80211_STYPE_PROBE_RESP))
-                               {
-                                       mark_ap_complete(bssid);
-                               }
--- 
-1.7.7
-
diff --git a/net/reaver/patches/0002-Use-the-current-directory-for-storing-and-loading-se.patch b/net/reaver/patches/0002-Use-the-current-directory-for-storing-and-loading-se.patch
deleted file mode 100644 (file)
index dd1bb42..0000000
+++ /dev/null
@@ -1,53 +0,0 @@
-From cd444949f3176790101b8bdc9656831a03d8c01d Mon Sep 17 00:00:00 2001
-From: Paul Fertser <fercerpav@gmail.com>
-Date: Tue, 10 Jul 2012 11:13:29 +0400
-Subject: [PATCH 2/3] Use the current directory for storing and loading
- sessions
-
-This allows the user to always explicitely choose (by changing the
-current directory before launching the program) where the session
-files should go. Useful e.g. to avoid hogging the precious space on
-embedded devices, just cd /tmp before starting the app.
-
-Signed-off-by: Paul Fertser <fercerpav@gmail.com>
----
- src/session.c |   16 +++-------------
- 1 files changed, 3 insertions(+), 13 deletions(-)
-
-diff --git a/src/session.c b/src/session.c
-index d3af0c3..308f213 100644
---- a/src/session.c
-+++ b/src/session.c
-@@ -62,7 +62,7 @@ int restore_session()
-               memset(file, 0, FILENAME_MAX);
-               bssid = mac2str(get_bssid(), '\0');
--              snprintf(file, FILENAME_MAX, "%s/%s.%s", CONF_DIR, bssid, CONF_EXT);
-+              snprintf(file, FILENAME_MAX, "%s.%s", bssid, CONF_EXT);
-               free(bssid);
-       }
-@@ -199,18 +199,8 @@ int save_session()
-               }
-               else
-               {       
--                      /* 
--                       * If the configuration directory exists, save the session file there; else, save it to the 
--                       * current working directory.
--                       */
--                      if(configuration_directory_exists())
--                      {
--                              snprintf((char *) &file_name, FILENAME_MAX, "%s/%s.%s", CONF_DIR, bssid, CONF_EXT);
--                      }
--                      else
--                      {
--                              snprintf((char *) &file_name, FILENAME_MAX, "%s.%s", bssid, CONF_EXT);
--                      }
-+                      /* save session to the current directory */
-+                      snprintf((char *) &file_name, FILENAME_MAX, "%s.%s", bssid, CONF_EXT);
-               }
-               /* Don't bother saving anything if nothing has been done */
--- 
-1.7.7
-
diff --git a/net/reaver/patches/0003-wash-wpsmon-use-less-useless-spaces-in-output-to-fit.patch b/net/reaver/patches/0003-wash-wpsmon-use-less-useless-spaces-in-output-to-fit.patch
deleted file mode 100644 (file)
index 64b290b..0000000
+++ /dev/null
@@ -1,38 +0,0 @@
-From 638bb8d70d6c7e5dc99975e0bf57d8ce0455e2cc Mon Sep 17 00:00:00 2001
-From: Paul Fertser <fercerpav@gmail.com>
-Date: Tue, 10 Jul 2012 11:25:00 +0400
-Subject: [PATCH 3/3] wash/wpsmon: use less useless spaces in output to fit
- narrow terminals
-
-Signed-off-by: Paul Fertser <fercerpav@gmail.com>
----
- src/wpsmon.c |    6 +++---
- 1 files changed, 3 insertions(+), 3 deletions(-)
-
-diff --git a/src/wpsmon.c b/src/wpsmon.c
-index 22a394f..e0948b3 100644
---- a/src/wpsmon.c
-+++ b/src/wpsmon.c
-@@ -262,8 +262,8 @@ void monitor(char *bssid, int passive, int source, int channel, int mode)
-       if(!header_printed)
-       {
--              cprintf(INFO, "BSSID                  Channel       RSSI       WPS Version       WPS Locked        ESSID\n");
--              cprintf(INFO, "---------------------------------------------------------------------------------------------------------------\n");
-+              cprintf(INFO, "BSSID              Channel  RSSI  WPS Version  WPS Locked  ESSID\n");
-+              cprintf(INFO, "--------------------------------------------------------------------------------------\n");
-               header_printed = 1;
-       }
-@@ -360,7 +360,7 @@ void parse_wps_settings(const u_char *packet, struct pcap_pkthdr *header, char *
-                                                       break;
-                                       }
--                                      cprintf(INFO, "%17s      %2d            %.2d        %d.%d               %s               %s\n", bssid, channel, rssi, (wps->version >> 4), (wps->version & 0x0F), lock_display, ssid);
-+                                      cprintf(INFO, "%17s    %2d       %.2d   %d.%d          %s         %s\n", bssid, channel, rssi, (wps->version >> 4), (wps->version & 0x0F), lock_display, ssid);
-                               }
-                               if(probe_sent)
--- 
-1.7.7
-
diff --git a/net/reaver/patches/0004-Fixed-probe-request-bug-in-wash.patch b/net/reaver/patches/0004-Fixed-probe-request-bug-in-wash.patch
deleted file mode 100644 (file)
index 9b51d06..0000000
+++ /dev/null
@@ -1,46 +0,0 @@
-From a8edcc1ce2a55e0e02ee13c46c6a5f22dd7920e9 Mon Sep 17 00:00:00 2001
-From: "cheffner@tacnetsol.com"
- <cheffner@tacnetsol.com@027a3e96-2d37-f1c0-85d6-5ce5a08386c2>
-Date: Tue, 27 Mar 2012 16:25:10 +0000
-Subject: [PATCH] Fixed probe request bug in wash.
-
-git-svn-id: http://reaver-wps.googlecode.com/svn/trunk@113 027a3e96-2d37-f1c0-85d6-5ce5a08386c2
----
- src/wpsmon.c | 7 +++++++
- 1 file changed, 7 insertions(+)
-
-diff --git a/src/wpsmon.c b/src/wpsmon.c
-index da688b9..d976924 100644
---- a/src/wpsmon.c
-+++ b/src/wpsmon.c
-@@ -132,6 +132,11 @@ int main(int argc, char *argv[])
-               usage(argv[0]);
-               goto end;
-       }
-+      else if(get_iface())
-+      {
-+              /* Get the MAC address of the specified interface */
-+              read_iface_mac();
-+      }
-       if(get_iface() && source == PCAP_FILE)
-       {
-@@ -300,6 +305,7 @@ void parse_wps_settings(const u_char *packet, struct pcap_pkthdr *header, char *
-       set_ssid(NULL);
-       bssid = (char *) mac2str(frame_header->addr3, ':');
-+      set_bssid((unsigned char *) frame_header->addr3);
-       if(bssid)
-       {
-@@ -383,6 +389,7 @@ void parse_wps_settings(const u_char *packet, struct pcap_pkthdr *header, char *
- end:
-       if(wps) free(wps);
-+      set_bssid((unsigned char *) NULL_MAC);
-       return;
- }
--- 
-2.6.4
-
diff --git a/net/reaver/patches/0100-Include-sys-types.h-for-definition-of-u_char.patch b/net/reaver/patches/0100-Include-sys-types.h-for-definition-of-u_char.patch
deleted file mode 100644 (file)
index 541968a..0000000
+++ /dev/null
@@ -1,27 +0,0 @@
-From 811f5c0b0a226edfbf5aa2f316e083f30ec3cd8d Mon Sep 17 00:00:00 2001
-From: Yousong Zhou <yszhou4tech@gmail.com>
-Date: Tue, 18 Aug 2015 14:34:26 +0800
-Subject: [PATCH] Include <sys/types.h> for definition of u_char.
-
-Fixes build with musl-libc.
-
-Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com>
----
- src/libwps/libwps.h |    1 +
- 1 file changed, 1 insertion(+)
-
-diff --git a/src/libwps/libwps.h b/src/libwps/libwps.h
-index b04dd8b..bdd7b9a 100755
---- a/src/libwps/libwps.h
-+++ b/src/libwps/libwps.h
-@@ -17,6 +17,7 @@
- #include <stdio.h>
- #include <string.h>
- #include <arpa/inet.h>
-+#include <sys/types.h>
- #define LIBWPS_MAX_STR_LEN 256
--- 
-1.7.10.4
-
diff --git a/net/reaver/patches/0101-pcap-use-65536-as-snaplen.patch b/net/reaver/patches/0101-pcap-use-65536-as-snaplen.patch
deleted file mode 100644 (file)
index 03f4318..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
---- a/src/init.c.orig  2016-12-08 13:23:17.386891467 +0800
-+++ b/src/init.c       2016-12-08 13:23:20.850892551 +0800
-@@ -121,7 +121,7 @@ pcap_t *capture_init(char *capture_sourc
-       pcap_t *handle = NULL;
-       char errbuf[PCAP_ERRBUF_SIZE] = { 0 };
-       
--      handle = pcap_open_live(capture_source, BUFSIZ, 1, 0, errbuf);
-+      handle = pcap_open_live(capture_source, 65536, 1, 0, errbuf);
-       if(!handle)
-       {
-               handle = pcap_open_offline(capture_source, errbuf);
diff --git a/net/reaver/patches/0102-wps-cflags.patch b/net/reaver/patches/0102-wps-cflags.patch
deleted file mode 100644 (file)
index 9a98025..0000000
+++ /dev/null
@@ -1,45 +0,0 @@
-Index: reaver-1.4/src/wps/Makefile
-===================================================================
---- reaver-1.4.orig/src/wps/Makefile
-+++ reaver-1.4/src/wps/Makefile
-@@ -4,31 +4,31 @@ INC=-I../utils -I ../
- all: wps_attr_build.o wps_attr_parse.o wps_attr_process.o wps.o wps_common.o wps_dev_attr.o wps_enrollee.o wps_registrar.o wps_ufd.o
- wps_attr_build.o:
--      $(CC) $(INC) wps_attr_build.c -c
-+      $(CC) $(CFLAGS) $(INC) wps_attr_build.c -c
- wps_attr_parse.o:
--      $(CC) $(INC) wps_attr_parse.c -c
-+      $(CC) $(CFLAGS) $(INC) wps_attr_parse.c -c
- wps_attr_process.o:
--      $(CC) $(INC) wps_attr_process.c -c
-+      $(CC) $(CFLAGS) $(INC) wps_attr_process.c -c
- wps.o:
--      $(CC) $(INC) wps.c -c
-+      $(CC) $(CFLAGS) $(INC) wps.c -c
- wps_common.o:
--      $(CC) $(INC) wps_common.c -c
-+      $(CC) $(CFLAGS) $(INC) wps_common.c -c
- wps_dev_attr.o:
--      $(CC) $(INC) wps_dev_attr.c -c
-+      $(CC) $(CFLAGS) $(INC) wps_dev_attr.c -c
- wps_enrollee.o:
--      $(CC) $(INC) wps_enrollee.c -c
-+      $(CC) $(CFLAGS) $(INC) wps_enrollee.c -c
- wps_registrar.o:
--      $(CC) $(INC) wps_registrar.c -c
-+      $(CC) $(CFLAGS) $(INC) wps_registrar.c -c
- wps_ufd.o:
--      $(CC) $(INC) wps_ufd.c -c
-+      $(CC) $(CFLAGS) $(INC) wps_ufd.c -c
- clean:
-       rm -f *.o
index 53f8909e095beefbf23c85aa3e67a999ad136578..20d5d5ea9c75917cef1b2cafd652ee041ef83c97 100644 (file)
@@ -8,13 +8,13 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=collectd
-PKG_VERSION:=5.7.2
-PKG_RELEASE:=2
+PKG_VERSION:=5.8.0
+PKG_RELEASE:=1
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
 PKG_SOURCE_URL:=https://collectd.org/files/ \
        https://github.com/collectd/collectd/releases/download/collectd-$(PKG_VERSION)
-PKG_HASH:=9d20a0221569a8d6b80bbc52b86e5e84965f5bafdbf5dfc3790e0fed0763e592
+PKG_HASH:=b06ff476bbf05533cb97ae6749262cc3c76c9969f032bd8496690084ddeb15c9
 
 PKG_FIXUP:=autoreconf
 PKG_REMOVE_FILES:=aclocal.m4 libltdl/aclocal.m4
@@ -36,6 +36,7 @@ COLLECTD_PLUGINS_DISABLED:= \
        curl_json \
        curl_xml \
        dbi \
+       dpdkevents \
        dpdkstat \
        drbd \
        ethstat \
@@ -46,6 +47,7 @@ COLLECTD_PLUGINS_DISABLED:= \
        grpc \
        hddtemp \
        hugepages \
+       intel_pmu \
        intel_rdt \
        ipc \
        ipmi \
@@ -57,6 +59,7 @@ COLLECTD_PLUGINS_DISABLED:= \
        lpar \
        madwifi \
        mbmon \
+       mcelog \
        md \
        memcachec \
        memcached \
@@ -73,6 +76,8 @@ COLLECTD_PLUGINS_DISABLED:= \
        openldap \
        openvz \
        oracle \
+       ovs_events \
+       ovs_stats \
        perl \
        pf \
        pinba \
@@ -83,8 +88,10 @@ COLLECTD_PLUGINS_DISABLED:= \
        serial \
        sigrok \
        smart \
+       snmp_agent \
        statsd \
        swap \
+       synproxy \
        tape \
        tokyotyrant \
        turbostat \
index d7cf23de15e51cab8018d38de6d8864e3fb311c7..b0ef7c48477c64b5e9fc5f82b091cb859929312d 100644 (file)
@@ -1,6 +1,6 @@
 --- a/src/rrdtool.c
 +++ b/src/rrdtool.c
-@@ -61,6 +61,7 @@ typedef struct rrd_queue_s rrd_queue_t;
+@@ -60,6 +60,7 @@ typedef struct rrd_queue_s rrd_queue_t;
  static const char *config_keys[] = {
      "CacheTimeout", "CacheFlush",      "CreateFilesAsync", "DataDir",
      "StepSize",     "HeartBeat",       "RRARows",          "RRATimespan",
@@ -8,7 +8,7 @@
      "XFF",          "WritesPerSecond", "RandomTimeout"};
  static int config_keys_num = STATIC_ARRAY_SIZE(config_keys);
  
-@@ -78,6 +79,8 @@ static rrdcreate_config_t rrdcreate_conf
+@@ -77,6 +78,8 @@ static rrdcreate_config_t rrdcreate_conf
      /* timespans = */ NULL,
      /* timespans_num = */ 0,
  
@@ -17,7 +17,7 @@
      /* consolidation_functions = */ NULL,
      /* consolidation_functions_num = */ 0,
  
-@@ -971,6 +974,12 @@ static int rrd_config(const char *key, c
+@@ -950,6 +953,12 @@ static int rrd_config(const char *key, c
            /* compar = */ rrd_compare_numeric);
  
      free(value_copy);
index 347ede4868685a894c787f776afdae0bf3e6af7f..3d878d750d764f425634dff3a19abeb56a560ac3 100644 (file)
@@ -1,6 +1,6 @@
 --- a/src/daemon/plugin.c
 +++ b/src/daemon/plugin.c
-@@ -1108,7 +1108,7 @@ static int plugin_insert_read(read_func_
+@@ -1099,7 +1099,7 @@ static int plugin_insert_read(read_func_
    int status;
    llentry_t *le;
  
index 18e8751cd2bff844ad2b4c1fc0a74b67c4789d46..d12295ad4ddd492fdb0a901280032fbe0b32a714 100644 (file)
@@ -2,7 +2,7 @@
 +++ b/src/olsrd.c
 @@ -585,7 +585,7 @@ static int olsrd_read(void) /* {{{ */
    if (fh == NULL)
-     return (-1);
+     return -1;
  
 -  fputs("\r\n", fh);
 +  fputs("/all \r\n", fh);
diff --git a/utils/collectd/patches/500-fix-uptime-reading.patch b/utils/collectd/patches/500-fix-uptime-reading.patch
deleted file mode 100644 (file)
index 8c80d16..0000000
+++ /dev/null
@@ -1,169 +0,0 @@
-From af01dd6fa3eb458e2fbb272703b0cae37ea54a9b Mon Sep 17 00:00:00 2001
-From: Marcin Jurkowski <marcin1j@gmail.com>
-Date: Tue, 11 Jul 2017 15:00:25 +0200
-Subject: [PATCH] uptime plugin: don't cache boot time and simplify Linux code
-
-Caching boottime on startup yields incorrect uptime values if system
-date changes after the daemon is started.
-This is almost certain to happen on embedded systems without RTC, where
-clock is set from NTP server at some point after boot process.
-
-On Linux, we can retrieve uptime directly by either reading /proc/uptime
-(it's sufficient to read a few bytes) or calling sysinfo() function.
-Use the latter since it's the most efficient way in speed, memory
-requirements and code simplicity terms.
----
- src/uptime.c | 71 ++++++++++++++++--------------------------------------------
- 1 file changed, 19 insertions(+), 52 deletions(-)
-
---- a/src/uptime.c
-+++ b/src/uptime.c
-@@ -25,8 +25,7 @@
- #include "plugin.h"
- #if KERNEL_LINUX
--#define STAT_FILE "/proc/stat"
--/* Using /proc filesystem to retrieve the boot time, Linux only. */
-+#include <sys/sysinfo.h>
- /* #endif KERNEL_LINUX */
- #elif HAVE_LIBKSTAT
-@@ -53,8 +52,6 @@
- /*
-  * Global variables
-  */
--/* boottime always used, no OS distinction */
--static time_t boottime;
- #if HAVE_LIBKSTAT
- extern kstat_ctl_t *kc;
-@@ -72,8 +69,6 @@ static void uptime_submit(gauge_t value)
-   plugin_dispatch_values(&vl);
- }
--static int uptime_init(void) /* {{{ */
--{
- /*
-  * On most unix systems the uptime is calculated by looking at the boot
-  * time (stored in unix time, since epoch) and the current one. We are
-@@ -84,48 +79,21 @@ static int uptime_init(void) /* {{{ */
-  * the boot time, the plugin is unregistered and there is no chance to
-  * try again later. Nevertheless, this is very unlikely to happen.
-  */
--
-+static time_t uptime_get_sys(void) { /* {{{ */
-+  time_t result;
- #if KERNEL_LINUX
--  unsigned long starttime;
--  char buffer[1024];
--  int ret;
--  FILE *fh;
--
--  ret = 0;
--
--  fh = fopen(STAT_FILE, "r");
-+  struct sysinfo info;
-+  int status;
--  if (fh == NULL) {
-+  status = sysinfo(&info);
-+  if (status != 0) {
-     char errbuf[1024];
--    ERROR("uptime plugin: Cannot open " STAT_FILE ": %s",
-+    ERROR("uptime plugin: Error calling sysinfo: %s",
-           sstrerror(errno, errbuf, sizeof(errbuf)));
-     return (-1);
-   }
--  while (fgets(buffer, 1024, fh) != NULL) {
--    /* look for the btime string and read the value */
--    ret = sscanf(buffer, "btime %lu", &starttime);
--    /* avoid further loops if btime has been found and read
--     * correctly (hopefully) */
--    if (ret == 1)
--      break;
--  }
--
--  fclose(fh);
--
--  /* loop done, check if no value has been found/read */
--  if (ret != 1) {
--    ERROR("uptime plugin: No value read from " STAT_FILE "");
--    return (-1);
--  }
--
--  boottime = (time_t)starttime;
--
--  if (boottime == 0) {
--    ERROR("uptime plugin: btime read from " STAT_FILE ", "
--          "but `boottime' is zero!");
--    return (-1);
--  }
-+  result = (time_t)info.uptime;
- /* #endif KERNEL_LINUX */
- #elif HAVE_LIBKSTAT
-@@ -159,13 +127,13 @@ static int uptime_init(void) /* {{{ */
-     return (-1);
-   }
--  boottime = (time_t)knp->value.ui32;
--
--  if (boottime == 0) {
-+  if (knp->value.ui32 == 0) {
-     ERROR("uptime plugin: kstat_data_lookup returned success, "
-           "but `boottime' is zero!");
-     return (-1);
-   }
-+
-+  result = time(NULL) - (time_t)knp->value.ui32;
- /* #endif HAVE_LIBKSTAT */
- #elif HAVE_SYS_SYSCTL_H
-@@ -186,13 +154,13 @@ static int uptime_init(void) /* {{{ */
-     return (-1);
-   }
--  boottime = boottv.tv_sec;
--
--  if (boottime == 0) {
-+  if (boottv.tv_sec == 0) {
-     ERROR("uptime plugin: sysctl(3) returned success, "
-           "but `boottime' is zero!");
-     return (-1);
-   }
-+
-+  result = time(NULL) - boottv.tv_sec;
- /* #endif HAVE_SYS_SYSCTL_H */
- #elif HAVE_PERFSTAT
-@@ -212,18 +180,18 @@ static int uptime_init(void) /* {{{ */
-   if (hertz <= 0)
-     hertz = HZ;
--  boottime = time(NULL) - cputotal.lbolt / hertz;
-+  result = cputotal.lbolt / hertz;
- #endif /* HAVE_PERFSTAT */
--  return (0);
--} /* }}} int uptime_init */
-+  return result;
-+} /* }}} int uptime_get_sys */
- static int uptime_read(void) {
-   gauge_t uptime;
-   time_t elapsed;
-   /* calculate the amount of time elapsed since boot, AKA uptime */
--  elapsed = time(NULL) - boottime;
-+  elapsed = uptime_get_sys();
-   uptime = (gauge_t)elapsed;
-@@ -233,6 +201,5 @@ static int uptime_read(void) {
- }
- void module_register(void) {
--  plugin_register_init("uptime", uptime_init);
-   plugin_register_read("uptime", uptime_read);
- } /* void module_register */
index 1811034ea156264ce38d9e11af9d3f1bf6770298..80e4720ac84be98fbfd515b0dad79bb6d672bf4f 100644 (file)
@@ -18,15 +18,18 @@ Reversed patch to be applied:
 
 --- a/configure.ac
 +++ b/configure.ac
-@@ -3278,7 +3278,7 @@ then
-       SAVE_CPPFLAGS="$CPPFLAGS"
-       CPPFLAGS="$CPPFLAGS $with_libmodbus_cflags"
+@@ -3327,9 +3327,9 @@ if test "x$with_libmodbus" = "xyes"; the
+   SAVE_CPPFLAGS="$CPPFLAGS"
+   CPPFLAGS="$CPPFLAGS $with_libmodbus_cflags"
  
--      AC_CHECK_HEADERS(modbus.h, [], [with_libmodbus="no (modbus.h not found)"])
-+      AC_CHECK_HEADERS(modbus/modbus.h, [], [with_libmodbus="no (modbus/modbus.h not found)"])
+-  AC_CHECK_HEADERS([modbus.h],
++  AC_CHECK_HEADERS([modbus/modbus.h],
+     [with_libmodbus="yes"],
+-    [with_libmodbus="no (modbus.h not found)"]
++    [with_libmodbus="no (modbus/modbus.h not found)"]
+   )
  
-       CPPFLAGS="$SAVE_CPPFLAGS"
- fi
+   CPPFLAGS="$SAVE_CPPFLAGS"
 --- a/src/modbus.c
 +++ b/src/modbus.c
 @@ -26,7 +26,7 @@
index 348885062fbb7ba1ef87900aff775724508ac127..95920681a46b4557cd420e5c167649f4bdcde428 100644 (file)
@@ -1,14 +1,15 @@
 --- a/configure.ac
 +++ b/configure.ac
-@@ -830,10 +830,7 @@ fi
- have_cpuid_h="no"
AC_CHECK_HEADERS(cpuid.h, [have_cpuid_h="yes"])
+@@ -526,11 +526,7 @@ if test "x$ac_system" = "xLinux"; then
+     [have_cpuid_h="no (cpuid.h not found)"]
  )
  
--have_capability="yes"
--AC_CHECK_HEADERS(sys/capability.h,
--                 [have_capability="yes"],
--                 [have_capability="no (<sys/capability.h> not found)"])
-+have_capability="no"
- if test "x$have_capability" = "xyes"; then
- AC_CHECK_LIB(cap, cap_get_proc,
-                  [have_capability="yes"],
+-  AC_CHECK_HEADERS([sys/capability.h],
+-    [have_capability="yes"],
+-    [have_capability="no (<sys/capability.h> not found)"]
+-  )
+-
++  have_capability="no"
+   if test "x$have_capability" = "xyes"; then
+     AC_CHECK_LIB([cap], [cap_get_proc],
+       [have_capability="yes"],
index 287bda4b87a07be91f4db037a8c2ae240b81b8a1..69aaf791284e6f8665dddbc6f2c01db85575a7a2 100644 (file)
@@ -1,24 +1,26 @@
 --- a/configure.ac
 +++ b/configure.ac
-@@ -804,6 +804,9 @@ AC_CACHE_CHECK([whether clock_boottime a
-                      [c_cv_have_clock_boottime_monotonic="no"]))
+@@ -710,6 +710,11 @@ AC_CACHE_CHECK([whether clock_boottime a
+   ]
+ )
  
 +# For the iwinfo plugin
-+AC_CHECK_LIB(iwinfo, iwinfo_backend, [with_iwinfo="yes"], [with_iwinfo="no (libiwinfo not found)"], [])
-+
- # For the turbostat plugin
- have_asm_msrindex_h="no"
- AC_CHECK_HEADERS(asm/msr-index.h, [have_asm_msrindex_h="yes"])
-@@ -6035,6 +6038,7 @@ plugin_interface="no"
++AC_CHECK_LIB([iwinfo], [iwinfo_backend],
++    [with_iwinfo="yes"],
++    [with_iwinfo="no (libiwinfo not found)"]
++)
+ #
+ # Checks for typedefs, structures, and compiler characteristics.
+@@ -6127,6 +6132,7 @@ plugin_ipc="no"
  plugin_ipmi="no"
  plugin_ipvs="no"
  plugin_irq="no"
 +plugin_iwinfo="no"
  plugin_load="no"
  plugin_log_logstash="no"
- plugin_memory="no"
-@@ -6505,6 +6509,7 @@ AC_PLUGIN([ipmi],                [$plugi
+ plugin_mcelog="no"
+@@ -6538,6 +6544,7 @@ AC_PLUGIN([ipmi],                [$plugi
  AC_PLUGIN([iptables],            [$with_libiptc],           [IPTables rule counters])
  AC_PLUGIN([ipvs],                [$plugin_ipvs],            [IPVS connection statistics])
  AC_PLUGIN([irq],                 [$plugin_irq],             [IRQ statistics])
@@ -26,7 +28,7 @@
  AC_PLUGIN([java],                [$with_java],              [Embed the Java Virtual Machine])
  AC_PLUGIN([load],                [$plugin_load],            [System load])
  AC_PLUGIN([log_logstash],        [$plugin_log_logstash],    [Logstash json_event compatible logging])
-@@ -6886,6 +6891,7 @@ AC_MSG_RESULT([    libyajl . . . . . . .
+@@ -6899,6 +6906,7 @@ AC_MSG_RESULT([    libyajl . . . . . . .
  AC_MSG_RESULT([    oracle  . . . . . . . $with_oracle])
  AC_MSG_RESULT([    protobuf-c  . . . . . $have_protoc_c])
  AC_MSG_RESULT([    protoc 3  . . . . . . $have_protoc3])
@@ -34,7 +36,7 @@
  AC_MSG_RESULT()
  AC_MSG_RESULT([  Features:])
  AC_MSG_RESULT([    daemon mode . . . . . $enable_daemon])
-@@ -6942,6 +6948,7 @@ AC_MSG_RESULT([    ipmi  . . . . . . . .
+@@ -6957,6 +6965,7 @@ AC_MSG_RESULT([    ipmi  . . . . . . . .
  AC_MSG_RESULT([    iptables  . . . . . . $enable_iptables])
  AC_MSG_RESULT([    ipvs  . . . . . . . . $enable_ipvs])
  AC_MSG_RESULT([    irq . . . . . . . . . $enable_irq])
@@ -44,7 +46,7 @@
  AC_MSG_RESULT([    logfile . . . . . . . $enable_logfile])
 --- a/src/collectd.conf.in
 +++ b/src/collectd.conf.in
-@@ -135,6 +135,7 @@
+@@ -137,6 +137,7 @@
  #@BUILD_PLUGIN_IPTABLES_TRUE@LoadPlugin iptables
  #@BUILD_PLUGIN_IPVS_TRUE@LoadPlugin ipvs
  #@BUILD_PLUGIN_IRQ_TRUE@LoadPlugin irq
@@ -52,7 +54,7 @@
  #@BUILD_PLUGIN_JAVA_TRUE@LoadPlugin java
  @BUILD_PLUGIN_LOAD_TRUE@@BUILD_PLUGIN_LOAD_TRUE@LoadPlugin load
  #@BUILD_PLUGIN_LPAR_TRUE@LoadPlugin lpar
-@@ -649,6 +650,12 @@
+@@ -720,6 +721,12 @@
  #     IgnoreSelected true
  #</Plugin>
  
@@ -67,7 +69,7 @@
  #     JVMArg "-Djava.class.path=@prefix@/share/collectd/java/collectd-api.jar"
 --- a/src/collectd.conf.pod
 +++ b/src/collectd.conf.pod
-@@ -3143,6 +3143,27 @@ and all other interrupts are collected.
+@@ -3503,6 +3503,27 @@ and all other interrupts are collected.
  
  =back
  
 +      plugin_register_config("iwinfo", iwinfo_config, config_keys, config_keys_num);
 +      plugin_register_read("iwinfo", iwinfo_read);
 +}
---- a/src/Makefile.am
-+++ b/src/Makefile.am
-@@ -568,6 +568,13 @@ irq_la_SOURCES = irq.c
- irq_la_LDFLAGS = $(PLUGIN_LDFLAGS)
- endif
-+if BUILD_PLUGIN_IWINFO
-+pkglib_LTLIBRARIES += iwinfo.la
-+iwinfo_la_SOURCES = iwinfo.c
-+iwinfo_la_LDFLAGS = -module -avoid-version
-+iwinfo_la_LIBADD = -liwinfo
-+endif
-+
- if BUILD_PLUGIN_JAVA
- pkglib_LTLIBRARIES += java.la
- java_la_SOURCES = java.c
 --- a/src/types.db
 +++ b/src/types.db
-@@ -260,6 +260,7 @@ voltage_threshold       value:GAUGE:U:U,
+@@ -269,6 +269,7 @@ voltage_threshold       value:GAUGE:U:U,
  vs_memory               value:GAUGE:0:9223372036854775807
  vs_processes            value:GAUGE:0:65535
  vs_threads              value:GAUGE:0:65535
  
  #
  # Legacy types
+--- a/Makefile.am
++++ b/Makefile.am
+@@ -983,6 +983,14 @@ irq_la_LDFLAGS = $(PLUGIN_LDFLAGS)
+ irq_la_LIBADD = libignorelist.la
+ endif
++if BUILD_PLUGIN_IWINFO
++pkglib_LTLIBRARIES += iwinfo.la
++iwinfo_la_SOURCES = src/iwinfo.c
++#iwinfo_la_LDFLAGS = -module -avoid-version
++iwinfo_la_LDFLAGS = $(PLUGIN_LDFLAGS)
++iwinfo_la_LIBADD = -liwinfo libignorelist.la
++endif
++
+ if BUILD_PLUGIN_JAVA
+ pkglib_LTLIBRARIES += java.la
+ java_la_SOURCES = src/java.c
index 5178f099367c91bb955b789af6db832a8e481361..f7f4645a20d2212f07b9275e1ba474e805157fb2 100644 (file)
@@ -8,8 +8,8 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=hd-idle
-PKG_VERSION:=1.04
-PKG_RELEASE:=2
+PKG_VERSION:=1.05
+PKG_RELEASE:=1
 
 PKG_MAINTAINER:=Lim Guo Wei <limguowei@gmail.com>
 PKG_LICENSE:=GPL-2.0
@@ -17,7 +17,7 @@ PKG_LICENSE_FILES:=
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tgz
 PKG_SOURCE_URL:=@SF/$(PKG_NAME)
-PKG_HASH:=308e90104d7ee8124db50dc9b0d8c61c6afc65d524de2e75f76d84f80674fbdc
+PKG_HASH:=4efefe79d145b50e055582730d9d685e485da3df3dad90fef030036d52aa3a0c
 
 PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)
 
index 6db1b311752cc39f27da592f4bd21e85078df735..a98fcfc54482aa64a44cd30a8aedcd37e11b8ef8 100644 (file)
@@ -332,6 +332,11 @@ rpc_lxc_info(struct ubus_context *ctx, struct ubus_object *obj,
        l = rpc_lxc_init(tb);
        if (!l)
                return UBUS_STATUS_INVALID_ARGUMENT;
+
+       if (!l->container->is_running(l->container) &&
+           !l->container->is_defined(l->container))
+               return UBUS_STATUS_NOT_FOUND;
+
        blob_buf_init(&buf, 0);
 
        blobmsg_add_string(&buf, "name", l->container->name);
index 71751968ab5a49bba579218b2d6e0a89d4dc84c8..60df6f57992684821f61aa9c95f8ede67b2a1592 100644 (file)
@@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=sysstat
 PKG_VERSION:=11.6.0
-PKG_RELEASE:=1
+PKG_RELEASE:=2
 
 PKG_LICENSE:=GPL-2.0
 PKG_MAINTAINER:=Marko Ratkaj <marko.ratkaj@sartura.hr>
diff --git a/utils/sysstat/patches/110-remove-sccsid.patch b/utils/sysstat/patches/110-remove-sccsid.patch
new file mode 100644 (file)
index 0000000..05c1032
--- /dev/null
@@ -0,0 +1,131 @@
+From: Robert Luberda <robert@debian.org>
+Date: Wed, 9 Sep 2015 21:37:37 +0200
+Subject: Remove scscid()
+
+Remove sccsid() function togethwe with SCCSID string that
+contained __DATE__ and __TIME__ macros. This should cause
+binary to be more reproducible, see
+https://wiki.debian.org/ReproducibleBuilds/TimestampsFromCPPMacros
+---
+ cifsiostat.c | 3 ---
+ iostat.c     | 3 ---
+ mpstat.c     | 3 ---
+ pidstat.c    | 3 ---
+ sadc.c       | 3 ---
+ sadf.c       | 3 ---
+ sar.c        | 3 ---
+ tapestat.c   | 3 ---
+ 8 files changed, 24 deletions(-)
+
+diff --git a/cifsiostat.c b/cifsiostat.c
+index a3c81d0..4668a7c 100644
+--- a/cifsiostat.c
++++ b/cifsiostat.c
+@@ -41,9 +41,6 @@
+ #define _(string) (string)
+ #endif
+-#define SCCSID "@(#)sysstat-" VERSION ": " __FILE__ " compiled " __DATE__ " " __TIME__
+-char *sccsid(void) { return (SCCSID); }
+-
+ unsigned long long uptime0[2] = {0, 0};
+ struct cifs_stats *st_cifs[2];
+ struct io_hdr_stats *st_hdr_cifs;
+diff --git a/iostat.c b/iostat.c
+index 7b346e2..a0199d2 100644
+--- a/iostat.c
++++ b/iostat.c
+@@ -48,9 +48,6 @@
+ #define _(string) (string)
+ #endif
+-#define SCCSID "@(#)sysstat-" VERSION ": " __FILE__ " compiled " __DATE__ " " __TIME__
+-char *sccsid(void) { return (SCCSID); }
+-
+ struct stats_cpu *st_cpu[2];
+ unsigned long long uptime[2]  = {0, 0};
+ unsigned long long uptime0[2] = {0, 0};
+diff --git a/mpstat.c b/mpstat.c
+index 1c83ea2..e4a040b 100644
+--- a/mpstat.c
++++ b/mpstat.c
+@@ -43,9 +43,6 @@
+ #define _(string) (string)
+ #endif
+-#define SCCSID "@(#)sysstat-" VERSION ": "  __FILE__ " compiled " __DATE__ " " __TIME__
+-char *sccsid(void) { return (SCCSID); }
+-
+ unsigned long long uptime[3] = {0, 0, 0};
+ unsigned long long uptime0[3] = {0, 0, 0};
+diff --git a/pidstat.c b/pidstat.c
+index 876635c..5372176 100644
+--- a/pidstat.c
++++ b/pidstat.c
+@@ -47,9 +47,6 @@
+ #define _(string) (string)
+ #endif
+-#define SCCSID "@(#)sysstat-" VERSION ": " __FILE__ " compiled " __DATE__ " " __TIME__
+-char *sccsid(void) { return (SCCSID); }
+-
+ unsigned long long uptime[3] = {0, 0, 0};
+ unsigned long long uptime0[3] = {0, 0, 0};
+ struct pid_stats *st_pid_list[3] = {NULL, NULL, NULL};
+diff --git a/sadc.c b/sadc.c
+index 7cdbc38..bfb4dac 100644
+--- a/sadc.c
++++ b/sadc.c
+@@ -52,9 +52,6 @@
+ #include "sensors/error.h"
+ #endif
+-#define SCCSID "@(#)sysstat-" VERSION ": " __FILE__ " compiled " __DATE__ " " __TIME__
+-char *sccsid(void) { return (SCCSID); }
+-
+ long interval = 0;
+ unsigned int flags = 0;
+diff --git a/sadf.c b/sadf.c
+index 160b485..0c0017c 100644
+--- a/sadf.c
++++ b/sadf.c
+@@ -41,9 +41,6 @@
+ # define _(string) (string)
+ #endif
+-#define SCCSID "@(#)sysstat-" VERSION ": " __FILE__ " compiled " __DATE__ " " __TIME__
+-char *sccsid(void) { return (SCCSID); }
+-
+ long interval = -1, count = 0;
+ unsigned int flags = 0;
+diff --git a/sar.c b/sar.c
+index ccf426e..07a9b4a 100644
+--- a/sar.c
++++ b/sar.c
+@@ -42,9 +42,6 @@
+ #define _(string) (string)
+ #endif
+-#define SCCSID "@(#)sysstat-" VERSION ": " __FILE__ " compiled " __DATE__ " " __TIME__
+-char *sccsid(void) { return (SCCSID); }
+-
+ /* Interval and count parameters */
+ long interval = -1, count = 0;
+diff --git a/tapestat.c b/tapestat.c
+index 268e4a5..df0a01b 100644
+--- a/tapestat.c
++++ b/tapestat.c
+@@ -58,9 +58,6 @@
+ #define _(string) (string)
+ #endif
+-#define SCCSID "@(#)sysstat-" VERSION ": " __FILE__ " compiled " __DATE__ " " __TIME__
+-char *sccsid(void) { return (SCCSID); }
+-
+ int cpu_nr = 0;               /* Nb of processors on the machine */
+ int flags = 0;                /* Flag for common options and system state */
index 1c8a16d3e4ed6c374f587c343809c06b82079fc9..2480c26572c98a324b7dcb11672eef88a5d26ca0 100644 (file)
@@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=vim
 PKG_VERSION:=8.0.586
-PKG_RELEASE:=1
+PKG_RELEASE:=2
 VIMVER:=80
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
@@ -114,7 +114,8 @@ CONFIGURE_ARGS += \
        --disable-cscope \
        --disable-gpm \
        --disable-acl \
-       --with-tlib=ncurses
+       --with-tlib=ncurses \
+       --with-compiledby="non-existent-hostname-compiled"
 
 CONFIGURE_VARS += \
        vim_cv_getcwd_broken=no \
@@ -126,6 +127,11 @@ CONFIGURE_VARS += \
        vim_cv_tty_group=root \
        vim_cv_tty_mode=0620
 
+define Build/Prepare
+       $(call Build/Prepare/Default)
+       $(MAKE) -C $(PKG_BUILD_DIR)/src autoconf
+endef
+
 ifneq ($(CONFIG_PACKAGE_vim),)
 define Build/Compile/vim
        $(call Build/Configure/Default, \
diff --git a/utils/vim/patches/001-support-defining-compilation-date-in-SOURCE_DATE_EPOCH.patch b/utils/vim/patches/001-support-defining-compilation-date-in-SOURCE_DATE_EPOCH.patch
new file mode 100644 (file)
index 0000000..220539c
--- /dev/null
@@ -0,0 +1,81 @@
+From: James McCoy <jamessan@jamessan.com>
+Date: Thu, 28 Jan 2016 10:55:11 -0500
+Subject: Support defining compilation date in $SOURCE_DATE_EPOCH
+
+There is an ongoing effort[0] to make FOSS software reproducibly
+buildable.  In order to make Vim build reproducibly, it is necessary to
+allow defining the date/time that is part of VIM_VERSION_LONG as part of
+the build process.
+
+This commit enables that by adding support for the SOURCE_DATE_EPOCH
+spec[1].  When the $SOURCE_DATE_EPOCH environment variable is defined,
+it will be used to populate the BUILD_DATE preprocessor define.
+
+If BUILD_DATE is not defined, the existing behavior of relying on the
+preprocessor's __DATE__/__TIME__ symbols will be used.
+
+[0]: https://reproducible-builds.org/
+[1]: https://reproducible-builds.org/specs/source-date-epoch/
+---
+ src/config.h.in  |  3 +++
+ src/configure.ac | 10 ++++++++++
+ src/version.c    |  6 ++++++
+ 3 files changed, 19 insertions(+)
+
+diff --git a/src/config.h.in b/src/config.h.in
+index e692d40..d3aa1a2 100644
+--- a/src/config.h.in
++++ b/src/config.h.in
+@@ -30,6 +30,9 @@
+ /* Define when __DATE__ " " __TIME__ can be used */
+ #undef HAVE_DATE_TIME
++/* Defined as the date of last modification */
++#undef BUILD_DATE
++
+ /* Define when __attribute__((unused)) can be used */
+ #undef HAVE_ATTRIBUTE_UNUSED
+diff --git a/src/configure.ac b/src/configure.ac
+index e287124..5a16797 100644
+--- a/src/configure.ac
++++ b/src/configure.ac
+@@ -29,6 +29,16 @@ dnl in autoconf needs it, where it uses STDC_HEADERS.
+ AC_HEADER_STDC
+ AC_HEADER_SYS_WAIT
++dnl If $SOURCE_DATE_EPOCH is present in the environment, use that as the
++dnl "compiled" timestamp in :version's output.  Attempt to get the formatted
++dnl date using GNU date syntax, BSD date syntax, and finally falling back to
++dnl just using the current time.
++if test -n "$SOURCE_DATE_EPOCH"; then
++  DATE_FMT="%b %d %Y %H:%M:%S"
++  BUILD_DATE=$(LC_ALL=C date -u -d "@$SOURCE_DATE_EPOCH" "+$DATE_FMT" 2>/dev/null || LC_ALL=C date -u -r "$SOURCE_DATE_EPOCH" "+$DATE_FMT" 2>/dev/null || LC_ALL=C date -u "+$DATE_FMT")
++  AC_DEFINE_UNQUOTED(BUILD_DATE, ["$BUILD_DATE"])
++fi
++
+ dnl Check for the flag that fails if stuff are missing.
+ AC_MSG_CHECKING(--enable-fail-if-missing argument)
+diff --git a/src/version.c b/src/version.c
+index 65f5a4b..9422657 100644
+--- a/src/version.c
++++ b/src/version.c
+@@ -44,11 +44,17 @@ make_version(void)
+      * VAX C can't catenate strings in the preprocessor.
+      */
+     strcpy(longVersion, VIM_VERSION_LONG_DATE);
++#ifdef BUILD_DATE
++    strcat(longVersion, BUILD_DATE);
++#else
+     strcat(longVersion, __DATE__);
+     strcat(longVersion, " ");
+     strcat(longVersion, __TIME__);
++#endif
+     strcat(longVersion, ")");
+ }
++# elif defined(BUILD_DATE)
++char  *longVersion = VIM_VERSION_LONG_DATE BUILD_DATE ")";
+ # else
+ char  *longVersion = VIM_VERSION_LONG_DATE __DATE__ " " __TIME__ ")";
+ # endif