]> git.ipfire.org Git - people/pmueller/ipfire-2.x.git/commitdiff
Merge remote-tracking branch 'origin/master' into next
authorArne Fitzenreiter <arne_f@ipfire.org>
Fri, 4 Mar 2016 06:09:02 +0000 (07:09 +0100)
committerArne Fitzenreiter <arne_f@ipfire.org>
Fri, 4 Mar 2016 06:09:02 +0000 (07:09 +0100)
Signed-off-by: Arne Fitzenreiter <arne_f@ipfire.org>
236 files changed:
config/dhcpc/dhcpcd-hooks/10-mtu [new file with mode: 0644]
config/dracut/dracut.conf
config/etc/modprobe.d/nf_conntrack.conf [new file with mode: 0644]
config/firewall/firewall-policy
config/kernel/kernel.config.armv5tel-ipfire-kirkwood
config/kernel/kernel.config.armv5tel-ipfire-multi
config/kernel/kernel.config.armv5tel-ipfire-rpi
config/kernel/kernel.config.i586-ipfire
config/kernel/kernel.config.i586-ipfire-pae
config/kernel/kernel.config.x86_64-ipfire
config/rootfiles/common/armv5tel/binutils
config/rootfiles/common/armv5tel/gcc
config/rootfiles/common/armv5tel/initscripts
config/rootfiles/common/bison
config/rootfiles/common/diffutils
config/rootfiles/common/i586/binutils
config/rootfiles/common/i586/gcc
config/rootfiles/common/i586/initscripts
config/rootfiles/common/libmpc [new file with mode: 0644]
config/rootfiles/common/lua [new file with mode: 0644]
config/rootfiles/common/ncurses
config/rootfiles/common/ntp
config/rootfiles/common/stage2
config/rootfiles/common/tzdata
config/rootfiles/common/x86_64/binutils
config/rootfiles/common/x86_64/gcc
config/rootfiles/common/x86_64/initscripts
config/rootfiles/common/xz
config/rootfiles/core/100/exclude [moved from config/rootfiles/core/96/exclude with 100% similarity]
config/rootfiles/core/100/filelists/bind [new symlink]
config/rootfiles/core/100/filelists/dnsmasq [moved from config/rootfiles/core/96/filelists/dnsmasq with 100% similarity]
config/rootfiles/core/100/filelists/files [new file with mode: 0644]
config/rootfiles/core/100/filelists/grep [new symlink]
config/rootfiles/core/100/filelists/ntp [moved from config/rootfiles/core/96/filelists/ntp with 100% similarity]
config/rootfiles/core/100/filelists/openssh [moved from config/rootfiles/core/97/filelists/openssh with 100% similarity]
config/rootfiles/core/100/filelists/openvpn [new symlink]
config/rootfiles/core/100/filelists/sed [new symlink]
config/rootfiles/core/100/filelists/squid [new symlink]
config/rootfiles/core/100/filelists/tzdata [new symlink]
config/rootfiles/core/100/filelists/xz [new symlink]
config/rootfiles/core/100/meta [moved from config/rootfiles/core/96/meta with 100% similarity]
config/rootfiles/core/100/update.sh [new file with mode: 0644]
config/rootfiles/core/98/filelists/files [deleted file]
config/rootfiles/oldcore/96/exclude [moved from config/rootfiles/core/97/exclude with 100% similarity]
config/rootfiles/oldcore/96/filelists/curl [moved from config/rootfiles/core/96/filelists/curl with 100% similarity]
config/rootfiles/oldcore/96/filelists/dma [moved from config/rootfiles/core/96/filelists/dma with 100% similarity]
config/rootfiles/oldcore/96/filelists/dnsmasq [new symlink]
config/rootfiles/oldcore/96/filelists/files [moved from config/rootfiles/core/96/filelists/files with 100% similarity]
config/rootfiles/oldcore/96/filelists/i586/grub [moved from config/rootfiles/core/96/filelists/i586/grub with 100% similarity]
config/rootfiles/oldcore/96/filelists/i586/openssl-sse2 [moved from config/rootfiles/core/96/filelists/i586/openssl-sse2 with 100% similarity]
config/rootfiles/oldcore/96/filelists/i586/strongswan-padlock [moved from config/rootfiles/core/96/filelists/i586/strongswan-padlock with 100% similarity]
config/rootfiles/oldcore/96/filelists/libnet [moved from config/rootfiles/core/96/filelists/libnet with 100% similarity]
config/rootfiles/oldcore/96/filelists/mdadm [moved from config/rootfiles/core/96/filelists/mdadm with 100% similarity]
config/rootfiles/oldcore/96/filelists/ntp [new symlink]
config/rootfiles/oldcore/96/filelists/openssl [moved from config/rootfiles/core/96/filelists/openssl with 100% similarity]
config/rootfiles/oldcore/96/filelists/rrdtool [moved from config/rootfiles/core/96/filelists/rrdtool with 100% similarity]
config/rootfiles/oldcore/96/filelists/strongswan [moved from config/rootfiles/core/96/filelists/strongswan with 100% similarity]
config/rootfiles/oldcore/96/filelists/x86_64/grub [moved from config/rootfiles/core/96/filelists/x86_64/grub with 100% similarity]
config/rootfiles/oldcore/96/meta [moved from config/rootfiles/core/97/meta with 100% similarity]
config/rootfiles/oldcore/96/update.sh [moved from config/rootfiles/core/96/update.sh with 100% similarity]
config/rootfiles/oldcore/97/exclude [moved from config/rootfiles/core/98/exclude with 100% similarity]
config/rootfiles/oldcore/97/filelists/files [new file with mode: 0644]
config/rootfiles/oldcore/97/filelists/hwdata [moved from config/rootfiles/core/97/filelists/hwdata with 100% similarity]
config/rootfiles/oldcore/97/filelists/i586/openssl-sse2 [moved from config/rootfiles/core/97/filelists/i586/openssl-sse2 with 100% similarity]
config/rootfiles/oldcore/97/filelists/openssh [new symlink]
config/rootfiles/oldcore/97/filelists/openssl [moved from config/rootfiles/core/97/filelists/openssl with 100% similarity]
config/rootfiles/oldcore/97/meta [moved from config/rootfiles/core/98/meta with 100% similarity]
config/rootfiles/oldcore/97/update.sh [moved from config/rootfiles/core/97/update.sh with 100% similarity]
config/rootfiles/oldcore/98/exclude [new file with mode: 0644]
config/rootfiles/oldcore/98/filelists/armv5tel/glibc [moved from config/rootfiles/core/98/filelists/armv5tel/glibc with 100% similarity]
config/rootfiles/oldcore/98/filelists/files [moved from config/rootfiles/core/97/filelists/files with 100% similarity]
config/rootfiles/oldcore/98/filelists/i586/glibc [moved from config/rootfiles/core/98/filelists/i586/glibc with 100% similarity]
config/rootfiles/oldcore/98/filelists/x86_64/glibc [moved from config/rootfiles/core/98/filelists/x86_64/glibc with 100% similarity]
config/rootfiles/oldcore/98/meta [new file with mode: 0644]
config/rootfiles/oldcore/98/update.sh [moved from config/rootfiles/core/98/update.sh with 100% similarity]
config/rootfiles/packages/dnsdist [new file with mode: 0644]
config/rootfiles/packages/mediatomb.off [moved from config/rootfiles/packages/mediatomb with 100% similarity]
config/rootfiles/packages/nano
config/rootfiles/packages/owncloud
config/udev/60-net.rules
doc/language_issues.de
doc/language_issues.en
doc/language_issues.es
doc/language_issues.fr
doc/language_issues.it
doc/language_issues.nl
doc/language_issues.pl
doc/language_issues.ru
doc/language_issues.tr
doc/language_missings
html/cgi-bin/logs.cgi/firewalllog.dat
html/cgi-bin/logs.cgi/firewalllogcountry.dat
html/cgi-bin/logs.cgi/firewalllogip.dat
html/cgi-bin/logs.cgi/firewalllogport.dat
html/cgi-bin/logs.cgi/showrequestfromcountry.dat
html/cgi-bin/logs.cgi/showrequestfromip.dat
html/cgi-bin/logs.cgi/showrequestfromport.dat
html/cgi-bin/optionsfw.cgi
html/cgi-bin/ovpnmain.cgi
html/cgi-bin/qos.cgi
html/cgi-bin/webaccess.cgi
langs/de/cgi-bin/de.pl
langs/en/cgi-bin/en.pl
lfs/Config
lfs/backports
lfs/bind
lfs/binutils
lfs/bison
lfs/ccache
lfs/cleanup-toolchain
lfs/cmake
lfs/configroot
lfs/dhcpcd
lfs/dnsdist [new file with mode: 0644]
lfs/dnsmasq
lfs/flash-images
lfs/gcc
lfs/glibc
lfs/grep
lfs/grub
lfs/libmpc [new file with mode: 0644]
lfs/linux
lfs/lua [new file with mode: 0644]
lfs/m4
lfs/nano
lfs/ntp
lfs/openvpn
lfs/owncloud
lfs/rsync
lfs/sed
lfs/squid
lfs/tzdata
lfs/xz
make.sh
src/initscripts/init.d/dnsdist [new file with mode: 0644]
src/initscripts/init.d/firewall
src/initscripts/init.d/functions
src/initscripts/init.d/networking/dhcpcd.exe
src/misc-progs/qosctrl.c
src/misc-progs/timectrl.c
src/misc-progs/wirelessctrl.c
src/patches/arm-multi-grsec-compile-fixes.patch [new file with mode: 0644]
src/patches/backports-4.2.6-1-add_usbnet_modules.patch [moved from src/patches/backports-3.18.1-1-add_usbnet_modules.patch with 93% similarity]
src/patches/backports-4.2.6-1-grsecurity.patch [moved from src/patches/backports-3.18.1-1-grsecurity.patch with 72% similarity]
src/patches/backports-4.2.6-1-mt7601_upstream_fixes.patch [new file with mode: 0644]
src/patches/binutils-2.22-pt-pax-flags-20111121.patch [deleted file]
src/patches/binutils-2.24-pt-pax-flags-20131231.patch [new file with mode: 0644]
src/patches/dnsmasq-Add-support-to-read-ISC-DHCP-lease-file.patch
src/patches/dnsmasq/001-Add_TTL_parameter_to_--host-record_and_--cname.patch [new file with mode: 0644]
src/patches/dnsmasq/001-include_0_0_0_0_8_in_DNS_rebind_checks.patch [deleted file]
src/patches/dnsmasq/002-Add_--dhcp-ttl_option.patch [new file with mode: 0644]
src/patches/dnsmasq/002-enhance_add_subnet_to_allow_arbitary_subnet_addresses.patch [deleted file]
src/patches/dnsmasq/003-Update_CHANGELOG.patch [new file with mode: 0644]
src/patches/dnsmasq/003-dont_answer_non_auth_queries_for_auth_zones_locally_when_localise_queries_set.patch [deleted file]
src/patches/dnsmasq/004-Add_--tftp-mtu_option.patch [new file with mode: 0644]
src/patches/dnsmasq/004-fix_behaviour_of_empty_dhcp-option.patch [deleted file]
src/patches/dnsmasq/005-Apply_ceiling_of_lease_length_to_TTL_when_--dhcp-ttl_in_use.patch [new file with mode: 0644]
src/patches/dnsmasq/005-suggest_solution_to_ENOMEM_error_with_IPv6_multicast.patch [deleted file]
src/patches/dnsmasq/006-clarify_man_page_on_RDNSS_set_in_router_advertisement.patch [deleted file]
src/patches/dnsmasq/007-handle_signed_dangling_CNAME_replies_to_DS_queries.patch [deleted file]
src/patches/dnsmasq/008-DHCPv6_option_56_does_not_hold_an_address_list.patch [deleted file]
src/patches/dnsmasq/009-Respect_the_--no_resolv_flag_in_inotify_code.patch [deleted file]
src/patches/dnsmasq/010-Rationalise_5e3e464ac4022ee0b3794513abe510817e2cf3ca.patch [deleted file]
src/patches/dnsmasq/011-Catch_errors_from_sendmsg_in_DHCP_code.patch [deleted file]
src/patches/dnsmasq/012-Update_list_of_subnet_for_--bogus-priv.patch [deleted file]
src/patches/dnsmasq/013-Fix_crash_when_empty_address_from_DNS_overlays_A_record_from.patch [deleted file]
src/patches/dnsmasq/014-Handle_unknown_DS_hash_algos_correctly.patch [deleted file]
src/patches/dnsmasq/015-Fix_crash_at_start_up_with_conf-dir.patch [deleted file]
src/patches/dnsmasq/016-Major_rationalisation_of_DNSSEC_validation.patch [deleted file]
src/patches/dnsmasq/017-Abandon_caching_RRSIGs_and_returning_them_from_cache.patch [deleted file]
src/patches/dnsmasq/018-Move_code_which_caches_DS_records_to_a_more_logical_place.patch [deleted file]
src/patches/dnsmasq/019-Generalise_RR-filtering_code_for_use_with_EDNS0.patch [deleted file]
src/patches/dnsmasq/020-DNSSEC_validation_tweak.patch [deleted file]
src/patches/dnsmasq/021-Tweaks_to_EDNS0_handling_in_DNS_replies.patch [deleted file]
src/patches/dnsmasq/022-Tidy_up_DNSSEC_non-existence_code_Check_zone_status_is_NSEC_proof_bad.patch [deleted file]
src/patches/dnsmasq/023-Fix_brace_botch_in_dnssec_validate_ds.patch [deleted file]
src/patches/dnsmasq/024-Do_a_better_job_of_determining_which_DNSSEC_sig_algos_are_supported.patch [deleted file]
src/patches/gcc/gcc-fix-inlining-issues.patch [new file with mode: 0644]
src/patches/gcc/gcc44-build-id.patch [deleted file]
src/patches/gcc/gcc44-c++-builtin-redecl.patch [deleted file]
src/patches/gcc/gcc44-i386-libgomp.patch [deleted file]
src/patches/gcc/gcc44-no-add-needed.patch [deleted file]
src/patches/gcc/gcc44-pr33763.patch [deleted file]
src/patches/gcc/gcc44-rh330771.patch [deleted file]
src/patches/gcc/gcc44-rh533181.patch [deleted file]
src/patches/gcc/gcc44-rh610785.patch [deleted file]
src/patches/gcc/gcc44-unwind-debug-hook.patch [deleted file]
src/patches/gcc/gcc49-i386-libgomp.patch [new file with mode: 0644]
src/patches/gcc/gcc49-libtool-no-rpath.patch [moved from src/patches/gcc/gcc44-libtool-no-rpath.patch with 100% similarity]
src/patches/gcc/gcc49-no-add-needed.patch [new file with mode: 0644]
src/patches/gcc/gcc49-pr38757.patch [new file with mode: 0644]
src/patches/gcc/gcc49-pr64336.patch [new file with mode: 0644]
src/patches/glibc/glibc-mq_open.patch [new file with mode: 0644]
src/patches/linux-3.10-dvb_tevi_s482.patch [deleted file]
src/patches/linux/0001-Drivers-net-hyperv-Get-rid-of-the-rndis_filter_packe.patch [new file with mode: 0644]
src/patches/linux/0001-hyperv-Add-support-for-virtual-Receive-Side-Scaling-.patch [new file with mode: 0644]
src/patches/linux/0002-Drivers-net-hyperv-Cleanup-the-receive-path.patch [new file with mode: 0644]
src/patches/linux/0002-hyperv-Remove-recv_pkt_list-and-lock.patch [new file with mode: 0644]
src/patches/linux/0003-Drivers-net-hyperv-Cleanup-the-netvsc-receive-callba.patch [new file with mode: 0644]
src/patches/linux/0003-hyperv-Simplify-the-send_completion-variables.patch [new file with mode: 0644]
src/patches/linux/0004-hyperv-Add-latest-NetVSP-versions-to-auto-negotiatio.patch [new file with mode: 0644]
src/patches/linux/0004-hyperv-Enable-sendbuf-mechanism-on-the-send-path.patch [new file with mode: 0644]
src/patches/linux/0005-Add-support-for-netvsc-build-without-CONFIG_SYSFS-fl.patch [new file with mode: 0644]
src/patches/linux/0005-Drivers-net-hyperv-Enable-scatter-gather-I-O.patch [new file with mode: 0644]
src/patches/linux/0006-Drivers-net-hyperv-Cleanup-the-send-path.patch [new file with mode: 0644]
src/patches/linux/0006-net-get-rid-of-SET_ETHTOOL_OPS.patch [new file with mode: 0644]
src/patches/linux/0007-Drivers-net-hyperv-Enable-offloads-on-the-host.patch [new file with mode: 0644]
src/patches/linux/0007-hyperv-Add-hash-value-into-RNDIS-Per-packet-info.patch [new file with mode: 0644]
src/patches/linux/0008-Drivers-net-hyperv-Enable-receive-side-IP-checksum-o.patch [new file with mode: 0644]
src/patches/linux/0008-hyperv-fix-apparent-cut-n-paste-error-in-send-path-t.patch [new file with mode: 0644]
src/patches/linux/0009-Drivers-net-hyperv-Enable-send-side-checksum-offload.patch [new file with mode: 0644]
src/patches/linux/0009-hyperv-Fix-error-return-code-in-netvsc_init_buf.patch [new file with mode: 0644]
src/patches/linux/0010-Drivers-net-hyperv-Enable-large-send-offload.patch [new file with mode: 0644]
src/patches/linux/0010-hyperv-Fix-a-bug-in-netvsc_start_xmit.patch [new file with mode: 0644]
src/patches/linux/0011-hyperv-Change-the-receive-buffer-size-for-legacy-hos.patch [moved from src/patches/linux-3.14.x-hyperv-2008-fix.patch with 81% similarity]
src/patches/linux/0011-hyperv-Fix-a-bug-in-netvsc_send.patch [new file with mode: 0644]
src/patches/linux/0012-Drivers-net-hyperv-Allocate-memory-for-all-possible-.patch [new file with mode: 0644]
src/patches/linux/0013-Drivers-net-hyperv-Negotiate-suitable-ndis-version-f.patch [new file with mode: 0644]
src/patches/linux/0014-Drivers-net-hyperv-Address-UDP-checksum-issues.patch [new file with mode: 0644]
src/patches/linux/0015-hyperv-Properly-handle-checksum-offload.patch [new file with mode: 0644]
src/patches/linux/0016-hyperv-Add-support-for-virtual-Receive-Side-Scaling-.patch [new file with mode: 0644]
src/patches/linux/0017-hyperv-Remove-recv_pkt_list-and-lock.patch [new file with mode: 0644]
src/patches/linux/0018-hyperv-Simplify-the-send_completion-variables.patch [new file with mode: 0644]
src/patches/linux/0019-hyperv-Enable-sendbuf-mechanism-on-the-send-path.patch [new file with mode: 0644]
src/patches/linux/0020-Add-support-for-netvsc-build-without-CONFIG_SYSFS-fl.patch [new file with mode: 0644]
src/patches/linux/0021-hyperv-Add-hash-value-into-RNDIS-Per-packet-info.patch [new file with mode: 0644]
src/patches/linux/0022-hyperv-fix-apparent-cut-n-paste-error-in-send-path-t.patch [new file with mode: 0644]
src/patches/linux/0023-hyperv-Fix-error-return-code-in-netvsc_init_buf.patch [new file with mode: 0644]
src/patches/linux/0024-hyperv-Fix-a-bug-in-netvsc_send.patch [new file with mode: 0644]
src/patches/linux/0025-Drivers-hv-vmbus-Support-per-channel-driver-state.patch [new file with mode: 0644]
src/patches/lua-5.3.0-autotoolize.patch [new file with mode: 0644]
src/patches/ntp-fix-sycing-with-local-clock.patch [deleted file]
src/patches/squid-3.4-13230.patch [new file with mode: 0644]
src/patches/squid-3.4.14-fix-max-file-descriptors.patch [new file with mode: 0644]
src/ppp/ip-up
tools/make-functions

diff --git a/config/dhcpc/dhcpcd-hooks/10-mtu b/config/dhcpc/dhcpcd-hooks/10-mtu
new file mode 100644 (file)
index 0000000..49e0519
--- /dev/null
@@ -0,0 +1,31 @@
+# Configure the MTU for the interface
+
+eval $(/usr/local/bin/readhash /var/ipfire/ethernet/settings)
+
+set_mtu()
+{
+       local mtu=$1
+       ip link set "$interface" mtu "$mtu"
+
+       # test for buggy nic that lose link at mtu set...
+       carrier=`cat /sys/class/net/$interface/carrier`
+       if [ "$carrier" == "0" ]; then
+               syslog info "Warning! Carrier loss after MTU set. Reinit ..."
+               ip link set "$interface" down
+               ip link set "$interface" up
+       fi
+}
+if [ -n "$new_interface_mtu" ] && $if_up; then
+       if [ $RED_DHCP_FORCE_MTU -ge 576 ]; then
+               new_interface_mtu=$RED_DHCP_FORCE_MTU
+       fi
+       if [ ! "$new_interface_mtu" == "$ifmtu" ]; then
+               # The smalled MTU dhcpcd can work with is 576
+               if [ "$new_interface_mtu" -gt 576 ]; then
+                       if set_mtu "$new_interface_mtu"; then
+                               syslog info "MTU set to $new_interface_mtu"
+                       fi
+               fi
+       fi
+fi
+
index 34e6a667d84600e56b8a38425bd54d7b00c3f243..52bba9c6294eee6532d1f1d54a7fe1abe26bcca8 100644 (file)
@@ -21,6 +21,9 @@
 # additional kernel modules to the default
 #add_drivers+=""
 
+# skip kernel modules (marvell sdio and compat from backports)
+omit_drivers+="libertas libertas_sdio mwifiex mwifiex_sdio compat"
+
 # list of kernel filesystem modules to be included in the generic initramfs
 filesystems+="reiserfs vfat xfs"
 
diff --git a/config/etc/modprobe.d/nf_conntrack.conf b/config/etc/modprobe.d/nf_conntrack.conf
new file mode 100644 (file)
index 0000000..d5a1813
--- /dev/null
@@ -0,0 +1,2 @@
+# Disable automatic conntrack helper assignment
+options nf_conntrack nf_conntrack_helper=0
index 4ba1ace8cec12cee5aab07082e1c8d0cc107a053..cbba3b021a4eb93bd3609ea58edaaea3cbe1353f 100755 (executable)
@@ -60,6 +60,11 @@ HAVE_OPENVPN="true"
 # Allow access from GREEN
 iptables -A POLICYIN -i "${GREEN_DEV}" -j ACCEPT
 
+# Allow access from BLUE
+if [ "${HAVE_BLUE}" = "true" ] && [ -n "${BLUE_DEV}" ]; then
+       iptables -A POLICYIN -i "${BLUE_DEV}" -j ACCEPT
+fi
+
 # IPsec INPUT
 case "${HAVE_IPSEC},${POLICY}" in
        true,MODE1) ;;
index 325add296e0f07daece734a745708323f2af4c51..9ec9b978696fcc59b82ca4f7c866145cf8eaaf9c 100644 (file)
@@ -1,6 +1,6 @@
 #
 # Automatically generated file; DO NOT EDIT.
-# Linux/arm 3.14.53 Kernel Configuration
+# Linux/arm 3.14.61 Kernel Configuration
 #
 CONFIG_ARM=y
 CONFIG_SYS_SUPPORTS_APM_EMULATION=y
@@ -196,8 +196,8 @@ CONFIG_SECCOMP_FILTER=y
 CONFIG_HAVE_CC_STACKPROTECTOR=y
 CONFIG_CC_STACKPROTECTOR=y
 # CONFIG_CC_STACKPROTECTOR_NONE is not set
-CONFIG_CC_STACKPROTECTOR_REGULAR=y
-# CONFIG_CC_STACKPROTECTOR_STRONG is not set
+# CONFIG_CC_STACKPROTECTOR_REGULAR is not set
+CONFIG_CC_STACKPROTECTOR_STRONG=y
 CONFIG_HAVE_CONTEXT_TRACKING=y
 CONFIG_HAVE_VIRT_CPU_ACCOUNTING_GEN=y
 CONFIG_HAVE_IRQ_TIME_ACCOUNTING=y
@@ -5238,8 +5238,7 @@ CONFIG_GRKERNSEC_PROC_MEMMAP=y
 CONFIG_GRKERNSEC_BRUTE=y
 CONFIG_GRKERNSEC_MODHARDEN=y
 CONFIG_GRKERNSEC_HIDESYM=y
-CONFIG_GRKERNSEC_RANDSTRUCT=y
-CONFIG_GRKERNSEC_RANDSTRUCT_PERFORMANCE=y
+# CONFIG_GRKERNSEC_RANDSTRUCT is not set
 CONFIG_GRKERNSEC_KERN_LOCKOUT=y
 
 #
index 9729903a7d3a42e2d532f211f49a554861536119..9bb91365bb3f8bf5983b95d65559a38fa9e9d94d 100644 (file)
@@ -1,6 +1,6 @@
 #
 # Automatically generated file; DO NOT EDIT.
-# Linux/arm 3.14.53 Kernel Configuration
+# Linux/arm 3.14.61 Kernel Configuration
 #
 CONFIG_ARM=y
 CONFIG_MIGHT_HAVE_PCI=y
@@ -219,8 +219,8 @@ CONFIG_HAVE_ARCH_SECCOMP_FILTER=y
 CONFIG_HAVE_CC_STACKPROTECTOR=y
 CONFIG_CC_STACKPROTECTOR=y
 # CONFIG_CC_STACKPROTECTOR_NONE is not set
-CONFIG_CC_STACKPROTECTOR_REGULAR=y
-# CONFIG_CC_STACKPROTECTOR_STRONG is not set
+# CONFIG_CC_STACKPROTECTOR_REGULAR is not set
+CONFIG_CC_STACKPROTECTOR_STRONG=y
 CONFIG_HAVE_CONTEXT_TRACKING=y
 CONFIG_HAVE_VIRT_CPU_ACCOUNTING_GEN=y
 CONFIG_HAVE_IRQ_TIME_ACCOUNTING=y
@@ -5726,8 +5726,7 @@ CONFIG_GRKERNSEC_PROC_MEMMAP=y
 CONFIG_GRKERNSEC_BRUTE=y
 CONFIG_GRKERNSEC_MODHARDEN=y
 CONFIG_GRKERNSEC_HIDESYM=y
-CONFIG_GRKERNSEC_RANDSTRUCT=y
-CONFIG_GRKERNSEC_RANDSTRUCT_PERFORMANCE=y
+# CONFIG_GRKERNSEC_RANDSTRUCT is not set
 CONFIG_GRKERNSEC_KERN_LOCKOUT=y
 CONFIG_GRKERNSEC_OLD_ARM_USERLAND=y
 
index 6e584cbfd546e3bc445bdf766ae1741c646a1b94..2501b14d2c86386c99030471932754e7054e04ca 100644 (file)
@@ -1,6 +1,6 @@
 #
 # Automatically generated file; DO NOT EDIT.
-# Linux/arm 3.14.53 Kernel Configuration
+# Linux/arm 3.14.61 Kernel Configuration
 #
 CONFIG_ARM=y
 CONFIG_SYS_SUPPORTS_APM_EMULATION=y
@@ -196,8 +196,8 @@ CONFIG_SECCOMP_FILTER=y
 CONFIG_HAVE_CC_STACKPROTECTOR=y
 CONFIG_CC_STACKPROTECTOR=y
 # CONFIG_CC_STACKPROTECTOR_NONE is not set
-CONFIG_CC_STACKPROTECTOR_REGULAR=y
-# CONFIG_CC_STACKPROTECTOR_STRONG is not set
+# CONFIG_CC_STACKPROTECTOR_REGULAR is not set
+CONFIG_CC_STACKPROTECTOR_STRONG=y
 CONFIG_HAVE_CONTEXT_TRACKING=y
 CONFIG_HAVE_VIRT_CPU_ACCOUNTING_GEN=y
 CONFIG_HAVE_IRQ_TIME_ACCOUNTING=y
@@ -3820,8 +3820,7 @@ CONFIG_GRKERNSEC_PROC_MEMMAP=y
 CONFIG_GRKERNSEC_BRUTE=y
 CONFIG_GRKERNSEC_MODHARDEN=y
 CONFIG_GRKERNSEC_HIDESYM=y
-CONFIG_GRKERNSEC_RANDSTRUCT=y
-CONFIG_GRKERNSEC_RANDSTRUCT_PERFORMANCE=y
+# CONFIG_GRKERNSEC_RANDSTRUCT is not set
 CONFIG_GRKERNSEC_KERN_LOCKOUT=y
 CONFIG_GRKERNSEC_OLD_ARM_USERLAND=y
 
index 734bea68436aa714b147667aa147c9cb8433da6b..8a4007bff7eec6119ab95311cfbb08eabccac1d4 100644 (file)
@@ -1,6 +1,6 @@
 #
 # Automatically generated file; DO NOT EDIT.
-# Linux/x86 3.14.57 Kernel Configuration
+# Linux/x86 3.14.61 Kernel Configuration
 #
 # CONFIG_64BIT is not set
 CONFIG_X86_32=y
@@ -247,8 +247,8 @@ CONFIG_SECCOMP_FILTER=y
 CONFIG_HAVE_CC_STACKPROTECTOR=y
 CONFIG_CC_STACKPROTECTOR=y
 # CONFIG_CC_STACKPROTECTOR_NONE is not set
-CONFIG_CC_STACKPROTECTOR_REGULAR=y
-# CONFIG_CC_STACKPROTECTOR_STRONG is not set
+# CONFIG_CC_STACKPROTECTOR_REGULAR is not set
+CONFIG_CC_STACKPROTECTOR_STRONG=y
 CONFIG_HAVE_IRQ_TIME_ACCOUNTING=y
 CONFIG_HAVE_ARCH_TRANSPARENT_HUGEPAGE=y
 CONFIG_HAVE_ARCH_SOFT_DIRTY=y
@@ -5731,8 +5731,7 @@ CONFIG_GRKERNSEC_PROC_MEMMAP=y
 CONFIG_GRKERNSEC_BRUTE=y
 CONFIG_GRKERNSEC_MODHARDEN=y
 CONFIG_GRKERNSEC_HIDESYM=y
-CONFIG_GRKERNSEC_RANDSTRUCT=y
-CONFIG_GRKERNSEC_RANDSTRUCT_PERFORMANCE=y
+# CONFIG_GRKERNSEC_RANDSTRUCT is not set
 CONFIG_GRKERNSEC_KERN_LOCKOUT=y
 
 #
index d6b5a7f5ce2d8e5268a8d8e6615f1b4b16e57889..55f30240c0aab61afa74bbef5ec99d8277c8e085 100644 (file)
@@ -1,6 +1,6 @@
 #
 # Automatically generated file; DO NOT EDIT.
-# Linux/x86 3.14.57 Kernel Configuration
+# Linux/x86 3.14.61 Kernel Configuration
 #
 # CONFIG_64BIT is not set
 CONFIG_X86_32=y
@@ -246,8 +246,8 @@ CONFIG_SECCOMP_FILTER=y
 CONFIG_HAVE_CC_STACKPROTECTOR=y
 CONFIG_CC_STACKPROTECTOR=y
 # CONFIG_CC_STACKPROTECTOR_NONE is not set
-CONFIG_CC_STACKPROTECTOR_REGULAR=y
-# CONFIG_CC_STACKPROTECTOR_STRONG is not set
+# CONFIG_CC_STACKPROTECTOR_REGULAR is not set
+CONFIG_CC_STACKPROTECTOR_STRONG=y
 CONFIG_HAVE_IRQ_TIME_ACCOUNTING=y
 CONFIG_HAVE_ARCH_TRANSPARENT_HUGEPAGE=y
 CONFIG_HAVE_ARCH_SOFT_DIRTY=y
@@ -5772,8 +5772,7 @@ CONFIG_GRKERNSEC_PROC_MEMMAP=y
 CONFIG_GRKERNSEC_BRUTE=y
 CONFIG_GRKERNSEC_MODHARDEN=y
 CONFIG_GRKERNSEC_HIDESYM=y
-CONFIG_GRKERNSEC_RANDSTRUCT=y
-CONFIG_GRKERNSEC_RANDSTRUCT_PERFORMANCE=y
+# CONFIG_GRKERNSEC_RANDSTRUCT is not set
 CONFIG_GRKERNSEC_KERN_LOCKOUT=y
 
 #
index 09503d7f2e77ed430fc68558c6d4d0f769c90bb3..5fa9bde4cca199ec28af37df17b52ea890c19035 100644 (file)
@@ -1,6 +1,6 @@
 #
 # Automatically generated file; DO NOT EDIT.
-# Linux/x86 3.14.57 Kernel Configuration
+# Linux/x86 3.14.61 Kernel Configuration
 #
 CONFIG_64BIT=y
 CONFIG_X86_64=y
@@ -253,8 +253,8 @@ CONFIG_SECCOMP_FILTER=y
 CONFIG_HAVE_CC_STACKPROTECTOR=y
 CONFIG_CC_STACKPROTECTOR=y
 # CONFIG_CC_STACKPROTECTOR_NONE is not set
-CONFIG_CC_STACKPROTECTOR_REGULAR=y
-# CONFIG_CC_STACKPROTECTOR_STRONG is not set
+# CONFIG_CC_STACKPROTECTOR_REGULAR is not set
+CONFIG_CC_STACKPROTECTOR_STRONG=y
 CONFIG_HAVE_CONTEXT_TRACKING=y
 CONFIG_HAVE_VIRT_CPU_ACCOUNTING_GEN=y
 CONFIG_HAVE_IRQ_TIME_ACCOUNTING=y
@@ -5586,12 +5586,11 @@ CONFIG_GRKERNSEC_JIT_HARDEN=y
 # CONFIG_GRKERNSEC_PERF_HARDEN is not set
 CONFIG_GRKERNSEC_RAND_THREADSTACK=y
 CONFIG_GRKERNSEC_PROC_MEMMAP=y
-CONFIG_GRKERNSEC_KSTACKOVERFLOW=y
+# CONFIG_GRKERNSEC_KSTACKOVERFLOW is not set
 CONFIG_GRKERNSEC_BRUTE=y
 CONFIG_GRKERNSEC_MODHARDEN=y
 CONFIG_GRKERNSEC_HIDESYM=y
-CONFIG_GRKERNSEC_RANDSTRUCT=y
-CONFIG_GRKERNSEC_RANDSTRUCT_PERFORMANCE=y
+# CONFIG_GRKERNSEC_RANDSTRUCT is not set
 CONFIG_GRKERNSEC_KERN_LOCKOUT=y
 
 #
index b3d281d85d88a428d3abffae35e8d76c7638a61d..ba6423716356c6bea659bc270e11877650c95b52 100644 (file)
 #usr/lib/ldscripts/armelfb_linux_eabi.xsw
 #usr/lib/ldscripts/armelfb_linux_eabi.xu
 #usr/lib/ldscripts/armelfb_linux_eabi.xw
-usr/lib/libbfd-2.22.so
+usr/lib/libbfd-2.24.so
 #usr/lib/libbfd.a
 #usr/lib/libbfd.la
 #usr/lib/libbfd.so
 #usr/lib/libiberty.a
-usr/lib/libopcodes-2.22.so
+usr/lib/libopcodes-2.24.so
 #usr/lib/libopcodes.a
 #usr/lib/libopcodes.la
 #usr/lib/libopcodes.so
index ee9d800353e32efe1f72ba660c5760312dbb632d..121ac1759097158ad26c3d3558d764bd863e1ed7 100644 (file)
 #usr/bin/armv5tel-unknown-linux-gnueabi-c++
 #usr/bin/armv5tel-unknown-linux-gnueabi-g++
 #usr/bin/armv5tel-unknown-linux-gnueabi-gcc
-#usr/bin/armv5tel-unknown-linux-gnueabi-gcc-4.4.7
+#usr/bin/armv5tel-unknown-linux-gnueabi-gcc-4.9.3
+#usr/bin/armv5tel-unknown-linux-gnueabi-gcc-ar
+#usr/bin/armv5tel-unknown-linux-gnueabi-gcc-nm
+#usr/bin/armv5tel-unknown-linux-gnueabi-gcc-ranlib
 #usr/bin/c++
 #usr/bin/cc
 #usr/bin/cpp
 #usr/bin/g++
 #usr/bin/gcc
-#usr/bin/gccbug
+#usr/bin/gcc-ar
+#usr/bin/gcc-nm
+#usr/bin/gcc-ranlib
 #usr/bin/gcov
 #usr/include/c++
-#usr/include/c++/4.4.7
-#usr/include/c++/4.4.7/algorithm
-#usr/include/c++/4.4.7/armv5tel-unknown-linux-gnueabi
-#usr/include/c++/4.4.7/armv5tel-unknown-linux-gnueabi/bits
-#usr/include/c++/4.4.7/armv5tel-unknown-linux-gnueabi/bits/atomic_word.h
-#usr/include/c++/4.4.7/armv5tel-unknown-linux-gnueabi/bits/basic_file.h
-#usr/include/c++/4.4.7/armv5tel-unknown-linux-gnueabi/bits/c++allocator.h
-#usr/include/c++/4.4.7/armv5tel-unknown-linux-gnueabi/bits/c++config.h
-#usr/include/c++/4.4.7/armv5tel-unknown-linux-gnueabi/bits/c++io.h
-#usr/include/c++/4.4.7/armv5tel-unknown-linux-gnueabi/bits/c++locale.h
-#usr/include/c++/4.4.7/armv5tel-unknown-linux-gnueabi/bits/cpu_defines.h
-#usr/include/c++/4.4.7/armv5tel-unknown-linux-gnueabi/bits/ctype_base.h
-#usr/include/c++/4.4.7/armv5tel-unknown-linux-gnueabi/bits/ctype_inline.h
-#usr/include/c++/4.4.7/armv5tel-unknown-linux-gnueabi/bits/ctype_noninline.h
-#usr/include/c++/4.4.7/armv5tel-unknown-linux-gnueabi/bits/cxxabi_tweaks.h
-#usr/include/c++/4.4.7/armv5tel-unknown-linux-gnueabi/bits/error_constants.h
-#usr/include/c++/4.4.7/armv5tel-unknown-linux-gnueabi/bits/extc++.h
-#usr/include/c++/4.4.7/armv5tel-unknown-linux-gnueabi/bits/gthr-default.h
-#usr/include/c++/4.4.7/armv5tel-unknown-linux-gnueabi/bits/gthr-posix.h
-#usr/include/c++/4.4.7/armv5tel-unknown-linux-gnueabi/bits/gthr-single.h
-#usr/include/c++/4.4.7/armv5tel-unknown-linux-gnueabi/bits/gthr-tpf.h
-#usr/include/c++/4.4.7/armv5tel-unknown-linux-gnueabi/bits/gthr.h
-#usr/include/c++/4.4.7/armv5tel-unknown-linux-gnueabi/bits/messages_members.h
-#usr/include/c++/4.4.7/armv5tel-unknown-linux-gnueabi/bits/os_defines.h
-#usr/include/c++/4.4.7/armv5tel-unknown-linux-gnueabi/bits/stdc++.h
-#usr/include/c++/4.4.7/armv5tel-unknown-linux-gnueabi/bits/stdtr1c++.h
-#usr/include/c++/4.4.7/armv5tel-unknown-linux-gnueabi/bits/time_members.h
-#usr/include/c++/4.4.7/array
-#usr/include/c++/4.4.7/backward
-#usr/include/c++/4.4.7/backward/auto_ptr.h
-#usr/include/c++/4.4.7/backward/backward_warning.h
-#usr/include/c++/4.4.7/backward/binders.h
-#usr/include/c++/4.4.7/backward/hash_fun.h
-#usr/include/c++/4.4.7/backward/hash_map
-#usr/include/c++/4.4.7/backward/hash_set
-#usr/include/c++/4.4.7/backward/hashtable.h
-#usr/include/c++/4.4.7/backward/strstream
-#usr/include/c++/4.4.7/bits
-#usr/include/c++/4.4.7/bits/algorithmfwd.h
-#usr/include/c++/4.4.7/bits/allocator.h
-#usr/include/c++/4.4.7/bits/atomic_0.h
-#usr/include/c++/4.4.7/bits/atomic_2.h
-#usr/include/c++/4.4.7/bits/atomicfwd_c.h
-#usr/include/c++/4.4.7/bits/atomicfwd_cxx.h
-#usr/include/c++/4.4.7/bits/basic_ios.h
-#usr/include/c++/4.4.7/bits/basic_ios.tcc
-#usr/include/c++/4.4.7/bits/basic_string.h
-#usr/include/c++/4.4.7/bits/basic_string.tcc
-#usr/include/c++/4.4.7/bits/boost_concept_check.h
-#usr/include/c++/4.4.7/bits/char_traits.h
-#usr/include/c++/4.4.7/bits/cmath.tcc
-#usr/include/c++/4.4.7/bits/codecvt.h
-#usr/include/c++/4.4.7/bits/concept_check.h
-#usr/include/c++/4.4.7/bits/cpp_type_traits.h
-#usr/include/c++/4.4.7/bits/deque.tcc
-#usr/include/c++/4.4.7/bits/forward_list.h
-#usr/include/c++/4.4.7/bits/forward_list.tcc
-#usr/include/c++/4.4.7/bits/fstream.tcc
-#usr/include/c++/4.4.7/bits/functexcept.h
-#usr/include/c++/4.4.7/bits/functional_hash.h
-#usr/include/c++/4.4.7/bits/gslice.h
-#usr/include/c++/4.4.7/bits/gslice_array.h
-#usr/include/c++/4.4.7/bits/hashtable.h
-#usr/include/c++/4.4.7/bits/indirect_array.h
-#usr/include/c++/4.4.7/bits/ios_base.h
-#usr/include/c++/4.4.7/bits/istream.tcc
-#usr/include/c++/4.4.7/bits/list.tcc
-#usr/include/c++/4.4.7/bits/locale_classes.h
-#usr/include/c++/4.4.7/bits/locale_classes.tcc
-#usr/include/c++/4.4.7/bits/locale_facets.h
-#usr/include/c++/4.4.7/bits/locale_facets.tcc
-#usr/include/c++/4.4.7/bits/locale_facets_nonio.h
-#usr/include/c++/4.4.7/bits/locale_facets_nonio.tcc
-#usr/include/c++/4.4.7/bits/localefwd.h
-#usr/include/c++/4.4.7/bits/mask_array.h
-#usr/include/c++/4.4.7/bits/move.h
-#usr/include/c++/4.4.7/bits/ostream.tcc
-#usr/include/c++/4.4.7/bits/ostream_insert.h
-#usr/include/c++/4.4.7/bits/postypes.h
-#usr/include/c++/4.4.7/bits/shared_ptr.h
-#usr/include/c++/4.4.7/bits/slice_array.h
-#usr/include/c++/4.4.7/bits/sstream.tcc
-#usr/include/c++/4.4.7/bits/stl_algo.h
-#usr/include/c++/4.4.7/bits/stl_algobase.h
-#usr/include/c++/4.4.7/bits/stl_bvector.h
-#usr/include/c++/4.4.7/bits/stl_construct.h
-#usr/include/c++/4.4.7/bits/stl_deque.h
-#usr/include/c++/4.4.7/bits/stl_function.h
-#usr/include/c++/4.4.7/bits/stl_heap.h
-#usr/include/c++/4.4.7/bits/stl_iterator.h
-#usr/include/c++/4.4.7/bits/stl_iterator_base_funcs.h
-#usr/include/c++/4.4.7/bits/stl_iterator_base_types.h
-#usr/include/c++/4.4.7/bits/stl_list.h
-#usr/include/c++/4.4.7/bits/stl_map.h
-#usr/include/c++/4.4.7/bits/stl_multimap.h
-#usr/include/c++/4.4.7/bits/stl_multiset.h
-#usr/include/c++/4.4.7/bits/stl_numeric.h
-#usr/include/c++/4.4.7/bits/stl_pair.h
-#usr/include/c++/4.4.7/bits/stl_queue.h
-#usr/include/c++/4.4.7/bits/stl_raw_storage_iter.h
-#usr/include/c++/4.4.7/bits/stl_relops.h
-#usr/include/c++/4.4.7/bits/stl_set.h
-#usr/include/c++/4.4.7/bits/stl_stack.h
-#usr/include/c++/4.4.7/bits/stl_tempbuf.h
-#usr/include/c++/4.4.7/bits/stl_tree.h
-#usr/include/c++/4.4.7/bits/stl_uninitialized.h
-#usr/include/c++/4.4.7/bits/stl_vector.h
-#usr/include/c++/4.4.7/bits/stream_iterator.h
-#usr/include/c++/4.4.7/bits/streambuf.tcc
-#usr/include/c++/4.4.7/bits/streambuf_iterator.h
-#usr/include/c++/4.4.7/bits/stringfwd.h
-#usr/include/c++/4.4.7/bits/unique_ptr.h
-#usr/include/c++/4.4.7/bits/valarray_after.h
-#usr/include/c++/4.4.7/bits/valarray_array.h
-#usr/include/c++/4.4.7/bits/valarray_array.tcc
-#usr/include/c++/4.4.7/bits/valarray_before.h
-#usr/include/c++/4.4.7/bits/vector.tcc
-#usr/include/c++/4.4.7/bitset
-#usr/include/c++/4.4.7/c++0x_warning.h
-#usr/include/c++/4.4.7/cassert
-#usr/include/c++/4.4.7/ccomplex
-#usr/include/c++/4.4.7/cctype
-#usr/include/c++/4.4.7/cerrno
-#usr/include/c++/4.4.7/cfenv
-#usr/include/c++/4.4.7/cfloat
-#usr/include/c++/4.4.7/chrono
-#usr/include/c++/4.4.7/cinttypes
-#usr/include/c++/4.4.7/ciso646
-#usr/include/c++/4.4.7/climits
-#usr/include/c++/4.4.7/clocale
-#usr/include/c++/4.4.7/cmath
-#usr/include/c++/4.4.7/complex
-#usr/include/c++/4.4.7/complex.h
-#usr/include/c++/4.4.7/condition_variable
-#usr/include/c++/4.4.7/csetjmp
-#usr/include/c++/4.4.7/csignal
-#usr/include/c++/4.4.7/cstdarg
-#usr/include/c++/4.4.7/cstdatomic
-#usr/include/c++/4.4.7/cstdbool
-#usr/include/c++/4.4.7/cstddef
-#usr/include/c++/4.4.7/cstdint
-#usr/include/c++/4.4.7/cstdio
-#usr/include/c++/4.4.7/cstdlib
-#usr/include/c++/4.4.7/cstring
-#usr/include/c++/4.4.7/ctgmath
-#usr/include/c++/4.4.7/ctime
-#usr/include/c++/4.4.7/cwchar
-#usr/include/c++/4.4.7/cwctype
-#usr/include/c++/4.4.7/cxxabi-forced.h
-#usr/include/c++/4.4.7/cxxabi.h
-#usr/include/c++/4.4.7/debug
-#usr/include/c++/4.4.7/debug/bitset
-#usr/include/c++/4.4.7/debug/debug.h
-#usr/include/c++/4.4.7/debug/deque
-#usr/include/c++/4.4.7/debug/formatter.h
-#usr/include/c++/4.4.7/debug/functions.h
-#usr/include/c++/4.4.7/debug/list
-#usr/include/c++/4.4.7/debug/macros.h
-#usr/include/c++/4.4.7/debug/map
-#usr/include/c++/4.4.7/debug/map.h
-#usr/include/c++/4.4.7/debug/multimap.h
-#usr/include/c++/4.4.7/debug/multiset.h
-#usr/include/c++/4.4.7/debug/safe_base.h
-#usr/include/c++/4.4.7/debug/safe_iterator.h
-#usr/include/c++/4.4.7/debug/safe_iterator.tcc
-#usr/include/c++/4.4.7/debug/safe_sequence.h
-#usr/include/c++/4.4.7/debug/set
-#usr/include/c++/4.4.7/debug/set.h
-#usr/include/c++/4.4.7/debug/string
-#usr/include/c++/4.4.7/debug/unordered_map
-#usr/include/c++/4.4.7/debug/unordered_set
-#usr/include/c++/4.4.7/debug/vector
-#usr/include/c++/4.4.7/deque
-#usr/include/c++/4.4.7/exception
-#usr/include/c++/4.4.7/exception_defines.h
-#usr/include/c++/4.4.7/exception_ptr.h
-#usr/include/c++/4.4.7/ext
-#usr/include/c++/4.4.7/ext/algorithm
-#usr/include/c++/4.4.7/ext/array_allocator.h
-#usr/include/c++/4.4.7/ext/atomicity.h
-#usr/include/c++/4.4.7/ext/bitmap_allocator.h
-#usr/include/c++/4.4.7/ext/cast.h
-#usr/include/c++/4.4.7/ext/codecvt_specializations.h
-#usr/include/c++/4.4.7/ext/concurrence.h
-#usr/include/c++/4.4.7/ext/debug_allocator.h
-#usr/include/c++/4.4.7/ext/enc_filebuf.h
-#usr/include/c++/4.4.7/ext/extptr_allocator.h
-#usr/include/c++/4.4.7/ext/functional
-#usr/include/c++/4.4.7/ext/hash_map
-#usr/include/c++/4.4.7/ext/hash_set
-#usr/include/c++/4.4.7/ext/iterator
-#usr/include/c++/4.4.7/ext/malloc_allocator.h
-#usr/include/c++/4.4.7/ext/memory
-#usr/include/c++/4.4.7/ext/mt_allocator.h
-#usr/include/c++/4.4.7/ext/new_allocator.h
-#usr/include/c++/4.4.7/ext/numeric
-#usr/include/c++/4.4.7/ext/numeric_traits.h
-#usr/include/c++/4.4.7/ext/pb_ds
-#usr/include/c++/4.4.7/ext/pb_ds/assoc_container.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail
-#usr/include/c++/4.4.7/ext/pb_ds/detail/basic_tree_policy
-#usr/include/c++/4.4.7/ext/pb_ds/detail/basic_tree_policy/basic_tree_policy_base.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/basic_tree_policy/null_node_metadata.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/basic_tree_policy/traits.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/basic_types.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/bin_search_tree_
-#usr/include/c++/4.4.7/ext/pb_ds/detail/bin_search_tree_/bin_search_tree_.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/bin_search_tree_/cond_dtor_entry_dealtor.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/bin_search_tree_/cond_key_dtor_entry_dealtor.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/bin_search_tree_/constructors_destructor_fn_imps.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/bin_search_tree_/debug_fn_imps.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/bin_search_tree_/erase_fn_imps.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/bin_search_tree_/find_fn_imps.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/bin_search_tree_/info_fn_imps.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/bin_search_tree_/insert_fn_imps.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/bin_search_tree_/iterators_fn_imps.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/bin_search_tree_/node_iterators.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/bin_search_tree_/point_iterators.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/bin_search_tree_/policy_access_fn_imps.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/bin_search_tree_/r_erase_fn_imps.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/bin_search_tree_/rotate_fn_imps.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/bin_search_tree_/split_join_fn_imps.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/bin_search_tree_/traits.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/binary_heap_
-#usr/include/c++/4.4.7/ext/pb_ds/detail/binary_heap_/binary_heap_.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/binary_heap_/const_iterator.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/binary_heap_/const_point_iterator.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/binary_heap_/constructors_destructor_fn_imps.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/binary_heap_/debug_fn_imps.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/binary_heap_/entry_cmp.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/binary_heap_/entry_pred.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/binary_heap_/erase_fn_imps.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/binary_heap_/find_fn_imps.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/binary_heap_/info_fn_imps.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/binary_heap_/insert_fn_imps.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/binary_heap_/iterators_fn_imps.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/binary_heap_/policy_access_fn_imps.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/binary_heap_/resize_policy.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/binary_heap_/split_join_fn_imps.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/binary_heap_/trace_fn_imps.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/binomial_heap_
-#usr/include/c++/4.4.7/ext/pb_ds/detail/binomial_heap_/binomial_heap_.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/binomial_heap_/constructors_destructor_fn_imps.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/binomial_heap_/debug_fn_imps.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/binomial_heap_base_
-#usr/include/c++/4.4.7/ext/pb_ds/detail/binomial_heap_base_/binomial_heap_base_.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/binomial_heap_base_/constructors_destructor_fn_imps.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/binomial_heap_base_/debug_fn_imps.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/binomial_heap_base_/erase_fn_imps.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/binomial_heap_base_/find_fn_imps.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/binomial_heap_base_/insert_fn_imps.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/binomial_heap_base_/split_join_fn_imps.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/cc_hash_table_map_
-#usr/include/c++/4.4.7/ext/pb_ds/detail/cc_hash_table_map_/cc_ht_map_.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/cc_hash_table_map_/cmp_fn_imps.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/cc_hash_table_map_/cond_key_dtor_entry_dealtor.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/cc_hash_table_map_/constructor_destructor_fn_imps.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/cc_hash_table_map_/constructor_destructor_no_store_hash_fn_imps.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/cc_hash_table_map_/constructor_destructor_store_hash_fn_imps.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/cc_hash_table_map_/debug_fn_imps.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/cc_hash_table_map_/debug_no_store_hash_fn_imps.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/cc_hash_table_map_/debug_store_hash_fn_imps.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/cc_hash_table_map_/entry_list_fn_imps.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/cc_hash_table_map_/erase_fn_imps.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/cc_hash_table_map_/erase_no_store_hash_fn_imps.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/cc_hash_table_map_/erase_store_hash_fn_imps.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/cc_hash_table_map_/find_fn_imps.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/cc_hash_table_map_/find_store_hash_fn_imps.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/cc_hash_table_map_/info_fn_imps.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/cc_hash_table_map_/insert_fn_imps.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/cc_hash_table_map_/insert_no_store_hash_fn_imps.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/cc_hash_table_map_/insert_store_hash_fn_imps.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/cc_hash_table_map_/iterators_fn_imps.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/cc_hash_table_map_/policy_access_fn_imps.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/cc_hash_table_map_/resize_fn_imps.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/cc_hash_table_map_/resize_no_store_hash_fn_imps.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/cc_hash_table_map_/resize_store_hash_fn_imps.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/cc_hash_table_map_/size_fn_imps.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/cc_hash_table_map_/standard_policies.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/cc_hash_table_map_/trace_fn_imps.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/cond_dealtor.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/constructors_destructor_fn_imps.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/container_base_dispatch.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/debug_map_base.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/eq_fn
-#usr/include/c++/4.4.7/ext/pb_ds/detail/eq_fn/eq_by_less.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/eq_fn/hash_eq_fn.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/gp_hash_table_map_
-#usr/include/c++/4.4.7/ext/pb_ds/detail/gp_hash_table_map_/constructor_destructor_fn_imps.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/gp_hash_table_map_/constructor_destructor_no_store_hash_fn_imps.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/gp_hash_table_map_/constructor_destructor_store_hash_fn_imps.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/gp_hash_table_map_/debug_fn_imps.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/gp_hash_table_map_/debug_no_store_hash_fn_imps.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/gp_hash_table_map_/debug_store_hash_fn_imps.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/gp_hash_table_map_/erase_fn_imps.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/gp_hash_table_map_/erase_no_store_hash_fn_imps.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/gp_hash_table_map_/erase_store_hash_fn_imps.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/gp_hash_table_map_/find_fn_imps.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/gp_hash_table_map_/find_no_store_hash_fn_imps.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/gp_hash_table_map_/find_store_hash_fn_imps.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/gp_hash_table_map_/gp_ht_map_.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/gp_hash_table_map_/info_fn_imps.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/gp_hash_table_map_/insert_fn_imps.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/gp_hash_table_map_/insert_no_store_hash_fn_imps.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/gp_hash_table_map_/insert_store_hash_fn_imps.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/gp_hash_table_map_/iterator_fn_imps.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/gp_hash_table_map_/policy_access_fn_imps.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/gp_hash_table_map_/resize_fn_imps.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/gp_hash_table_map_/resize_no_store_hash_fn_imps.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/gp_hash_table_map_/resize_store_hash_fn_imps.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/gp_hash_table_map_/standard_policies.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/gp_hash_table_map_/trace_fn_imps.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/hash_fn
-#usr/include/c++/4.4.7/ext/pb_ds/detail/hash_fn/direct_mask_range_hashing_imp.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/hash_fn/direct_mod_range_hashing_imp.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/hash_fn/linear_probe_fn_imp.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/hash_fn/mask_based_range_hashing.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/hash_fn/mod_based_range_hashing.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/hash_fn/probe_fn_base.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/hash_fn/quadratic_probe_fn_imp.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/hash_fn/ranged_hash_fn.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/hash_fn/ranged_probe_fn.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/hash_fn/sample_probe_fn.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/hash_fn/sample_range_hashing.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/hash_fn/sample_ranged_hash_fn.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/hash_fn/sample_ranged_probe_fn.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/left_child_next_sibling_heap_
-#usr/include/c++/4.4.7/ext/pb_ds/detail/left_child_next_sibling_heap_/const_iterator.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/left_child_next_sibling_heap_/const_point_iterator.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/left_child_next_sibling_heap_/constructors_destructor_fn_imps.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/left_child_next_sibling_heap_/debug_fn_imps.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/left_child_next_sibling_heap_/erase_fn_imps.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/left_child_next_sibling_heap_/info_fn_imps.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/left_child_next_sibling_heap_/insert_fn_imps.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/left_child_next_sibling_heap_/iterators_fn_imps.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/left_child_next_sibling_heap_/left_child_next_sibling_heap_.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/left_child_next_sibling_heap_/node.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/left_child_next_sibling_heap_/null_metadata.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/left_child_next_sibling_heap_/policy_access_fn_imps.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/left_child_next_sibling_heap_/trace_fn_imps.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/list_update_map_
-#usr/include/c++/4.4.7/ext/pb_ds/detail/list_update_map_/constructor_destructor_fn_imps.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/list_update_map_/debug_fn_imps.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/list_update_map_/entry_metadata_base.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/list_update_map_/erase_fn_imps.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/list_update_map_/find_fn_imps.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/list_update_map_/info_fn_imps.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/list_update_map_/insert_fn_imps.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/list_update_map_/iterators_fn_imps.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/list_update_map_/lu_map_.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/list_update_map_/trace_fn_imps.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/list_update_policy
-#usr/include/c++/4.4.7/ext/pb_ds/detail/list_update_policy/counter_lu_metadata.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/list_update_policy/counter_lu_policy_imp.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/list_update_policy/mtf_lu_policy_imp.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/list_update_policy/sample_update_policy.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/ov_tree_map_
-#usr/include/c++/4.4.7/ext/pb_ds/detail/ov_tree_map_/cond_dtor.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/ov_tree_map_/constructors_destructor_fn_imps.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/ov_tree_map_/debug_fn_imps.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/ov_tree_map_/erase_fn_imps.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/ov_tree_map_/info_fn_imps.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/ov_tree_map_/insert_fn_imps.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/ov_tree_map_/iterators_fn_imps.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/ov_tree_map_/node_iterators.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/ov_tree_map_/ov_tree_map_.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/ov_tree_map_/policy_access_fn_imps.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/ov_tree_map_/split_join_fn_imps.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/ov_tree_map_/traits.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/pairing_heap_
-#usr/include/c++/4.4.7/ext/pb_ds/detail/pairing_heap_/constructors_destructor_fn_imps.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/pairing_heap_/debug_fn_imps.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/pairing_heap_/erase_fn_imps.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/pairing_heap_/find_fn_imps.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/pairing_heap_/insert_fn_imps.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/pairing_heap_/pairing_heap_.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/pairing_heap_/split_join_fn_imps.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/pat_trie_
-#usr/include/c++/4.4.7/ext/pb_ds/detail/pat_trie_/child_iterator.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/pat_trie_/cond_dtor_entry_dealtor.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/pat_trie_/const_child_iterator.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/pat_trie_/constructors_destructor_fn_imps.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/pat_trie_/debug_fn_imps.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/pat_trie_/erase_fn_imps.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/pat_trie_/find_fn_imps.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/pat_trie_/head.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/pat_trie_/info_fn_imps.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/pat_trie_/insert_join_fn_imps.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/pat_trie_/internal_node.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/pat_trie_/iterators_fn_imps.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/pat_trie_/leaf.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/pat_trie_/node_base.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/pat_trie_/node_iterators.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/pat_trie_/node_metadata_base.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/pat_trie_/pat_trie_.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/pat_trie_/point_iterators.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/pat_trie_/policy_access_fn_imps.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/pat_trie_/r_erase_fn_imps.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/pat_trie_/rotate_fn_imps.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/pat_trie_/split_fn_imps.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/pat_trie_/split_join_branch_bag.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/pat_trie_/synth_e_access_traits.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/pat_trie_/trace_fn_imps.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/pat_trie_/traits.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/pat_trie_/update_fn_imps.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/priority_queue_base_dispatch.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/rb_tree_map_
-#usr/include/c++/4.4.7/ext/pb_ds/detail/rb_tree_map_/constructors_destructor_fn_imps.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/rb_tree_map_/debug_fn_imps.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/rb_tree_map_/erase_fn_imps.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/rb_tree_map_/find_fn_imps.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/rb_tree_map_/info_fn_imps.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/rb_tree_map_/insert_fn_imps.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/rb_tree_map_/node.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/rb_tree_map_/rb_tree_.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/rb_tree_map_/split_join_fn_imps.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/rb_tree_map_/traits.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/rc_binomial_heap_
-#usr/include/c++/4.4.7/ext/pb_ds/detail/rc_binomial_heap_/constructors_destructor_fn_imps.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/rc_binomial_heap_/debug_fn_imps.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/rc_binomial_heap_/erase_fn_imps.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/rc_binomial_heap_/insert_fn_imps.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/rc_binomial_heap_/rc.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/rc_binomial_heap_/rc_binomial_heap_.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/rc_binomial_heap_/split_join_fn_imps.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/rc_binomial_heap_/trace_fn_imps.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/resize_policy
-#usr/include/c++/4.4.7/ext/pb_ds/detail/resize_policy/cc_hash_max_collision_check_resize_trigger_imp.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/resize_policy/hash_exponential_size_policy_imp.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/resize_policy/hash_load_check_resize_trigger_imp.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/resize_policy/hash_load_check_resize_trigger_size_base.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/resize_policy/hash_prime_size_policy_imp.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/resize_policy/hash_standard_resize_policy_imp.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/resize_policy/sample_resize_policy.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/resize_policy/sample_resize_trigger.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/resize_policy/sample_size_policy.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/splay_tree_
-#usr/include/c++/4.4.7/ext/pb_ds/detail/splay_tree_/constructors_destructor_fn_imps.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/splay_tree_/debug_fn_imps.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/splay_tree_/erase_fn_imps.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/splay_tree_/find_fn_imps.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/splay_tree_/info_fn_imps.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/splay_tree_/insert_fn_imps.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/splay_tree_/node.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/splay_tree_/splay_fn_imps.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/splay_tree_/splay_tree_.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/splay_tree_/split_join_fn_imps.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/splay_tree_/traits.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/standard_policies.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/thin_heap_
-#usr/include/c++/4.4.7/ext/pb_ds/detail/thin_heap_/constructors_destructor_fn_imps.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/thin_heap_/debug_fn_imps.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/thin_heap_/erase_fn_imps.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/thin_heap_/find_fn_imps.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/thin_heap_/insert_fn_imps.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/thin_heap_/split_join_fn_imps.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/thin_heap_/thin_heap_.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/thin_heap_/trace_fn_imps.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/tree_policy
-#usr/include/c++/4.4.7/ext/pb_ds/detail/tree_policy/node_metadata_selector.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/tree_policy/null_node_update_imp.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/tree_policy/order_statistics_imp.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/tree_policy/sample_tree_node_update.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/tree_trace_base.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/trie_policy
-#usr/include/c++/4.4.7/ext/pb_ds/detail/trie_policy/node_metadata_selector.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/trie_policy/null_node_update_imp.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/trie_policy/order_statistics_imp.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/trie_policy/prefix_search_node_update_imp.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/trie_policy/sample_trie_e_access_traits.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/trie_policy/sample_trie_node_update.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/trie_policy/string_trie_e_access_traits_imp.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/trie_policy/trie_policy_base.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/type_utils.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/types_traits.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/unordered_iterator
-#usr/include/c++/4.4.7/ext/pb_ds/detail/unordered_iterator/const_iterator.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/unordered_iterator/const_point_iterator.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/unordered_iterator/iterator.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/unordered_iterator/point_iterator.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/exception.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/hash_policy.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/list_update_policy.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/priority_queue.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/tag_and_trait.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/tree_policy.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/trie_policy.hpp
-#usr/include/c++/4.4.7/ext/pod_char_traits.h
-#usr/include/c++/4.4.7/ext/pointer.h
-#usr/include/c++/4.4.7/ext/pool_allocator.h
-#usr/include/c++/4.4.7/ext/rb_tree
-#usr/include/c++/4.4.7/ext/rc_string_base.h
-#usr/include/c++/4.4.7/ext/rope
-#usr/include/c++/4.4.7/ext/ropeimpl.h
-#usr/include/c++/4.4.7/ext/slist
-#usr/include/c++/4.4.7/ext/sso_string_base.h
-#usr/include/c++/4.4.7/ext/stdio_filebuf.h
-#usr/include/c++/4.4.7/ext/stdio_sync_filebuf.h
-#usr/include/c++/4.4.7/ext/string_conversions.h
-#usr/include/c++/4.4.7/ext/throw_allocator.h
-#usr/include/c++/4.4.7/ext/type_traits.h
-#usr/include/c++/4.4.7/ext/typelist.h
-#usr/include/c++/4.4.7/ext/vstring.h
-#usr/include/c++/4.4.7/ext/vstring.tcc
-#usr/include/c++/4.4.7/ext/vstring_fwd.h
-#usr/include/c++/4.4.7/ext/vstring_util.h
-#usr/include/c++/4.4.7/fenv.h
-#usr/include/c++/4.4.7/forward_list
-#usr/include/c++/4.4.7/fstream
-#usr/include/c++/4.4.7/functional
-#usr/include/c++/4.4.7/initializer_list
-#usr/include/c++/4.4.7/iomanip
-#usr/include/c++/4.4.7/ios
-#usr/include/c++/4.4.7/iosfwd
-#usr/include/c++/4.4.7/iostream
-#usr/include/c++/4.4.7/istream
-#usr/include/c++/4.4.7/iterator
-#usr/include/c++/4.4.7/limits
-#usr/include/c++/4.4.7/list
-#usr/include/c++/4.4.7/locale
-#usr/include/c++/4.4.7/map
-#usr/include/c++/4.4.7/memory
-#usr/include/c++/4.4.7/mutex
-#usr/include/c++/4.4.7/new
-#usr/include/c++/4.4.7/numeric
-#usr/include/c++/4.4.7/ostream
-#usr/include/c++/4.4.7/parallel
-#usr/include/c++/4.4.7/parallel/algo.h
-#usr/include/c++/4.4.7/parallel/algobase.h
-#usr/include/c++/4.4.7/parallel/algorithm
-#usr/include/c++/4.4.7/parallel/algorithmfwd.h
-#usr/include/c++/4.4.7/parallel/balanced_quicksort.h
-#usr/include/c++/4.4.7/parallel/base.h
-#usr/include/c++/4.4.7/parallel/basic_iterator.h
-#usr/include/c++/4.4.7/parallel/checkers.h
-#usr/include/c++/4.4.7/parallel/compatibility.h
-#usr/include/c++/4.4.7/parallel/compiletime_settings.h
-#usr/include/c++/4.4.7/parallel/equally_split.h
-#usr/include/c++/4.4.7/parallel/features.h
-#usr/include/c++/4.4.7/parallel/find.h
-#usr/include/c++/4.4.7/parallel/find_selectors.h
-#usr/include/c++/4.4.7/parallel/for_each.h
-#usr/include/c++/4.4.7/parallel/for_each_selectors.h
-#usr/include/c++/4.4.7/parallel/iterator.h
-#usr/include/c++/4.4.7/parallel/list_partition.h
-#usr/include/c++/4.4.7/parallel/losertree.h
-#usr/include/c++/4.4.7/parallel/merge.h
-#usr/include/c++/4.4.7/parallel/multiseq_selection.h
-#usr/include/c++/4.4.7/parallel/multiway_merge.h
-#usr/include/c++/4.4.7/parallel/multiway_mergesort.h
-#usr/include/c++/4.4.7/parallel/numeric
-#usr/include/c++/4.4.7/parallel/numericfwd.h
-#usr/include/c++/4.4.7/parallel/omp_loop.h
-#usr/include/c++/4.4.7/parallel/omp_loop_static.h
-#usr/include/c++/4.4.7/parallel/par_loop.h
-#usr/include/c++/4.4.7/parallel/parallel.h
-#usr/include/c++/4.4.7/parallel/partial_sum.h
-#usr/include/c++/4.4.7/parallel/partition.h
-#usr/include/c++/4.4.7/parallel/queue.h
-#usr/include/c++/4.4.7/parallel/quicksort.h
-#usr/include/c++/4.4.7/parallel/random_number.h
-#usr/include/c++/4.4.7/parallel/random_shuffle.h
-#usr/include/c++/4.4.7/parallel/search.h
-#usr/include/c++/4.4.7/parallel/set_operations.h
-#usr/include/c++/4.4.7/parallel/settings.h
-#usr/include/c++/4.4.7/parallel/sort.h
-#usr/include/c++/4.4.7/parallel/tags.h
-#usr/include/c++/4.4.7/parallel/types.h
-#usr/include/c++/4.4.7/parallel/unique_copy.h
-#usr/include/c++/4.4.7/parallel/workstealing.h
-#usr/include/c++/4.4.7/queue
-#usr/include/c++/4.4.7/random
-#usr/include/c++/4.4.7/ratio
-#usr/include/c++/4.4.7/regex
-#usr/include/c++/4.4.7/set
-#usr/include/c++/4.4.7/sstream
-#usr/include/c++/4.4.7/stack
-#usr/include/c++/4.4.7/stdatomic.h
-#usr/include/c++/4.4.7/stdexcept
-#usr/include/c++/4.4.7/streambuf
-#usr/include/c++/4.4.7/string
-#usr/include/c++/4.4.7/system_error
-#usr/include/c++/4.4.7/tgmath.h
-#usr/include/c++/4.4.7/thread
-#usr/include/c++/4.4.7/tr1
-#usr/include/c++/4.4.7/tr1/array
-#usr/include/c++/4.4.7/tr1/bessel_function.tcc
-#usr/include/c++/4.4.7/tr1/beta_function.tcc
-#usr/include/c++/4.4.7/tr1/ccomplex
-#usr/include/c++/4.4.7/tr1/cctype
-#usr/include/c++/4.4.7/tr1/cfenv
-#usr/include/c++/4.4.7/tr1/cfloat
-#usr/include/c++/4.4.7/tr1/cinttypes
-#usr/include/c++/4.4.7/tr1/climits
-#usr/include/c++/4.4.7/tr1/cmath
-#usr/include/c++/4.4.7/tr1/complex
-#usr/include/c++/4.4.7/tr1/complex.h
-#usr/include/c++/4.4.7/tr1/cstdarg
-#usr/include/c++/4.4.7/tr1/cstdbool
-#usr/include/c++/4.4.7/tr1/cstdint
-#usr/include/c++/4.4.7/tr1/cstdio
-#usr/include/c++/4.4.7/tr1/cstdlib
-#usr/include/c++/4.4.7/tr1/ctgmath
-#usr/include/c++/4.4.7/tr1/ctime
-#usr/include/c++/4.4.7/tr1/ctype.h
-#usr/include/c++/4.4.7/tr1/cwchar
-#usr/include/c++/4.4.7/tr1/cwctype
-#usr/include/c++/4.4.7/tr1/ell_integral.tcc
-#usr/include/c++/4.4.7/tr1/exp_integral.tcc
-#usr/include/c++/4.4.7/tr1/fenv.h
-#usr/include/c++/4.4.7/tr1/float.h
-#usr/include/c++/4.4.7/tr1/functional
-#usr/include/c++/4.4.7/tr1/functional_hash.h
-#usr/include/c++/4.4.7/tr1/gamma.tcc
-#usr/include/c++/4.4.7/tr1/hashtable.h
-#usr/include/c++/4.4.7/tr1/hypergeometric.tcc
-#usr/include/c++/4.4.7/tr1/inttypes.h
-#usr/include/c++/4.4.7/tr1/legendre_function.tcc
-#usr/include/c++/4.4.7/tr1/limits.h
-#usr/include/c++/4.4.7/tr1/math.h
-#usr/include/c++/4.4.7/tr1/memory
-#usr/include/c++/4.4.7/tr1/modified_bessel_func.tcc
-#usr/include/c++/4.4.7/tr1/poly_hermite.tcc
-#usr/include/c++/4.4.7/tr1/poly_laguerre.tcc
-#usr/include/c++/4.4.7/tr1/random
-#usr/include/c++/4.4.7/tr1/regex
-#usr/include/c++/4.4.7/tr1/riemann_zeta.tcc
-#usr/include/c++/4.4.7/tr1/shared_ptr.h
-#usr/include/c++/4.4.7/tr1/special_function_util.h
-#usr/include/c++/4.4.7/tr1/stdarg.h
-#usr/include/c++/4.4.7/tr1/stdbool.h
-#usr/include/c++/4.4.7/tr1/stdint.h
-#usr/include/c++/4.4.7/tr1/stdio.h
-#usr/include/c++/4.4.7/tr1/stdlib.h
-#usr/include/c++/4.4.7/tr1/tgmath.h
-#usr/include/c++/4.4.7/tr1/tuple
-#usr/include/c++/4.4.7/tr1/type_traits
-#usr/include/c++/4.4.7/tr1/unordered_map
-#usr/include/c++/4.4.7/tr1/unordered_set
-#usr/include/c++/4.4.7/tr1/utility
-#usr/include/c++/4.4.7/tr1/wchar.h
-#usr/include/c++/4.4.7/tr1/wctype.h
-#usr/include/c++/4.4.7/tr1_impl
-#usr/include/c++/4.4.7/tr1_impl/array
-#usr/include/c++/4.4.7/tr1_impl/boost_sp_counted_base.h
-#usr/include/c++/4.4.7/tr1_impl/cctype
-#usr/include/c++/4.4.7/tr1_impl/cfenv
-#usr/include/c++/4.4.7/tr1_impl/cinttypes
-#usr/include/c++/4.4.7/tr1_impl/cmath
-#usr/include/c++/4.4.7/tr1_impl/complex
-#usr/include/c++/4.4.7/tr1_impl/cstdint
-#usr/include/c++/4.4.7/tr1_impl/cstdio
-#usr/include/c++/4.4.7/tr1_impl/cstdlib
-#usr/include/c++/4.4.7/tr1_impl/cwchar
-#usr/include/c++/4.4.7/tr1_impl/cwctype
-#usr/include/c++/4.4.7/tr1_impl/functional
-#usr/include/c++/4.4.7/tr1_impl/functional_hash.h
-#usr/include/c++/4.4.7/tr1_impl/hashtable
-#usr/include/c++/4.4.7/tr1_impl/hashtable_policy.h
-#usr/include/c++/4.4.7/tr1_impl/random
-#usr/include/c++/4.4.7/tr1_impl/random.tcc
-#usr/include/c++/4.4.7/tr1_impl/regex
-#usr/include/c++/4.4.7/tr1_impl/type_traits
-#usr/include/c++/4.4.7/tr1_impl/unordered_map
-#usr/include/c++/4.4.7/tr1_impl/unordered_set
-#usr/include/c++/4.4.7/tr1_impl/utility
-#usr/include/c++/4.4.7/tuple
-#usr/include/c++/4.4.7/type_traits
-#usr/include/c++/4.4.7/typeinfo
-#usr/include/c++/4.4.7/unordered_map
-#usr/include/c++/4.4.7/unordered_set
-#usr/include/c++/4.4.7/utility
-#usr/include/c++/4.4.7/valarray
-#usr/include/c++/4.4.7/vector
-#usr/info
-#usr/info/cpp.info
-#usr/info/cppinternals.info
-#usr/info/dir
-#usr/info/gcc.info
-#usr/info/gccinstall.info
-#usr/info/gccint.info
-#usr/info/libgomp.info
+#usr/include/c++/4.9.3
+#usr/include/c++/4.9.3/algorithm
+#usr/include/c++/4.9.3/armv5tel-unknown-linux-gnueabi
+#usr/include/c++/4.9.3/armv5tel-unknown-linux-gnueabi/bits
+#usr/include/c++/4.9.3/armv5tel-unknown-linux-gnueabi/bits/atomic_word.h
+#usr/include/c++/4.9.3/armv5tel-unknown-linux-gnueabi/bits/basic_file.h
+#usr/include/c++/4.9.3/armv5tel-unknown-linux-gnueabi/bits/c++allocator.h
+#usr/include/c++/4.9.3/armv5tel-unknown-linux-gnueabi/bits/c++config.h
+#usr/include/c++/4.9.3/armv5tel-unknown-linux-gnueabi/bits/c++io.h
+#usr/include/c++/4.9.3/armv5tel-unknown-linux-gnueabi/bits/c++locale.h
+#usr/include/c++/4.9.3/armv5tel-unknown-linux-gnueabi/bits/cpu_defines.h
+#usr/include/c++/4.9.3/armv5tel-unknown-linux-gnueabi/bits/ctype_base.h
+#usr/include/c++/4.9.3/armv5tel-unknown-linux-gnueabi/bits/ctype_inline.h
+#usr/include/c++/4.9.3/armv5tel-unknown-linux-gnueabi/bits/cxxabi_tweaks.h
+#usr/include/c++/4.9.3/armv5tel-unknown-linux-gnueabi/bits/error_constants.h
+#usr/include/c++/4.9.3/armv5tel-unknown-linux-gnueabi/bits/extc++.h
+#usr/include/c++/4.9.3/armv5tel-unknown-linux-gnueabi/bits/gthr-default.h
+#usr/include/c++/4.9.3/armv5tel-unknown-linux-gnueabi/bits/gthr-posix.h
+#usr/include/c++/4.9.3/armv5tel-unknown-linux-gnueabi/bits/gthr-single.h
+#usr/include/c++/4.9.3/armv5tel-unknown-linux-gnueabi/bits/gthr.h
+#usr/include/c++/4.9.3/armv5tel-unknown-linux-gnueabi/bits/messages_members.h
+#usr/include/c++/4.9.3/armv5tel-unknown-linux-gnueabi/bits/opt_random.h
+#usr/include/c++/4.9.3/armv5tel-unknown-linux-gnueabi/bits/os_defines.h
+#usr/include/c++/4.9.3/armv5tel-unknown-linux-gnueabi/bits/stdc++.h
+#usr/include/c++/4.9.3/armv5tel-unknown-linux-gnueabi/bits/stdtr1c++.h
+#usr/include/c++/4.9.3/armv5tel-unknown-linux-gnueabi/bits/time_members.h
+#usr/include/c++/4.9.3/armv5tel-unknown-linux-gnueabi/ext
+#usr/include/c++/4.9.3/armv5tel-unknown-linux-gnueabi/ext/opt_random.h
+#usr/include/c++/4.9.3/array
+#usr/include/c++/4.9.3/atomic
+#usr/include/c++/4.9.3/backward
+#usr/include/c++/4.9.3/backward/auto_ptr.h
+#usr/include/c++/4.9.3/backward/backward_warning.h
+#usr/include/c++/4.9.3/backward/binders.h
+#usr/include/c++/4.9.3/backward/hash_fun.h
+#usr/include/c++/4.9.3/backward/hash_map
+#usr/include/c++/4.9.3/backward/hash_set
+#usr/include/c++/4.9.3/backward/hashtable.h
+#usr/include/c++/4.9.3/backward/strstream
+#usr/include/c++/4.9.3/bits
+#usr/include/c++/4.9.3/bits/algorithmfwd.h
+#usr/include/c++/4.9.3/bits/alloc_traits.h
+#usr/include/c++/4.9.3/bits/allocator.h
+#usr/include/c++/4.9.3/bits/atomic_base.h
+#usr/include/c++/4.9.3/bits/atomic_lockfree_defines.h
+#usr/include/c++/4.9.3/bits/basic_ios.h
+#usr/include/c++/4.9.3/bits/basic_ios.tcc
+#usr/include/c++/4.9.3/bits/basic_string.h
+#usr/include/c++/4.9.3/bits/basic_string.tcc
+#usr/include/c++/4.9.3/bits/boost_concept_check.h
+#usr/include/c++/4.9.3/bits/c++0x_warning.h
+#usr/include/c++/4.9.3/bits/c++14_warning.h
+#usr/include/c++/4.9.3/bits/char_traits.h
+#usr/include/c++/4.9.3/bits/codecvt.h
+#usr/include/c++/4.9.3/bits/concept_check.h
+#usr/include/c++/4.9.3/bits/cpp_type_traits.h
+#usr/include/c++/4.9.3/bits/cxxabi_forced.h
+#usr/include/c++/4.9.3/bits/deque.tcc
+#usr/include/c++/4.9.3/bits/enable_special_members.h
+#usr/include/c++/4.9.3/bits/exception_defines.h
+#usr/include/c++/4.9.3/bits/exception_ptr.h
+#usr/include/c++/4.9.3/bits/forward_list.h
+#usr/include/c++/4.9.3/bits/forward_list.tcc
+#usr/include/c++/4.9.3/bits/fstream.tcc
+#usr/include/c++/4.9.3/bits/functexcept.h
+#usr/include/c++/4.9.3/bits/functional_hash.h
+#usr/include/c++/4.9.3/bits/gslice.h
+#usr/include/c++/4.9.3/bits/gslice_array.h
+#usr/include/c++/4.9.3/bits/hash_bytes.h
+#usr/include/c++/4.9.3/bits/hashtable.h
+#usr/include/c++/4.9.3/bits/hashtable_policy.h
+#usr/include/c++/4.9.3/bits/indirect_array.h
+#usr/include/c++/4.9.3/bits/ios_base.h
+#usr/include/c++/4.9.3/bits/istream.tcc
+#usr/include/c++/4.9.3/bits/list.tcc
+#usr/include/c++/4.9.3/bits/locale_classes.h
+#usr/include/c++/4.9.3/bits/locale_classes.tcc
+#usr/include/c++/4.9.3/bits/locale_facets.h
+#usr/include/c++/4.9.3/bits/locale_facets.tcc
+#usr/include/c++/4.9.3/bits/locale_facets_nonio.h
+#usr/include/c++/4.9.3/bits/locale_facets_nonio.tcc
+#usr/include/c++/4.9.3/bits/localefwd.h
+#usr/include/c++/4.9.3/bits/mask_array.h
+#usr/include/c++/4.9.3/bits/memoryfwd.h
+#usr/include/c++/4.9.3/bits/move.h
+#usr/include/c++/4.9.3/bits/nested_exception.h
+#usr/include/c++/4.9.3/bits/ostream.tcc
+#usr/include/c++/4.9.3/bits/ostream_insert.h
+#usr/include/c++/4.9.3/bits/parse_numbers.h
+#usr/include/c++/4.9.3/bits/postypes.h
+#usr/include/c++/4.9.3/bits/predefined_ops.h
+#usr/include/c++/4.9.3/bits/ptr_traits.h
+#usr/include/c++/4.9.3/bits/random.h
+#usr/include/c++/4.9.3/bits/random.tcc
+#usr/include/c++/4.9.3/bits/range_access.h
+#usr/include/c++/4.9.3/bits/regex.h
+#usr/include/c++/4.9.3/bits/regex.tcc
+#usr/include/c++/4.9.3/bits/regex_automaton.h
+#usr/include/c++/4.9.3/bits/regex_automaton.tcc
+#usr/include/c++/4.9.3/bits/regex_compiler.h
+#usr/include/c++/4.9.3/bits/regex_compiler.tcc
+#usr/include/c++/4.9.3/bits/regex_constants.h
+#usr/include/c++/4.9.3/bits/regex_error.h
+#usr/include/c++/4.9.3/bits/regex_executor.h
+#usr/include/c++/4.9.3/bits/regex_executor.tcc
+#usr/include/c++/4.9.3/bits/regex_scanner.h
+#usr/include/c++/4.9.3/bits/regex_scanner.tcc
+#usr/include/c++/4.9.3/bits/shared_ptr.h
+#usr/include/c++/4.9.3/bits/shared_ptr_base.h
+#usr/include/c++/4.9.3/bits/slice_array.h
+#usr/include/c++/4.9.3/bits/sstream.tcc
+#usr/include/c++/4.9.3/bits/stl_algo.h
+#usr/include/c++/4.9.3/bits/stl_algobase.h
+#usr/include/c++/4.9.3/bits/stl_bvector.h
+#usr/include/c++/4.9.3/bits/stl_construct.h
+#usr/include/c++/4.9.3/bits/stl_deque.h
+#usr/include/c++/4.9.3/bits/stl_function.h
+#usr/include/c++/4.9.3/bits/stl_heap.h
+#usr/include/c++/4.9.3/bits/stl_iterator.h
+#usr/include/c++/4.9.3/bits/stl_iterator_base_funcs.h
+#usr/include/c++/4.9.3/bits/stl_iterator_base_types.h
+#usr/include/c++/4.9.3/bits/stl_list.h
+#usr/include/c++/4.9.3/bits/stl_map.h
+#usr/include/c++/4.9.3/bits/stl_multimap.h
+#usr/include/c++/4.9.3/bits/stl_multiset.h
+#usr/include/c++/4.9.3/bits/stl_numeric.h
+#usr/include/c++/4.9.3/bits/stl_pair.h
+#usr/include/c++/4.9.3/bits/stl_queue.h
+#usr/include/c++/4.9.3/bits/stl_raw_storage_iter.h
+#usr/include/c++/4.9.3/bits/stl_relops.h
+#usr/include/c++/4.9.3/bits/stl_set.h
+#usr/include/c++/4.9.3/bits/stl_stack.h
+#usr/include/c++/4.9.3/bits/stl_tempbuf.h
+#usr/include/c++/4.9.3/bits/stl_tree.h
+#usr/include/c++/4.9.3/bits/stl_uninitialized.h
+#usr/include/c++/4.9.3/bits/stl_vector.h
+#usr/include/c++/4.9.3/bits/stream_iterator.h
+#usr/include/c++/4.9.3/bits/streambuf.tcc
+#usr/include/c++/4.9.3/bits/streambuf_iterator.h
+#usr/include/c++/4.9.3/bits/stringfwd.h
+#usr/include/c++/4.9.3/bits/unique_ptr.h
+#usr/include/c++/4.9.3/bits/unordered_map.h
+#usr/include/c++/4.9.3/bits/unordered_set.h
+#usr/include/c++/4.9.3/bits/uses_allocator.h
+#usr/include/c++/4.9.3/bits/valarray_after.h
+#usr/include/c++/4.9.3/bits/valarray_array.h
+#usr/include/c++/4.9.3/bits/valarray_array.tcc
+#usr/include/c++/4.9.3/bits/valarray_before.h
+#usr/include/c++/4.9.3/bits/vector.tcc
+#usr/include/c++/4.9.3/bitset
+#usr/include/c++/4.9.3/cassert
+#usr/include/c++/4.9.3/ccomplex
+#usr/include/c++/4.9.3/cctype
+#usr/include/c++/4.9.3/cerrno
+#usr/include/c++/4.9.3/cfenv
+#usr/include/c++/4.9.3/cfloat
+#usr/include/c++/4.9.3/chrono
+#usr/include/c++/4.9.3/cinttypes
+#usr/include/c++/4.9.3/ciso646
+#usr/include/c++/4.9.3/climits
+#usr/include/c++/4.9.3/clocale
+#usr/include/c++/4.9.3/cmath
+#usr/include/c++/4.9.3/complex
+#usr/include/c++/4.9.3/complex.h
+#usr/include/c++/4.9.3/condition_variable
+#usr/include/c++/4.9.3/csetjmp
+#usr/include/c++/4.9.3/csignal
+#usr/include/c++/4.9.3/cstdalign
+#usr/include/c++/4.9.3/cstdarg
+#usr/include/c++/4.9.3/cstdbool
+#usr/include/c++/4.9.3/cstddef
+#usr/include/c++/4.9.3/cstdint
+#usr/include/c++/4.9.3/cstdio
+#usr/include/c++/4.9.3/cstdlib
+#usr/include/c++/4.9.3/cstring
+#usr/include/c++/4.9.3/ctgmath
+#usr/include/c++/4.9.3/ctime
+#usr/include/c++/4.9.3/cwchar
+#usr/include/c++/4.9.3/cwctype
+#usr/include/c++/4.9.3/cxxabi.h
+#usr/include/c++/4.9.3/debug
+#usr/include/c++/4.9.3/debug/array
+#usr/include/c++/4.9.3/debug/bitset
+#usr/include/c++/4.9.3/debug/debug.h
+#usr/include/c++/4.9.3/debug/deque
+#usr/include/c++/4.9.3/debug/formatter.h
+#usr/include/c++/4.9.3/debug/forward_list
+#usr/include/c++/4.9.3/debug/functions.h
+#usr/include/c++/4.9.3/debug/list
+#usr/include/c++/4.9.3/debug/macros.h
+#usr/include/c++/4.9.3/debug/map
+#usr/include/c++/4.9.3/debug/map.h
+#usr/include/c++/4.9.3/debug/multimap.h
+#usr/include/c++/4.9.3/debug/multiset.h
+#usr/include/c++/4.9.3/debug/safe_base.h
+#usr/include/c++/4.9.3/debug/safe_iterator.h
+#usr/include/c++/4.9.3/debug/safe_iterator.tcc
+#usr/include/c++/4.9.3/debug/safe_local_iterator.h
+#usr/include/c++/4.9.3/debug/safe_local_iterator.tcc
+#usr/include/c++/4.9.3/debug/safe_sequence.h
+#usr/include/c++/4.9.3/debug/safe_sequence.tcc
+#usr/include/c++/4.9.3/debug/safe_unordered_base.h
+#usr/include/c++/4.9.3/debug/safe_unordered_container.h
+#usr/include/c++/4.9.3/debug/safe_unordered_container.tcc
+#usr/include/c++/4.9.3/debug/set
+#usr/include/c++/4.9.3/debug/set.h
+#usr/include/c++/4.9.3/debug/string
+#usr/include/c++/4.9.3/debug/unordered_map
+#usr/include/c++/4.9.3/debug/unordered_set
+#usr/include/c++/4.9.3/debug/vector
+#usr/include/c++/4.9.3/decimal
+#usr/include/c++/4.9.3/decimal/decimal
+#usr/include/c++/4.9.3/decimal/decimal.h
+#usr/include/c++/4.9.3/deque
+#usr/include/c++/4.9.3/exception
+#usr/include/c++/4.9.3/experimental
+#usr/include/c++/4.9.3/experimental/optional
+#usr/include/c++/4.9.3/experimental/string_view
+#usr/include/c++/4.9.3/experimental/string_view.tcc
+#usr/include/c++/4.9.3/ext
+#usr/include/c++/4.9.3/ext/algorithm
+#usr/include/c++/4.9.3/ext/aligned_buffer.h
+#usr/include/c++/4.9.3/ext/alloc_traits.h
+#usr/include/c++/4.9.3/ext/array_allocator.h
+#usr/include/c++/4.9.3/ext/atomicity.h
+#usr/include/c++/4.9.3/ext/bitmap_allocator.h
+#usr/include/c++/4.9.3/ext/cast.h
+#usr/include/c++/4.9.3/ext/cmath
+#usr/include/c++/4.9.3/ext/codecvt_specializations.h
+#usr/include/c++/4.9.3/ext/concurrence.h
+#usr/include/c++/4.9.3/ext/debug_allocator.h
+#usr/include/c++/4.9.3/ext/enc_filebuf.h
+#usr/include/c++/4.9.3/ext/extptr_allocator.h
+#usr/include/c++/4.9.3/ext/functional
+#usr/include/c++/4.9.3/ext/hash_map
+#usr/include/c++/4.9.3/ext/hash_set
+#usr/include/c++/4.9.3/ext/iterator
+#usr/include/c++/4.9.3/ext/malloc_allocator.h
+#usr/include/c++/4.9.3/ext/memory
+#usr/include/c++/4.9.3/ext/mt_allocator.h
+#usr/include/c++/4.9.3/ext/new_allocator.h
+#usr/include/c++/4.9.3/ext/numeric
+#usr/include/c++/4.9.3/ext/numeric_traits.h
+#usr/include/c++/4.9.3/ext/pb_ds
+#usr/include/c++/4.9.3/ext/pb_ds/assoc_container.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail
+#usr/include/c++/4.9.3/ext/pb_ds/detail/bin_search_tree_
+#usr/include/c++/4.9.3/ext/pb_ds/detail/bin_search_tree_/bin_search_tree_.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/bin_search_tree_/constructors_destructor_fn_imps.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/bin_search_tree_/debug_fn_imps.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/bin_search_tree_/erase_fn_imps.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/bin_search_tree_/find_fn_imps.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/bin_search_tree_/info_fn_imps.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/bin_search_tree_/insert_fn_imps.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/bin_search_tree_/iterators_fn_imps.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/bin_search_tree_/node_iterators.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/bin_search_tree_/point_iterators.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/bin_search_tree_/policy_access_fn_imps.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/bin_search_tree_/r_erase_fn_imps.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/bin_search_tree_/rotate_fn_imps.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/bin_search_tree_/split_join_fn_imps.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/bin_search_tree_/traits.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/binary_heap_
+#usr/include/c++/4.9.3/ext/pb_ds/detail/binary_heap_/binary_heap_.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/binary_heap_/const_iterator.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/binary_heap_/constructors_destructor_fn_imps.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/binary_heap_/debug_fn_imps.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/binary_heap_/entry_cmp.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/binary_heap_/entry_pred.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/binary_heap_/erase_fn_imps.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/binary_heap_/find_fn_imps.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/binary_heap_/info_fn_imps.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/binary_heap_/insert_fn_imps.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/binary_heap_/iterators_fn_imps.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/binary_heap_/point_const_iterator.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/binary_heap_/policy_access_fn_imps.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/binary_heap_/resize_policy.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/binary_heap_/split_join_fn_imps.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/binary_heap_/trace_fn_imps.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/binomial_heap_
+#usr/include/c++/4.9.3/ext/pb_ds/detail/binomial_heap_/binomial_heap_.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/binomial_heap_/constructors_destructor_fn_imps.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/binomial_heap_/debug_fn_imps.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/binomial_heap_base_
+#usr/include/c++/4.9.3/ext/pb_ds/detail/binomial_heap_base_/binomial_heap_base_.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/binomial_heap_base_/constructors_destructor_fn_imps.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/binomial_heap_base_/debug_fn_imps.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/binomial_heap_base_/erase_fn_imps.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/binomial_heap_base_/find_fn_imps.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/binomial_heap_base_/insert_fn_imps.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/binomial_heap_base_/split_join_fn_imps.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/branch_policy
+#usr/include/c++/4.9.3/ext/pb_ds/detail/branch_policy/branch_policy.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/branch_policy/null_node_metadata.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/branch_policy/traits.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/cc_hash_table_map_
+#usr/include/c++/4.9.3/ext/pb_ds/detail/cc_hash_table_map_/cc_ht_map_.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/cc_hash_table_map_/cmp_fn_imps.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/cc_hash_table_map_/cond_key_dtor_entry_dealtor.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/cc_hash_table_map_/constructor_destructor_fn_imps.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/cc_hash_table_map_/constructor_destructor_no_store_hash_fn_imps.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/cc_hash_table_map_/constructor_destructor_store_hash_fn_imps.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/cc_hash_table_map_/debug_fn_imps.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/cc_hash_table_map_/debug_no_store_hash_fn_imps.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/cc_hash_table_map_/debug_store_hash_fn_imps.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/cc_hash_table_map_/entry_list_fn_imps.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/cc_hash_table_map_/erase_fn_imps.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/cc_hash_table_map_/erase_no_store_hash_fn_imps.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/cc_hash_table_map_/erase_store_hash_fn_imps.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/cc_hash_table_map_/find_fn_imps.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/cc_hash_table_map_/find_store_hash_fn_imps.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/cc_hash_table_map_/info_fn_imps.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/cc_hash_table_map_/insert_fn_imps.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/cc_hash_table_map_/insert_no_store_hash_fn_imps.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/cc_hash_table_map_/insert_store_hash_fn_imps.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/cc_hash_table_map_/iterators_fn_imps.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/cc_hash_table_map_/policy_access_fn_imps.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/cc_hash_table_map_/resize_fn_imps.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/cc_hash_table_map_/resize_no_store_hash_fn_imps.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/cc_hash_table_map_/resize_store_hash_fn_imps.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/cc_hash_table_map_/size_fn_imps.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/cc_hash_table_map_/trace_fn_imps.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/cond_dealtor.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/container_base_dispatch.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/debug_map_base.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/eq_fn
+#usr/include/c++/4.9.3/ext/pb_ds/detail/eq_fn/eq_by_less.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/eq_fn/hash_eq_fn.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/gp_hash_table_map_
+#usr/include/c++/4.9.3/ext/pb_ds/detail/gp_hash_table_map_/constructor_destructor_fn_imps.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/gp_hash_table_map_/constructor_destructor_no_store_hash_fn_imps.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/gp_hash_table_map_/constructor_destructor_store_hash_fn_imps.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/gp_hash_table_map_/debug_fn_imps.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/gp_hash_table_map_/debug_no_store_hash_fn_imps.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/gp_hash_table_map_/debug_store_hash_fn_imps.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/gp_hash_table_map_/erase_fn_imps.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/gp_hash_table_map_/erase_no_store_hash_fn_imps.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/gp_hash_table_map_/erase_store_hash_fn_imps.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/gp_hash_table_map_/find_fn_imps.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/gp_hash_table_map_/find_no_store_hash_fn_imps.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/gp_hash_table_map_/find_store_hash_fn_imps.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/gp_hash_table_map_/gp_ht_map_.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/gp_hash_table_map_/info_fn_imps.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/gp_hash_table_map_/insert_fn_imps.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/gp_hash_table_map_/insert_no_store_hash_fn_imps.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/gp_hash_table_map_/insert_store_hash_fn_imps.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/gp_hash_table_map_/iterator_fn_imps.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/gp_hash_table_map_/policy_access_fn_imps.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/gp_hash_table_map_/resize_fn_imps.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/gp_hash_table_map_/resize_no_store_hash_fn_imps.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/gp_hash_table_map_/resize_store_hash_fn_imps.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/gp_hash_table_map_/trace_fn_imps.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/hash_fn
+#usr/include/c++/4.9.3/ext/pb_ds/detail/hash_fn/direct_mask_range_hashing_imp.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/hash_fn/direct_mod_range_hashing_imp.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/hash_fn/linear_probe_fn_imp.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/hash_fn/mask_based_range_hashing.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/hash_fn/mod_based_range_hashing.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/hash_fn/probe_fn_base.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/hash_fn/quadratic_probe_fn_imp.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/hash_fn/ranged_hash_fn.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/hash_fn/ranged_probe_fn.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/hash_fn/sample_probe_fn.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/hash_fn/sample_range_hashing.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/hash_fn/sample_ranged_hash_fn.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/hash_fn/sample_ranged_probe_fn.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/left_child_next_sibling_heap_
+#usr/include/c++/4.9.3/ext/pb_ds/detail/left_child_next_sibling_heap_/const_iterator.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/left_child_next_sibling_heap_/constructors_destructor_fn_imps.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/left_child_next_sibling_heap_/debug_fn_imps.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/left_child_next_sibling_heap_/erase_fn_imps.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/left_child_next_sibling_heap_/info_fn_imps.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/left_child_next_sibling_heap_/insert_fn_imps.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/left_child_next_sibling_heap_/iterators_fn_imps.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/left_child_next_sibling_heap_/left_child_next_sibling_heap_.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/left_child_next_sibling_heap_/node.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/left_child_next_sibling_heap_/point_const_iterator.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/left_child_next_sibling_heap_/policy_access_fn_imps.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/left_child_next_sibling_heap_/trace_fn_imps.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/list_update_map_
+#usr/include/c++/4.9.3/ext/pb_ds/detail/list_update_map_/constructor_destructor_fn_imps.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/list_update_map_/debug_fn_imps.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/list_update_map_/entry_metadata_base.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/list_update_map_/erase_fn_imps.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/list_update_map_/find_fn_imps.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/list_update_map_/info_fn_imps.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/list_update_map_/insert_fn_imps.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/list_update_map_/iterators_fn_imps.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/list_update_map_/lu_map_.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/list_update_map_/trace_fn_imps.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/list_update_policy
+#usr/include/c++/4.9.3/ext/pb_ds/detail/list_update_policy/lu_counter_metadata.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/list_update_policy/sample_update_policy.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/ov_tree_map_
+#usr/include/c++/4.9.3/ext/pb_ds/detail/ov_tree_map_/constructors_destructor_fn_imps.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/ov_tree_map_/debug_fn_imps.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/ov_tree_map_/erase_fn_imps.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/ov_tree_map_/info_fn_imps.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/ov_tree_map_/insert_fn_imps.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/ov_tree_map_/iterators_fn_imps.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/ov_tree_map_/node_iterators.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/ov_tree_map_/ov_tree_map_.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/ov_tree_map_/policy_access_fn_imps.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/ov_tree_map_/split_join_fn_imps.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/ov_tree_map_/traits.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/pairing_heap_
+#usr/include/c++/4.9.3/ext/pb_ds/detail/pairing_heap_/constructors_destructor_fn_imps.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/pairing_heap_/debug_fn_imps.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/pairing_heap_/erase_fn_imps.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/pairing_heap_/find_fn_imps.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/pairing_heap_/insert_fn_imps.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/pairing_heap_/pairing_heap_.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/pairing_heap_/split_join_fn_imps.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/pat_trie_
+#usr/include/c++/4.9.3/ext/pb_ds/detail/pat_trie_/constructors_destructor_fn_imps.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/pat_trie_/debug_fn_imps.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/pat_trie_/erase_fn_imps.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/pat_trie_/find_fn_imps.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/pat_trie_/info_fn_imps.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/pat_trie_/insert_join_fn_imps.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/pat_trie_/iterators_fn_imps.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/pat_trie_/pat_trie_.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/pat_trie_/pat_trie_base.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/pat_trie_/policy_access_fn_imps.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/pat_trie_/r_erase_fn_imps.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/pat_trie_/rotate_fn_imps.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/pat_trie_/split_fn_imps.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/pat_trie_/synth_access_traits.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/pat_trie_/trace_fn_imps.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/pat_trie_/traits.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/pat_trie_/update_fn_imps.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/priority_queue_base_dispatch.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/rb_tree_map_
+#usr/include/c++/4.9.3/ext/pb_ds/detail/rb_tree_map_/constructors_destructor_fn_imps.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/rb_tree_map_/debug_fn_imps.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/rb_tree_map_/erase_fn_imps.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/rb_tree_map_/find_fn_imps.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/rb_tree_map_/info_fn_imps.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/rb_tree_map_/insert_fn_imps.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/rb_tree_map_/node.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/rb_tree_map_/rb_tree_.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/rb_tree_map_/split_join_fn_imps.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/rb_tree_map_/traits.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/rc_binomial_heap_
+#usr/include/c++/4.9.3/ext/pb_ds/detail/rc_binomial_heap_/constructors_destructor_fn_imps.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/rc_binomial_heap_/debug_fn_imps.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/rc_binomial_heap_/erase_fn_imps.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/rc_binomial_heap_/insert_fn_imps.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/rc_binomial_heap_/rc.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/rc_binomial_heap_/rc_binomial_heap_.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/rc_binomial_heap_/split_join_fn_imps.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/rc_binomial_heap_/trace_fn_imps.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/resize_policy
+#usr/include/c++/4.9.3/ext/pb_ds/detail/resize_policy/cc_hash_max_collision_check_resize_trigger_imp.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/resize_policy/hash_exponential_size_policy_imp.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/resize_policy/hash_load_check_resize_trigger_imp.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/resize_policy/hash_load_check_resize_trigger_size_base.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/resize_policy/hash_prime_size_policy_imp.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/resize_policy/hash_standard_resize_policy_imp.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/resize_policy/sample_resize_policy.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/resize_policy/sample_resize_trigger.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/resize_policy/sample_size_policy.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/splay_tree_
+#usr/include/c++/4.9.3/ext/pb_ds/detail/splay_tree_/constructors_destructor_fn_imps.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/splay_tree_/debug_fn_imps.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/splay_tree_/erase_fn_imps.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/splay_tree_/find_fn_imps.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/splay_tree_/info_fn_imps.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/splay_tree_/insert_fn_imps.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/splay_tree_/node.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/splay_tree_/splay_fn_imps.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/splay_tree_/splay_tree_.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/splay_tree_/split_join_fn_imps.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/splay_tree_/traits.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/standard_policies.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/thin_heap_
+#usr/include/c++/4.9.3/ext/pb_ds/detail/thin_heap_/constructors_destructor_fn_imps.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/thin_heap_/debug_fn_imps.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/thin_heap_/erase_fn_imps.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/thin_heap_/find_fn_imps.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/thin_heap_/insert_fn_imps.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/thin_heap_/split_join_fn_imps.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/thin_heap_/thin_heap_.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/thin_heap_/trace_fn_imps.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/tree_policy
+#usr/include/c++/4.9.3/ext/pb_ds/detail/tree_policy/node_metadata_selector.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/tree_policy/order_statistics_imp.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/tree_policy/sample_tree_node_update.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/tree_trace_base.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/trie_policy
+#usr/include/c++/4.9.3/ext/pb_ds/detail/trie_policy/node_metadata_selector.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/trie_policy/order_statistics_imp.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/trie_policy/prefix_search_node_update_imp.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/trie_policy/sample_trie_access_traits.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/trie_policy/sample_trie_node_update.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/trie_policy/trie_policy_base.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/trie_policy/trie_string_access_traits_imp.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/type_utils.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/types_traits.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/unordered_iterator
+#usr/include/c++/4.9.3/ext/pb_ds/detail/unordered_iterator/const_iterator.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/unordered_iterator/iterator.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/unordered_iterator/point_const_iterator.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/unordered_iterator/point_iterator.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/exception.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/hash_policy.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/list_update_policy.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/priority_queue.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/tag_and_trait.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/tree_policy.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/trie_policy.hpp
+#usr/include/c++/4.9.3/ext/pod_char_traits.h
+#usr/include/c++/4.9.3/ext/pointer.h
+#usr/include/c++/4.9.3/ext/pool_allocator.h
+#usr/include/c++/4.9.3/ext/random
+#usr/include/c++/4.9.3/ext/random.tcc
+#usr/include/c++/4.9.3/ext/rb_tree
+#usr/include/c++/4.9.3/ext/rc_string_base.h
+#usr/include/c++/4.9.3/ext/rope
+#usr/include/c++/4.9.3/ext/ropeimpl.h
+#usr/include/c++/4.9.3/ext/slist
+#usr/include/c++/4.9.3/ext/sso_string_base.h
+#usr/include/c++/4.9.3/ext/stdio_filebuf.h
+#usr/include/c++/4.9.3/ext/stdio_sync_filebuf.h
+#usr/include/c++/4.9.3/ext/string_conversions.h
+#usr/include/c++/4.9.3/ext/throw_allocator.h
+#usr/include/c++/4.9.3/ext/type_traits.h
+#usr/include/c++/4.9.3/ext/typelist.h
+#usr/include/c++/4.9.3/ext/vstring.h
+#usr/include/c++/4.9.3/ext/vstring.tcc
+#usr/include/c++/4.9.3/ext/vstring_fwd.h
+#usr/include/c++/4.9.3/ext/vstring_util.h
+#usr/include/c++/4.9.3/fenv.h
+#usr/include/c++/4.9.3/forward_list
+#usr/include/c++/4.9.3/fstream
+#usr/include/c++/4.9.3/functional
+#usr/include/c++/4.9.3/future
+#usr/include/c++/4.9.3/initializer_list
+#usr/include/c++/4.9.3/iomanip
+#usr/include/c++/4.9.3/ios
+#usr/include/c++/4.9.3/iosfwd
+#usr/include/c++/4.9.3/iostream
+#usr/include/c++/4.9.3/istream
+#usr/include/c++/4.9.3/iterator
+#usr/include/c++/4.9.3/limits
+#usr/include/c++/4.9.3/list
+#usr/include/c++/4.9.3/locale
+#usr/include/c++/4.9.3/map
+#usr/include/c++/4.9.3/memory
+#usr/include/c++/4.9.3/mutex
+#usr/include/c++/4.9.3/new
+#usr/include/c++/4.9.3/numeric
+#usr/include/c++/4.9.3/ostream
+#usr/include/c++/4.9.3/parallel
+#usr/include/c++/4.9.3/parallel/algo.h
+#usr/include/c++/4.9.3/parallel/algobase.h
+#usr/include/c++/4.9.3/parallel/algorithm
+#usr/include/c++/4.9.3/parallel/algorithmfwd.h
+#usr/include/c++/4.9.3/parallel/balanced_quicksort.h
+#usr/include/c++/4.9.3/parallel/base.h
+#usr/include/c++/4.9.3/parallel/basic_iterator.h
+#usr/include/c++/4.9.3/parallel/checkers.h
+#usr/include/c++/4.9.3/parallel/compatibility.h
+#usr/include/c++/4.9.3/parallel/compiletime_settings.h
+#usr/include/c++/4.9.3/parallel/equally_split.h
+#usr/include/c++/4.9.3/parallel/features.h
+#usr/include/c++/4.9.3/parallel/find.h
+#usr/include/c++/4.9.3/parallel/find_selectors.h
+#usr/include/c++/4.9.3/parallel/for_each.h
+#usr/include/c++/4.9.3/parallel/for_each_selectors.h
+#usr/include/c++/4.9.3/parallel/iterator.h
+#usr/include/c++/4.9.3/parallel/list_partition.h
+#usr/include/c++/4.9.3/parallel/losertree.h
+#usr/include/c++/4.9.3/parallel/merge.h
+#usr/include/c++/4.9.3/parallel/multiseq_selection.h
+#usr/include/c++/4.9.3/parallel/multiway_merge.h
+#usr/include/c++/4.9.3/parallel/multiway_mergesort.h
+#usr/include/c++/4.9.3/parallel/numeric
+#usr/include/c++/4.9.3/parallel/numericfwd.h
+#usr/include/c++/4.9.3/parallel/omp_loop.h
+#usr/include/c++/4.9.3/parallel/omp_loop_static.h
+#usr/include/c++/4.9.3/parallel/par_loop.h
+#usr/include/c++/4.9.3/parallel/parallel.h
+#usr/include/c++/4.9.3/parallel/partial_sum.h
+#usr/include/c++/4.9.3/parallel/partition.h
+#usr/include/c++/4.9.3/parallel/queue.h
+#usr/include/c++/4.9.3/parallel/quicksort.h
+#usr/include/c++/4.9.3/parallel/random_number.h
+#usr/include/c++/4.9.3/parallel/random_shuffle.h
+#usr/include/c++/4.9.3/parallel/search.h
+#usr/include/c++/4.9.3/parallel/set_operations.h
+#usr/include/c++/4.9.3/parallel/settings.h
+#usr/include/c++/4.9.3/parallel/sort.h
+#usr/include/c++/4.9.3/parallel/tags.h
+#usr/include/c++/4.9.3/parallel/types.h
+#usr/include/c++/4.9.3/parallel/unique_copy.h
+#usr/include/c++/4.9.3/parallel/workstealing.h
+#usr/include/c++/4.9.3/profile
+#usr/include/c++/4.9.3/profile/array
+#usr/include/c++/4.9.3/profile/base.h
+#usr/include/c++/4.9.3/profile/bitset
+#usr/include/c++/4.9.3/profile/deque
+#usr/include/c++/4.9.3/profile/forward_list
+#usr/include/c++/4.9.3/profile/impl
+#usr/include/c++/4.9.3/profile/impl/profiler.h
+#usr/include/c++/4.9.3/profile/impl/profiler_algos.h
+#usr/include/c++/4.9.3/profile/impl/profiler_container_size.h
+#usr/include/c++/4.9.3/profile/impl/profiler_hash_func.h
+#usr/include/c++/4.9.3/profile/impl/profiler_hashtable_size.h
+#usr/include/c++/4.9.3/profile/impl/profiler_list_to_slist.h
+#usr/include/c++/4.9.3/profile/impl/profiler_list_to_vector.h
+#usr/include/c++/4.9.3/profile/impl/profiler_map_to_unordered_map.h
+#usr/include/c++/4.9.3/profile/impl/profiler_node.h
+#usr/include/c++/4.9.3/profile/impl/profiler_state.h
+#usr/include/c++/4.9.3/profile/impl/profiler_trace.h
+#usr/include/c++/4.9.3/profile/impl/profiler_vector_size.h
+#usr/include/c++/4.9.3/profile/impl/profiler_vector_to_list.h
+#usr/include/c++/4.9.3/profile/iterator_tracker.h
+#usr/include/c++/4.9.3/profile/list
+#usr/include/c++/4.9.3/profile/map
+#usr/include/c++/4.9.3/profile/map.h
+#usr/include/c++/4.9.3/profile/multimap.h
+#usr/include/c++/4.9.3/profile/multiset.h
+#usr/include/c++/4.9.3/profile/set
+#usr/include/c++/4.9.3/profile/set.h
+#usr/include/c++/4.9.3/profile/unordered_base.h
+#usr/include/c++/4.9.3/profile/unordered_map
+#usr/include/c++/4.9.3/profile/unordered_set
+#usr/include/c++/4.9.3/profile/vector
+#usr/include/c++/4.9.3/queue
+#usr/include/c++/4.9.3/random
+#usr/include/c++/4.9.3/ratio
+#usr/include/c++/4.9.3/regex
+#usr/include/c++/4.9.3/scoped_allocator
+#usr/include/c++/4.9.3/set
+#usr/include/c++/4.9.3/shared_mutex
+#usr/include/c++/4.9.3/sstream
+#usr/include/c++/4.9.3/stack
+#usr/include/c++/4.9.3/stdexcept
+#usr/include/c++/4.9.3/streambuf
+#usr/include/c++/4.9.3/string
+#usr/include/c++/4.9.3/system_error
+#usr/include/c++/4.9.3/tgmath.h
+#usr/include/c++/4.9.3/thread
+#usr/include/c++/4.9.3/tr1
+#usr/include/c++/4.9.3/tr1/array
+#usr/include/c++/4.9.3/tr1/bessel_function.tcc
+#usr/include/c++/4.9.3/tr1/beta_function.tcc
+#usr/include/c++/4.9.3/tr1/ccomplex
+#usr/include/c++/4.9.3/tr1/cctype
+#usr/include/c++/4.9.3/tr1/cfenv
+#usr/include/c++/4.9.3/tr1/cfloat
+#usr/include/c++/4.9.3/tr1/cinttypes
+#usr/include/c++/4.9.3/tr1/climits
+#usr/include/c++/4.9.3/tr1/cmath
+#usr/include/c++/4.9.3/tr1/complex
+#usr/include/c++/4.9.3/tr1/complex.h
+#usr/include/c++/4.9.3/tr1/cstdarg
+#usr/include/c++/4.9.3/tr1/cstdbool
+#usr/include/c++/4.9.3/tr1/cstdint
+#usr/include/c++/4.9.3/tr1/cstdio
+#usr/include/c++/4.9.3/tr1/cstdlib
+#usr/include/c++/4.9.3/tr1/ctgmath
+#usr/include/c++/4.9.3/tr1/ctime
+#usr/include/c++/4.9.3/tr1/ctype.h
+#usr/include/c++/4.9.3/tr1/cwchar
+#usr/include/c++/4.9.3/tr1/cwctype
+#usr/include/c++/4.9.3/tr1/ell_integral.tcc
+#usr/include/c++/4.9.3/tr1/exp_integral.tcc
+#usr/include/c++/4.9.3/tr1/fenv.h
+#usr/include/c++/4.9.3/tr1/float.h
+#usr/include/c++/4.9.3/tr1/functional
+#usr/include/c++/4.9.3/tr1/functional_hash.h
+#usr/include/c++/4.9.3/tr1/gamma.tcc
+#usr/include/c++/4.9.3/tr1/hashtable.h
+#usr/include/c++/4.9.3/tr1/hashtable_policy.h
+#usr/include/c++/4.9.3/tr1/hypergeometric.tcc
+#usr/include/c++/4.9.3/tr1/inttypes.h
+#usr/include/c++/4.9.3/tr1/legendre_function.tcc
+#usr/include/c++/4.9.3/tr1/limits.h
+#usr/include/c++/4.9.3/tr1/math.h
+#usr/include/c++/4.9.3/tr1/memory
+#usr/include/c++/4.9.3/tr1/modified_bessel_func.tcc
+#usr/include/c++/4.9.3/tr1/poly_hermite.tcc
+#usr/include/c++/4.9.3/tr1/poly_laguerre.tcc
+#usr/include/c++/4.9.3/tr1/random
+#usr/include/c++/4.9.3/tr1/random.h
+#usr/include/c++/4.9.3/tr1/random.tcc
+#usr/include/c++/4.9.3/tr1/regex
+#usr/include/c++/4.9.3/tr1/riemann_zeta.tcc
+#usr/include/c++/4.9.3/tr1/shared_ptr.h
+#usr/include/c++/4.9.3/tr1/special_function_util.h
+#usr/include/c++/4.9.3/tr1/stdarg.h
+#usr/include/c++/4.9.3/tr1/stdbool.h
+#usr/include/c++/4.9.3/tr1/stdint.h
+#usr/include/c++/4.9.3/tr1/stdio.h
+#usr/include/c++/4.9.3/tr1/stdlib.h
+#usr/include/c++/4.9.3/tr1/tgmath.h
+#usr/include/c++/4.9.3/tr1/tuple
+#usr/include/c++/4.9.3/tr1/type_traits
+#usr/include/c++/4.9.3/tr1/unordered_map
+#usr/include/c++/4.9.3/tr1/unordered_map.h
+#usr/include/c++/4.9.3/tr1/unordered_set
+#usr/include/c++/4.9.3/tr1/unordered_set.h
+#usr/include/c++/4.9.3/tr1/utility
+#usr/include/c++/4.9.3/tr1/wchar.h
+#usr/include/c++/4.9.3/tr1/wctype.h
+#usr/include/c++/4.9.3/tr2
+#usr/include/c++/4.9.3/tr2/bool_set
+#usr/include/c++/4.9.3/tr2/bool_set.tcc
+#usr/include/c++/4.9.3/tr2/dynamic_bitset
+#usr/include/c++/4.9.3/tr2/dynamic_bitset.tcc
+#usr/include/c++/4.9.3/tr2/ratio
+#usr/include/c++/4.9.3/tr2/type_traits
+#usr/include/c++/4.9.3/tuple
+#usr/include/c++/4.9.3/type_traits
+#usr/include/c++/4.9.3/typeindex
+#usr/include/c++/4.9.3/typeinfo
+#usr/include/c++/4.9.3/unordered_map
+#usr/include/c++/4.9.3/unordered_set
+#usr/include/c++/4.9.3/utility
+#usr/include/c++/4.9.3/valarray
+#usr/include/c++/4.9.3/vector
 #usr/lib/gcc
 #usr/lib/gcc/armv5tel-unknown-linux-gnueabi
-#usr/lib/gcc/armv5tel-unknown-linux-gnueabi/4.4.7
-#usr/lib/gcc/armv5tel-unknown-linux-gnueabi/4.4.7/cc1
-#usr/lib/gcc/armv5tel-unknown-linux-gnueabi/4.4.7/cc1plus
-#usr/lib/gcc/armv5tel-unknown-linux-gnueabi/4.4.7/collect2
-#usr/lib/gcc/armv5tel-unknown-linux-gnueabi/4.4.7/crtbegin.o
-#usr/lib/gcc/armv5tel-unknown-linux-gnueabi/4.4.7/crtbeginS.o
-#usr/lib/gcc/armv5tel-unknown-linux-gnueabi/4.4.7/crtbeginT.o
-#usr/lib/gcc/armv5tel-unknown-linux-gnueabi/4.4.7/crtend.o
-#usr/lib/gcc/armv5tel-unknown-linux-gnueabi/4.4.7/crtendS.o
-#usr/lib/gcc/armv5tel-unknown-linux-gnueabi/4.4.7/finclude
-#usr/lib/gcc/armv5tel-unknown-linux-gnueabi/4.4.7/include
-#usr/lib/gcc/armv5tel-unknown-linux-gnueabi/4.4.7/include-fixed
-#usr/lib/gcc/armv5tel-unknown-linux-gnueabi/4.4.7/include-fixed/README
-#usr/lib/gcc/armv5tel-unknown-linux-gnueabi/4.4.7/include-fixed/limits.h
-#usr/lib/gcc/armv5tel-unknown-linux-gnueabi/4.4.7/include-fixed/syslimits.h
-#usr/lib/gcc/armv5tel-unknown-linux-gnueabi/4.4.7/include/arm_neon.h
-#usr/lib/gcc/armv5tel-unknown-linux-gnueabi/4.4.7/include/float.h
-#usr/lib/gcc/armv5tel-unknown-linux-gnueabi/4.4.7/include/iso646.h
-#usr/lib/gcc/armv5tel-unknown-linux-gnueabi/4.4.7/include/mf-runtime.h
-#usr/lib/gcc/armv5tel-unknown-linux-gnueabi/4.4.7/include/mmintrin.h
-#usr/lib/gcc/armv5tel-unknown-linux-gnueabi/4.4.7/include/omp.h
-#usr/lib/gcc/armv5tel-unknown-linux-gnueabi/4.4.7/include/ssp
-#usr/lib/gcc/armv5tel-unknown-linux-gnueabi/4.4.7/include/ssp/ssp.h
-#usr/lib/gcc/armv5tel-unknown-linux-gnueabi/4.4.7/include/ssp/stdio.h
-#usr/lib/gcc/armv5tel-unknown-linux-gnueabi/4.4.7/include/ssp/string.h
-#usr/lib/gcc/armv5tel-unknown-linux-gnueabi/4.4.7/include/ssp/unistd.h
-#usr/lib/gcc/armv5tel-unknown-linux-gnueabi/4.4.7/include/stdarg.h
-#usr/lib/gcc/armv5tel-unknown-linux-gnueabi/4.4.7/include/stdbool.h
-#usr/lib/gcc/armv5tel-unknown-linux-gnueabi/4.4.7/include/stddef.h
-#usr/lib/gcc/armv5tel-unknown-linux-gnueabi/4.4.7/include/stdfix.h
-#usr/lib/gcc/armv5tel-unknown-linux-gnueabi/4.4.7/include/unwind.h
-#usr/lib/gcc/armv5tel-unknown-linux-gnueabi/4.4.7/include/varargs.h
-#usr/lib/gcc/armv5tel-unknown-linux-gnueabi/4.4.7/install-tools
-#usr/lib/gcc/armv5tel-unknown-linux-gnueabi/4.4.7/install-tools/fixinc.sh
-#usr/lib/gcc/armv5tel-unknown-linux-gnueabi/4.4.7/install-tools/fixinc_list
-#usr/lib/gcc/armv5tel-unknown-linux-gnueabi/4.4.7/install-tools/fixincl
-#usr/lib/gcc/armv5tel-unknown-linux-gnueabi/4.4.7/install-tools/gsyslimits.h
-#usr/lib/gcc/armv5tel-unknown-linux-gnueabi/4.4.7/install-tools/include
-#usr/lib/gcc/armv5tel-unknown-linux-gnueabi/4.4.7/install-tools/include/README
-#usr/lib/gcc/armv5tel-unknown-linux-gnueabi/4.4.7/install-tools/include/limits.h
-#usr/lib/gcc/armv5tel-unknown-linux-gnueabi/4.4.7/install-tools/macro_list
-#usr/lib/gcc/armv5tel-unknown-linux-gnueabi/4.4.7/install-tools/mkheaders
-#usr/lib/gcc/armv5tel-unknown-linux-gnueabi/4.4.7/install-tools/mkheaders.conf
-#usr/lib/gcc/armv5tel-unknown-linux-gnueabi/4.4.7/install-tools/mkinstalldirs
-#usr/lib/gcc/armv5tel-unknown-linux-gnueabi/4.4.7/libgcc.a
-#usr/lib/gcc/armv5tel-unknown-linux-gnueabi/4.4.7/libgcc_eh.a
-#usr/lib/gcc/armv5tel-unknown-linux-gnueabi/4.4.7/libgcov.a
+#usr/lib/gcc/armv5tel-unknown-linux-gnueabi/4.9.3
+#usr/lib/gcc/armv5tel-unknown-linux-gnueabi/4.9.3/cc1
+#usr/lib/gcc/armv5tel-unknown-linux-gnueabi/4.9.3/cc1plus
+#usr/lib/gcc/armv5tel-unknown-linux-gnueabi/4.9.3/collect2
+#usr/lib/gcc/armv5tel-unknown-linux-gnueabi/4.9.3/crtbegin.o
+#usr/lib/gcc/armv5tel-unknown-linux-gnueabi/4.9.3/crtbeginS.o
+#usr/lib/gcc/armv5tel-unknown-linux-gnueabi/4.9.3/crtbeginT.o
+#usr/lib/gcc/armv5tel-unknown-linux-gnueabi/4.9.3/crtend.o
+#usr/lib/gcc/armv5tel-unknown-linux-gnueabi/4.9.3/crtendS.o
+#usr/lib/gcc/armv5tel-unknown-linux-gnueabi/4.9.3/finclude
+#usr/lib/gcc/armv5tel-unknown-linux-gnueabi/4.9.3/include
+#usr/lib/gcc/armv5tel-unknown-linux-gnueabi/4.9.3/include-fixed
+#usr/lib/gcc/armv5tel-unknown-linux-gnueabi/4.9.3/include-fixed/README
+#usr/lib/gcc/armv5tel-unknown-linux-gnueabi/4.9.3/include-fixed/limits.h
+#usr/lib/gcc/armv5tel-unknown-linux-gnueabi/4.9.3/include-fixed/syslimits.h
+#usr/lib/gcc/armv5tel-unknown-linux-gnueabi/4.9.3/include/arm_acle.h
+#usr/lib/gcc/armv5tel-unknown-linux-gnueabi/4.9.3/include/arm_neon.h
+#usr/lib/gcc/armv5tel-unknown-linux-gnueabi/4.9.3/include/float.h
+#usr/lib/gcc/armv5tel-unknown-linux-gnueabi/4.9.3/include/iso646.h
+#usr/lib/gcc/armv5tel-unknown-linux-gnueabi/4.9.3/include/mmintrin.h
+#usr/lib/gcc/armv5tel-unknown-linux-gnueabi/4.9.3/include/omp.h
+#usr/lib/gcc/armv5tel-unknown-linux-gnueabi/4.9.3/include/sanitizer
+#usr/lib/gcc/armv5tel-unknown-linux-gnueabi/4.9.3/include/sanitizer/asan_interface.h
+#usr/lib/gcc/armv5tel-unknown-linux-gnueabi/4.9.3/include/sanitizer/common_interface_defs.h
+#usr/lib/gcc/armv5tel-unknown-linux-gnueabi/4.9.3/include/sanitizer/lsan_interface.h
+#usr/lib/gcc/armv5tel-unknown-linux-gnueabi/4.9.3/include/ssp
+#usr/lib/gcc/armv5tel-unknown-linux-gnueabi/4.9.3/include/ssp/ssp.h
+#usr/lib/gcc/armv5tel-unknown-linux-gnueabi/4.9.3/include/ssp/stdio.h
+#usr/lib/gcc/armv5tel-unknown-linux-gnueabi/4.9.3/include/ssp/string.h
+#usr/lib/gcc/armv5tel-unknown-linux-gnueabi/4.9.3/include/ssp/unistd.h
+#usr/lib/gcc/armv5tel-unknown-linux-gnueabi/4.9.3/include/stdalign.h
+#usr/lib/gcc/armv5tel-unknown-linux-gnueabi/4.9.3/include/stdarg.h
+#usr/lib/gcc/armv5tel-unknown-linux-gnueabi/4.9.3/include/stdatomic.h
+#usr/lib/gcc/armv5tel-unknown-linux-gnueabi/4.9.3/include/stdbool.h
+#usr/lib/gcc/armv5tel-unknown-linux-gnueabi/4.9.3/include/stddef.h
+#usr/lib/gcc/armv5tel-unknown-linux-gnueabi/4.9.3/include/stdfix.h
+#usr/lib/gcc/armv5tel-unknown-linux-gnueabi/4.9.3/include/stdint-gcc.h
+#usr/lib/gcc/armv5tel-unknown-linux-gnueabi/4.9.3/include/stdint.h
+#usr/lib/gcc/armv5tel-unknown-linux-gnueabi/4.9.3/include/stdnoreturn.h
+#usr/lib/gcc/armv5tel-unknown-linux-gnueabi/4.9.3/include/unwind-arm-common.h
+#usr/lib/gcc/armv5tel-unknown-linux-gnueabi/4.9.3/include/unwind.h
+#usr/lib/gcc/armv5tel-unknown-linux-gnueabi/4.9.3/include/varargs.h
+#usr/lib/gcc/armv5tel-unknown-linux-gnueabi/4.9.3/install-tools
+#usr/lib/gcc/armv5tel-unknown-linux-gnueabi/4.9.3/install-tools/fixinc.sh
+#usr/lib/gcc/armv5tel-unknown-linux-gnueabi/4.9.3/install-tools/fixinc_list
+#usr/lib/gcc/armv5tel-unknown-linux-gnueabi/4.9.3/install-tools/fixincl
+#usr/lib/gcc/armv5tel-unknown-linux-gnueabi/4.9.3/install-tools/gsyslimits.h
+#usr/lib/gcc/armv5tel-unknown-linux-gnueabi/4.9.3/install-tools/include
+#usr/lib/gcc/armv5tel-unknown-linux-gnueabi/4.9.3/install-tools/include/README
+#usr/lib/gcc/armv5tel-unknown-linux-gnueabi/4.9.3/install-tools/include/limits.h
+#usr/lib/gcc/armv5tel-unknown-linux-gnueabi/4.9.3/install-tools/macro_list
+#usr/lib/gcc/armv5tel-unknown-linux-gnueabi/4.9.3/install-tools/mkheaders
+#usr/lib/gcc/armv5tel-unknown-linux-gnueabi/4.9.3/install-tools/mkheaders.conf
+#usr/lib/gcc/armv5tel-unknown-linux-gnueabi/4.9.3/install-tools/mkinstalldirs
+#usr/lib/gcc/armv5tel-unknown-linux-gnueabi/4.9.3/libgcc.a
+#usr/lib/gcc/armv5tel-unknown-linux-gnueabi/4.9.3/libgcc_eh.a
+#usr/lib/gcc/armv5tel-unknown-linux-gnueabi/4.9.3/libgcov.a
+#usr/lib/gcc/armv5tel-unknown-linux-gnueabi/4.9.3/liblto_plugin.la
+#usr/lib/gcc/armv5tel-unknown-linux-gnueabi/4.9.3/liblto_plugin.so
+#usr/lib/gcc/armv5tel-unknown-linux-gnueabi/4.9.3/liblto_plugin.so.0
+#usr/lib/gcc/armv5tel-unknown-linux-gnueabi/4.9.3/liblto_plugin.so.0.0.0
+#usr/lib/gcc/armv5tel-unknown-linux-gnueabi/4.9.3/lto-wrapper
+#usr/lib/gcc/armv5tel-unknown-linux-gnueabi/4.9.3/lto1
+#usr/lib/gcc/armv5tel-unknown-linux-gnueabi/4.9.3/plugin
+#usr/lib/gcc/armv5tel-unknown-linux-gnueabi/4.9.3/plugin/gengtype
+#usr/lib/gcc/armv5tel-unknown-linux-gnueabi/4.9.3/plugin/gtype.state
+#usr/lib/gcc/armv5tel-unknown-linux-gnueabi/4.9.3/plugin/include
+#usr/lib/gcc/armv5tel-unknown-linux-gnueabi/4.9.3/plugin/include/ada
+#usr/lib/gcc/armv5tel-unknown-linux-gnueabi/4.9.3/plugin/include/ada/gcc-interface
+#usr/lib/gcc/armv5tel-unknown-linux-gnueabi/4.9.3/plugin/include/ada/gcc-interface/ada-tree.def
+#usr/lib/gcc/armv5tel-unknown-linux-gnueabi/4.9.3/plugin/include/alias.h
+#usr/lib/gcc/armv5tel-unknown-linux-gnueabi/4.9.3/plugin/include/all-tree.def
+#usr/lib/gcc/armv5tel-unknown-linux-gnueabi/4.9.3/plugin/include/alloc-pool.h
+#usr/lib/gcc/armv5tel-unknown-linux-gnueabi/4.9.3/plugin/include/ansidecl.h
+#usr/lib/gcc/armv5tel-unknown-linux-gnueabi/4.9.3/plugin/include/attribs.h
+#usr/lib/gcc/armv5tel-unknown-linux-gnueabi/4.9.3/plugin/include/auto-host.h
+#usr/lib/gcc/armv5tel-unknown-linux-gnueabi/4.9.3/plugin/include/b-header-vars
+#usr/lib/gcc/armv5tel-unknown-linux-gnueabi/4.9.3/plugin/include/basic-block.h
+#usr/lib/gcc/armv5tel-unknown-linux-gnueabi/4.9.3/plugin/include/bitmap.h
+#usr/lib/gcc/armv5tel-unknown-linux-gnueabi/4.9.3/plugin/include/builtins.def
+#usr/lib/gcc/armv5tel-unknown-linux-gnueabi/4.9.3/plugin/include/bversion.h
+#usr/lib/gcc/armv5tel-unknown-linux-gnueabi/4.9.3/plugin/include/c-family
+#usr/lib/gcc/armv5tel-unknown-linux-gnueabi/4.9.3/plugin/include/c-family/c-common.def
+#usr/lib/gcc/armv5tel-unknown-linux-gnueabi/4.9.3/plugin/include/c-family/c-common.h
+#usr/lib/gcc/armv5tel-unknown-linux-gnueabi/4.9.3/plugin/include/c-family/c-objc.h
+#usr/lib/gcc/armv5tel-unknown-linux-gnueabi/4.9.3/plugin/include/c-family/c-pragma.h
+#usr/lib/gcc/armv5tel-unknown-linux-gnueabi/4.9.3/plugin/include/c-family/c-pretty-print.h
+#usr/lib/gcc/armv5tel-unknown-linux-gnueabi/4.9.3/plugin/include/c-tree.h
+#usr/lib/gcc/armv5tel-unknown-linux-gnueabi/4.9.3/plugin/include/calls.h
+#usr/lib/gcc/armv5tel-unknown-linux-gnueabi/4.9.3/plugin/include/cfg-flags.def
+#usr/lib/gcc/armv5tel-unknown-linux-gnueabi/4.9.3/plugin/include/cfgexpand.h
+#usr/lib/gcc/armv5tel-unknown-linux-gnueabi/4.9.3/plugin/include/cfghooks.h
+#usr/lib/gcc/armv5tel-unknown-linux-gnueabi/4.9.3/plugin/include/cfgloop.h
+#usr/lib/gcc/armv5tel-unknown-linux-gnueabi/4.9.3/plugin/include/cgraph.h
+#usr/lib/gcc/armv5tel-unknown-linux-gnueabi/4.9.3/plugin/include/cif-code.def
+#usr/lib/gcc/armv5tel-unknown-linux-gnueabi/4.9.3/plugin/include/cilk-builtins.def
+#usr/lib/gcc/armv5tel-unknown-linux-gnueabi/4.9.3/plugin/include/cilkplus.def
+#usr/lib/gcc/armv5tel-unknown-linux-gnueabi/4.9.3/plugin/include/config
+#usr/lib/gcc/armv5tel-unknown-linux-gnueabi/4.9.3/plugin/include/config.h
+#usr/lib/gcc/armv5tel-unknown-linux-gnueabi/4.9.3/plugin/include/config/arm
+#usr/lib/gcc/armv5tel-unknown-linux-gnueabi/4.9.3/plugin/include/config/arm/aarch-common-protos.h
+#usr/lib/gcc/armv5tel-unknown-linux-gnueabi/4.9.3/plugin/include/config/arm/aout.h
+#usr/lib/gcc/armv5tel-unknown-linux-gnueabi/4.9.3/plugin/include/config/arm/arm-cores.def
+#usr/lib/gcc/armv5tel-unknown-linux-gnueabi/4.9.3/plugin/include/config/arm/arm-opts.h
+#usr/lib/gcc/armv5tel-unknown-linux-gnueabi/4.9.3/plugin/include/config/arm/arm-protos.h
+#usr/lib/gcc/armv5tel-unknown-linux-gnueabi/4.9.3/plugin/include/config/arm/arm.h
+#usr/lib/gcc/armv5tel-unknown-linux-gnueabi/4.9.3/plugin/include/config/arm/bpabi.h
+#usr/lib/gcc/armv5tel-unknown-linux-gnueabi/4.9.3/plugin/include/config/arm/elf.h
+#usr/lib/gcc/armv5tel-unknown-linux-gnueabi/4.9.3/plugin/include/config/arm/linux-eabi.h
+#usr/lib/gcc/armv5tel-unknown-linux-gnueabi/4.9.3/plugin/include/config/arm/linux-elf.h
+#usr/lib/gcc/armv5tel-unknown-linux-gnueabi/4.9.3/plugin/include/config/arm/linux-gas.h
+#usr/lib/gcc/armv5tel-unknown-linux-gnueabi/4.9.3/plugin/include/config/dbxelf.h
+#usr/lib/gcc/armv5tel-unknown-linux-gnueabi/4.9.3/plugin/include/config/elfos.h
+#usr/lib/gcc/armv5tel-unknown-linux-gnueabi/4.9.3/plugin/include/config/glibc-stdint.h
+#usr/lib/gcc/armv5tel-unknown-linux-gnueabi/4.9.3/plugin/include/config/gnu-user.h
+#usr/lib/gcc/armv5tel-unknown-linux-gnueabi/4.9.3/plugin/include/config/initfini-array.h
+#usr/lib/gcc/armv5tel-unknown-linux-gnueabi/4.9.3/plugin/include/config/linux-android.h
+#usr/lib/gcc/armv5tel-unknown-linux-gnueabi/4.9.3/plugin/include/config/linux-protos.h
+#usr/lib/gcc/armv5tel-unknown-linux-gnueabi/4.9.3/plugin/include/config/linux.h
+#usr/lib/gcc/armv5tel-unknown-linux-gnueabi/4.9.3/plugin/include/config/vxworks-dummy.h
+#usr/lib/gcc/armv5tel-unknown-linux-gnueabi/4.9.3/plugin/include/configargs.h
+#usr/lib/gcc/armv5tel-unknown-linux-gnueabi/4.9.3/plugin/include/context.h
+#usr/lib/gcc/armv5tel-unknown-linux-gnueabi/4.9.3/plugin/include/coretypes.h
+#usr/lib/gcc/armv5tel-unknown-linux-gnueabi/4.9.3/plugin/include/cp
+#usr/lib/gcc/armv5tel-unknown-linux-gnueabi/4.9.3/plugin/include/cp/cp-tree.def
+#usr/lib/gcc/armv5tel-unknown-linux-gnueabi/4.9.3/plugin/include/cp/cp-tree.h
+#usr/lib/gcc/armv5tel-unknown-linux-gnueabi/4.9.3/plugin/include/cp/cxx-pretty-print.h
+#usr/lib/gcc/armv5tel-unknown-linux-gnueabi/4.9.3/plugin/include/cp/name-lookup.h
+#usr/lib/gcc/armv5tel-unknown-linux-gnueabi/4.9.3/plugin/include/cp/type-utils.h
+#usr/lib/gcc/armv5tel-unknown-linux-gnueabi/4.9.3/plugin/include/cppdefault.h
+#usr/lib/gcc/armv5tel-unknown-linux-gnueabi/4.9.3/plugin/include/cpplib.h
+#usr/lib/gcc/armv5tel-unknown-linux-gnueabi/4.9.3/plugin/include/debug.h
+#usr/lib/gcc/armv5tel-unknown-linux-gnueabi/4.9.3/plugin/include/defaults.h
+#usr/lib/gcc/armv5tel-unknown-linux-gnueabi/4.9.3/plugin/include/df.h
+#usr/lib/gcc/armv5tel-unknown-linux-gnueabi/4.9.3/plugin/include/diagnostic-color.h
+#usr/lib/gcc/armv5tel-unknown-linux-gnueabi/4.9.3/plugin/include/diagnostic-core.h
+#usr/lib/gcc/armv5tel-unknown-linux-gnueabi/4.9.3/plugin/include/diagnostic.def
+#usr/lib/gcc/armv5tel-unknown-linux-gnueabi/4.9.3/plugin/include/diagnostic.h
+#usr/lib/gcc/armv5tel-unknown-linux-gnueabi/4.9.3/plugin/include/double-int.h
+#usr/lib/gcc/armv5tel-unknown-linux-gnueabi/4.9.3/plugin/include/dumpfile.h
+#usr/lib/gcc/armv5tel-unknown-linux-gnueabi/4.9.3/plugin/include/emit-rtl.h
+#usr/lib/gcc/armv5tel-unknown-linux-gnueabi/4.9.3/plugin/include/except.h
+#usr/lib/gcc/armv5tel-unknown-linux-gnueabi/4.9.3/plugin/include/filenames.h
+#usr/lib/gcc/armv5tel-unknown-linux-gnueabi/4.9.3/plugin/include/fixed-value.h
+#usr/lib/gcc/armv5tel-unknown-linux-gnueabi/4.9.3/plugin/include/flag-types.h
+#usr/lib/gcc/armv5tel-unknown-linux-gnueabi/4.9.3/plugin/include/flags.h
+#usr/lib/gcc/armv5tel-unknown-linux-gnueabi/4.9.3/plugin/include/fold-const.h
+#usr/lib/gcc/armv5tel-unknown-linux-gnueabi/4.9.3/plugin/include/function.h
+#usr/lib/gcc/armv5tel-unknown-linux-gnueabi/4.9.3/plugin/include/gcc-plugin.h
+#usr/lib/gcc/armv5tel-unknown-linux-gnueabi/4.9.3/plugin/include/gcc-symtab.h
+#usr/lib/gcc/armv5tel-unknown-linux-gnueabi/4.9.3/plugin/include/genrtl.h
+#usr/lib/gcc/armv5tel-unknown-linux-gnueabi/4.9.3/plugin/include/ggc.h
+#usr/lib/gcc/armv5tel-unknown-linux-gnueabi/4.9.3/plugin/include/gimple-builder.h
+#usr/lib/gcc/armv5tel-unknown-linux-gnueabi/4.9.3/plugin/include/gimple-expr.h
+#usr/lib/gcc/armv5tel-unknown-linux-gnueabi/4.9.3/plugin/include/gimple-fold.h
+#usr/lib/gcc/armv5tel-unknown-linux-gnueabi/4.9.3/plugin/include/gimple-iterator.h
+#usr/lib/gcc/armv5tel-unknown-linux-gnueabi/4.9.3/plugin/include/gimple-low.h
+#usr/lib/gcc/armv5tel-unknown-linux-gnueabi/4.9.3/plugin/include/gimple-pretty-print.h
+#usr/lib/gcc/armv5tel-unknown-linux-gnueabi/4.9.3/plugin/include/gimple-ssa.h
+#usr/lib/gcc/armv5tel-unknown-linux-gnueabi/4.9.3/plugin/include/gimple-walk.h
+#usr/lib/gcc/armv5tel-unknown-linux-gnueabi/4.9.3/plugin/include/gimple.def
+#usr/lib/gcc/armv5tel-unknown-linux-gnueabi/4.9.3/plugin/include/gimple.h
+#usr/lib/gcc/armv5tel-unknown-linux-gnueabi/4.9.3/plugin/include/gimplify-me.h
+#usr/lib/gcc/armv5tel-unknown-linux-gnueabi/4.9.3/plugin/include/gimplify.h
+#usr/lib/gcc/armv5tel-unknown-linux-gnueabi/4.9.3/plugin/include/gsstruct.def
+#usr/lib/gcc/armv5tel-unknown-linux-gnueabi/4.9.3/plugin/include/gtm-builtins.def
+#usr/lib/gcc/armv5tel-unknown-linux-gnueabi/4.9.3/plugin/include/gtype-desc.h
+#usr/lib/gcc/armv5tel-unknown-linux-gnueabi/4.9.3/plugin/include/hard-reg-set.h
+#usr/lib/gcc/armv5tel-unknown-linux-gnueabi/4.9.3/plugin/include/hash-table.h
+#usr/lib/gcc/armv5tel-unknown-linux-gnueabi/4.9.3/plugin/include/hashtab.h
+#usr/lib/gcc/armv5tel-unknown-linux-gnueabi/4.9.3/plugin/include/highlev-plugin-common.h
+#usr/lib/gcc/armv5tel-unknown-linux-gnueabi/4.9.3/plugin/include/hwint.h
+#usr/lib/gcc/armv5tel-unknown-linux-gnueabi/4.9.3/plugin/include/incpath.h
+#usr/lib/gcc/armv5tel-unknown-linux-gnueabi/4.9.3/plugin/include/input.h
+#usr/lib/gcc/armv5tel-unknown-linux-gnueabi/4.9.3/plugin/include/insn-codes.h
+#usr/lib/gcc/armv5tel-unknown-linux-gnueabi/4.9.3/plugin/include/insn-constants.h
+#usr/lib/gcc/armv5tel-unknown-linux-gnueabi/4.9.3/plugin/include/insn-flags.h
+#usr/lib/gcc/armv5tel-unknown-linux-gnueabi/4.9.3/plugin/include/insn-modes.h
+#usr/lib/gcc/armv5tel-unknown-linux-gnueabi/4.9.3/plugin/include/insn-notes.def
+#usr/lib/gcc/armv5tel-unknown-linux-gnueabi/4.9.3/plugin/include/internal-fn.def
+#usr/lib/gcc/armv5tel-unknown-linux-gnueabi/4.9.3/plugin/include/internal-fn.h
+#usr/lib/gcc/armv5tel-unknown-linux-gnueabi/4.9.3/plugin/include/intl.h
+#usr/lib/gcc/armv5tel-unknown-linux-gnueabi/4.9.3/plugin/include/ipa-prop.h
+#usr/lib/gcc/armv5tel-unknown-linux-gnueabi/4.9.3/plugin/include/ipa-ref-inline.h
+#usr/lib/gcc/armv5tel-unknown-linux-gnueabi/4.9.3/plugin/include/ipa-ref.h
+#usr/lib/gcc/armv5tel-unknown-linux-gnueabi/4.9.3/plugin/include/ipa-reference.h
+#usr/lib/gcc/armv5tel-unknown-linux-gnueabi/4.9.3/plugin/include/ipa-utils.h
+#usr/lib/gcc/armv5tel-unknown-linux-gnueabi/4.9.3/plugin/include/is-a.h
+#usr/lib/gcc/armv5tel-unknown-linux-gnueabi/4.9.3/plugin/include/java
+#usr/lib/gcc/armv5tel-unknown-linux-gnueabi/4.9.3/plugin/include/java/java-tree.def
+#usr/lib/gcc/armv5tel-unknown-linux-gnueabi/4.9.3/plugin/include/langhooks.h
+#usr/lib/gcc/armv5tel-unknown-linux-gnueabi/4.9.3/plugin/include/libiberty.h
+#usr/lib/gcc/armv5tel-unknown-linux-gnueabi/4.9.3/plugin/include/line-map.h
+#usr/lib/gcc/armv5tel-unknown-linux-gnueabi/4.9.3/plugin/include/machmode.h
+#usr/lib/gcc/armv5tel-unknown-linux-gnueabi/4.9.3/plugin/include/md5.h
+#usr/lib/gcc/armv5tel-unknown-linux-gnueabi/4.9.3/plugin/include/mode-classes.def
+#usr/lib/gcc/armv5tel-unknown-linux-gnueabi/4.9.3/plugin/include/objc
+#usr/lib/gcc/armv5tel-unknown-linux-gnueabi/4.9.3/plugin/include/objc/objc-tree.def
+#usr/lib/gcc/armv5tel-unknown-linux-gnueabi/4.9.3/plugin/include/obstack.h
+#usr/lib/gcc/armv5tel-unknown-linux-gnueabi/4.9.3/plugin/include/omp-builtins.def
+#usr/lib/gcc/armv5tel-unknown-linux-gnueabi/4.9.3/plugin/include/options.h
+#usr/lib/gcc/armv5tel-unknown-linux-gnueabi/4.9.3/plugin/include/opts.h
+#usr/lib/gcc/armv5tel-unknown-linux-gnueabi/4.9.3/plugin/include/output.h
+#usr/lib/gcc/armv5tel-unknown-linux-gnueabi/4.9.3/plugin/include/params.def
+#usr/lib/gcc/armv5tel-unknown-linux-gnueabi/4.9.3/plugin/include/params.h
+#usr/lib/gcc/armv5tel-unknown-linux-gnueabi/4.9.3/plugin/include/pass-instances.def
+#usr/lib/gcc/armv5tel-unknown-linux-gnueabi/4.9.3/plugin/include/pass_manager.h
+#usr/lib/gcc/armv5tel-unknown-linux-gnueabi/4.9.3/plugin/include/plugin-api.h
+#usr/lib/gcc/armv5tel-unknown-linux-gnueabi/4.9.3/plugin/include/plugin-version.h
+#usr/lib/gcc/armv5tel-unknown-linux-gnueabi/4.9.3/plugin/include/plugin.def
+#usr/lib/gcc/armv5tel-unknown-linux-gnueabi/4.9.3/plugin/include/plugin.h
+#usr/lib/gcc/armv5tel-unknown-linux-gnueabi/4.9.3/plugin/include/pointer-set.h
+#usr/lib/gcc/armv5tel-unknown-linux-gnueabi/4.9.3/plugin/include/predict.def
+#usr/lib/gcc/armv5tel-unknown-linux-gnueabi/4.9.3/plugin/include/predict.h
+#usr/lib/gcc/armv5tel-unknown-linux-gnueabi/4.9.3/plugin/include/prefix.h
+#usr/lib/gcc/armv5tel-unknown-linux-gnueabi/4.9.3/plugin/include/pretty-print.h
+#usr/lib/gcc/armv5tel-unknown-linux-gnueabi/4.9.3/plugin/include/print-rtl.h
+#usr/lib/gcc/armv5tel-unknown-linux-gnueabi/4.9.3/plugin/include/print-tree.h
+#usr/lib/gcc/armv5tel-unknown-linux-gnueabi/4.9.3/plugin/include/real.h
+#usr/lib/gcc/armv5tel-unknown-linux-gnueabi/4.9.3/plugin/include/realmpfr.h
+#usr/lib/gcc/armv5tel-unknown-linux-gnueabi/4.9.3/plugin/include/reg-notes.def
+#usr/lib/gcc/armv5tel-unknown-linux-gnueabi/4.9.3/plugin/include/regset.h
+#usr/lib/gcc/armv5tel-unknown-linux-gnueabi/4.9.3/plugin/include/resource.h
+#usr/lib/gcc/armv5tel-unknown-linux-gnueabi/4.9.3/plugin/include/rtl.def
+#usr/lib/gcc/armv5tel-unknown-linux-gnueabi/4.9.3/plugin/include/rtl.h
+#usr/lib/gcc/armv5tel-unknown-linux-gnueabi/4.9.3/plugin/include/safe-ctype.h
+#usr/lib/gcc/armv5tel-unknown-linux-gnueabi/4.9.3/plugin/include/sanitizer.def
+#usr/lib/gcc/armv5tel-unknown-linux-gnueabi/4.9.3/plugin/include/sbitmap.h
+#usr/lib/gcc/armv5tel-unknown-linux-gnueabi/4.9.3/plugin/include/splay-tree.h
+#usr/lib/gcc/armv5tel-unknown-linux-gnueabi/4.9.3/plugin/include/ssa-iterators.h
+#usr/lib/gcc/armv5tel-unknown-linux-gnueabi/4.9.3/plugin/include/statistics.h
+#usr/lib/gcc/armv5tel-unknown-linux-gnueabi/4.9.3/plugin/include/stmt.h
+#usr/lib/gcc/armv5tel-unknown-linux-gnueabi/4.9.3/plugin/include/stor-layout.h
+#usr/lib/gcc/armv5tel-unknown-linux-gnueabi/4.9.3/plugin/include/stringpool.h
+#usr/lib/gcc/armv5tel-unknown-linux-gnueabi/4.9.3/plugin/include/symtab.h
+#usr/lib/gcc/armv5tel-unknown-linux-gnueabi/4.9.3/plugin/include/sync-builtins.def
+#usr/lib/gcc/armv5tel-unknown-linux-gnueabi/4.9.3/plugin/include/system.h
+#usr/lib/gcc/armv5tel-unknown-linux-gnueabi/4.9.3/plugin/include/target-hooks-macros.h
+#usr/lib/gcc/armv5tel-unknown-linux-gnueabi/4.9.3/plugin/include/target.def
+#usr/lib/gcc/armv5tel-unknown-linux-gnueabi/4.9.3/plugin/include/target.h
+#usr/lib/gcc/armv5tel-unknown-linux-gnueabi/4.9.3/plugin/include/timevar.def
+#usr/lib/gcc/armv5tel-unknown-linux-gnueabi/4.9.3/plugin/include/timevar.h
+#usr/lib/gcc/armv5tel-unknown-linux-gnueabi/4.9.3/plugin/include/tm-preds.h
+#usr/lib/gcc/armv5tel-unknown-linux-gnueabi/4.9.3/plugin/include/tm.h
+#usr/lib/gcc/armv5tel-unknown-linux-gnueabi/4.9.3/plugin/include/tm_p.h
+#usr/lib/gcc/armv5tel-unknown-linux-gnueabi/4.9.3/plugin/include/toplev.h
+#usr/lib/gcc/armv5tel-unknown-linux-gnueabi/4.9.3/plugin/include/tree-cfg.h
+#usr/lib/gcc/armv5tel-unknown-linux-gnueabi/4.9.3/plugin/include/tree-cfgcleanup.h
+#usr/lib/gcc/armv5tel-unknown-linux-gnueabi/4.9.3/plugin/include/tree-check.h
+#usr/lib/gcc/armv5tel-unknown-linux-gnueabi/4.9.3/plugin/include/tree-core.h
+#usr/lib/gcc/armv5tel-unknown-linux-gnueabi/4.9.3/plugin/include/tree-dfa.h
+#usr/lib/gcc/armv5tel-unknown-linux-gnueabi/4.9.3/plugin/include/tree-dump.h
+#usr/lib/gcc/armv5tel-unknown-linux-gnueabi/4.9.3/plugin/include/tree-eh.h
+#usr/lib/gcc/armv5tel-unknown-linux-gnueabi/4.9.3/plugin/include/tree-hasher.h
+#usr/lib/gcc/armv5tel-unknown-linux-gnueabi/4.9.3/plugin/include/tree-inline.h
+#usr/lib/gcc/armv5tel-unknown-linux-gnueabi/4.9.3/plugin/include/tree-into-ssa.h
+#usr/lib/gcc/armv5tel-unknown-linux-gnueabi/4.9.3/plugin/include/tree-iterator.h
+#usr/lib/gcc/armv5tel-unknown-linux-gnueabi/4.9.3/plugin/include/tree-nested.h
+#usr/lib/gcc/armv5tel-unknown-linux-gnueabi/4.9.3/plugin/include/tree-object-size.h
+#usr/lib/gcc/armv5tel-unknown-linux-gnueabi/4.9.3/plugin/include/tree-outof-ssa.h
+#usr/lib/gcc/armv5tel-unknown-linux-gnueabi/4.9.3/plugin/include/tree-parloops.h
+#usr/lib/gcc/armv5tel-unknown-linux-gnueabi/4.9.3/plugin/include/tree-pass.h
+#usr/lib/gcc/armv5tel-unknown-linux-gnueabi/4.9.3/plugin/include/tree-phinodes.h
+#usr/lib/gcc/armv5tel-unknown-linux-gnueabi/4.9.3/plugin/include/tree-pretty-print.h
+#usr/lib/gcc/armv5tel-unknown-linux-gnueabi/4.9.3/plugin/include/tree-ssa-address.h
+#usr/lib/gcc/armv5tel-unknown-linux-gnueabi/4.9.3/plugin/include/tree-ssa-alias.h
+#usr/lib/gcc/armv5tel-unknown-linux-gnueabi/4.9.3/plugin/include/tree-ssa-coalesce.h
+#usr/lib/gcc/armv5tel-unknown-linux-gnueabi/4.9.3/plugin/include/tree-ssa-dom.h
+#usr/lib/gcc/armv5tel-unknown-linux-gnueabi/4.9.3/plugin/include/tree-ssa-loop-ivopts.h
+#usr/lib/gcc/armv5tel-unknown-linux-gnueabi/4.9.3/plugin/include/tree-ssa-loop-manip.h
+#usr/lib/gcc/armv5tel-unknown-linux-gnueabi/4.9.3/plugin/include/tree-ssa-loop-niter.h
+#usr/lib/gcc/armv5tel-unknown-linux-gnueabi/4.9.3/plugin/include/tree-ssa-loop.h
+#usr/lib/gcc/armv5tel-unknown-linux-gnueabi/4.9.3/plugin/include/tree-ssa-operands.h
+#usr/lib/gcc/armv5tel-unknown-linux-gnueabi/4.9.3/plugin/include/tree-ssa-sccvn.h
+#usr/lib/gcc/armv5tel-unknown-linux-gnueabi/4.9.3/plugin/include/tree-ssa-ter.h
+#usr/lib/gcc/armv5tel-unknown-linux-gnueabi/4.9.3/plugin/include/tree-ssa-threadedge.h
+#usr/lib/gcc/armv5tel-unknown-linux-gnueabi/4.9.3/plugin/include/tree-ssa-threadupdate.h
+#usr/lib/gcc/armv5tel-unknown-linux-gnueabi/4.9.3/plugin/include/tree-ssa.h
+#usr/lib/gcc/armv5tel-unknown-linux-gnueabi/4.9.3/plugin/include/tree-ssanames.h
+#usr/lib/gcc/armv5tel-unknown-linux-gnueabi/4.9.3/plugin/include/tree.def
+#usr/lib/gcc/armv5tel-unknown-linux-gnueabi/4.9.3/plugin/include/tree.h
+#usr/lib/gcc/armv5tel-unknown-linux-gnueabi/4.9.3/plugin/include/treestruct.def
+#usr/lib/gcc/armv5tel-unknown-linux-gnueabi/4.9.3/plugin/include/varasm.h
+#usr/lib/gcc/armv5tel-unknown-linux-gnueabi/4.9.3/plugin/include/vec.h
+#usr/lib/gcc/armv5tel-unknown-linux-gnueabi/4.9.3/plugin/include/version.h
+#usr/lib/libasan.a
+#usr/lib/libasan.la
+#usr/lib/libasan.so
+usr/lib/libasan.so.1
+usr/lib/libasan.so.1.0.0
+#usr/lib/libasan_preinit.o
+#usr/lib/libatomic.a
+#usr/lib/libatomic.la
+#usr/lib/libatomic.so
+usr/lib/libatomic.so.1
+usr/lib/libatomic.so.1.1.0
 #usr/lib/libgomp.a
 #usr/lib/libgomp.la
 #usr/lib/libgomp.so
 usr/lib/libgomp.so.1
 usr/lib/libgomp.so.1.0.0
 #usr/lib/libgomp.spec
-#usr/lib/libmudflap.a
-#usr/lib/libmudflap.la
-#usr/lib/libmudflap.so
-usr/lib/libmudflap.so.0
-usr/lib/libmudflap.so.0.0.0
-#usr/lib/libmudflapth.a
-#usr/lib/libmudflapth.la
-#usr/lib/libmudflapth.so
-usr/lib/libmudflapth.so.0
-usr/lib/libmudflapth.so.0.0.0
+#usr/lib/libitm.a
+#usr/lib/libitm.la
+#usr/lib/libitm.so
+usr/lib/libitm.so.1
+usr/lib/libitm.so.1.0.0
+#usr/lib/libitm.spec
+#usr/lib/libsanitizer.spec
 #usr/lib/libssp.a
 #usr/lib/libssp.la
 #usr/lib/libssp.so
@@ -766,16 +1058,34 @@ usr/lib/libssp.so.0.0.0
 #usr/lib/libssp_nonshared.a
 #usr/lib/libssp_nonshared.la
 #usr/lib/libstdc++.a
-usr/lib/libstdc++.so.6.0.13
+usr/lib/libstdc++.so.6.0.20
+#usr/lib/libstdc++.so.6.0.20-gdb.py
 #usr/lib/libsupc++.a
 #usr/lib/libsupc++.la
-#usr/man
-#usr/man/man1
-#usr/man/man1/cpp.1
-#usr/man/man1/g++.1
-#usr/man/man1/gcc.1
-#usr/man/man1/gcov.1
-#usr/man/man7
-#usr/man/man7/fsf-funding.7
-#usr/man/man7/gfdl.7
-#usr/man/man7/gpl.7
+#usr/lib/libubsan.a
+#usr/lib/libubsan.la
+#usr/lib/libubsan.so
+usr/lib/libubsan.so.0
+usr/lib/libubsan.so.0.0.0
+#usr/share/gcc-4.9.3
+#usr/share/gcc-4.9.3/python
+#usr/share/gcc-4.9.3/python/libstdcxx
+#usr/share/gcc-4.9.3/python/libstdcxx/__init__.py
+#usr/share/gcc-4.9.3/python/libstdcxx/v6
+#usr/share/gcc-4.9.3/python/libstdcxx/v6/__init__.py
+#usr/share/gcc-4.9.3/python/libstdcxx/v6/printers.py
+#usr/share/info/cpp.info
+#usr/share/info/cppinternals.info
+#usr/share/info/gcc.info
+#usr/share/info/gccinstall.info
+#usr/share/info/gccint.info
+#usr/share/info/libgomp.info
+#usr/share/info/libitm.info
+#usr/share/info/libquadmath.info
+#usr/share/man/man1/cpp.1
+#usr/share/man/man1/g++.1
+#usr/share/man/man1/gcc.1
+#usr/share/man/man1/gcov.1
+#usr/share/man/man7/fsf-funding.7
+#usr/share/man/man7/gfdl.7
+#usr/share/man/man7/gpl.7
index a2a2ea015fbbdd0bbcc9aa4eaf0caae2635be722..e6d328bb5ae9f636964bcac219bfa623f1e152f9 100644 (file)
@@ -25,6 +25,7 @@ etc/rc.d/init.d/console
 #etc/rc.d/init.d/cyrus-sasl
 etc/rc.d/init.d/dhcp
 etc/rc.d/init.d/dhcrelay
+#etc/rc.d/init.d/dnsdist
 etc/rc.d/init.d/dnsmasq
 etc/rc.d/init.d/fcron
 #etc/rc.d/init.d/fetchmail
index ca8d5ee3b3d8e8bf7e5ceef19631b7af77ab4295..2304eca1b879cf4950394e3072e46f68c2976d8d 100644 (file)
@@ -8,6 +8,7 @@
 #usr/share/bison/bison.m4
 #usr/share/bison/c++-skel.m4
 #usr/share/bison/c++.m4
+#usr/share/bison/c-like.m4
 #usr/share/bison/c-skel.m4
 #usr/share/bison/c.m4
 #usr/share/bison/glr.c
 #usr/share/bison/m4sugar/foreach.m4
 #usr/share/bison/m4sugar/m4sugar.m4
 #usr/share/bison/stack.hh
+#usr/share/bison/variant.hh
 #usr/share/bison/xslt
 #usr/share/bison/xslt/bison.xsl
 #usr/share/bison/xslt/xml2dot.xsl
 #usr/share/bison/xslt/xml2text.xsl
 #usr/share/bison/xslt/xml2xhtml.xsl
 #usr/share/bison/yacc.c
+#usr/share/doc/bison-3.0.4
+#usr/share/doc/bison-3.0.4/AUTHORS
+#usr/share/doc/bison-3.0.4/COPYING
+#usr/share/doc/bison-3.0.4/NEWS
+#usr/share/doc/bison-3.0.4/README
+#usr/share/doc/bison-3.0.4/THANKS
+#usr/share/doc/bison-3.0.4/TODO
+#usr/share/doc/bison-3.0.4/examples
+#usr/share/doc/bison-3.0.4/examples/calc++
+#usr/share/doc/bison-3.0.4/examples/calc++/calc++-driver.cc
+#usr/share/doc/bison-3.0.4/examples/calc++/calc++-driver.hh
+#usr/share/doc/bison-3.0.4/examples/calc++/calc++-parser.yy
+#usr/share/doc/bison-3.0.4/examples/calc++/calc++-scanner.ll
+#usr/share/doc/bison-3.0.4/examples/calc++/calc++.cc
+#usr/share/doc/bison-3.0.4/examples/mfcalc
+#usr/share/doc/bison-3.0.4/examples/mfcalc/calc.h
+#usr/share/doc/bison-3.0.4/examples/mfcalc/mfcalc.y
+#usr/share/doc/bison-3.0.4/examples/rpcalc
+#usr/share/doc/bison-3.0.4/examples/rpcalc/rpcalc.y
 #usr/share/info/bison.info
 #usr/share/man/man1/bison.1
 #usr/share/man/man1/yacc.1
index 9fe53d18a1a6be3b8228ea266afdf2bb10cb1d0a..b00abdb9e33fde40711d58714e9611a567d52cf5 100644 (file)
@@ -2,7 +2,9 @@ usr/bin/cmp
 usr/bin/diff
 #usr/bin/diff3
 #usr/bin/sdiff
+#usr/info
 #usr/info/diff.info
+#usr/info/dir
 #usr/man/man1/cmp.1
 #usr/man/man1/diff.1
 #usr/man/man1/diff3.1
index d0997bfb297a29d6129291c949fb94ae4d862c70..fd5bfb8d0a39c6cddc73d9946b8dc25785ea9ac4 100644 (file)
 #usr/lib/ldscripts/i386linux.xn
 #usr/lib/ldscripts/i386linux.xr
 #usr/lib/ldscripts/i386linux.xu
-usr/lib/libbfd-2.22.so
+usr/lib/libbfd-2.24.so
 #usr/lib/libbfd.a
 #usr/lib/libbfd.la
 #usr/lib/libbfd.so
 #usr/lib/libiberty.a
-usr/lib/libopcodes-2.22.so
+usr/lib/libopcodes-2.24.so
 #usr/lib/libopcodes.a
 #usr/lib/libopcodes.la
 #usr/lib/libopcodes.so
index 10c712a7589fd9b6eb69244c233a6351f7a4d0fc..0e4b5c7baa045737fc747d4f7b7053ccdf5dbcdd 100644 (file)
 #usr/bin/cpp
 #usr/bin/g++
 #usr/bin/gcc
-#usr/bin/gccbug
+#usr/bin/gcc-ar
+#usr/bin/gcc-nm
+#usr/bin/gcc-ranlib
 #usr/bin/gcov
 #usr/bin/i586-pc-linux-gnu-c++
 #usr/bin/i586-pc-linux-gnu-g++
 #usr/bin/i586-pc-linux-gnu-gcc
-#usr/bin/i586-pc-linux-gnu-gcc-4.4.7
+#usr/bin/i586-pc-linux-gnu-gcc-4.9.3
+#usr/bin/i586-pc-linux-gnu-gcc-ar
+#usr/bin/i586-pc-linux-gnu-gcc-nm
+#usr/bin/i586-pc-linux-gnu-gcc-ranlib
 #usr/include/c++
-#usr/include/c++/4.4.7
-#usr/include/c++/4.4.7/algorithm
-#usr/include/c++/4.4.7/array
-#usr/include/c++/4.4.7/backward
-#usr/include/c++/4.4.7/backward/auto_ptr.h
-#usr/include/c++/4.4.7/backward/backward_warning.h
-#usr/include/c++/4.4.7/backward/binders.h
-#usr/include/c++/4.4.7/backward/hash_fun.h
-#usr/include/c++/4.4.7/backward/hash_map
-#usr/include/c++/4.4.7/backward/hash_set
-#usr/include/c++/4.4.7/backward/hashtable.h
-#usr/include/c++/4.4.7/backward/strstream
-#usr/include/c++/4.4.7/bits
-#usr/include/c++/4.4.7/bits/algorithmfwd.h
-#usr/include/c++/4.4.7/bits/allocator.h
-#usr/include/c++/4.4.7/bits/atomic_0.h
-#usr/include/c++/4.4.7/bits/atomic_2.h
-#usr/include/c++/4.4.7/bits/atomicfwd_c.h
-#usr/include/c++/4.4.7/bits/atomicfwd_cxx.h
-#usr/include/c++/4.4.7/bits/basic_ios.h
-#usr/include/c++/4.4.7/bits/basic_ios.tcc
-#usr/include/c++/4.4.7/bits/basic_string.h
-#usr/include/c++/4.4.7/bits/basic_string.tcc
-#usr/include/c++/4.4.7/bits/boost_concept_check.h
-#usr/include/c++/4.4.7/bits/char_traits.h
-#usr/include/c++/4.4.7/bits/cmath.tcc
-#usr/include/c++/4.4.7/bits/codecvt.h
-#usr/include/c++/4.4.7/bits/concept_check.h
-#usr/include/c++/4.4.7/bits/cpp_type_traits.h
-#usr/include/c++/4.4.7/bits/deque.tcc
-#usr/include/c++/4.4.7/bits/forward_list.h
-#usr/include/c++/4.4.7/bits/forward_list.tcc
-#usr/include/c++/4.4.7/bits/fstream.tcc
-#usr/include/c++/4.4.7/bits/functexcept.h
-#usr/include/c++/4.4.7/bits/functional_hash.h
-#usr/include/c++/4.4.7/bits/gslice.h
-#usr/include/c++/4.4.7/bits/gslice_array.h
-#usr/include/c++/4.4.7/bits/hashtable.h
-#usr/include/c++/4.4.7/bits/indirect_array.h
-#usr/include/c++/4.4.7/bits/ios_base.h
-#usr/include/c++/4.4.7/bits/istream.tcc
-#usr/include/c++/4.4.7/bits/list.tcc
-#usr/include/c++/4.4.7/bits/locale_classes.h
-#usr/include/c++/4.4.7/bits/locale_classes.tcc
-#usr/include/c++/4.4.7/bits/locale_facets.h
-#usr/include/c++/4.4.7/bits/locale_facets.tcc
-#usr/include/c++/4.4.7/bits/locale_facets_nonio.h
-#usr/include/c++/4.4.7/bits/locale_facets_nonio.tcc
-#usr/include/c++/4.4.7/bits/localefwd.h
-#usr/include/c++/4.4.7/bits/mask_array.h
-#usr/include/c++/4.4.7/bits/move.h
-#usr/include/c++/4.4.7/bits/ostream.tcc
-#usr/include/c++/4.4.7/bits/ostream_insert.h
-#usr/include/c++/4.4.7/bits/postypes.h
-#usr/include/c++/4.4.7/bits/shared_ptr.h
-#usr/include/c++/4.4.7/bits/slice_array.h
-#usr/include/c++/4.4.7/bits/sstream.tcc
-#usr/include/c++/4.4.7/bits/stl_algo.h
-#usr/include/c++/4.4.7/bits/stl_algobase.h
-#usr/include/c++/4.4.7/bits/stl_bvector.h
-#usr/include/c++/4.4.7/bits/stl_construct.h
-#usr/include/c++/4.4.7/bits/stl_deque.h
-#usr/include/c++/4.4.7/bits/stl_function.h
-#usr/include/c++/4.4.7/bits/stl_heap.h
-#usr/include/c++/4.4.7/bits/stl_iterator.h
-#usr/include/c++/4.4.7/bits/stl_iterator_base_funcs.h
-#usr/include/c++/4.4.7/bits/stl_iterator_base_types.h
-#usr/include/c++/4.4.7/bits/stl_list.h
-#usr/include/c++/4.4.7/bits/stl_map.h
-#usr/include/c++/4.4.7/bits/stl_multimap.h
-#usr/include/c++/4.4.7/bits/stl_multiset.h
-#usr/include/c++/4.4.7/bits/stl_numeric.h
-#usr/include/c++/4.4.7/bits/stl_pair.h
-#usr/include/c++/4.4.7/bits/stl_queue.h
-#usr/include/c++/4.4.7/bits/stl_raw_storage_iter.h
-#usr/include/c++/4.4.7/bits/stl_relops.h
-#usr/include/c++/4.4.7/bits/stl_set.h
-#usr/include/c++/4.4.7/bits/stl_stack.h
-#usr/include/c++/4.4.7/bits/stl_tempbuf.h
-#usr/include/c++/4.4.7/bits/stl_tree.h
-#usr/include/c++/4.4.7/bits/stl_uninitialized.h
-#usr/include/c++/4.4.7/bits/stl_vector.h
-#usr/include/c++/4.4.7/bits/stream_iterator.h
-#usr/include/c++/4.4.7/bits/streambuf.tcc
-#usr/include/c++/4.4.7/bits/streambuf_iterator.h
-#usr/include/c++/4.4.7/bits/stringfwd.h
-#usr/include/c++/4.4.7/bits/unique_ptr.h
-#usr/include/c++/4.4.7/bits/valarray_after.h
-#usr/include/c++/4.4.7/bits/valarray_array.h
-#usr/include/c++/4.4.7/bits/valarray_array.tcc
-#usr/include/c++/4.4.7/bits/valarray_before.h
-#usr/include/c++/4.4.7/bits/vector.tcc
-#usr/include/c++/4.4.7/bitset
-#usr/include/c++/4.4.7/c++0x_warning.h
-#usr/include/c++/4.4.7/cassert
-#usr/include/c++/4.4.7/ccomplex
-#usr/include/c++/4.4.7/cctype
-#usr/include/c++/4.4.7/cerrno
-#usr/include/c++/4.4.7/cfenv
-#usr/include/c++/4.4.7/cfloat
-#usr/include/c++/4.4.7/chrono
-#usr/include/c++/4.4.7/cinttypes
-#usr/include/c++/4.4.7/ciso646
-#usr/include/c++/4.4.7/climits
-#usr/include/c++/4.4.7/clocale
-#usr/include/c++/4.4.7/cmath
-#usr/include/c++/4.4.7/complex
-#usr/include/c++/4.4.7/complex.h
-#usr/include/c++/4.4.7/condition_variable
-#usr/include/c++/4.4.7/csetjmp
-#usr/include/c++/4.4.7/csignal
-#usr/include/c++/4.4.7/cstdarg
-#usr/include/c++/4.4.7/cstdatomic
-#usr/include/c++/4.4.7/cstdbool
-#usr/include/c++/4.4.7/cstddef
-#usr/include/c++/4.4.7/cstdint
-#usr/include/c++/4.4.7/cstdio
-#usr/include/c++/4.4.7/cstdlib
-#usr/include/c++/4.4.7/cstring
-#usr/include/c++/4.4.7/ctgmath
-#usr/include/c++/4.4.7/ctime
-#usr/include/c++/4.4.7/cwchar
-#usr/include/c++/4.4.7/cwctype
-#usr/include/c++/4.4.7/cxxabi-forced.h
-#usr/include/c++/4.4.7/cxxabi.h
-#usr/include/c++/4.4.7/debug
-#usr/include/c++/4.4.7/debug/bitset
-#usr/include/c++/4.4.7/debug/debug.h
-#usr/include/c++/4.4.7/debug/deque
-#usr/include/c++/4.4.7/debug/formatter.h
-#usr/include/c++/4.4.7/debug/functions.h
-#usr/include/c++/4.4.7/debug/list
-#usr/include/c++/4.4.7/debug/macros.h
-#usr/include/c++/4.4.7/debug/map
-#usr/include/c++/4.4.7/debug/map.h
-#usr/include/c++/4.4.7/debug/multimap.h
-#usr/include/c++/4.4.7/debug/multiset.h
-#usr/include/c++/4.4.7/debug/safe_base.h
-#usr/include/c++/4.4.7/debug/safe_iterator.h
-#usr/include/c++/4.4.7/debug/safe_iterator.tcc
-#usr/include/c++/4.4.7/debug/safe_sequence.h
-#usr/include/c++/4.4.7/debug/set
-#usr/include/c++/4.4.7/debug/set.h
-#usr/include/c++/4.4.7/debug/string
-#usr/include/c++/4.4.7/debug/unordered_map
-#usr/include/c++/4.4.7/debug/unordered_set
-#usr/include/c++/4.4.7/debug/vector
-#usr/include/c++/4.4.7/deque
-#usr/include/c++/4.4.7/exception
-#usr/include/c++/4.4.7/exception_defines.h
-#usr/include/c++/4.4.7/exception_ptr.h
-#usr/include/c++/4.4.7/ext
-#usr/include/c++/4.4.7/ext/algorithm
-#usr/include/c++/4.4.7/ext/array_allocator.h
-#usr/include/c++/4.4.7/ext/atomicity.h
-#usr/include/c++/4.4.7/ext/bitmap_allocator.h
-#usr/include/c++/4.4.7/ext/cast.h
-#usr/include/c++/4.4.7/ext/codecvt_specializations.h
-#usr/include/c++/4.4.7/ext/concurrence.h
-#usr/include/c++/4.4.7/ext/debug_allocator.h
-#usr/include/c++/4.4.7/ext/enc_filebuf.h
-#usr/include/c++/4.4.7/ext/extptr_allocator.h
-#usr/include/c++/4.4.7/ext/functional
-#usr/include/c++/4.4.7/ext/hash_map
-#usr/include/c++/4.4.7/ext/hash_set
-#usr/include/c++/4.4.7/ext/iterator
-#usr/include/c++/4.4.7/ext/malloc_allocator.h
-#usr/include/c++/4.4.7/ext/memory
-#usr/include/c++/4.4.7/ext/mt_allocator.h
-#usr/include/c++/4.4.7/ext/new_allocator.h
-#usr/include/c++/4.4.7/ext/numeric
-#usr/include/c++/4.4.7/ext/numeric_traits.h
-#usr/include/c++/4.4.7/ext/pb_ds
-#usr/include/c++/4.4.7/ext/pb_ds/assoc_container.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail
-#usr/include/c++/4.4.7/ext/pb_ds/detail/basic_tree_policy
-#usr/include/c++/4.4.7/ext/pb_ds/detail/basic_tree_policy/basic_tree_policy_base.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/basic_tree_policy/null_node_metadata.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/basic_tree_policy/traits.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/basic_types.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/bin_search_tree_
-#usr/include/c++/4.4.7/ext/pb_ds/detail/bin_search_tree_/bin_search_tree_.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/bin_search_tree_/cond_dtor_entry_dealtor.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/bin_search_tree_/cond_key_dtor_entry_dealtor.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/bin_search_tree_/constructors_destructor_fn_imps.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/bin_search_tree_/debug_fn_imps.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/bin_search_tree_/erase_fn_imps.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/bin_search_tree_/find_fn_imps.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/bin_search_tree_/info_fn_imps.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/bin_search_tree_/insert_fn_imps.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/bin_search_tree_/iterators_fn_imps.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/bin_search_tree_/node_iterators.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/bin_search_tree_/point_iterators.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/bin_search_tree_/policy_access_fn_imps.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/bin_search_tree_/r_erase_fn_imps.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/bin_search_tree_/rotate_fn_imps.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/bin_search_tree_/split_join_fn_imps.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/bin_search_tree_/traits.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/binary_heap_
-#usr/include/c++/4.4.7/ext/pb_ds/detail/binary_heap_/binary_heap_.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/binary_heap_/const_iterator.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/binary_heap_/const_point_iterator.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/binary_heap_/constructors_destructor_fn_imps.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/binary_heap_/debug_fn_imps.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/binary_heap_/entry_cmp.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/binary_heap_/entry_pred.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/binary_heap_/erase_fn_imps.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/binary_heap_/find_fn_imps.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/binary_heap_/info_fn_imps.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/binary_heap_/insert_fn_imps.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/binary_heap_/iterators_fn_imps.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/binary_heap_/policy_access_fn_imps.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/binary_heap_/resize_policy.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/binary_heap_/split_join_fn_imps.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/binary_heap_/trace_fn_imps.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/binomial_heap_
-#usr/include/c++/4.4.7/ext/pb_ds/detail/binomial_heap_/binomial_heap_.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/binomial_heap_/constructors_destructor_fn_imps.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/binomial_heap_/debug_fn_imps.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/binomial_heap_base_
-#usr/include/c++/4.4.7/ext/pb_ds/detail/binomial_heap_base_/binomial_heap_base_.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/binomial_heap_base_/constructors_destructor_fn_imps.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/binomial_heap_base_/debug_fn_imps.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/binomial_heap_base_/erase_fn_imps.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/binomial_heap_base_/find_fn_imps.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/binomial_heap_base_/insert_fn_imps.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/binomial_heap_base_/split_join_fn_imps.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/cc_hash_table_map_
-#usr/include/c++/4.4.7/ext/pb_ds/detail/cc_hash_table_map_/cc_ht_map_.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/cc_hash_table_map_/cmp_fn_imps.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/cc_hash_table_map_/cond_key_dtor_entry_dealtor.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/cc_hash_table_map_/constructor_destructor_fn_imps.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/cc_hash_table_map_/constructor_destructor_no_store_hash_fn_imps.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/cc_hash_table_map_/constructor_destructor_store_hash_fn_imps.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/cc_hash_table_map_/debug_fn_imps.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/cc_hash_table_map_/debug_no_store_hash_fn_imps.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/cc_hash_table_map_/debug_store_hash_fn_imps.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/cc_hash_table_map_/entry_list_fn_imps.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/cc_hash_table_map_/erase_fn_imps.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/cc_hash_table_map_/erase_no_store_hash_fn_imps.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/cc_hash_table_map_/erase_store_hash_fn_imps.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/cc_hash_table_map_/find_fn_imps.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/cc_hash_table_map_/find_store_hash_fn_imps.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/cc_hash_table_map_/info_fn_imps.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/cc_hash_table_map_/insert_fn_imps.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/cc_hash_table_map_/insert_no_store_hash_fn_imps.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/cc_hash_table_map_/insert_store_hash_fn_imps.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/cc_hash_table_map_/iterators_fn_imps.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/cc_hash_table_map_/policy_access_fn_imps.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/cc_hash_table_map_/resize_fn_imps.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/cc_hash_table_map_/resize_no_store_hash_fn_imps.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/cc_hash_table_map_/resize_store_hash_fn_imps.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/cc_hash_table_map_/size_fn_imps.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/cc_hash_table_map_/standard_policies.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/cc_hash_table_map_/trace_fn_imps.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/cond_dealtor.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/constructors_destructor_fn_imps.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/container_base_dispatch.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/debug_map_base.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/eq_fn
-#usr/include/c++/4.4.7/ext/pb_ds/detail/eq_fn/eq_by_less.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/eq_fn/hash_eq_fn.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/gp_hash_table_map_
-#usr/include/c++/4.4.7/ext/pb_ds/detail/gp_hash_table_map_/constructor_destructor_fn_imps.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/gp_hash_table_map_/constructor_destructor_no_store_hash_fn_imps.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/gp_hash_table_map_/constructor_destructor_store_hash_fn_imps.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/gp_hash_table_map_/debug_fn_imps.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/gp_hash_table_map_/debug_no_store_hash_fn_imps.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/gp_hash_table_map_/debug_store_hash_fn_imps.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/gp_hash_table_map_/erase_fn_imps.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/gp_hash_table_map_/erase_no_store_hash_fn_imps.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/gp_hash_table_map_/erase_store_hash_fn_imps.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/gp_hash_table_map_/find_fn_imps.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/gp_hash_table_map_/find_no_store_hash_fn_imps.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/gp_hash_table_map_/find_store_hash_fn_imps.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/gp_hash_table_map_/gp_ht_map_.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/gp_hash_table_map_/info_fn_imps.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/gp_hash_table_map_/insert_fn_imps.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/gp_hash_table_map_/insert_no_store_hash_fn_imps.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/gp_hash_table_map_/insert_store_hash_fn_imps.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/gp_hash_table_map_/iterator_fn_imps.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/gp_hash_table_map_/policy_access_fn_imps.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/gp_hash_table_map_/resize_fn_imps.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/gp_hash_table_map_/resize_no_store_hash_fn_imps.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/gp_hash_table_map_/resize_store_hash_fn_imps.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/gp_hash_table_map_/standard_policies.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/gp_hash_table_map_/trace_fn_imps.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/hash_fn
-#usr/include/c++/4.4.7/ext/pb_ds/detail/hash_fn/direct_mask_range_hashing_imp.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/hash_fn/direct_mod_range_hashing_imp.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/hash_fn/linear_probe_fn_imp.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/hash_fn/mask_based_range_hashing.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/hash_fn/mod_based_range_hashing.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/hash_fn/probe_fn_base.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/hash_fn/quadratic_probe_fn_imp.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/hash_fn/ranged_hash_fn.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/hash_fn/ranged_probe_fn.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/hash_fn/sample_probe_fn.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/hash_fn/sample_range_hashing.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/hash_fn/sample_ranged_hash_fn.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/hash_fn/sample_ranged_probe_fn.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/left_child_next_sibling_heap_
-#usr/include/c++/4.4.7/ext/pb_ds/detail/left_child_next_sibling_heap_/const_iterator.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/left_child_next_sibling_heap_/const_point_iterator.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/left_child_next_sibling_heap_/constructors_destructor_fn_imps.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/left_child_next_sibling_heap_/debug_fn_imps.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/left_child_next_sibling_heap_/erase_fn_imps.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/left_child_next_sibling_heap_/info_fn_imps.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/left_child_next_sibling_heap_/insert_fn_imps.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/left_child_next_sibling_heap_/iterators_fn_imps.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/left_child_next_sibling_heap_/left_child_next_sibling_heap_.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/left_child_next_sibling_heap_/node.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/left_child_next_sibling_heap_/null_metadata.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/left_child_next_sibling_heap_/policy_access_fn_imps.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/left_child_next_sibling_heap_/trace_fn_imps.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/list_update_map_
-#usr/include/c++/4.4.7/ext/pb_ds/detail/list_update_map_/constructor_destructor_fn_imps.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/list_update_map_/debug_fn_imps.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/list_update_map_/entry_metadata_base.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/list_update_map_/erase_fn_imps.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/list_update_map_/find_fn_imps.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/list_update_map_/info_fn_imps.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/list_update_map_/insert_fn_imps.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/list_update_map_/iterators_fn_imps.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/list_update_map_/lu_map_.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/list_update_map_/trace_fn_imps.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/list_update_policy
-#usr/include/c++/4.4.7/ext/pb_ds/detail/list_update_policy/counter_lu_metadata.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/list_update_policy/counter_lu_policy_imp.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/list_update_policy/mtf_lu_policy_imp.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/list_update_policy/sample_update_policy.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/ov_tree_map_
-#usr/include/c++/4.4.7/ext/pb_ds/detail/ov_tree_map_/cond_dtor.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/ov_tree_map_/constructors_destructor_fn_imps.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/ov_tree_map_/debug_fn_imps.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/ov_tree_map_/erase_fn_imps.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/ov_tree_map_/info_fn_imps.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/ov_tree_map_/insert_fn_imps.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/ov_tree_map_/iterators_fn_imps.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/ov_tree_map_/node_iterators.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/ov_tree_map_/ov_tree_map_.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/ov_tree_map_/policy_access_fn_imps.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/ov_tree_map_/split_join_fn_imps.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/ov_tree_map_/traits.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/pairing_heap_
-#usr/include/c++/4.4.7/ext/pb_ds/detail/pairing_heap_/constructors_destructor_fn_imps.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/pairing_heap_/debug_fn_imps.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/pairing_heap_/erase_fn_imps.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/pairing_heap_/find_fn_imps.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/pairing_heap_/insert_fn_imps.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/pairing_heap_/pairing_heap_.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/pairing_heap_/split_join_fn_imps.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/pat_trie_
-#usr/include/c++/4.4.7/ext/pb_ds/detail/pat_trie_/child_iterator.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/pat_trie_/cond_dtor_entry_dealtor.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/pat_trie_/const_child_iterator.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/pat_trie_/constructors_destructor_fn_imps.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/pat_trie_/debug_fn_imps.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/pat_trie_/erase_fn_imps.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/pat_trie_/find_fn_imps.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/pat_trie_/head.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/pat_trie_/info_fn_imps.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/pat_trie_/insert_join_fn_imps.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/pat_trie_/internal_node.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/pat_trie_/iterators_fn_imps.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/pat_trie_/leaf.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/pat_trie_/node_base.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/pat_trie_/node_iterators.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/pat_trie_/node_metadata_base.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/pat_trie_/pat_trie_.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/pat_trie_/point_iterators.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/pat_trie_/policy_access_fn_imps.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/pat_trie_/r_erase_fn_imps.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/pat_trie_/rotate_fn_imps.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/pat_trie_/split_fn_imps.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/pat_trie_/split_join_branch_bag.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/pat_trie_/synth_e_access_traits.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/pat_trie_/trace_fn_imps.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/pat_trie_/traits.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/pat_trie_/update_fn_imps.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/priority_queue_base_dispatch.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/rb_tree_map_
-#usr/include/c++/4.4.7/ext/pb_ds/detail/rb_tree_map_/constructors_destructor_fn_imps.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/rb_tree_map_/debug_fn_imps.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/rb_tree_map_/erase_fn_imps.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/rb_tree_map_/find_fn_imps.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/rb_tree_map_/info_fn_imps.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/rb_tree_map_/insert_fn_imps.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/rb_tree_map_/node.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/rb_tree_map_/rb_tree_.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/rb_tree_map_/split_join_fn_imps.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/rb_tree_map_/traits.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/rc_binomial_heap_
-#usr/include/c++/4.4.7/ext/pb_ds/detail/rc_binomial_heap_/constructors_destructor_fn_imps.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/rc_binomial_heap_/debug_fn_imps.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/rc_binomial_heap_/erase_fn_imps.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/rc_binomial_heap_/insert_fn_imps.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/rc_binomial_heap_/rc.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/rc_binomial_heap_/rc_binomial_heap_.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/rc_binomial_heap_/split_join_fn_imps.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/rc_binomial_heap_/trace_fn_imps.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/resize_policy
-#usr/include/c++/4.4.7/ext/pb_ds/detail/resize_policy/cc_hash_max_collision_check_resize_trigger_imp.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/resize_policy/hash_exponential_size_policy_imp.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/resize_policy/hash_load_check_resize_trigger_imp.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/resize_policy/hash_load_check_resize_trigger_size_base.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/resize_policy/hash_prime_size_policy_imp.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/resize_policy/hash_standard_resize_policy_imp.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/resize_policy/sample_resize_policy.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/resize_policy/sample_resize_trigger.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/resize_policy/sample_size_policy.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/splay_tree_
-#usr/include/c++/4.4.7/ext/pb_ds/detail/splay_tree_/constructors_destructor_fn_imps.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/splay_tree_/debug_fn_imps.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/splay_tree_/erase_fn_imps.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/splay_tree_/find_fn_imps.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/splay_tree_/info_fn_imps.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/splay_tree_/insert_fn_imps.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/splay_tree_/node.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/splay_tree_/splay_fn_imps.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/splay_tree_/splay_tree_.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/splay_tree_/split_join_fn_imps.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/splay_tree_/traits.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/standard_policies.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/thin_heap_
-#usr/include/c++/4.4.7/ext/pb_ds/detail/thin_heap_/constructors_destructor_fn_imps.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/thin_heap_/debug_fn_imps.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/thin_heap_/erase_fn_imps.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/thin_heap_/find_fn_imps.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/thin_heap_/insert_fn_imps.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/thin_heap_/split_join_fn_imps.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/thin_heap_/thin_heap_.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/thin_heap_/trace_fn_imps.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/tree_policy
-#usr/include/c++/4.4.7/ext/pb_ds/detail/tree_policy/node_metadata_selector.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/tree_policy/null_node_update_imp.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/tree_policy/order_statistics_imp.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/tree_policy/sample_tree_node_update.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/tree_trace_base.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/trie_policy
-#usr/include/c++/4.4.7/ext/pb_ds/detail/trie_policy/node_metadata_selector.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/trie_policy/null_node_update_imp.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/trie_policy/order_statistics_imp.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/trie_policy/prefix_search_node_update_imp.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/trie_policy/sample_trie_e_access_traits.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/trie_policy/sample_trie_node_update.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/trie_policy/string_trie_e_access_traits_imp.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/trie_policy/trie_policy_base.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/type_utils.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/types_traits.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/unordered_iterator
-#usr/include/c++/4.4.7/ext/pb_ds/detail/unordered_iterator/const_iterator.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/unordered_iterator/const_point_iterator.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/unordered_iterator/iterator.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/unordered_iterator/point_iterator.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/exception.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/hash_policy.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/list_update_policy.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/priority_queue.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/tag_and_trait.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/tree_policy.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/trie_policy.hpp
-#usr/include/c++/4.4.7/ext/pod_char_traits.h
-#usr/include/c++/4.4.7/ext/pointer.h
-#usr/include/c++/4.4.7/ext/pool_allocator.h
-#usr/include/c++/4.4.7/ext/rb_tree
-#usr/include/c++/4.4.7/ext/rc_string_base.h
-#usr/include/c++/4.4.7/ext/rope
-#usr/include/c++/4.4.7/ext/ropeimpl.h
-#usr/include/c++/4.4.7/ext/slist
-#usr/include/c++/4.4.7/ext/sso_string_base.h
-#usr/include/c++/4.4.7/ext/stdio_filebuf.h
-#usr/include/c++/4.4.7/ext/stdio_sync_filebuf.h
-#usr/include/c++/4.4.7/ext/string_conversions.h
-#usr/include/c++/4.4.7/ext/throw_allocator.h
-#usr/include/c++/4.4.7/ext/type_traits.h
-#usr/include/c++/4.4.7/ext/typelist.h
-#usr/include/c++/4.4.7/ext/vstring.h
-#usr/include/c++/4.4.7/ext/vstring.tcc
-#usr/include/c++/4.4.7/ext/vstring_fwd.h
-#usr/include/c++/4.4.7/ext/vstring_util.h
-#usr/include/c++/4.4.7/fenv.h
-#usr/include/c++/4.4.7/forward_list
-#usr/include/c++/4.4.7/fstream
-#usr/include/c++/4.4.7/functional
-#usr/include/c++/4.4.7/i586-pc-linux-gnu
-#usr/include/c++/4.4.7/i586-pc-linux-gnu/bits
-#usr/include/c++/4.4.7/i586-pc-linux-gnu/bits/atomic_word.h
-#usr/include/c++/4.4.7/i586-pc-linux-gnu/bits/basic_file.h
-#usr/include/c++/4.4.7/i586-pc-linux-gnu/bits/c++allocator.h
-#usr/include/c++/4.4.7/i586-pc-linux-gnu/bits/c++config.h
-#usr/include/c++/4.4.7/i586-pc-linux-gnu/bits/c++io.h
-#usr/include/c++/4.4.7/i586-pc-linux-gnu/bits/c++locale.h
-#usr/include/c++/4.4.7/i586-pc-linux-gnu/bits/cpu_defines.h
-#usr/include/c++/4.4.7/i586-pc-linux-gnu/bits/ctype_base.h
-#usr/include/c++/4.4.7/i586-pc-linux-gnu/bits/ctype_inline.h
-#usr/include/c++/4.4.7/i586-pc-linux-gnu/bits/ctype_noninline.h
-#usr/include/c++/4.4.7/i586-pc-linux-gnu/bits/cxxabi_tweaks.h
-#usr/include/c++/4.4.7/i586-pc-linux-gnu/bits/error_constants.h
-#usr/include/c++/4.4.7/i586-pc-linux-gnu/bits/extc++.h
-#usr/include/c++/4.4.7/i586-pc-linux-gnu/bits/gthr-default.h
-#usr/include/c++/4.4.7/i586-pc-linux-gnu/bits/gthr-posix.h
-#usr/include/c++/4.4.7/i586-pc-linux-gnu/bits/gthr-single.h
-#usr/include/c++/4.4.7/i586-pc-linux-gnu/bits/gthr-tpf.h
-#usr/include/c++/4.4.7/i586-pc-linux-gnu/bits/gthr.h
-#usr/include/c++/4.4.7/i586-pc-linux-gnu/bits/messages_members.h
-#usr/include/c++/4.4.7/i586-pc-linux-gnu/bits/os_defines.h
-#usr/include/c++/4.4.7/i586-pc-linux-gnu/bits/stdc++.h
-#usr/include/c++/4.4.7/i586-pc-linux-gnu/bits/stdtr1c++.h
-#usr/include/c++/4.4.7/i586-pc-linux-gnu/bits/time_members.h
-#usr/include/c++/4.4.7/initializer_list
-#usr/include/c++/4.4.7/iomanip
-#usr/include/c++/4.4.7/ios
-#usr/include/c++/4.4.7/iosfwd
-#usr/include/c++/4.4.7/iostream
-#usr/include/c++/4.4.7/istream
-#usr/include/c++/4.4.7/iterator
-#usr/include/c++/4.4.7/limits
-#usr/include/c++/4.4.7/list
-#usr/include/c++/4.4.7/locale
-#usr/include/c++/4.4.7/map
-#usr/include/c++/4.4.7/memory
-#usr/include/c++/4.4.7/mutex
-#usr/include/c++/4.4.7/new
-#usr/include/c++/4.4.7/numeric
-#usr/include/c++/4.4.7/ostream
-#usr/include/c++/4.4.7/parallel
-#usr/include/c++/4.4.7/parallel/algo.h
-#usr/include/c++/4.4.7/parallel/algobase.h
-#usr/include/c++/4.4.7/parallel/algorithm
-#usr/include/c++/4.4.7/parallel/algorithmfwd.h
-#usr/include/c++/4.4.7/parallel/balanced_quicksort.h
-#usr/include/c++/4.4.7/parallel/base.h
-#usr/include/c++/4.4.7/parallel/basic_iterator.h
-#usr/include/c++/4.4.7/parallel/checkers.h
-#usr/include/c++/4.4.7/parallel/compatibility.h
-#usr/include/c++/4.4.7/parallel/compiletime_settings.h
-#usr/include/c++/4.4.7/parallel/equally_split.h
-#usr/include/c++/4.4.7/parallel/features.h
-#usr/include/c++/4.4.7/parallel/find.h
-#usr/include/c++/4.4.7/parallel/find_selectors.h
-#usr/include/c++/4.4.7/parallel/for_each.h
-#usr/include/c++/4.4.7/parallel/for_each_selectors.h
-#usr/include/c++/4.4.7/parallel/iterator.h
-#usr/include/c++/4.4.7/parallel/list_partition.h
-#usr/include/c++/4.4.7/parallel/losertree.h
-#usr/include/c++/4.4.7/parallel/merge.h
-#usr/include/c++/4.4.7/parallel/multiseq_selection.h
-#usr/include/c++/4.4.7/parallel/multiway_merge.h
-#usr/include/c++/4.4.7/parallel/multiway_mergesort.h
-#usr/include/c++/4.4.7/parallel/numeric
-#usr/include/c++/4.4.7/parallel/numericfwd.h
-#usr/include/c++/4.4.7/parallel/omp_loop.h
-#usr/include/c++/4.4.7/parallel/omp_loop_static.h
-#usr/include/c++/4.4.7/parallel/par_loop.h
-#usr/include/c++/4.4.7/parallel/parallel.h
-#usr/include/c++/4.4.7/parallel/partial_sum.h
-#usr/include/c++/4.4.7/parallel/partition.h
-#usr/include/c++/4.4.7/parallel/queue.h
-#usr/include/c++/4.4.7/parallel/quicksort.h
-#usr/include/c++/4.4.7/parallel/random_number.h
-#usr/include/c++/4.4.7/parallel/random_shuffle.h
-#usr/include/c++/4.4.7/parallel/search.h
-#usr/include/c++/4.4.7/parallel/set_operations.h
-#usr/include/c++/4.4.7/parallel/settings.h
-#usr/include/c++/4.4.7/parallel/sort.h
-#usr/include/c++/4.4.7/parallel/tags.h
-#usr/include/c++/4.4.7/parallel/types.h
-#usr/include/c++/4.4.7/parallel/unique_copy.h
-#usr/include/c++/4.4.7/parallel/workstealing.h
-#usr/include/c++/4.4.7/queue
-#usr/include/c++/4.4.7/random
-#usr/include/c++/4.4.7/ratio
-#usr/include/c++/4.4.7/regex
-#usr/include/c++/4.4.7/set
-#usr/include/c++/4.4.7/sstream
-#usr/include/c++/4.4.7/stack
-#usr/include/c++/4.4.7/stdatomic.h
-#usr/include/c++/4.4.7/stdexcept
-#usr/include/c++/4.4.7/streambuf
-#usr/include/c++/4.4.7/string
-#usr/include/c++/4.4.7/system_error
-#usr/include/c++/4.4.7/tgmath.h
-#usr/include/c++/4.4.7/thread
-#usr/include/c++/4.4.7/tr1
-#usr/include/c++/4.4.7/tr1/array
-#usr/include/c++/4.4.7/tr1/bessel_function.tcc
-#usr/include/c++/4.4.7/tr1/beta_function.tcc
-#usr/include/c++/4.4.7/tr1/ccomplex
-#usr/include/c++/4.4.7/tr1/cctype
-#usr/include/c++/4.4.7/tr1/cfenv
-#usr/include/c++/4.4.7/tr1/cfloat
-#usr/include/c++/4.4.7/tr1/cinttypes
-#usr/include/c++/4.4.7/tr1/climits
-#usr/include/c++/4.4.7/tr1/cmath
-#usr/include/c++/4.4.7/tr1/complex
-#usr/include/c++/4.4.7/tr1/complex.h
-#usr/include/c++/4.4.7/tr1/cstdarg
-#usr/include/c++/4.4.7/tr1/cstdbool
-#usr/include/c++/4.4.7/tr1/cstdint
-#usr/include/c++/4.4.7/tr1/cstdio
-#usr/include/c++/4.4.7/tr1/cstdlib
-#usr/include/c++/4.4.7/tr1/ctgmath
-#usr/include/c++/4.4.7/tr1/ctime
-#usr/include/c++/4.4.7/tr1/ctype.h
-#usr/include/c++/4.4.7/tr1/cwchar
-#usr/include/c++/4.4.7/tr1/cwctype
-#usr/include/c++/4.4.7/tr1/ell_integral.tcc
-#usr/include/c++/4.4.7/tr1/exp_integral.tcc
-#usr/include/c++/4.4.7/tr1/fenv.h
-#usr/include/c++/4.4.7/tr1/float.h
-#usr/include/c++/4.4.7/tr1/functional
-#usr/include/c++/4.4.7/tr1/functional_hash.h
-#usr/include/c++/4.4.7/tr1/gamma.tcc
-#usr/include/c++/4.4.7/tr1/hashtable.h
-#usr/include/c++/4.4.7/tr1/hypergeometric.tcc
-#usr/include/c++/4.4.7/tr1/inttypes.h
-#usr/include/c++/4.4.7/tr1/legendre_function.tcc
-#usr/include/c++/4.4.7/tr1/limits.h
-#usr/include/c++/4.4.7/tr1/math.h
-#usr/include/c++/4.4.7/tr1/memory
-#usr/include/c++/4.4.7/tr1/modified_bessel_func.tcc
-#usr/include/c++/4.4.7/tr1/poly_hermite.tcc
-#usr/include/c++/4.4.7/tr1/poly_laguerre.tcc
-#usr/include/c++/4.4.7/tr1/random
-#usr/include/c++/4.4.7/tr1/regex
-#usr/include/c++/4.4.7/tr1/riemann_zeta.tcc
-#usr/include/c++/4.4.7/tr1/shared_ptr.h
-#usr/include/c++/4.4.7/tr1/special_function_util.h
-#usr/include/c++/4.4.7/tr1/stdarg.h
-#usr/include/c++/4.4.7/tr1/stdbool.h
-#usr/include/c++/4.4.7/tr1/stdint.h
-#usr/include/c++/4.4.7/tr1/stdio.h
-#usr/include/c++/4.4.7/tr1/stdlib.h
-#usr/include/c++/4.4.7/tr1/tgmath.h
-#usr/include/c++/4.4.7/tr1/tuple
-#usr/include/c++/4.4.7/tr1/type_traits
-#usr/include/c++/4.4.7/tr1/unordered_map
-#usr/include/c++/4.4.7/tr1/unordered_set
-#usr/include/c++/4.4.7/tr1/utility
-#usr/include/c++/4.4.7/tr1/wchar.h
-#usr/include/c++/4.4.7/tr1/wctype.h
-#usr/include/c++/4.4.7/tr1_impl
-#usr/include/c++/4.4.7/tr1_impl/array
-#usr/include/c++/4.4.7/tr1_impl/boost_sp_counted_base.h
-#usr/include/c++/4.4.7/tr1_impl/cctype
-#usr/include/c++/4.4.7/tr1_impl/cfenv
-#usr/include/c++/4.4.7/tr1_impl/cinttypes
-#usr/include/c++/4.4.7/tr1_impl/cmath
-#usr/include/c++/4.4.7/tr1_impl/complex
-#usr/include/c++/4.4.7/tr1_impl/cstdint
-#usr/include/c++/4.4.7/tr1_impl/cstdio
-#usr/include/c++/4.4.7/tr1_impl/cstdlib
-#usr/include/c++/4.4.7/tr1_impl/cwchar
-#usr/include/c++/4.4.7/tr1_impl/cwctype
-#usr/include/c++/4.4.7/tr1_impl/functional
-#usr/include/c++/4.4.7/tr1_impl/functional_hash.h
-#usr/include/c++/4.4.7/tr1_impl/hashtable
-#usr/include/c++/4.4.7/tr1_impl/hashtable_policy.h
-#usr/include/c++/4.4.7/tr1_impl/random
-#usr/include/c++/4.4.7/tr1_impl/random.tcc
-#usr/include/c++/4.4.7/tr1_impl/regex
-#usr/include/c++/4.4.7/tr1_impl/type_traits
-#usr/include/c++/4.4.7/tr1_impl/unordered_map
-#usr/include/c++/4.4.7/tr1_impl/unordered_set
-#usr/include/c++/4.4.7/tr1_impl/utility
-#usr/include/c++/4.4.7/tuple
-#usr/include/c++/4.4.7/type_traits
-#usr/include/c++/4.4.7/typeinfo
-#usr/include/c++/4.4.7/unordered_map
-#usr/include/c++/4.4.7/unordered_set
-#usr/include/c++/4.4.7/utility
-#usr/include/c++/4.4.7/valarray
-#usr/include/c++/4.4.7/vector
-#usr/info
-#usr/info/cpp.info
-#usr/info/cppinternals.info
-#usr/info/dir
-#usr/info/gcc.info
-#usr/info/gccinstall.info
-#usr/info/gccint.info
-#usr/info/libgomp.info
+#usr/include/c++/4.9.3
+#usr/include/c++/4.9.3/algorithm
+#usr/include/c++/4.9.3/array
+#usr/include/c++/4.9.3/atomic
+#usr/include/c++/4.9.3/backward
+#usr/include/c++/4.9.3/backward/auto_ptr.h
+#usr/include/c++/4.9.3/backward/backward_warning.h
+#usr/include/c++/4.9.3/backward/binders.h
+#usr/include/c++/4.9.3/backward/hash_fun.h
+#usr/include/c++/4.9.3/backward/hash_map
+#usr/include/c++/4.9.3/backward/hash_set
+#usr/include/c++/4.9.3/backward/hashtable.h
+#usr/include/c++/4.9.3/backward/strstream
+#usr/include/c++/4.9.3/bits
+#usr/include/c++/4.9.3/bits/algorithmfwd.h
+#usr/include/c++/4.9.3/bits/alloc_traits.h
+#usr/include/c++/4.9.3/bits/allocator.h
+#usr/include/c++/4.9.3/bits/atomic_base.h
+#usr/include/c++/4.9.3/bits/atomic_lockfree_defines.h
+#usr/include/c++/4.9.3/bits/basic_ios.h
+#usr/include/c++/4.9.3/bits/basic_ios.tcc
+#usr/include/c++/4.9.3/bits/basic_string.h
+#usr/include/c++/4.9.3/bits/basic_string.tcc
+#usr/include/c++/4.9.3/bits/boost_concept_check.h
+#usr/include/c++/4.9.3/bits/c++0x_warning.h
+#usr/include/c++/4.9.3/bits/c++14_warning.h
+#usr/include/c++/4.9.3/bits/char_traits.h
+#usr/include/c++/4.9.3/bits/codecvt.h
+#usr/include/c++/4.9.3/bits/concept_check.h
+#usr/include/c++/4.9.3/bits/cpp_type_traits.h
+#usr/include/c++/4.9.3/bits/cxxabi_forced.h
+#usr/include/c++/4.9.3/bits/deque.tcc
+#usr/include/c++/4.9.3/bits/enable_special_members.h
+#usr/include/c++/4.9.3/bits/exception_defines.h
+#usr/include/c++/4.9.3/bits/exception_ptr.h
+#usr/include/c++/4.9.3/bits/forward_list.h
+#usr/include/c++/4.9.3/bits/forward_list.tcc
+#usr/include/c++/4.9.3/bits/fstream.tcc
+#usr/include/c++/4.9.3/bits/functexcept.h
+#usr/include/c++/4.9.3/bits/functional_hash.h
+#usr/include/c++/4.9.3/bits/gslice.h
+#usr/include/c++/4.9.3/bits/gslice_array.h
+#usr/include/c++/4.9.3/bits/hash_bytes.h
+#usr/include/c++/4.9.3/bits/hashtable.h
+#usr/include/c++/4.9.3/bits/hashtable_policy.h
+#usr/include/c++/4.9.3/bits/indirect_array.h
+#usr/include/c++/4.9.3/bits/ios_base.h
+#usr/include/c++/4.9.3/bits/istream.tcc
+#usr/include/c++/4.9.3/bits/list.tcc
+#usr/include/c++/4.9.3/bits/locale_classes.h
+#usr/include/c++/4.9.3/bits/locale_classes.tcc
+#usr/include/c++/4.9.3/bits/locale_facets.h
+#usr/include/c++/4.9.3/bits/locale_facets.tcc
+#usr/include/c++/4.9.3/bits/locale_facets_nonio.h
+#usr/include/c++/4.9.3/bits/locale_facets_nonio.tcc
+#usr/include/c++/4.9.3/bits/localefwd.h
+#usr/include/c++/4.9.3/bits/mask_array.h
+#usr/include/c++/4.9.3/bits/memoryfwd.h
+#usr/include/c++/4.9.3/bits/move.h
+#usr/include/c++/4.9.3/bits/nested_exception.h
+#usr/include/c++/4.9.3/bits/ostream.tcc
+#usr/include/c++/4.9.3/bits/ostream_insert.h
+#usr/include/c++/4.9.3/bits/parse_numbers.h
+#usr/include/c++/4.9.3/bits/postypes.h
+#usr/include/c++/4.9.3/bits/predefined_ops.h
+#usr/include/c++/4.9.3/bits/ptr_traits.h
+#usr/include/c++/4.9.3/bits/random.h
+#usr/include/c++/4.9.3/bits/random.tcc
+#usr/include/c++/4.9.3/bits/range_access.h
+#usr/include/c++/4.9.3/bits/regex.h
+#usr/include/c++/4.9.3/bits/regex.tcc
+#usr/include/c++/4.9.3/bits/regex_automaton.h
+#usr/include/c++/4.9.3/bits/regex_automaton.tcc
+#usr/include/c++/4.9.3/bits/regex_compiler.h
+#usr/include/c++/4.9.3/bits/regex_compiler.tcc
+#usr/include/c++/4.9.3/bits/regex_constants.h
+#usr/include/c++/4.9.3/bits/regex_error.h
+#usr/include/c++/4.9.3/bits/regex_executor.h
+#usr/include/c++/4.9.3/bits/regex_executor.tcc
+#usr/include/c++/4.9.3/bits/regex_scanner.h
+#usr/include/c++/4.9.3/bits/regex_scanner.tcc
+#usr/include/c++/4.9.3/bits/shared_ptr.h
+#usr/include/c++/4.9.3/bits/shared_ptr_base.h
+#usr/include/c++/4.9.3/bits/slice_array.h
+#usr/include/c++/4.9.3/bits/sstream.tcc
+#usr/include/c++/4.9.3/bits/stl_algo.h
+#usr/include/c++/4.9.3/bits/stl_algobase.h
+#usr/include/c++/4.9.3/bits/stl_bvector.h
+#usr/include/c++/4.9.3/bits/stl_construct.h
+#usr/include/c++/4.9.3/bits/stl_deque.h
+#usr/include/c++/4.9.3/bits/stl_function.h
+#usr/include/c++/4.9.3/bits/stl_heap.h
+#usr/include/c++/4.9.3/bits/stl_iterator.h
+#usr/include/c++/4.9.3/bits/stl_iterator_base_funcs.h
+#usr/include/c++/4.9.3/bits/stl_iterator_base_types.h
+#usr/include/c++/4.9.3/bits/stl_list.h
+#usr/include/c++/4.9.3/bits/stl_map.h
+#usr/include/c++/4.9.3/bits/stl_multimap.h
+#usr/include/c++/4.9.3/bits/stl_multiset.h
+#usr/include/c++/4.9.3/bits/stl_numeric.h
+#usr/include/c++/4.9.3/bits/stl_pair.h
+#usr/include/c++/4.9.3/bits/stl_queue.h
+#usr/include/c++/4.9.3/bits/stl_raw_storage_iter.h
+#usr/include/c++/4.9.3/bits/stl_relops.h
+#usr/include/c++/4.9.3/bits/stl_set.h
+#usr/include/c++/4.9.3/bits/stl_stack.h
+#usr/include/c++/4.9.3/bits/stl_tempbuf.h
+#usr/include/c++/4.9.3/bits/stl_tree.h
+#usr/include/c++/4.9.3/bits/stl_uninitialized.h
+#usr/include/c++/4.9.3/bits/stl_vector.h
+#usr/include/c++/4.9.3/bits/stream_iterator.h
+#usr/include/c++/4.9.3/bits/streambuf.tcc
+#usr/include/c++/4.9.3/bits/streambuf_iterator.h
+#usr/include/c++/4.9.3/bits/stringfwd.h
+#usr/include/c++/4.9.3/bits/unique_ptr.h
+#usr/include/c++/4.9.3/bits/unordered_map.h
+#usr/include/c++/4.9.3/bits/unordered_set.h
+#usr/include/c++/4.9.3/bits/uses_allocator.h
+#usr/include/c++/4.9.3/bits/valarray_after.h
+#usr/include/c++/4.9.3/bits/valarray_array.h
+#usr/include/c++/4.9.3/bits/valarray_array.tcc
+#usr/include/c++/4.9.3/bits/valarray_before.h
+#usr/include/c++/4.9.3/bits/vector.tcc
+#usr/include/c++/4.9.3/bitset
+#usr/include/c++/4.9.3/cassert
+#usr/include/c++/4.9.3/ccomplex
+#usr/include/c++/4.9.3/cctype
+#usr/include/c++/4.9.3/cerrno
+#usr/include/c++/4.9.3/cfenv
+#usr/include/c++/4.9.3/cfloat
+#usr/include/c++/4.9.3/chrono
+#usr/include/c++/4.9.3/cinttypes
+#usr/include/c++/4.9.3/ciso646
+#usr/include/c++/4.9.3/climits
+#usr/include/c++/4.9.3/clocale
+#usr/include/c++/4.9.3/cmath
+#usr/include/c++/4.9.3/complex
+#usr/include/c++/4.9.3/complex.h
+#usr/include/c++/4.9.3/condition_variable
+#usr/include/c++/4.9.3/csetjmp
+#usr/include/c++/4.9.3/csignal
+#usr/include/c++/4.9.3/cstdalign
+#usr/include/c++/4.9.3/cstdarg
+#usr/include/c++/4.9.3/cstdbool
+#usr/include/c++/4.9.3/cstddef
+#usr/include/c++/4.9.3/cstdint
+#usr/include/c++/4.9.3/cstdio
+#usr/include/c++/4.9.3/cstdlib
+#usr/include/c++/4.9.3/cstring
+#usr/include/c++/4.9.3/ctgmath
+#usr/include/c++/4.9.3/ctime
+#usr/include/c++/4.9.3/cwchar
+#usr/include/c++/4.9.3/cwctype
+#usr/include/c++/4.9.3/cxxabi.h
+#usr/include/c++/4.9.3/debug
+#usr/include/c++/4.9.3/debug/array
+#usr/include/c++/4.9.3/debug/bitset
+#usr/include/c++/4.9.3/debug/debug.h
+#usr/include/c++/4.9.3/debug/deque
+#usr/include/c++/4.9.3/debug/formatter.h
+#usr/include/c++/4.9.3/debug/forward_list
+#usr/include/c++/4.9.3/debug/functions.h
+#usr/include/c++/4.9.3/debug/list
+#usr/include/c++/4.9.3/debug/macros.h
+#usr/include/c++/4.9.3/debug/map
+#usr/include/c++/4.9.3/debug/map.h
+#usr/include/c++/4.9.3/debug/multimap.h
+#usr/include/c++/4.9.3/debug/multiset.h
+#usr/include/c++/4.9.3/debug/safe_base.h
+#usr/include/c++/4.9.3/debug/safe_iterator.h
+#usr/include/c++/4.9.3/debug/safe_iterator.tcc
+#usr/include/c++/4.9.3/debug/safe_local_iterator.h
+#usr/include/c++/4.9.3/debug/safe_local_iterator.tcc
+#usr/include/c++/4.9.3/debug/safe_sequence.h
+#usr/include/c++/4.9.3/debug/safe_sequence.tcc
+#usr/include/c++/4.9.3/debug/safe_unordered_base.h
+#usr/include/c++/4.9.3/debug/safe_unordered_container.h
+#usr/include/c++/4.9.3/debug/safe_unordered_container.tcc
+#usr/include/c++/4.9.3/debug/set
+#usr/include/c++/4.9.3/debug/set.h
+#usr/include/c++/4.9.3/debug/string
+#usr/include/c++/4.9.3/debug/unordered_map
+#usr/include/c++/4.9.3/debug/unordered_set
+#usr/include/c++/4.9.3/debug/vector
+#usr/include/c++/4.9.3/decimal
+#usr/include/c++/4.9.3/decimal/decimal
+#usr/include/c++/4.9.3/decimal/decimal.h
+#usr/include/c++/4.9.3/deque
+#usr/include/c++/4.9.3/exception
+#usr/include/c++/4.9.3/experimental
+#usr/include/c++/4.9.3/experimental/optional
+#usr/include/c++/4.9.3/experimental/string_view
+#usr/include/c++/4.9.3/experimental/string_view.tcc
+#usr/include/c++/4.9.3/ext
+#usr/include/c++/4.9.3/ext/algorithm
+#usr/include/c++/4.9.3/ext/aligned_buffer.h
+#usr/include/c++/4.9.3/ext/alloc_traits.h
+#usr/include/c++/4.9.3/ext/array_allocator.h
+#usr/include/c++/4.9.3/ext/atomicity.h
+#usr/include/c++/4.9.3/ext/bitmap_allocator.h
+#usr/include/c++/4.9.3/ext/cast.h
+#usr/include/c++/4.9.3/ext/cmath
+#usr/include/c++/4.9.3/ext/codecvt_specializations.h
+#usr/include/c++/4.9.3/ext/concurrence.h
+#usr/include/c++/4.9.3/ext/debug_allocator.h
+#usr/include/c++/4.9.3/ext/enc_filebuf.h
+#usr/include/c++/4.9.3/ext/extptr_allocator.h
+#usr/include/c++/4.9.3/ext/functional
+#usr/include/c++/4.9.3/ext/hash_map
+#usr/include/c++/4.9.3/ext/hash_set
+#usr/include/c++/4.9.3/ext/iterator
+#usr/include/c++/4.9.3/ext/malloc_allocator.h
+#usr/include/c++/4.9.3/ext/memory
+#usr/include/c++/4.9.3/ext/mt_allocator.h
+#usr/include/c++/4.9.3/ext/new_allocator.h
+#usr/include/c++/4.9.3/ext/numeric
+#usr/include/c++/4.9.3/ext/numeric_traits.h
+#usr/include/c++/4.9.3/ext/pb_ds
+#usr/include/c++/4.9.3/ext/pb_ds/assoc_container.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail
+#usr/include/c++/4.9.3/ext/pb_ds/detail/bin_search_tree_
+#usr/include/c++/4.9.3/ext/pb_ds/detail/bin_search_tree_/bin_search_tree_.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/bin_search_tree_/constructors_destructor_fn_imps.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/bin_search_tree_/debug_fn_imps.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/bin_search_tree_/erase_fn_imps.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/bin_search_tree_/find_fn_imps.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/bin_search_tree_/info_fn_imps.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/bin_search_tree_/insert_fn_imps.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/bin_search_tree_/iterators_fn_imps.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/bin_search_tree_/node_iterators.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/bin_search_tree_/point_iterators.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/bin_search_tree_/policy_access_fn_imps.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/bin_search_tree_/r_erase_fn_imps.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/bin_search_tree_/rotate_fn_imps.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/bin_search_tree_/split_join_fn_imps.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/bin_search_tree_/traits.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/binary_heap_
+#usr/include/c++/4.9.3/ext/pb_ds/detail/binary_heap_/binary_heap_.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/binary_heap_/const_iterator.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/binary_heap_/constructors_destructor_fn_imps.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/binary_heap_/debug_fn_imps.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/binary_heap_/entry_cmp.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/binary_heap_/entry_pred.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/binary_heap_/erase_fn_imps.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/binary_heap_/find_fn_imps.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/binary_heap_/info_fn_imps.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/binary_heap_/insert_fn_imps.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/binary_heap_/iterators_fn_imps.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/binary_heap_/point_const_iterator.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/binary_heap_/policy_access_fn_imps.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/binary_heap_/resize_policy.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/binary_heap_/split_join_fn_imps.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/binary_heap_/trace_fn_imps.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/binomial_heap_
+#usr/include/c++/4.9.3/ext/pb_ds/detail/binomial_heap_/binomial_heap_.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/binomial_heap_/constructors_destructor_fn_imps.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/binomial_heap_/debug_fn_imps.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/binomial_heap_base_
+#usr/include/c++/4.9.3/ext/pb_ds/detail/binomial_heap_base_/binomial_heap_base_.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/binomial_heap_base_/constructors_destructor_fn_imps.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/binomial_heap_base_/debug_fn_imps.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/binomial_heap_base_/erase_fn_imps.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/binomial_heap_base_/find_fn_imps.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/binomial_heap_base_/insert_fn_imps.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/binomial_heap_base_/split_join_fn_imps.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/branch_policy
+#usr/include/c++/4.9.3/ext/pb_ds/detail/branch_policy/branch_policy.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/branch_policy/null_node_metadata.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/branch_policy/traits.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/cc_hash_table_map_
+#usr/include/c++/4.9.3/ext/pb_ds/detail/cc_hash_table_map_/cc_ht_map_.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/cc_hash_table_map_/cmp_fn_imps.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/cc_hash_table_map_/cond_key_dtor_entry_dealtor.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/cc_hash_table_map_/constructor_destructor_fn_imps.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/cc_hash_table_map_/constructor_destructor_no_store_hash_fn_imps.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/cc_hash_table_map_/constructor_destructor_store_hash_fn_imps.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/cc_hash_table_map_/debug_fn_imps.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/cc_hash_table_map_/debug_no_store_hash_fn_imps.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/cc_hash_table_map_/debug_store_hash_fn_imps.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/cc_hash_table_map_/entry_list_fn_imps.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/cc_hash_table_map_/erase_fn_imps.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/cc_hash_table_map_/erase_no_store_hash_fn_imps.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/cc_hash_table_map_/erase_store_hash_fn_imps.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/cc_hash_table_map_/find_fn_imps.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/cc_hash_table_map_/find_store_hash_fn_imps.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/cc_hash_table_map_/info_fn_imps.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/cc_hash_table_map_/insert_fn_imps.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/cc_hash_table_map_/insert_no_store_hash_fn_imps.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/cc_hash_table_map_/insert_store_hash_fn_imps.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/cc_hash_table_map_/iterators_fn_imps.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/cc_hash_table_map_/policy_access_fn_imps.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/cc_hash_table_map_/resize_fn_imps.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/cc_hash_table_map_/resize_no_store_hash_fn_imps.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/cc_hash_table_map_/resize_store_hash_fn_imps.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/cc_hash_table_map_/size_fn_imps.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/cc_hash_table_map_/trace_fn_imps.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/cond_dealtor.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/container_base_dispatch.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/debug_map_base.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/eq_fn
+#usr/include/c++/4.9.3/ext/pb_ds/detail/eq_fn/eq_by_less.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/eq_fn/hash_eq_fn.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/gp_hash_table_map_
+#usr/include/c++/4.9.3/ext/pb_ds/detail/gp_hash_table_map_/constructor_destructor_fn_imps.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/gp_hash_table_map_/constructor_destructor_no_store_hash_fn_imps.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/gp_hash_table_map_/constructor_destructor_store_hash_fn_imps.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/gp_hash_table_map_/debug_fn_imps.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/gp_hash_table_map_/debug_no_store_hash_fn_imps.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/gp_hash_table_map_/debug_store_hash_fn_imps.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/gp_hash_table_map_/erase_fn_imps.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/gp_hash_table_map_/erase_no_store_hash_fn_imps.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/gp_hash_table_map_/erase_store_hash_fn_imps.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/gp_hash_table_map_/find_fn_imps.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/gp_hash_table_map_/find_no_store_hash_fn_imps.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/gp_hash_table_map_/find_store_hash_fn_imps.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/gp_hash_table_map_/gp_ht_map_.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/gp_hash_table_map_/info_fn_imps.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/gp_hash_table_map_/insert_fn_imps.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/gp_hash_table_map_/insert_no_store_hash_fn_imps.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/gp_hash_table_map_/insert_store_hash_fn_imps.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/gp_hash_table_map_/iterator_fn_imps.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/gp_hash_table_map_/policy_access_fn_imps.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/gp_hash_table_map_/resize_fn_imps.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/gp_hash_table_map_/resize_no_store_hash_fn_imps.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/gp_hash_table_map_/resize_store_hash_fn_imps.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/gp_hash_table_map_/trace_fn_imps.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/hash_fn
+#usr/include/c++/4.9.3/ext/pb_ds/detail/hash_fn/direct_mask_range_hashing_imp.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/hash_fn/direct_mod_range_hashing_imp.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/hash_fn/linear_probe_fn_imp.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/hash_fn/mask_based_range_hashing.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/hash_fn/mod_based_range_hashing.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/hash_fn/probe_fn_base.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/hash_fn/quadratic_probe_fn_imp.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/hash_fn/ranged_hash_fn.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/hash_fn/ranged_probe_fn.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/hash_fn/sample_probe_fn.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/hash_fn/sample_range_hashing.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/hash_fn/sample_ranged_hash_fn.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/hash_fn/sample_ranged_probe_fn.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/left_child_next_sibling_heap_
+#usr/include/c++/4.9.3/ext/pb_ds/detail/left_child_next_sibling_heap_/const_iterator.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/left_child_next_sibling_heap_/constructors_destructor_fn_imps.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/left_child_next_sibling_heap_/debug_fn_imps.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/left_child_next_sibling_heap_/erase_fn_imps.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/left_child_next_sibling_heap_/info_fn_imps.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/left_child_next_sibling_heap_/insert_fn_imps.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/left_child_next_sibling_heap_/iterators_fn_imps.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/left_child_next_sibling_heap_/left_child_next_sibling_heap_.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/left_child_next_sibling_heap_/node.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/left_child_next_sibling_heap_/point_const_iterator.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/left_child_next_sibling_heap_/policy_access_fn_imps.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/left_child_next_sibling_heap_/trace_fn_imps.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/list_update_map_
+#usr/include/c++/4.9.3/ext/pb_ds/detail/list_update_map_/constructor_destructor_fn_imps.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/list_update_map_/debug_fn_imps.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/list_update_map_/entry_metadata_base.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/list_update_map_/erase_fn_imps.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/list_update_map_/find_fn_imps.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/list_update_map_/info_fn_imps.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/list_update_map_/insert_fn_imps.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/list_update_map_/iterators_fn_imps.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/list_update_map_/lu_map_.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/list_update_map_/trace_fn_imps.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/list_update_policy
+#usr/include/c++/4.9.3/ext/pb_ds/detail/list_update_policy/lu_counter_metadata.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/list_update_policy/sample_update_policy.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/ov_tree_map_
+#usr/include/c++/4.9.3/ext/pb_ds/detail/ov_tree_map_/constructors_destructor_fn_imps.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/ov_tree_map_/debug_fn_imps.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/ov_tree_map_/erase_fn_imps.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/ov_tree_map_/info_fn_imps.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/ov_tree_map_/insert_fn_imps.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/ov_tree_map_/iterators_fn_imps.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/ov_tree_map_/node_iterators.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/ov_tree_map_/ov_tree_map_.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/ov_tree_map_/policy_access_fn_imps.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/ov_tree_map_/split_join_fn_imps.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/ov_tree_map_/traits.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/pairing_heap_
+#usr/include/c++/4.9.3/ext/pb_ds/detail/pairing_heap_/constructors_destructor_fn_imps.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/pairing_heap_/debug_fn_imps.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/pairing_heap_/erase_fn_imps.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/pairing_heap_/find_fn_imps.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/pairing_heap_/insert_fn_imps.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/pairing_heap_/pairing_heap_.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/pairing_heap_/split_join_fn_imps.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/pat_trie_
+#usr/include/c++/4.9.3/ext/pb_ds/detail/pat_trie_/constructors_destructor_fn_imps.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/pat_trie_/debug_fn_imps.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/pat_trie_/erase_fn_imps.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/pat_trie_/find_fn_imps.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/pat_trie_/info_fn_imps.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/pat_trie_/insert_join_fn_imps.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/pat_trie_/iterators_fn_imps.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/pat_trie_/pat_trie_.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/pat_trie_/pat_trie_base.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/pat_trie_/policy_access_fn_imps.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/pat_trie_/r_erase_fn_imps.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/pat_trie_/rotate_fn_imps.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/pat_trie_/split_fn_imps.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/pat_trie_/synth_access_traits.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/pat_trie_/trace_fn_imps.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/pat_trie_/traits.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/pat_trie_/update_fn_imps.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/priority_queue_base_dispatch.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/rb_tree_map_
+#usr/include/c++/4.9.3/ext/pb_ds/detail/rb_tree_map_/constructors_destructor_fn_imps.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/rb_tree_map_/debug_fn_imps.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/rb_tree_map_/erase_fn_imps.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/rb_tree_map_/find_fn_imps.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/rb_tree_map_/info_fn_imps.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/rb_tree_map_/insert_fn_imps.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/rb_tree_map_/node.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/rb_tree_map_/rb_tree_.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/rb_tree_map_/split_join_fn_imps.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/rb_tree_map_/traits.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/rc_binomial_heap_
+#usr/include/c++/4.9.3/ext/pb_ds/detail/rc_binomial_heap_/constructors_destructor_fn_imps.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/rc_binomial_heap_/debug_fn_imps.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/rc_binomial_heap_/erase_fn_imps.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/rc_binomial_heap_/insert_fn_imps.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/rc_binomial_heap_/rc.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/rc_binomial_heap_/rc_binomial_heap_.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/rc_binomial_heap_/split_join_fn_imps.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/rc_binomial_heap_/trace_fn_imps.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/resize_policy
+#usr/include/c++/4.9.3/ext/pb_ds/detail/resize_policy/cc_hash_max_collision_check_resize_trigger_imp.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/resize_policy/hash_exponential_size_policy_imp.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/resize_policy/hash_load_check_resize_trigger_imp.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/resize_policy/hash_load_check_resize_trigger_size_base.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/resize_policy/hash_prime_size_policy_imp.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/resize_policy/hash_standard_resize_policy_imp.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/resize_policy/sample_resize_policy.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/resize_policy/sample_resize_trigger.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/resize_policy/sample_size_policy.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/splay_tree_
+#usr/include/c++/4.9.3/ext/pb_ds/detail/splay_tree_/constructors_destructor_fn_imps.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/splay_tree_/debug_fn_imps.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/splay_tree_/erase_fn_imps.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/splay_tree_/find_fn_imps.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/splay_tree_/info_fn_imps.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/splay_tree_/insert_fn_imps.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/splay_tree_/node.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/splay_tree_/splay_fn_imps.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/splay_tree_/splay_tree_.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/splay_tree_/split_join_fn_imps.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/splay_tree_/traits.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/standard_policies.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/thin_heap_
+#usr/include/c++/4.9.3/ext/pb_ds/detail/thin_heap_/constructors_destructor_fn_imps.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/thin_heap_/debug_fn_imps.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/thin_heap_/erase_fn_imps.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/thin_heap_/find_fn_imps.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/thin_heap_/insert_fn_imps.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/thin_heap_/split_join_fn_imps.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/thin_heap_/thin_heap_.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/thin_heap_/trace_fn_imps.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/tree_policy
+#usr/include/c++/4.9.3/ext/pb_ds/detail/tree_policy/node_metadata_selector.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/tree_policy/order_statistics_imp.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/tree_policy/sample_tree_node_update.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/tree_trace_base.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/trie_policy
+#usr/include/c++/4.9.3/ext/pb_ds/detail/trie_policy/node_metadata_selector.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/trie_policy/order_statistics_imp.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/trie_policy/prefix_search_node_update_imp.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/trie_policy/sample_trie_access_traits.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/trie_policy/sample_trie_node_update.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/trie_policy/trie_policy_base.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/trie_policy/trie_string_access_traits_imp.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/type_utils.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/types_traits.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/unordered_iterator
+#usr/include/c++/4.9.3/ext/pb_ds/detail/unordered_iterator/const_iterator.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/unordered_iterator/iterator.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/unordered_iterator/point_const_iterator.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/unordered_iterator/point_iterator.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/exception.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/hash_policy.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/list_update_policy.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/priority_queue.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/tag_and_trait.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/tree_policy.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/trie_policy.hpp
+#usr/include/c++/4.9.3/ext/pod_char_traits.h
+#usr/include/c++/4.9.3/ext/pointer.h
+#usr/include/c++/4.9.3/ext/pool_allocator.h
+#usr/include/c++/4.9.3/ext/random
+#usr/include/c++/4.9.3/ext/random.tcc
+#usr/include/c++/4.9.3/ext/rb_tree
+#usr/include/c++/4.9.3/ext/rc_string_base.h
+#usr/include/c++/4.9.3/ext/rope
+#usr/include/c++/4.9.3/ext/ropeimpl.h
+#usr/include/c++/4.9.3/ext/slist
+#usr/include/c++/4.9.3/ext/sso_string_base.h
+#usr/include/c++/4.9.3/ext/stdio_filebuf.h
+#usr/include/c++/4.9.3/ext/stdio_sync_filebuf.h
+#usr/include/c++/4.9.3/ext/string_conversions.h
+#usr/include/c++/4.9.3/ext/throw_allocator.h
+#usr/include/c++/4.9.3/ext/type_traits.h
+#usr/include/c++/4.9.3/ext/typelist.h
+#usr/include/c++/4.9.3/ext/vstring.h
+#usr/include/c++/4.9.3/ext/vstring.tcc
+#usr/include/c++/4.9.3/ext/vstring_fwd.h
+#usr/include/c++/4.9.3/ext/vstring_util.h
+#usr/include/c++/4.9.3/fenv.h
+#usr/include/c++/4.9.3/forward_list
+#usr/include/c++/4.9.3/fstream
+#usr/include/c++/4.9.3/functional
+#usr/include/c++/4.9.3/future
+#usr/include/c++/4.9.3/i586-pc-linux-gnu
+#usr/include/c++/4.9.3/i586-pc-linux-gnu/bits
+#usr/include/c++/4.9.3/i586-pc-linux-gnu/bits/atomic_word.h
+#usr/include/c++/4.9.3/i586-pc-linux-gnu/bits/basic_file.h
+#usr/include/c++/4.9.3/i586-pc-linux-gnu/bits/c++allocator.h
+#usr/include/c++/4.9.3/i586-pc-linux-gnu/bits/c++config.h
+#usr/include/c++/4.9.3/i586-pc-linux-gnu/bits/c++io.h
+#usr/include/c++/4.9.3/i586-pc-linux-gnu/bits/c++locale.h
+#usr/include/c++/4.9.3/i586-pc-linux-gnu/bits/cpu_defines.h
+#usr/include/c++/4.9.3/i586-pc-linux-gnu/bits/ctype_base.h
+#usr/include/c++/4.9.3/i586-pc-linux-gnu/bits/ctype_inline.h
+#usr/include/c++/4.9.3/i586-pc-linux-gnu/bits/cxxabi_tweaks.h
+#usr/include/c++/4.9.3/i586-pc-linux-gnu/bits/error_constants.h
+#usr/include/c++/4.9.3/i586-pc-linux-gnu/bits/extc++.h
+#usr/include/c++/4.9.3/i586-pc-linux-gnu/bits/gthr-default.h
+#usr/include/c++/4.9.3/i586-pc-linux-gnu/bits/gthr-posix.h
+#usr/include/c++/4.9.3/i586-pc-linux-gnu/bits/gthr-single.h
+#usr/include/c++/4.9.3/i586-pc-linux-gnu/bits/gthr.h
+#usr/include/c++/4.9.3/i586-pc-linux-gnu/bits/messages_members.h
+#usr/include/c++/4.9.3/i586-pc-linux-gnu/bits/opt_random.h
+#usr/include/c++/4.9.3/i586-pc-linux-gnu/bits/os_defines.h
+#usr/include/c++/4.9.3/i586-pc-linux-gnu/bits/stdc++.h
+#usr/include/c++/4.9.3/i586-pc-linux-gnu/bits/stdtr1c++.h
+#usr/include/c++/4.9.3/i586-pc-linux-gnu/bits/time_members.h
+#usr/include/c++/4.9.3/i586-pc-linux-gnu/ext
+#usr/include/c++/4.9.3/i586-pc-linux-gnu/ext/opt_random.h
+#usr/include/c++/4.9.3/initializer_list
+#usr/include/c++/4.9.3/iomanip
+#usr/include/c++/4.9.3/ios
+#usr/include/c++/4.9.3/iosfwd
+#usr/include/c++/4.9.3/iostream
+#usr/include/c++/4.9.3/istream
+#usr/include/c++/4.9.3/iterator
+#usr/include/c++/4.9.3/limits
+#usr/include/c++/4.9.3/list
+#usr/include/c++/4.9.3/locale
+#usr/include/c++/4.9.3/map
+#usr/include/c++/4.9.3/memory
+#usr/include/c++/4.9.3/mutex
+#usr/include/c++/4.9.3/new
+#usr/include/c++/4.9.3/numeric
+#usr/include/c++/4.9.3/ostream
+#usr/include/c++/4.9.3/parallel
+#usr/include/c++/4.9.3/parallel/algo.h
+#usr/include/c++/4.9.3/parallel/algobase.h
+#usr/include/c++/4.9.3/parallel/algorithm
+#usr/include/c++/4.9.3/parallel/algorithmfwd.h
+#usr/include/c++/4.9.3/parallel/balanced_quicksort.h
+#usr/include/c++/4.9.3/parallel/base.h
+#usr/include/c++/4.9.3/parallel/basic_iterator.h
+#usr/include/c++/4.9.3/parallel/checkers.h
+#usr/include/c++/4.9.3/parallel/compatibility.h
+#usr/include/c++/4.9.3/parallel/compiletime_settings.h
+#usr/include/c++/4.9.3/parallel/equally_split.h
+#usr/include/c++/4.9.3/parallel/features.h
+#usr/include/c++/4.9.3/parallel/find.h
+#usr/include/c++/4.9.3/parallel/find_selectors.h
+#usr/include/c++/4.9.3/parallel/for_each.h
+#usr/include/c++/4.9.3/parallel/for_each_selectors.h
+#usr/include/c++/4.9.3/parallel/iterator.h
+#usr/include/c++/4.9.3/parallel/list_partition.h
+#usr/include/c++/4.9.3/parallel/losertree.h
+#usr/include/c++/4.9.3/parallel/merge.h
+#usr/include/c++/4.9.3/parallel/multiseq_selection.h
+#usr/include/c++/4.9.3/parallel/multiway_merge.h
+#usr/include/c++/4.9.3/parallel/multiway_mergesort.h
+#usr/include/c++/4.9.3/parallel/numeric
+#usr/include/c++/4.9.3/parallel/numericfwd.h
+#usr/include/c++/4.9.3/parallel/omp_loop.h
+#usr/include/c++/4.9.3/parallel/omp_loop_static.h
+#usr/include/c++/4.9.3/parallel/par_loop.h
+#usr/include/c++/4.9.3/parallel/parallel.h
+#usr/include/c++/4.9.3/parallel/partial_sum.h
+#usr/include/c++/4.9.3/parallel/partition.h
+#usr/include/c++/4.9.3/parallel/queue.h
+#usr/include/c++/4.9.3/parallel/quicksort.h
+#usr/include/c++/4.9.3/parallel/random_number.h
+#usr/include/c++/4.9.3/parallel/random_shuffle.h
+#usr/include/c++/4.9.3/parallel/search.h
+#usr/include/c++/4.9.3/parallel/set_operations.h
+#usr/include/c++/4.9.3/parallel/settings.h
+#usr/include/c++/4.9.3/parallel/sort.h
+#usr/include/c++/4.9.3/parallel/tags.h
+#usr/include/c++/4.9.3/parallel/types.h
+#usr/include/c++/4.9.3/parallel/unique_copy.h
+#usr/include/c++/4.9.3/parallel/workstealing.h
+#usr/include/c++/4.9.3/profile
+#usr/include/c++/4.9.3/profile/array
+#usr/include/c++/4.9.3/profile/base.h
+#usr/include/c++/4.9.3/profile/bitset
+#usr/include/c++/4.9.3/profile/deque
+#usr/include/c++/4.9.3/profile/forward_list
+#usr/include/c++/4.9.3/profile/impl
+#usr/include/c++/4.9.3/profile/impl/profiler.h
+#usr/include/c++/4.9.3/profile/impl/profiler_algos.h
+#usr/include/c++/4.9.3/profile/impl/profiler_container_size.h
+#usr/include/c++/4.9.3/profile/impl/profiler_hash_func.h
+#usr/include/c++/4.9.3/profile/impl/profiler_hashtable_size.h
+#usr/include/c++/4.9.3/profile/impl/profiler_list_to_slist.h
+#usr/include/c++/4.9.3/profile/impl/profiler_list_to_vector.h
+#usr/include/c++/4.9.3/profile/impl/profiler_map_to_unordered_map.h
+#usr/include/c++/4.9.3/profile/impl/profiler_node.h
+#usr/include/c++/4.9.3/profile/impl/profiler_state.h
+#usr/include/c++/4.9.3/profile/impl/profiler_trace.h
+#usr/include/c++/4.9.3/profile/impl/profiler_vector_size.h
+#usr/include/c++/4.9.3/profile/impl/profiler_vector_to_list.h
+#usr/include/c++/4.9.3/profile/iterator_tracker.h
+#usr/include/c++/4.9.3/profile/list
+#usr/include/c++/4.9.3/profile/map
+#usr/include/c++/4.9.3/profile/map.h
+#usr/include/c++/4.9.3/profile/multimap.h
+#usr/include/c++/4.9.3/profile/multiset.h
+#usr/include/c++/4.9.3/profile/set
+#usr/include/c++/4.9.3/profile/set.h
+#usr/include/c++/4.9.3/profile/unordered_base.h
+#usr/include/c++/4.9.3/profile/unordered_map
+#usr/include/c++/4.9.3/profile/unordered_set
+#usr/include/c++/4.9.3/profile/vector
+#usr/include/c++/4.9.3/queue
+#usr/include/c++/4.9.3/random
+#usr/include/c++/4.9.3/ratio
+#usr/include/c++/4.9.3/regex
+#usr/include/c++/4.9.3/scoped_allocator
+#usr/include/c++/4.9.3/set
+#usr/include/c++/4.9.3/shared_mutex
+#usr/include/c++/4.9.3/sstream
+#usr/include/c++/4.9.3/stack
+#usr/include/c++/4.9.3/stdexcept
+#usr/include/c++/4.9.3/streambuf
+#usr/include/c++/4.9.3/string
+#usr/include/c++/4.9.3/system_error
+#usr/include/c++/4.9.3/tgmath.h
+#usr/include/c++/4.9.3/thread
+#usr/include/c++/4.9.3/tr1
+#usr/include/c++/4.9.3/tr1/array
+#usr/include/c++/4.9.3/tr1/bessel_function.tcc
+#usr/include/c++/4.9.3/tr1/beta_function.tcc
+#usr/include/c++/4.9.3/tr1/ccomplex
+#usr/include/c++/4.9.3/tr1/cctype
+#usr/include/c++/4.9.3/tr1/cfenv
+#usr/include/c++/4.9.3/tr1/cfloat
+#usr/include/c++/4.9.3/tr1/cinttypes
+#usr/include/c++/4.9.3/tr1/climits
+#usr/include/c++/4.9.3/tr1/cmath
+#usr/include/c++/4.9.3/tr1/complex
+#usr/include/c++/4.9.3/tr1/complex.h
+#usr/include/c++/4.9.3/tr1/cstdarg
+#usr/include/c++/4.9.3/tr1/cstdbool
+#usr/include/c++/4.9.3/tr1/cstdint
+#usr/include/c++/4.9.3/tr1/cstdio
+#usr/include/c++/4.9.3/tr1/cstdlib
+#usr/include/c++/4.9.3/tr1/ctgmath
+#usr/include/c++/4.9.3/tr1/ctime
+#usr/include/c++/4.9.3/tr1/ctype.h
+#usr/include/c++/4.9.3/tr1/cwchar
+#usr/include/c++/4.9.3/tr1/cwctype
+#usr/include/c++/4.9.3/tr1/ell_integral.tcc
+#usr/include/c++/4.9.3/tr1/exp_integral.tcc
+#usr/include/c++/4.9.3/tr1/fenv.h
+#usr/include/c++/4.9.3/tr1/float.h
+#usr/include/c++/4.9.3/tr1/functional
+#usr/include/c++/4.9.3/tr1/functional_hash.h
+#usr/include/c++/4.9.3/tr1/gamma.tcc
+#usr/include/c++/4.9.3/tr1/hashtable.h
+#usr/include/c++/4.9.3/tr1/hashtable_policy.h
+#usr/include/c++/4.9.3/tr1/hypergeometric.tcc
+#usr/include/c++/4.9.3/tr1/inttypes.h
+#usr/include/c++/4.9.3/tr1/legendre_function.tcc
+#usr/include/c++/4.9.3/tr1/limits.h
+#usr/include/c++/4.9.3/tr1/math.h
+#usr/include/c++/4.9.3/tr1/memory
+#usr/include/c++/4.9.3/tr1/modified_bessel_func.tcc
+#usr/include/c++/4.9.3/tr1/poly_hermite.tcc
+#usr/include/c++/4.9.3/tr1/poly_laguerre.tcc
+#usr/include/c++/4.9.3/tr1/random
+#usr/include/c++/4.9.3/tr1/random.h
+#usr/include/c++/4.9.3/tr1/random.tcc
+#usr/include/c++/4.9.3/tr1/regex
+#usr/include/c++/4.9.3/tr1/riemann_zeta.tcc
+#usr/include/c++/4.9.3/tr1/shared_ptr.h
+#usr/include/c++/4.9.3/tr1/special_function_util.h
+#usr/include/c++/4.9.3/tr1/stdarg.h
+#usr/include/c++/4.9.3/tr1/stdbool.h
+#usr/include/c++/4.9.3/tr1/stdint.h
+#usr/include/c++/4.9.3/tr1/stdio.h
+#usr/include/c++/4.9.3/tr1/stdlib.h
+#usr/include/c++/4.9.3/tr1/tgmath.h
+#usr/include/c++/4.9.3/tr1/tuple
+#usr/include/c++/4.9.3/tr1/type_traits
+#usr/include/c++/4.9.3/tr1/unordered_map
+#usr/include/c++/4.9.3/tr1/unordered_map.h
+#usr/include/c++/4.9.3/tr1/unordered_set
+#usr/include/c++/4.9.3/tr1/unordered_set.h
+#usr/include/c++/4.9.3/tr1/utility
+#usr/include/c++/4.9.3/tr1/wchar.h
+#usr/include/c++/4.9.3/tr1/wctype.h
+#usr/include/c++/4.9.3/tr2
+#usr/include/c++/4.9.3/tr2/bool_set
+#usr/include/c++/4.9.3/tr2/bool_set.tcc
+#usr/include/c++/4.9.3/tr2/dynamic_bitset
+#usr/include/c++/4.9.3/tr2/dynamic_bitset.tcc
+#usr/include/c++/4.9.3/tr2/ratio
+#usr/include/c++/4.9.3/tr2/type_traits
+#usr/include/c++/4.9.3/tuple
+#usr/include/c++/4.9.3/type_traits
+#usr/include/c++/4.9.3/typeindex
+#usr/include/c++/4.9.3/typeinfo
+#usr/include/c++/4.9.3/unordered_map
+#usr/include/c++/4.9.3/unordered_set
+#usr/include/c++/4.9.3/utility
+#usr/include/c++/4.9.3/valarray
+#usr/include/c++/4.9.3/vector
 #usr/lib/gcc
 #usr/lib/gcc/i586-pc-linux-gnu
-#usr/lib/gcc/i586-pc-linux-gnu/4.4.7
-#usr/lib/gcc/i586-pc-linux-gnu/4.4.7/cc1
-#usr/lib/gcc/i586-pc-linux-gnu/4.4.7/cc1plus
-#usr/lib/gcc/i586-pc-linux-gnu/4.4.7/collect2
-#usr/lib/gcc/i586-pc-linux-gnu/4.4.7/crtbegin.o
-#usr/lib/gcc/i586-pc-linux-gnu/4.4.7/crtbeginS.o
-#usr/lib/gcc/i586-pc-linux-gnu/4.4.7/crtbeginT.o
-#usr/lib/gcc/i586-pc-linux-gnu/4.4.7/crtend.o
-#usr/lib/gcc/i586-pc-linux-gnu/4.4.7/crtendS.o
-#usr/lib/gcc/i586-pc-linux-gnu/4.4.7/crtfastmath.o
-#usr/lib/gcc/i586-pc-linux-gnu/4.4.7/crtprec32.o
-#usr/lib/gcc/i586-pc-linux-gnu/4.4.7/crtprec64.o
-#usr/lib/gcc/i586-pc-linux-gnu/4.4.7/crtprec80.o
-#usr/lib/gcc/i586-pc-linux-gnu/4.4.7/finclude
-#usr/lib/gcc/i586-pc-linux-gnu/4.4.7/include
-#usr/lib/gcc/i586-pc-linux-gnu/4.4.7/include-fixed
-#usr/lib/gcc/i586-pc-linux-gnu/4.4.7/include-fixed/README
-#usr/lib/gcc/i586-pc-linux-gnu/4.4.7/include-fixed/limits.h
-#usr/lib/gcc/i586-pc-linux-gnu/4.4.7/include-fixed/syslimits.h
-#usr/lib/gcc/i586-pc-linux-gnu/4.4.7/include/ammintrin.h
-#usr/lib/gcc/i586-pc-linux-gnu/4.4.7/include/avxintrin.h
-#usr/lib/gcc/i586-pc-linux-gnu/4.4.7/include/bmmintrin.h
-#usr/lib/gcc/i586-pc-linux-gnu/4.4.7/include/cpuid.h
-#usr/lib/gcc/i586-pc-linux-gnu/4.4.7/include/cross-stdarg.h
-#usr/lib/gcc/i586-pc-linux-gnu/4.4.7/include/emmintrin.h
-#usr/lib/gcc/i586-pc-linux-gnu/4.4.7/include/float.h
-#usr/lib/gcc/i586-pc-linux-gnu/4.4.7/include/immintrin.h
-#usr/lib/gcc/i586-pc-linux-gnu/4.4.7/include/iso646.h
-#usr/lib/gcc/i586-pc-linux-gnu/4.4.7/include/mf-runtime.h
-#usr/lib/gcc/i586-pc-linux-gnu/4.4.7/include/mm3dnow.h
-#usr/lib/gcc/i586-pc-linux-gnu/4.4.7/include/mm_malloc.h
-#usr/lib/gcc/i586-pc-linux-gnu/4.4.7/include/mmintrin-common.h
-#usr/lib/gcc/i586-pc-linux-gnu/4.4.7/include/mmintrin.h
-#usr/lib/gcc/i586-pc-linux-gnu/4.4.7/include/nmmintrin.h
-#usr/lib/gcc/i586-pc-linux-gnu/4.4.7/include/omp.h
-#usr/lib/gcc/i586-pc-linux-gnu/4.4.7/include/pmmintrin.h
-#usr/lib/gcc/i586-pc-linux-gnu/4.4.7/include/smmintrin.h
-#usr/lib/gcc/i586-pc-linux-gnu/4.4.7/include/ssp
-#usr/lib/gcc/i586-pc-linux-gnu/4.4.7/include/ssp/ssp.h
-#usr/lib/gcc/i586-pc-linux-gnu/4.4.7/include/ssp/stdio.h
-#usr/lib/gcc/i586-pc-linux-gnu/4.4.7/include/ssp/string.h
-#usr/lib/gcc/i586-pc-linux-gnu/4.4.7/include/ssp/unistd.h
-#usr/lib/gcc/i586-pc-linux-gnu/4.4.7/include/stdarg.h
-#usr/lib/gcc/i586-pc-linux-gnu/4.4.7/include/stdbool.h
-#usr/lib/gcc/i586-pc-linux-gnu/4.4.7/include/stddef.h
-#usr/lib/gcc/i586-pc-linux-gnu/4.4.7/include/stdfix.h
-#usr/lib/gcc/i586-pc-linux-gnu/4.4.7/include/tmmintrin.h
-#usr/lib/gcc/i586-pc-linux-gnu/4.4.7/include/unwind.h
-#usr/lib/gcc/i586-pc-linux-gnu/4.4.7/include/varargs.h
-#usr/lib/gcc/i586-pc-linux-gnu/4.4.7/include/wmmintrin.h
-#usr/lib/gcc/i586-pc-linux-gnu/4.4.7/include/x86intrin.h
-#usr/lib/gcc/i586-pc-linux-gnu/4.4.7/include/xmmintrin.h
-#usr/lib/gcc/i586-pc-linux-gnu/4.4.7/install-tools
-#usr/lib/gcc/i586-pc-linux-gnu/4.4.7/install-tools/fixinc.sh
-#usr/lib/gcc/i586-pc-linux-gnu/4.4.7/install-tools/fixinc_list
-#usr/lib/gcc/i586-pc-linux-gnu/4.4.7/install-tools/fixincl
-#usr/lib/gcc/i586-pc-linux-gnu/4.4.7/install-tools/gsyslimits.h
-#usr/lib/gcc/i586-pc-linux-gnu/4.4.7/install-tools/include
-#usr/lib/gcc/i586-pc-linux-gnu/4.4.7/install-tools/include/README
-#usr/lib/gcc/i586-pc-linux-gnu/4.4.7/install-tools/include/limits.h
-#usr/lib/gcc/i586-pc-linux-gnu/4.4.7/install-tools/macro_list
-#usr/lib/gcc/i586-pc-linux-gnu/4.4.7/install-tools/mkheaders
-#usr/lib/gcc/i586-pc-linux-gnu/4.4.7/install-tools/mkheaders.conf
-#usr/lib/gcc/i586-pc-linux-gnu/4.4.7/install-tools/mkinstalldirs
-#usr/lib/gcc/i586-pc-linux-gnu/4.4.7/libgcc.a
-#usr/lib/gcc/i586-pc-linux-gnu/4.4.7/libgcc_eh.a
-#usr/lib/gcc/i586-pc-linux-gnu/4.4.7/libgcov.a
+#usr/lib/gcc/i586-pc-linux-gnu/4.9.3
+#usr/lib/gcc/i586-pc-linux-gnu/4.9.3/cc1
+#usr/lib/gcc/i586-pc-linux-gnu/4.9.3/cc1plus
+#usr/lib/gcc/i586-pc-linux-gnu/4.9.3/collect2
+#usr/lib/gcc/i586-pc-linux-gnu/4.9.3/crtbegin.o
+#usr/lib/gcc/i586-pc-linux-gnu/4.9.3/crtbeginS.o
+#usr/lib/gcc/i586-pc-linux-gnu/4.9.3/crtbeginT.o
+#usr/lib/gcc/i586-pc-linux-gnu/4.9.3/crtend.o
+#usr/lib/gcc/i586-pc-linux-gnu/4.9.3/crtendS.o
+#usr/lib/gcc/i586-pc-linux-gnu/4.9.3/crtfastmath.o
+#usr/lib/gcc/i586-pc-linux-gnu/4.9.3/crtprec32.o
+#usr/lib/gcc/i586-pc-linux-gnu/4.9.3/crtprec64.o
+#usr/lib/gcc/i586-pc-linux-gnu/4.9.3/crtprec80.o
+#usr/lib/gcc/i586-pc-linux-gnu/4.9.3/finclude
+#usr/lib/gcc/i586-pc-linux-gnu/4.9.3/include
+#usr/lib/gcc/i586-pc-linux-gnu/4.9.3/include-fixed
+#usr/lib/gcc/i586-pc-linux-gnu/4.9.3/include-fixed/README
+#usr/lib/gcc/i586-pc-linux-gnu/4.9.3/include-fixed/limits.h
+#usr/lib/gcc/i586-pc-linux-gnu/4.9.3/include-fixed/syslimits.h
+#usr/lib/gcc/i586-pc-linux-gnu/4.9.3/include/adxintrin.h
+#usr/lib/gcc/i586-pc-linux-gnu/4.9.3/include/ammintrin.h
+#usr/lib/gcc/i586-pc-linux-gnu/4.9.3/include/avx2intrin.h
+#usr/lib/gcc/i586-pc-linux-gnu/4.9.3/include/avx512cdintrin.h
+#usr/lib/gcc/i586-pc-linux-gnu/4.9.3/include/avx512erintrin.h
+#usr/lib/gcc/i586-pc-linux-gnu/4.9.3/include/avx512fintrin.h
+#usr/lib/gcc/i586-pc-linux-gnu/4.9.3/include/avx512pfintrin.h
+#usr/lib/gcc/i586-pc-linux-gnu/4.9.3/include/avxintrin.h
+#usr/lib/gcc/i586-pc-linux-gnu/4.9.3/include/bmi2intrin.h
+#usr/lib/gcc/i586-pc-linux-gnu/4.9.3/include/bmiintrin.h
+#usr/lib/gcc/i586-pc-linux-gnu/4.9.3/include/bmmintrin.h
+#usr/lib/gcc/i586-pc-linux-gnu/4.9.3/include/cilk
+#usr/lib/gcc/i586-pc-linux-gnu/4.9.3/include/cilk/cilk.h
+#usr/lib/gcc/i586-pc-linux-gnu/4.9.3/include/cilk/cilk_api.h
+#usr/lib/gcc/i586-pc-linux-gnu/4.9.3/include/cilk/cilk_api_linux.h
+#usr/lib/gcc/i586-pc-linux-gnu/4.9.3/include/cilk/cilk_stub.h
+#usr/lib/gcc/i586-pc-linux-gnu/4.9.3/include/cilk/cilk_undocumented.h
+#usr/lib/gcc/i586-pc-linux-gnu/4.9.3/include/cilk/common.h
+#usr/lib/gcc/i586-pc-linux-gnu/4.9.3/include/cilk/holder.h
+#usr/lib/gcc/i586-pc-linux-gnu/4.9.3/include/cilk/hyperobject_base.h
+#usr/lib/gcc/i586-pc-linux-gnu/4.9.3/include/cilk/metaprogramming.h
+#usr/lib/gcc/i586-pc-linux-gnu/4.9.3/include/cilk/reducer.h
+#usr/lib/gcc/i586-pc-linux-gnu/4.9.3/include/cilk/reducer_file.h
+#usr/lib/gcc/i586-pc-linux-gnu/4.9.3/include/cilk/reducer_list.h
+#usr/lib/gcc/i586-pc-linux-gnu/4.9.3/include/cilk/reducer_max.h
+#usr/lib/gcc/i586-pc-linux-gnu/4.9.3/include/cilk/reducer_min.h
+#usr/lib/gcc/i586-pc-linux-gnu/4.9.3/include/cilk/reducer_min_max.h
+#usr/lib/gcc/i586-pc-linux-gnu/4.9.3/include/cilk/reducer_opadd.h
+#usr/lib/gcc/i586-pc-linux-gnu/4.9.3/include/cilk/reducer_opand.h
+#usr/lib/gcc/i586-pc-linux-gnu/4.9.3/include/cilk/reducer_opmul.h
+#usr/lib/gcc/i586-pc-linux-gnu/4.9.3/include/cilk/reducer_opor.h
+#usr/lib/gcc/i586-pc-linux-gnu/4.9.3/include/cilk/reducer_opxor.h
+#usr/lib/gcc/i586-pc-linux-gnu/4.9.3/include/cilk/reducer_ostream.h
+#usr/lib/gcc/i586-pc-linux-gnu/4.9.3/include/cilk/reducer_string.h
+#usr/lib/gcc/i586-pc-linux-gnu/4.9.3/include/cpuid.h
+#usr/lib/gcc/i586-pc-linux-gnu/4.9.3/include/cross-stdarg.h
+#usr/lib/gcc/i586-pc-linux-gnu/4.9.3/include/emmintrin.h
+#usr/lib/gcc/i586-pc-linux-gnu/4.9.3/include/f16cintrin.h
+#usr/lib/gcc/i586-pc-linux-gnu/4.9.3/include/float.h
+#usr/lib/gcc/i586-pc-linux-gnu/4.9.3/include/fma4intrin.h
+#usr/lib/gcc/i586-pc-linux-gnu/4.9.3/include/fmaintrin.h
+#usr/lib/gcc/i586-pc-linux-gnu/4.9.3/include/fxsrintrin.h
+#usr/lib/gcc/i586-pc-linux-gnu/4.9.3/include/ia32intrin.h
+#usr/lib/gcc/i586-pc-linux-gnu/4.9.3/include/immintrin.h
+#usr/lib/gcc/i586-pc-linux-gnu/4.9.3/include/iso646.h
+#usr/lib/gcc/i586-pc-linux-gnu/4.9.3/include/lwpintrin.h
+#usr/lib/gcc/i586-pc-linux-gnu/4.9.3/include/lzcntintrin.h
+#usr/lib/gcc/i586-pc-linux-gnu/4.9.3/include/mm3dnow.h
+#usr/lib/gcc/i586-pc-linux-gnu/4.9.3/include/mm_malloc.h
+#usr/lib/gcc/i586-pc-linux-gnu/4.9.3/include/mmintrin.h
+#usr/lib/gcc/i586-pc-linux-gnu/4.9.3/include/nmmintrin.h
+#usr/lib/gcc/i586-pc-linux-gnu/4.9.3/include/omp.h
+#usr/lib/gcc/i586-pc-linux-gnu/4.9.3/include/pmmintrin.h
+#usr/lib/gcc/i586-pc-linux-gnu/4.9.3/include/popcntintrin.h
+#usr/lib/gcc/i586-pc-linux-gnu/4.9.3/include/prfchwintrin.h
+#usr/lib/gcc/i586-pc-linux-gnu/4.9.3/include/quadmath.h
+#usr/lib/gcc/i586-pc-linux-gnu/4.9.3/include/quadmath_weak.h
+#usr/lib/gcc/i586-pc-linux-gnu/4.9.3/include/rdseedintrin.h
+#usr/lib/gcc/i586-pc-linux-gnu/4.9.3/include/rtmintrin.h
+#usr/lib/gcc/i586-pc-linux-gnu/4.9.3/include/sanitizer
+#usr/lib/gcc/i586-pc-linux-gnu/4.9.3/include/sanitizer/asan_interface.h
+#usr/lib/gcc/i586-pc-linux-gnu/4.9.3/include/sanitizer/common_interface_defs.h
+#usr/lib/gcc/i586-pc-linux-gnu/4.9.3/include/sanitizer/lsan_interface.h
+#usr/lib/gcc/i586-pc-linux-gnu/4.9.3/include/shaintrin.h
+#usr/lib/gcc/i586-pc-linux-gnu/4.9.3/include/smmintrin.h
+#usr/lib/gcc/i586-pc-linux-gnu/4.9.3/include/ssp
+#usr/lib/gcc/i586-pc-linux-gnu/4.9.3/include/ssp/ssp.h
+#usr/lib/gcc/i586-pc-linux-gnu/4.9.3/include/ssp/stdio.h
+#usr/lib/gcc/i586-pc-linux-gnu/4.9.3/include/ssp/string.h
+#usr/lib/gcc/i586-pc-linux-gnu/4.9.3/include/ssp/unistd.h
+#usr/lib/gcc/i586-pc-linux-gnu/4.9.3/include/stdalign.h
+#usr/lib/gcc/i586-pc-linux-gnu/4.9.3/include/stdarg.h
+#usr/lib/gcc/i586-pc-linux-gnu/4.9.3/include/stdatomic.h
+#usr/lib/gcc/i586-pc-linux-gnu/4.9.3/include/stdbool.h
+#usr/lib/gcc/i586-pc-linux-gnu/4.9.3/include/stddef.h
+#usr/lib/gcc/i586-pc-linux-gnu/4.9.3/include/stdfix.h
+#usr/lib/gcc/i586-pc-linux-gnu/4.9.3/include/stdint-gcc.h
+#usr/lib/gcc/i586-pc-linux-gnu/4.9.3/include/stdint.h
+#usr/lib/gcc/i586-pc-linux-gnu/4.9.3/include/stdnoreturn.h
+#usr/lib/gcc/i586-pc-linux-gnu/4.9.3/include/tbmintrin.h
+#usr/lib/gcc/i586-pc-linux-gnu/4.9.3/include/tmmintrin.h
+#usr/lib/gcc/i586-pc-linux-gnu/4.9.3/include/unwind.h
+#usr/lib/gcc/i586-pc-linux-gnu/4.9.3/include/varargs.h
+#usr/lib/gcc/i586-pc-linux-gnu/4.9.3/include/wmmintrin.h
+#usr/lib/gcc/i586-pc-linux-gnu/4.9.3/include/x86intrin.h
+#usr/lib/gcc/i586-pc-linux-gnu/4.9.3/include/xmmintrin.h
+#usr/lib/gcc/i586-pc-linux-gnu/4.9.3/include/xopintrin.h
+#usr/lib/gcc/i586-pc-linux-gnu/4.9.3/include/xsaveintrin.h
+#usr/lib/gcc/i586-pc-linux-gnu/4.9.3/include/xsaveoptintrin.h
+#usr/lib/gcc/i586-pc-linux-gnu/4.9.3/include/xtestintrin.h
+#usr/lib/gcc/i586-pc-linux-gnu/4.9.3/install-tools
+#usr/lib/gcc/i586-pc-linux-gnu/4.9.3/install-tools/fixinc.sh
+#usr/lib/gcc/i586-pc-linux-gnu/4.9.3/install-tools/fixinc_list
+#usr/lib/gcc/i586-pc-linux-gnu/4.9.3/install-tools/fixincl
+#usr/lib/gcc/i586-pc-linux-gnu/4.9.3/install-tools/gsyslimits.h
+#usr/lib/gcc/i586-pc-linux-gnu/4.9.3/install-tools/include
+#usr/lib/gcc/i586-pc-linux-gnu/4.9.3/install-tools/include/README
+#usr/lib/gcc/i586-pc-linux-gnu/4.9.3/install-tools/include/limits.h
+#usr/lib/gcc/i586-pc-linux-gnu/4.9.3/install-tools/macro_list
+#usr/lib/gcc/i586-pc-linux-gnu/4.9.3/install-tools/mkheaders
+#usr/lib/gcc/i586-pc-linux-gnu/4.9.3/install-tools/mkheaders.conf
+#usr/lib/gcc/i586-pc-linux-gnu/4.9.3/install-tools/mkinstalldirs
+#usr/lib/gcc/i586-pc-linux-gnu/4.9.3/libgcc.a
+#usr/lib/gcc/i586-pc-linux-gnu/4.9.3/libgcc_eh.a
+#usr/lib/gcc/i586-pc-linux-gnu/4.9.3/libgcov.a
+#usr/lib/gcc/i586-pc-linux-gnu/4.9.3/liblto_plugin.la
+#usr/lib/gcc/i586-pc-linux-gnu/4.9.3/liblto_plugin.so
+#usr/lib/gcc/i586-pc-linux-gnu/4.9.3/liblto_plugin.so.0
+#usr/lib/gcc/i586-pc-linux-gnu/4.9.3/liblto_plugin.so.0.0.0
+#usr/lib/gcc/i586-pc-linux-gnu/4.9.3/lto-wrapper
+#usr/lib/gcc/i586-pc-linux-gnu/4.9.3/lto1
+#usr/lib/gcc/i586-pc-linux-gnu/4.9.3/plugin
+#usr/lib/gcc/i586-pc-linux-gnu/4.9.3/plugin/gengtype
+#usr/lib/gcc/i586-pc-linux-gnu/4.9.3/plugin/gtype.state
+#usr/lib/gcc/i586-pc-linux-gnu/4.9.3/plugin/include
+#usr/lib/gcc/i586-pc-linux-gnu/4.9.3/plugin/include/ada
+#usr/lib/gcc/i586-pc-linux-gnu/4.9.3/plugin/include/ada/gcc-interface
+#usr/lib/gcc/i586-pc-linux-gnu/4.9.3/plugin/include/ada/gcc-interface/ada-tree.def
+#usr/lib/gcc/i586-pc-linux-gnu/4.9.3/plugin/include/alias.h
+#usr/lib/gcc/i586-pc-linux-gnu/4.9.3/plugin/include/all-tree.def
+#usr/lib/gcc/i586-pc-linux-gnu/4.9.3/plugin/include/alloc-pool.h
+#usr/lib/gcc/i586-pc-linux-gnu/4.9.3/plugin/include/ansidecl.h
+#usr/lib/gcc/i586-pc-linux-gnu/4.9.3/plugin/include/attribs.h
+#usr/lib/gcc/i586-pc-linux-gnu/4.9.3/plugin/include/auto-host.h
+#usr/lib/gcc/i586-pc-linux-gnu/4.9.3/plugin/include/b-header-vars
+#usr/lib/gcc/i586-pc-linux-gnu/4.9.3/plugin/include/basic-block.h
+#usr/lib/gcc/i586-pc-linux-gnu/4.9.3/plugin/include/bitmap.h
+#usr/lib/gcc/i586-pc-linux-gnu/4.9.3/plugin/include/builtins.def
+#usr/lib/gcc/i586-pc-linux-gnu/4.9.3/plugin/include/bversion.h
+#usr/lib/gcc/i586-pc-linux-gnu/4.9.3/plugin/include/c-family
+#usr/lib/gcc/i586-pc-linux-gnu/4.9.3/plugin/include/c-family/c-common.def
+#usr/lib/gcc/i586-pc-linux-gnu/4.9.3/plugin/include/c-family/c-common.h
+#usr/lib/gcc/i586-pc-linux-gnu/4.9.3/plugin/include/c-family/c-objc.h
+#usr/lib/gcc/i586-pc-linux-gnu/4.9.3/plugin/include/c-family/c-pragma.h
+#usr/lib/gcc/i586-pc-linux-gnu/4.9.3/plugin/include/c-family/c-pretty-print.h
+#usr/lib/gcc/i586-pc-linux-gnu/4.9.3/plugin/include/c-tree.h
+#usr/lib/gcc/i586-pc-linux-gnu/4.9.3/plugin/include/calls.h
+#usr/lib/gcc/i586-pc-linux-gnu/4.9.3/plugin/include/cfg-flags.def
+#usr/lib/gcc/i586-pc-linux-gnu/4.9.3/plugin/include/cfgexpand.h
+#usr/lib/gcc/i586-pc-linux-gnu/4.9.3/plugin/include/cfghooks.h
+#usr/lib/gcc/i586-pc-linux-gnu/4.9.3/plugin/include/cfgloop.h
+#usr/lib/gcc/i586-pc-linux-gnu/4.9.3/plugin/include/cgraph.h
+#usr/lib/gcc/i586-pc-linux-gnu/4.9.3/plugin/include/cif-code.def
+#usr/lib/gcc/i586-pc-linux-gnu/4.9.3/plugin/include/cilk-builtins.def
+#usr/lib/gcc/i586-pc-linux-gnu/4.9.3/plugin/include/cilkplus.def
+#usr/lib/gcc/i586-pc-linux-gnu/4.9.3/plugin/include/config
+#usr/lib/gcc/i586-pc-linux-gnu/4.9.3/plugin/include/config.h
+#usr/lib/gcc/i586-pc-linux-gnu/4.9.3/plugin/include/config/dbxelf.h
+#usr/lib/gcc/i586-pc-linux-gnu/4.9.3/plugin/include/config/elfos.h
+#usr/lib/gcc/i586-pc-linux-gnu/4.9.3/plugin/include/config/glibc-stdint.h
+#usr/lib/gcc/i586-pc-linux-gnu/4.9.3/plugin/include/config/gnu-user.h
+#usr/lib/gcc/i586-pc-linux-gnu/4.9.3/plugin/include/config/i386
+#usr/lib/gcc/i586-pc-linux-gnu/4.9.3/plugin/include/config/i386/att.h
+#usr/lib/gcc/i586-pc-linux-gnu/4.9.3/plugin/include/config/i386/gnu-user-common.h
+#usr/lib/gcc/i586-pc-linux-gnu/4.9.3/plugin/include/config/i386/gnu-user.h
+#usr/lib/gcc/i586-pc-linux-gnu/4.9.3/plugin/include/config/i386/i386-opts.h
+#usr/lib/gcc/i586-pc-linux-gnu/4.9.3/plugin/include/config/i386/i386-protos.h
+#usr/lib/gcc/i586-pc-linux-gnu/4.9.3/plugin/include/config/i386/i386.h
+#usr/lib/gcc/i586-pc-linux-gnu/4.9.3/plugin/include/config/i386/linux-common.h
+#usr/lib/gcc/i586-pc-linux-gnu/4.9.3/plugin/include/config/i386/linux.h
+#usr/lib/gcc/i586-pc-linux-gnu/4.9.3/plugin/include/config/i386/stringop.def
+#usr/lib/gcc/i586-pc-linux-gnu/4.9.3/plugin/include/config/i386/unix.h
+#usr/lib/gcc/i586-pc-linux-gnu/4.9.3/plugin/include/config/i386/x86-tune.def
+#usr/lib/gcc/i586-pc-linux-gnu/4.9.3/plugin/include/config/initfini-array.h
+#usr/lib/gcc/i586-pc-linux-gnu/4.9.3/plugin/include/config/linux-android.h
+#usr/lib/gcc/i586-pc-linux-gnu/4.9.3/plugin/include/config/linux-protos.h
+#usr/lib/gcc/i586-pc-linux-gnu/4.9.3/plugin/include/config/linux.h
+#usr/lib/gcc/i586-pc-linux-gnu/4.9.3/plugin/include/config/vxworks-dummy.h
+#usr/lib/gcc/i586-pc-linux-gnu/4.9.3/plugin/include/configargs.h
+#usr/lib/gcc/i586-pc-linux-gnu/4.9.3/plugin/include/context.h
+#usr/lib/gcc/i586-pc-linux-gnu/4.9.3/plugin/include/coretypes.h
+#usr/lib/gcc/i586-pc-linux-gnu/4.9.3/plugin/include/cp
+#usr/lib/gcc/i586-pc-linux-gnu/4.9.3/plugin/include/cp/cp-tree.def
+#usr/lib/gcc/i586-pc-linux-gnu/4.9.3/plugin/include/cp/cp-tree.h
+#usr/lib/gcc/i586-pc-linux-gnu/4.9.3/plugin/include/cp/cxx-pretty-print.h
+#usr/lib/gcc/i586-pc-linux-gnu/4.9.3/plugin/include/cp/name-lookup.h
+#usr/lib/gcc/i586-pc-linux-gnu/4.9.3/plugin/include/cp/type-utils.h
+#usr/lib/gcc/i586-pc-linux-gnu/4.9.3/plugin/include/cppdefault.h
+#usr/lib/gcc/i586-pc-linux-gnu/4.9.3/plugin/include/cpplib.h
+#usr/lib/gcc/i586-pc-linux-gnu/4.9.3/plugin/include/debug.h
+#usr/lib/gcc/i586-pc-linux-gnu/4.9.3/plugin/include/defaults.h
+#usr/lib/gcc/i586-pc-linux-gnu/4.9.3/plugin/include/df.h
+#usr/lib/gcc/i586-pc-linux-gnu/4.9.3/plugin/include/diagnostic-color.h
+#usr/lib/gcc/i586-pc-linux-gnu/4.9.3/plugin/include/diagnostic-core.h
+#usr/lib/gcc/i586-pc-linux-gnu/4.9.3/plugin/include/diagnostic.def
+#usr/lib/gcc/i586-pc-linux-gnu/4.9.3/plugin/include/diagnostic.h
+#usr/lib/gcc/i586-pc-linux-gnu/4.9.3/plugin/include/double-int.h
+#usr/lib/gcc/i586-pc-linux-gnu/4.9.3/plugin/include/dumpfile.h
+#usr/lib/gcc/i586-pc-linux-gnu/4.9.3/plugin/include/emit-rtl.h
+#usr/lib/gcc/i586-pc-linux-gnu/4.9.3/plugin/include/except.h
+#usr/lib/gcc/i586-pc-linux-gnu/4.9.3/plugin/include/filenames.h
+#usr/lib/gcc/i586-pc-linux-gnu/4.9.3/plugin/include/fixed-value.h
+#usr/lib/gcc/i586-pc-linux-gnu/4.9.3/plugin/include/flag-types.h
+#usr/lib/gcc/i586-pc-linux-gnu/4.9.3/plugin/include/flags.h
+#usr/lib/gcc/i586-pc-linux-gnu/4.9.3/plugin/include/fold-const.h
+#usr/lib/gcc/i586-pc-linux-gnu/4.9.3/plugin/include/function.h
+#usr/lib/gcc/i586-pc-linux-gnu/4.9.3/plugin/include/gcc-plugin.h
+#usr/lib/gcc/i586-pc-linux-gnu/4.9.3/plugin/include/gcc-symtab.h
+#usr/lib/gcc/i586-pc-linux-gnu/4.9.3/plugin/include/genrtl.h
+#usr/lib/gcc/i586-pc-linux-gnu/4.9.3/plugin/include/ggc.h
+#usr/lib/gcc/i586-pc-linux-gnu/4.9.3/plugin/include/gimple-builder.h
+#usr/lib/gcc/i586-pc-linux-gnu/4.9.3/plugin/include/gimple-expr.h
+#usr/lib/gcc/i586-pc-linux-gnu/4.9.3/plugin/include/gimple-fold.h
+#usr/lib/gcc/i586-pc-linux-gnu/4.9.3/plugin/include/gimple-iterator.h
+#usr/lib/gcc/i586-pc-linux-gnu/4.9.3/plugin/include/gimple-low.h
+#usr/lib/gcc/i586-pc-linux-gnu/4.9.3/plugin/include/gimple-pretty-print.h
+#usr/lib/gcc/i586-pc-linux-gnu/4.9.3/plugin/include/gimple-ssa.h
+#usr/lib/gcc/i586-pc-linux-gnu/4.9.3/plugin/include/gimple-walk.h
+#usr/lib/gcc/i586-pc-linux-gnu/4.9.3/plugin/include/gimple.def
+#usr/lib/gcc/i586-pc-linux-gnu/4.9.3/plugin/include/gimple.h
+#usr/lib/gcc/i586-pc-linux-gnu/4.9.3/plugin/include/gimplify-me.h
+#usr/lib/gcc/i586-pc-linux-gnu/4.9.3/plugin/include/gimplify.h
+#usr/lib/gcc/i586-pc-linux-gnu/4.9.3/plugin/include/gsstruct.def
+#usr/lib/gcc/i586-pc-linux-gnu/4.9.3/plugin/include/gtm-builtins.def
+#usr/lib/gcc/i586-pc-linux-gnu/4.9.3/plugin/include/gtype-desc.h
+#usr/lib/gcc/i586-pc-linux-gnu/4.9.3/plugin/include/hard-reg-set.h
+#usr/lib/gcc/i586-pc-linux-gnu/4.9.3/plugin/include/hash-table.h
+#usr/lib/gcc/i586-pc-linux-gnu/4.9.3/plugin/include/hashtab.h
+#usr/lib/gcc/i586-pc-linux-gnu/4.9.3/plugin/include/highlev-plugin-common.h
+#usr/lib/gcc/i586-pc-linux-gnu/4.9.3/plugin/include/hwint.h
+#usr/lib/gcc/i586-pc-linux-gnu/4.9.3/plugin/include/incpath.h
+#usr/lib/gcc/i586-pc-linux-gnu/4.9.3/plugin/include/input.h
+#usr/lib/gcc/i586-pc-linux-gnu/4.9.3/plugin/include/insn-codes.h
+#usr/lib/gcc/i586-pc-linux-gnu/4.9.3/plugin/include/insn-constants.h
+#usr/lib/gcc/i586-pc-linux-gnu/4.9.3/plugin/include/insn-flags.h
+#usr/lib/gcc/i586-pc-linux-gnu/4.9.3/plugin/include/insn-modes.h
+#usr/lib/gcc/i586-pc-linux-gnu/4.9.3/plugin/include/insn-notes.def
+#usr/lib/gcc/i586-pc-linux-gnu/4.9.3/plugin/include/internal-fn.def
+#usr/lib/gcc/i586-pc-linux-gnu/4.9.3/plugin/include/internal-fn.h
+#usr/lib/gcc/i586-pc-linux-gnu/4.9.3/plugin/include/intl.h
+#usr/lib/gcc/i586-pc-linux-gnu/4.9.3/plugin/include/ipa-prop.h
+#usr/lib/gcc/i586-pc-linux-gnu/4.9.3/plugin/include/ipa-ref-inline.h
+#usr/lib/gcc/i586-pc-linux-gnu/4.9.3/plugin/include/ipa-ref.h
+#usr/lib/gcc/i586-pc-linux-gnu/4.9.3/plugin/include/ipa-reference.h
+#usr/lib/gcc/i586-pc-linux-gnu/4.9.3/plugin/include/ipa-utils.h
+#usr/lib/gcc/i586-pc-linux-gnu/4.9.3/plugin/include/is-a.h
+#usr/lib/gcc/i586-pc-linux-gnu/4.9.3/plugin/include/java
+#usr/lib/gcc/i586-pc-linux-gnu/4.9.3/plugin/include/java/java-tree.def
+#usr/lib/gcc/i586-pc-linux-gnu/4.9.3/plugin/include/langhooks.h
+#usr/lib/gcc/i586-pc-linux-gnu/4.9.3/plugin/include/libiberty.h
+#usr/lib/gcc/i586-pc-linux-gnu/4.9.3/plugin/include/line-map.h
+#usr/lib/gcc/i586-pc-linux-gnu/4.9.3/plugin/include/machmode.h
+#usr/lib/gcc/i586-pc-linux-gnu/4.9.3/plugin/include/md5.h
+#usr/lib/gcc/i586-pc-linux-gnu/4.9.3/plugin/include/mode-classes.def
+#usr/lib/gcc/i586-pc-linux-gnu/4.9.3/plugin/include/objc
+#usr/lib/gcc/i586-pc-linux-gnu/4.9.3/plugin/include/objc/objc-tree.def
+#usr/lib/gcc/i586-pc-linux-gnu/4.9.3/plugin/include/obstack.h
+#usr/lib/gcc/i586-pc-linux-gnu/4.9.3/plugin/include/omp-builtins.def
+#usr/lib/gcc/i586-pc-linux-gnu/4.9.3/plugin/include/options.h
+#usr/lib/gcc/i586-pc-linux-gnu/4.9.3/plugin/include/opts.h
+#usr/lib/gcc/i586-pc-linux-gnu/4.9.3/plugin/include/output.h
+#usr/lib/gcc/i586-pc-linux-gnu/4.9.3/plugin/include/params.def
+#usr/lib/gcc/i586-pc-linux-gnu/4.9.3/plugin/include/params.h
+#usr/lib/gcc/i586-pc-linux-gnu/4.9.3/plugin/include/pass-instances.def
+#usr/lib/gcc/i586-pc-linux-gnu/4.9.3/plugin/include/pass_manager.h
+#usr/lib/gcc/i586-pc-linux-gnu/4.9.3/plugin/include/plugin-api.h
+#usr/lib/gcc/i586-pc-linux-gnu/4.9.3/plugin/include/plugin-version.h
+#usr/lib/gcc/i586-pc-linux-gnu/4.9.3/plugin/include/plugin.def
+#usr/lib/gcc/i586-pc-linux-gnu/4.9.3/plugin/include/plugin.h
+#usr/lib/gcc/i586-pc-linux-gnu/4.9.3/plugin/include/pointer-set.h
+#usr/lib/gcc/i586-pc-linux-gnu/4.9.3/plugin/include/predict.def
+#usr/lib/gcc/i586-pc-linux-gnu/4.9.3/plugin/include/predict.h
+#usr/lib/gcc/i586-pc-linux-gnu/4.9.3/plugin/include/prefix.h
+#usr/lib/gcc/i586-pc-linux-gnu/4.9.3/plugin/include/pretty-print.h
+#usr/lib/gcc/i586-pc-linux-gnu/4.9.3/plugin/include/print-rtl.h
+#usr/lib/gcc/i586-pc-linux-gnu/4.9.3/plugin/include/print-tree.h
+#usr/lib/gcc/i586-pc-linux-gnu/4.9.3/plugin/include/real.h
+#usr/lib/gcc/i586-pc-linux-gnu/4.9.3/plugin/include/realmpfr.h
+#usr/lib/gcc/i586-pc-linux-gnu/4.9.3/plugin/include/reg-notes.def
+#usr/lib/gcc/i586-pc-linux-gnu/4.9.3/plugin/include/regset.h
+#usr/lib/gcc/i586-pc-linux-gnu/4.9.3/plugin/include/resource.h
+#usr/lib/gcc/i586-pc-linux-gnu/4.9.3/plugin/include/rtl.def
+#usr/lib/gcc/i586-pc-linux-gnu/4.9.3/plugin/include/rtl.h
+#usr/lib/gcc/i586-pc-linux-gnu/4.9.3/plugin/include/safe-ctype.h
+#usr/lib/gcc/i586-pc-linux-gnu/4.9.3/plugin/include/sanitizer.def
+#usr/lib/gcc/i586-pc-linux-gnu/4.9.3/plugin/include/sbitmap.h
+#usr/lib/gcc/i586-pc-linux-gnu/4.9.3/plugin/include/splay-tree.h
+#usr/lib/gcc/i586-pc-linux-gnu/4.9.3/plugin/include/ssa-iterators.h
+#usr/lib/gcc/i586-pc-linux-gnu/4.9.3/plugin/include/statistics.h
+#usr/lib/gcc/i586-pc-linux-gnu/4.9.3/plugin/include/stmt.h
+#usr/lib/gcc/i586-pc-linux-gnu/4.9.3/plugin/include/stor-layout.h
+#usr/lib/gcc/i586-pc-linux-gnu/4.9.3/plugin/include/stringpool.h
+#usr/lib/gcc/i586-pc-linux-gnu/4.9.3/plugin/include/symtab.h
+#usr/lib/gcc/i586-pc-linux-gnu/4.9.3/plugin/include/sync-builtins.def
+#usr/lib/gcc/i586-pc-linux-gnu/4.9.3/plugin/include/system.h
+#usr/lib/gcc/i586-pc-linux-gnu/4.9.3/plugin/include/target-hooks-macros.h
+#usr/lib/gcc/i586-pc-linux-gnu/4.9.3/plugin/include/target.def
+#usr/lib/gcc/i586-pc-linux-gnu/4.9.3/plugin/include/target.h
+#usr/lib/gcc/i586-pc-linux-gnu/4.9.3/plugin/include/timevar.def
+#usr/lib/gcc/i586-pc-linux-gnu/4.9.3/plugin/include/timevar.h
+#usr/lib/gcc/i586-pc-linux-gnu/4.9.3/plugin/include/tm-preds.h
+#usr/lib/gcc/i586-pc-linux-gnu/4.9.3/plugin/include/tm.h
+#usr/lib/gcc/i586-pc-linux-gnu/4.9.3/plugin/include/tm_p.h
+#usr/lib/gcc/i586-pc-linux-gnu/4.9.3/plugin/include/toplev.h
+#usr/lib/gcc/i586-pc-linux-gnu/4.9.3/plugin/include/tree-cfg.h
+#usr/lib/gcc/i586-pc-linux-gnu/4.9.3/plugin/include/tree-cfgcleanup.h
+#usr/lib/gcc/i586-pc-linux-gnu/4.9.3/plugin/include/tree-check.h
+#usr/lib/gcc/i586-pc-linux-gnu/4.9.3/plugin/include/tree-core.h
+#usr/lib/gcc/i586-pc-linux-gnu/4.9.3/plugin/include/tree-dfa.h
+#usr/lib/gcc/i586-pc-linux-gnu/4.9.3/plugin/include/tree-dump.h
+#usr/lib/gcc/i586-pc-linux-gnu/4.9.3/plugin/include/tree-eh.h
+#usr/lib/gcc/i586-pc-linux-gnu/4.9.3/plugin/include/tree-hasher.h
+#usr/lib/gcc/i586-pc-linux-gnu/4.9.3/plugin/include/tree-inline.h
+#usr/lib/gcc/i586-pc-linux-gnu/4.9.3/plugin/include/tree-into-ssa.h
+#usr/lib/gcc/i586-pc-linux-gnu/4.9.3/plugin/include/tree-iterator.h
+#usr/lib/gcc/i586-pc-linux-gnu/4.9.3/plugin/include/tree-nested.h
+#usr/lib/gcc/i586-pc-linux-gnu/4.9.3/plugin/include/tree-object-size.h
+#usr/lib/gcc/i586-pc-linux-gnu/4.9.3/plugin/include/tree-outof-ssa.h
+#usr/lib/gcc/i586-pc-linux-gnu/4.9.3/plugin/include/tree-parloops.h
+#usr/lib/gcc/i586-pc-linux-gnu/4.9.3/plugin/include/tree-pass.h
+#usr/lib/gcc/i586-pc-linux-gnu/4.9.3/plugin/include/tree-phinodes.h
+#usr/lib/gcc/i586-pc-linux-gnu/4.9.3/plugin/include/tree-pretty-print.h
+#usr/lib/gcc/i586-pc-linux-gnu/4.9.3/plugin/include/tree-ssa-address.h
+#usr/lib/gcc/i586-pc-linux-gnu/4.9.3/plugin/include/tree-ssa-alias.h
+#usr/lib/gcc/i586-pc-linux-gnu/4.9.3/plugin/include/tree-ssa-coalesce.h
+#usr/lib/gcc/i586-pc-linux-gnu/4.9.3/plugin/include/tree-ssa-dom.h
+#usr/lib/gcc/i586-pc-linux-gnu/4.9.3/plugin/include/tree-ssa-loop-ivopts.h
+#usr/lib/gcc/i586-pc-linux-gnu/4.9.3/plugin/include/tree-ssa-loop-manip.h
+#usr/lib/gcc/i586-pc-linux-gnu/4.9.3/plugin/include/tree-ssa-loop-niter.h
+#usr/lib/gcc/i586-pc-linux-gnu/4.9.3/plugin/include/tree-ssa-loop.h
+#usr/lib/gcc/i586-pc-linux-gnu/4.9.3/plugin/include/tree-ssa-operands.h
+#usr/lib/gcc/i586-pc-linux-gnu/4.9.3/plugin/include/tree-ssa-sccvn.h
+#usr/lib/gcc/i586-pc-linux-gnu/4.9.3/plugin/include/tree-ssa-ter.h
+#usr/lib/gcc/i586-pc-linux-gnu/4.9.3/plugin/include/tree-ssa-threadedge.h
+#usr/lib/gcc/i586-pc-linux-gnu/4.9.3/plugin/include/tree-ssa-threadupdate.h
+#usr/lib/gcc/i586-pc-linux-gnu/4.9.3/plugin/include/tree-ssa.h
+#usr/lib/gcc/i586-pc-linux-gnu/4.9.3/plugin/include/tree-ssanames.h
+#usr/lib/gcc/i586-pc-linux-gnu/4.9.3/plugin/include/tree.def
+#usr/lib/gcc/i586-pc-linux-gnu/4.9.3/plugin/include/tree.h
+#usr/lib/gcc/i586-pc-linux-gnu/4.9.3/plugin/include/treestruct.def
+#usr/lib/gcc/i586-pc-linux-gnu/4.9.3/plugin/include/varasm.h
+#usr/lib/gcc/i586-pc-linux-gnu/4.9.3/plugin/include/vec.h
+#usr/lib/gcc/i586-pc-linux-gnu/4.9.3/plugin/include/version.h
+#usr/lib/libasan.a
+#usr/lib/libasan.la
+#usr/lib/libasan.so
+usr/lib/libasan.so.1
+usr/lib/libasan.so.1.0.0
+usr/lib/libasan_preinit.o
+#usr/lib/libatomic.a
+#usr/lib/libatomic.la
+usr/lib/libatomic.so
+usr/lib/libatomic.so.1
+usr/lib/libatomic.so.1.1.0
+#usr/lib/libcilkrts.a
+#usr/lib/libcilkrts.la
+#usr/lib/libcilkrts.so
+usr/lib/libcilkrts.so.5
+usr/lib/libcilkrts.so.5.0.0
+#usr/lib/libcilkrts.spec
 #usr/lib/libgomp.a
 #usr/lib/libgomp.la
 #usr/lib/libgomp.so
 usr/lib/libgomp.so.1
 usr/lib/libgomp.so.1.0.0
 #usr/lib/libgomp.spec
-#usr/lib/libmudflap.a
-#usr/lib/libmudflap.la
-#usr/lib/libmudflap.so
-usr/lib/libmudflap.so.0
-usr/lib/libmudflap.so.0.0.0
-#usr/lib/libmudflapth.a
-#usr/lib/libmudflapth.la
-#usr/lib/libmudflapth.so
-usr/lib/libmudflapth.so.0
-usr/lib/libmudflapth.so.0.0.0
+#usr/lib/libitm.a
+#usr/lib/libitm.la
+#usr/lib/libitm.so
+usr/lib/libitm.so.1
+usr/lib/libitm.so.1.0.0
+#usr/lib/libitm.spec
+#usr/lib/libquadmath.a
+#usr/lib/libquadmath.la
+#usr/lib/libquadmath.so
+usr/lib/libquadmath.so.0
+usr/lib/libquadmath.so.0.0.0
+#usr/lib/libsanitizer.spec
 #usr/lib/libssp.a
 #usr/lib/libssp.la
 #usr/lib/libssp.so
@@ -786,16 +1136,39 @@ usr/lib/libssp.so.0.0.0
 #usr/lib/libssp_nonshared.a
 #usr/lib/libssp_nonshared.la
 #usr/lib/libstdc++.a
-usr/lib/libstdc++.so.6.0.13
+usr/lib/libstdc++.so.6.0.20
+#usr/lib/libstdc++.so.6.0.20-gdb.py
 #usr/lib/libsupc++.a
 #usr/lib/libsupc++.la
-#usr/man
-#usr/man/man1
-#usr/man/man1/cpp.1
-#usr/man/man1/g++.1
-#usr/man/man1/gcc.1
-#usr/man/man1/gcov.1
-#usr/man/man7
-#usr/man/man7/fsf-funding.7
-#usr/man/man7/gfdl.7
-#usr/man/man7/gpl.7
+#usr/lib/libubsan.a
+#usr/lib/libubsan.la
+#usr/lib/libubsan.so
+usr/lib/libubsan.so.0
+usr/lib/libubsan.so.0.0.0
+#usr/lib/libvtv.a
+#usr/lib/libvtv.la
+#usr/lib/libvtv.so
+usr/lib/libvtv.so.0
+usr/lib/libvtv.so.0.0.0
+#usr/share/gcc-4.9.3
+#usr/share/gcc-4.9.3/python
+#usr/share/gcc-4.9.3/python/libstdcxx
+#usr/share/gcc-4.9.3/python/libstdcxx/__init__.py
+#usr/share/gcc-4.9.3/python/libstdcxx/v6
+#usr/share/gcc-4.9.3/python/libstdcxx/v6/__init__.py
+#usr/share/gcc-4.9.3/python/libstdcxx/v6/printers.py
+#usr/share/info/cpp.info
+#usr/share/info/cppinternals.info
+#usr/share/info/gcc.info
+#usr/share/info/gccinstall.info
+#usr/share/info/gccint.info
+#usr/share/info/libgomp.info
+#usr/share/info/libitm.info
+#usr/share/info/libquadmath.info
+#usr/share/man/man1/cpp.1
+#usr/share/man/man1/g++.1
+#usr/share/man/man1/gcc.1
+#usr/share/man/man1/gcov.1
+#usr/share/man/man7/fsf-funding.7
+#usr/share/man/man7/gfdl.7
+#usr/share/man/man7/gpl.7
index aabc8a68c3c1695b0e891994bc96001496b4a114..80ae0dd2d762a3fad31bf5613775bb55fc766bd7 100644 (file)
@@ -27,6 +27,7 @@ etc/rc.d/init.d/console
 #etc/rc.d/init.d/cyrus-sasl
 etc/rc.d/init.d/dhcp
 etc/rc.d/init.d/dhcrelay
+#etc/rc.d/init.d/dnsdist
 etc/rc.d/init.d/dnsmasq
 etc/rc.d/init.d/fcron
 #etc/rc.d/init.d/fetchmail
diff --git a/config/rootfiles/common/libmpc b/config/rootfiles/common/libmpc
new file mode 100644 (file)
index 0000000..c8684ce
--- /dev/null
@@ -0,0 +1,7 @@
+#usr/include/mpc.h
+#usr/lib/libmpc.a
+#usr/lib/libmpc.la
+#usr/lib/libmpc.so
+usr/lib/libmpc.so.3
+usr/lib/libmpc.so.3.0.0
+#usr/share/info/mpc.info
diff --git a/config/rootfiles/common/lua b/config/rootfiles/common/lua
new file mode 100644 (file)
index 0000000..15d5995
--- /dev/null
@@ -0,0 +1,14 @@
+usr/bin/lua
+usr/bin/luac
+#usr/include/lauxlib.h
+#usr/include/lua.h
+#usr/include/lua.hpp
+#usr/include/luaconf.h
+#usr/include/lualib.h
+usr/lib/liblua-5.3.so
+#usr/lib/liblua.a
+#usr/lib/liblua.la
+usr/lib/liblua.so
+#usr/lib/pkgconfig/lua.pc
+#usr/share/man/man1/lua.1
+#usr/share/man/man1/luac.1
index 46b3bd9c967078a9cda4d75e2eff69fe7eef0326..da434e92df6f40d3339969cec1b31c09cf6be8e2 100644 (file)
@@ -77,6 +77,8 @@ usr/lib/libtic.so.5.9
 usr/lib/libtinfo.so.5
 usr/lib/libtinfo.so.5.9
 #usr/lib/terminfo
+#usr/man
+#usr/man/man1
 #usr/man/man1/captoinfo.1m
 #usr/man/man1/clear.1
 #usr/man/man1/infocmp.1m
@@ -941,6 +943,7 @@ usr/lib/libtinfo.so.5.9
 #usr/man/man5
 #usr/man/man5/term.5
 #usr/man/man5/terminfo.5
+#usr/man/man7
 #usr/man/man7/term.7
 #usr/share/tabset
 #usr/share/tabset/std
index c6b95a56b91cabe9201c338e5c310020449057ed..fd1262e9bdc531151a003ae0da9faba88e421fe9 100644 (file)
@@ -10,6 +10,7 @@ usr/bin/ntpd
 usr/bin/ntpdate
 usr/bin/ntpdc
 usr/bin/ntpq
+#usr/bin/ntpsnmpd
 usr/bin/ntptime
 usr/bin/ntptrace
 usr/bin/sntp
@@ -276,6 +277,7 @@ usr/bin/update-leap
 #usr/share/man/man1/ntpdc.1
 #usr/share/man/man1/ntpq.1
 #usr/share/man/man1/ntptrace.1
+#usr/share/man/man1/ntpsnmpd.1
 #usr/share/man/man1/sntp.1
 #usr/share/man/man1/update-leap.1
 #usr/share/man/man5/ntp.conf.5
index 5b763fd874749b6f5c04e57f5f1b59d1cc8f3ad3..07446b73b175ef5d7222af27b5cc2db556f3c4ac 100644 (file)
@@ -22,6 +22,7 @@ etc/mime.types
 etc/modprobe.d
 etc/modprobe.d/btmrvl_sdio.conf
 etc/modprobe.d/cfg80211.conf
+etc/modprobe.d/nf_conntrack.conf
 etc/modprobe.d/pcspeaker.conf
 etc/modules.conf
 etc/mtab
index a18ba0a8878fcd3981a530d692140be616c9a468..86b1e27d8b2a078f150a2d3504042c5b21668632 100644 (file)
@@ -113,6 +113,7 @@ usr/share/zoneinfo
 #usr/share/zoneinfo/America/Eirunepe
 #usr/share/zoneinfo/America/El_Salvador
 #usr/share/zoneinfo/America/Ensenada
+#usr/share/zoneinfo/America/Fort_Nelson
 #usr/share/zoneinfo/America/Fort_Wayne
 #usr/share/zoneinfo/America/Fortaleza
 #usr/share/zoneinfo/America/Glace_Bay
@@ -717,6 +718,7 @@ usr/share/zoneinfo
 #usr/share/zoneinfo/posix/America/Eirunepe
 #usr/share/zoneinfo/posix/America/El_Salvador
 #usr/share/zoneinfo/posix/America/Ensenada
+#usr/share/zoneinfo/posix/America/Fort_Nelson
 #usr/share/zoneinfo/posix/America/Fort_Wayne
 #usr/share/zoneinfo/posix/America/Fortaleza
 #usr/share/zoneinfo/posix/America/Glace_Bay
@@ -1321,6 +1323,7 @@ usr/share/zoneinfo
 #usr/share/zoneinfo/right/America/Eirunepe
 #usr/share/zoneinfo/right/America/El_Salvador
 #usr/share/zoneinfo/right/America/Ensenada
+#usr/share/zoneinfo/right/America/Fort_Nelson
 #usr/share/zoneinfo/right/America/Fort_Wayne
 #usr/share/zoneinfo/right/America/Fortaleza
 #usr/share/zoneinfo/right/America/Glace_Bay
index ce6a6fe4c27f180b0643f2e082e2028f62983143..b1f819c9cf2698f31940753edf83a3358644c6ac 100644 (file)
 #usr/lib/ldscripts/i386linux.xn
 #usr/lib/ldscripts/i386linux.xr
 #usr/lib/ldscripts/i386linux.xu
-#usr/lib/libbfd-2.22.so
+#usr/lib/libbfd-2.24.so
 #usr/lib/libbfd.a
 #usr/lib/libbfd.la
 #usr/lib/libbfd.so
 #usr/lib/libiberty.a
-#usr/lib/libopcodes-2.22.so
+#usr/lib/libopcodes-2.24.so
 #usr/lib/libopcodes.a
 #usr/lib/libopcodes.la
 #usr/lib/libopcodes.so
index 3c1a63f74d30070d92e6cedb26ee0206cd2f844d..e378d930bcf010be0f64ec3879df56d90f11718d 100644 (file)
 #usr/bin/cpp
 #usr/bin/g++
 #usr/bin/gcc
-#usr/bin/gccbug
+#usr/bin/gcc-ar
+#usr/bin/gcc-nm
+#usr/bin/gcc-ranlib
 #usr/bin/gcov
 #usr/bin/x86_64-unknown-linux-gnu-c++
 #usr/bin/x86_64-unknown-linux-gnu-g++
 #usr/bin/x86_64-unknown-linux-gnu-gcc
-#usr/bin/x86_64-unknown-linux-gnu-gcc-4.4.7
+#usr/bin/x86_64-unknown-linux-gnu-gcc-4.9.3
+#usr/bin/x86_64-unknown-linux-gnu-gcc-ar
+#usr/bin/x86_64-unknown-linux-gnu-gcc-nm
+#usr/bin/x86_64-unknown-linux-gnu-gcc-ranlib
 #usr/include/c++
-#usr/include/c++/4.4.7
-#usr/include/c++/4.4.7/algorithm
-#usr/include/c++/4.4.7/array
-#usr/include/c++/4.4.7/backward
-#usr/include/c++/4.4.7/backward/auto_ptr.h
-#usr/include/c++/4.4.7/backward/backward_warning.h
-#usr/include/c++/4.4.7/backward/binders.h
-#usr/include/c++/4.4.7/backward/hash_fun.h
-#usr/include/c++/4.4.7/backward/hash_map
-#usr/include/c++/4.4.7/backward/hash_set
-#usr/include/c++/4.4.7/backward/hashtable.h
-#usr/include/c++/4.4.7/backward/strstream
-#usr/include/c++/4.4.7/bits
-#usr/include/c++/4.4.7/bits/algorithmfwd.h
-#usr/include/c++/4.4.7/bits/allocator.h
-#usr/include/c++/4.4.7/bits/atomic_0.h
-#usr/include/c++/4.4.7/bits/atomic_2.h
-#usr/include/c++/4.4.7/bits/atomicfwd_c.h
-#usr/include/c++/4.4.7/bits/atomicfwd_cxx.h
-#usr/include/c++/4.4.7/bits/basic_ios.h
-#usr/include/c++/4.4.7/bits/basic_ios.tcc
-#usr/include/c++/4.4.7/bits/basic_string.h
-#usr/include/c++/4.4.7/bits/basic_string.tcc
-#usr/include/c++/4.4.7/bits/boost_concept_check.h
-#usr/include/c++/4.4.7/bits/char_traits.h
-#usr/include/c++/4.4.7/bits/cmath.tcc
-#usr/include/c++/4.4.7/bits/codecvt.h
-#usr/include/c++/4.4.7/bits/concept_check.h
-#usr/include/c++/4.4.7/bits/cpp_type_traits.h
-#usr/include/c++/4.4.7/bits/deque.tcc
-#usr/include/c++/4.4.7/bits/forward_list.h
-#usr/include/c++/4.4.7/bits/forward_list.tcc
-#usr/include/c++/4.4.7/bits/fstream.tcc
-#usr/include/c++/4.4.7/bits/functexcept.h
-#usr/include/c++/4.4.7/bits/functional_hash.h
-#usr/include/c++/4.4.7/bits/gslice.h
-#usr/include/c++/4.4.7/bits/gslice_array.h
-#usr/include/c++/4.4.7/bits/hashtable.h
-#usr/include/c++/4.4.7/bits/indirect_array.h
-#usr/include/c++/4.4.7/bits/ios_base.h
-#usr/include/c++/4.4.7/bits/istream.tcc
-#usr/include/c++/4.4.7/bits/list.tcc
-#usr/include/c++/4.4.7/bits/locale_classes.h
-#usr/include/c++/4.4.7/bits/locale_classes.tcc
-#usr/include/c++/4.4.7/bits/locale_facets.h
-#usr/include/c++/4.4.7/bits/locale_facets.tcc
-#usr/include/c++/4.4.7/bits/locale_facets_nonio.h
-#usr/include/c++/4.4.7/bits/locale_facets_nonio.tcc
-#usr/include/c++/4.4.7/bits/localefwd.h
-#usr/include/c++/4.4.7/bits/mask_array.h
-#usr/include/c++/4.4.7/bits/move.h
-#usr/include/c++/4.4.7/bits/ostream.tcc
-#usr/include/c++/4.4.7/bits/ostream_insert.h
-#usr/include/c++/4.4.7/bits/postypes.h
-#usr/include/c++/4.4.7/bits/shared_ptr.h
-#usr/include/c++/4.4.7/bits/slice_array.h
-#usr/include/c++/4.4.7/bits/sstream.tcc
-#usr/include/c++/4.4.7/bits/stl_algo.h
-#usr/include/c++/4.4.7/bits/stl_algobase.h
-#usr/include/c++/4.4.7/bits/stl_bvector.h
-#usr/include/c++/4.4.7/bits/stl_construct.h
-#usr/include/c++/4.4.7/bits/stl_deque.h
-#usr/include/c++/4.4.7/bits/stl_function.h
-#usr/include/c++/4.4.7/bits/stl_heap.h
-#usr/include/c++/4.4.7/bits/stl_iterator.h
-#usr/include/c++/4.4.7/bits/stl_iterator_base_funcs.h
-#usr/include/c++/4.4.7/bits/stl_iterator_base_types.h
-#usr/include/c++/4.4.7/bits/stl_list.h
-#usr/include/c++/4.4.7/bits/stl_map.h
-#usr/include/c++/4.4.7/bits/stl_multimap.h
-#usr/include/c++/4.4.7/bits/stl_multiset.h
-#usr/include/c++/4.4.7/bits/stl_numeric.h
-#usr/include/c++/4.4.7/bits/stl_pair.h
-#usr/include/c++/4.4.7/bits/stl_queue.h
-#usr/include/c++/4.4.7/bits/stl_raw_storage_iter.h
-#usr/include/c++/4.4.7/bits/stl_relops.h
-#usr/include/c++/4.4.7/bits/stl_set.h
-#usr/include/c++/4.4.7/bits/stl_stack.h
-#usr/include/c++/4.4.7/bits/stl_tempbuf.h
-#usr/include/c++/4.4.7/bits/stl_tree.h
-#usr/include/c++/4.4.7/bits/stl_uninitialized.h
-#usr/include/c++/4.4.7/bits/stl_vector.h
-#usr/include/c++/4.4.7/bits/stream_iterator.h
-#usr/include/c++/4.4.7/bits/streambuf.tcc
-#usr/include/c++/4.4.7/bits/streambuf_iterator.h
-#usr/include/c++/4.4.7/bits/stringfwd.h
-#usr/include/c++/4.4.7/bits/unique_ptr.h
-#usr/include/c++/4.4.7/bits/valarray_after.h
-#usr/include/c++/4.4.7/bits/valarray_array.h
-#usr/include/c++/4.4.7/bits/valarray_array.tcc
-#usr/include/c++/4.4.7/bits/valarray_before.h
-#usr/include/c++/4.4.7/bits/vector.tcc
-#usr/include/c++/4.4.7/bitset
-#usr/include/c++/4.4.7/c++0x_warning.h
-#usr/include/c++/4.4.7/cassert
-#usr/include/c++/4.4.7/ccomplex
-#usr/include/c++/4.4.7/cctype
-#usr/include/c++/4.4.7/cerrno
-#usr/include/c++/4.4.7/cfenv
-#usr/include/c++/4.4.7/cfloat
-#usr/include/c++/4.4.7/chrono
-#usr/include/c++/4.4.7/cinttypes
-#usr/include/c++/4.4.7/ciso646
-#usr/include/c++/4.4.7/climits
-#usr/include/c++/4.4.7/clocale
-#usr/include/c++/4.4.7/cmath
-#usr/include/c++/4.4.7/complex
-#usr/include/c++/4.4.7/complex.h
-#usr/include/c++/4.4.7/condition_variable
-#usr/include/c++/4.4.7/csetjmp
-#usr/include/c++/4.4.7/csignal
-#usr/include/c++/4.4.7/cstdarg
-#usr/include/c++/4.4.7/cstdatomic
-#usr/include/c++/4.4.7/cstdbool
-#usr/include/c++/4.4.7/cstddef
-#usr/include/c++/4.4.7/cstdint
-#usr/include/c++/4.4.7/cstdio
-#usr/include/c++/4.4.7/cstdlib
-#usr/include/c++/4.4.7/cstring
-#usr/include/c++/4.4.7/ctgmath
-#usr/include/c++/4.4.7/ctime
-#usr/include/c++/4.4.7/cwchar
-#usr/include/c++/4.4.7/cwctype
-#usr/include/c++/4.4.7/cxxabi-forced.h
-#usr/include/c++/4.4.7/cxxabi.h
-#usr/include/c++/4.4.7/debug
-#usr/include/c++/4.4.7/debug/bitset
-#usr/include/c++/4.4.7/debug/debug.h
-#usr/include/c++/4.4.7/debug/deque
-#usr/include/c++/4.4.7/debug/formatter.h
-#usr/include/c++/4.4.7/debug/functions.h
-#usr/include/c++/4.4.7/debug/list
-#usr/include/c++/4.4.7/debug/macros.h
-#usr/include/c++/4.4.7/debug/map
-#usr/include/c++/4.4.7/debug/map.h
-#usr/include/c++/4.4.7/debug/multimap.h
-#usr/include/c++/4.4.7/debug/multiset.h
-#usr/include/c++/4.4.7/debug/safe_base.h
-#usr/include/c++/4.4.7/debug/safe_iterator.h
-#usr/include/c++/4.4.7/debug/safe_iterator.tcc
-#usr/include/c++/4.4.7/debug/safe_sequence.h
-#usr/include/c++/4.4.7/debug/set
-#usr/include/c++/4.4.7/debug/set.h
-#usr/include/c++/4.4.7/debug/string
-#usr/include/c++/4.4.7/debug/unordered_map
-#usr/include/c++/4.4.7/debug/unordered_set
-#usr/include/c++/4.4.7/debug/vector
-#usr/include/c++/4.4.7/deque
-#usr/include/c++/4.4.7/exception
-#usr/include/c++/4.4.7/exception_defines.h
-#usr/include/c++/4.4.7/exception_ptr.h
-#usr/include/c++/4.4.7/ext
-#usr/include/c++/4.4.7/ext/algorithm
-#usr/include/c++/4.4.7/ext/array_allocator.h
-#usr/include/c++/4.4.7/ext/atomicity.h
-#usr/include/c++/4.4.7/ext/bitmap_allocator.h
-#usr/include/c++/4.4.7/ext/cast.h
-#usr/include/c++/4.4.7/ext/codecvt_specializations.h
-#usr/include/c++/4.4.7/ext/concurrence.h
-#usr/include/c++/4.4.7/ext/debug_allocator.h
-#usr/include/c++/4.4.7/ext/enc_filebuf.h
-#usr/include/c++/4.4.7/ext/extptr_allocator.h
-#usr/include/c++/4.4.7/ext/functional
-#usr/include/c++/4.4.7/ext/hash_map
-#usr/include/c++/4.4.7/ext/hash_set
-#usr/include/c++/4.4.7/ext/iterator
-#usr/include/c++/4.4.7/ext/malloc_allocator.h
-#usr/include/c++/4.4.7/ext/memory
-#usr/include/c++/4.4.7/ext/mt_allocator.h
-#usr/include/c++/4.4.7/ext/new_allocator.h
-#usr/include/c++/4.4.7/ext/numeric
-#usr/include/c++/4.4.7/ext/numeric_traits.h
-#usr/include/c++/4.4.7/ext/pb_ds
-#usr/include/c++/4.4.7/ext/pb_ds/assoc_container.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail
-#usr/include/c++/4.4.7/ext/pb_ds/detail/basic_tree_policy
-#usr/include/c++/4.4.7/ext/pb_ds/detail/basic_tree_policy/basic_tree_policy_base.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/basic_tree_policy/null_node_metadata.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/basic_tree_policy/traits.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/basic_types.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/bin_search_tree_
-#usr/include/c++/4.4.7/ext/pb_ds/detail/bin_search_tree_/bin_search_tree_.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/bin_search_tree_/cond_dtor_entry_dealtor.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/bin_search_tree_/cond_key_dtor_entry_dealtor.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/bin_search_tree_/constructors_destructor_fn_imps.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/bin_search_tree_/debug_fn_imps.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/bin_search_tree_/erase_fn_imps.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/bin_search_tree_/find_fn_imps.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/bin_search_tree_/info_fn_imps.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/bin_search_tree_/insert_fn_imps.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/bin_search_tree_/iterators_fn_imps.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/bin_search_tree_/node_iterators.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/bin_search_tree_/point_iterators.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/bin_search_tree_/policy_access_fn_imps.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/bin_search_tree_/r_erase_fn_imps.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/bin_search_tree_/rotate_fn_imps.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/bin_search_tree_/split_join_fn_imps.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/bin_search_tree_/traits.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/binary_heap_
-#usr/include/c++/4.4.7/ext/pb_ds/detail/binary_heap_/binary_heap_.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/binary_heap_/const_iterator.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/binary_heap_/const_point_iterator.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/binary_heap_/constructors_destructor_fn_imps.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/binary_heap_/debug_fn_imps.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/binary_heap_/entry_cmp.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/binary_heap_/entry_pred.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/binary_heap_/erase_fn_imps.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/binary_heap_/find_fn_imps.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/binary_heap_/info_fn_imps.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/binary_heap_/insert_fn_imps.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/binary_heap_/iterators_fn_imps.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/binary_heap_/policy_access_fn_imps.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/binary_heap_/resize_policy.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/binary_heap_/split_join_fn_imps.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/binary_heap_/trace_fn_imps.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/binomial_heap_
-#usr/include/c++/4.4.7/ext/pb_ds/detail/binomial_heap_/binomial_heap_.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/binomial_heap_/constructors_destructor_fn_imps.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/binomial_heap_/debug_fn_imps.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/binomial_heap_base_
-#usr/include/c++/4.4.7/ext/pb_ds/detail/binomial_heap_base_/binomial_heap_base_.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/binomial_heap_base_/constructors_destructor_fn_imps.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/binomial_heap_base_/debug_fn_imps.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/binomial_heap_base_/erase_fn_imps.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/binomial_heap_base_/find_fn_imps.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/binomial_heap_base_/insert_fn_imps.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/binomial_heap_base_/split_join_fn_imps.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/cc_hash_table_map_
-#usr/include/c++/4.4.7/ext/pb_ds/detail/cc_hash_table_map_/cc_ht_map_.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/cc_hash_table_map_/cmp_fn_imps.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/cc_hash_table_map_/cond_key_dtor_entry_dealtor.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/cc_hash_table_map_/constructor_destructor_fn_imps.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/cc_hash_table_map_/constructor_destructor_no_store_hash_fn_imps.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/cc_hash_table_map_/constructor_destructor_store_hash_fn_imps.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/cc_hash_table_map_/debug_fn_imps.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/cc_hash_table_map_/debug_no_store_hash_fn_imps.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/cc_hash_table_map_/debug_store_hash_fn_imps.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/cc_hash_table_map_/entry_list_fn_imps.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/cc_hash_table_map_/erase_fn_imps.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/cc_hash_table_map_/erase_no_store_hash_fn_imps.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/cc_hash_table_map_/erase_store_hash_fn_imps.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/cc_hash_table_map_/find_fn_imps.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/cc_hash_table_map_/find_store_hash_fn_imps.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/cc_hash_table_map_/info_fn_imps.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/cc_hash_table_map_/insert_fn_imps.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/cc_hash_table_map_/insert_no_store_hash_fn_imps.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/cc_hash_table_map_/insert_store_hash_fn_imps.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/cc_hash_table_map_/iterators_fn_imps.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/cc_hash_table_map_/policy_access_fn_imps.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/cc_hash_table_map_/resize_fn_imps.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/cc_hash_table_map_/resize_no_store_hash_fn_imps.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/cc_hash_table_map_/resize_store_hash_fn_imps.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/cc_hash_table_map_/size_fn_imps.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/cc_hash_table_map_/standard_policies.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/cc_hash_table_map_/trace_fn_imps.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/cond_dealtor.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/constructors_destructor_fn_imps.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/container_base_dispatch.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/debug_map_base.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/eq_fn
-#usr/include/c++/4.4.7/ext/pb_ds/detail/eq_fn/eq_by_less.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/eq_fn/hash_eq_fn.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/gp_hash_table_map_
-#usr/include/c++/4.4.7/ext/pb_ds/detail/gp_hash_table_map_/constructor_destructor_fn_imps.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/gp_hash_table_map_/constructor_destructor_no_store_hash_fn_imps.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/gp_hash_table_map_/constructor_destructor_store_hash_fn_imps.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/gp_hash_table_map_/debug_fn_imps.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/gp_hash_table_map_/debug_no_store_hash_fn_imps.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/gp_hash_table_map_/debug_store_hash_fn_imps.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/gp_hash_table_map_/erase_fn_imps.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/gp_hash_table_map_/erase_no_store_hash_fn_imps.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/gp_hash_table_map_/erase_store_hash_fn_imps.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/gp_hash_table_map_/find_fn_imps.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/gp_hash_table_map_/find_no_store_hash_fn_imps.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/gp_hash_table_map_/find_store_hash_fn_imps.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/gp_hash_table_map_/gp_ht_map_.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/gp_hash_table_map_/info_fn_imps.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/gp_hash_table_map_/insert_fn_imps.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/gp_hash_table_map_/insert_no_store_hash_fn_imps.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/gp_hash_table_map_/insert_store_hash_fn_imps.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/gp_hash_table_map_/iterator_fn_imps.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/gp_hash_table_map_/policy_access_fn_imps.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/gp_hash_table_map_/resize_fn_imps.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/gp_hash_table_map_/resize_no_store_hash_fn_imps.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/gp_hash_table_map_/resize_store_hash_fn_imps.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/gp_hash_table_map_/standard_policies.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/gp_hash_table_map_/trace_fn_imps.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/hash_fn
-#usr/include/c++/4.4.7/ext/pb_ds/detail/hash_fn/direct_mask_range_hashing_imp.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/hash_fn/direct_mod_range_hashing_imp.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/hash_fn/linear_probe_fn_imp.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/hash_fn/mask_based_range_hashing.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/hash_fn/mod_based_range_hashing.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/hash_fn/probe_fn_base.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/hash_fn/quadratic_probe_fn_imp.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/hash_fn/ranged_hash_fn.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/hash_fn/ranged_probe_fn.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/hash_fn/sample_probe_fn.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/hash_fn/sample_range_hashing.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/hash_fn/sample_ranged_hash_fn.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/hash_fn/sample_ranged_probe_fn.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/left_child_next_sibling_heap_
-#usr/include/c++/4.4.7/ext/pb_ds/detail/left_child_next_sibling_heap_/const_iterator.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/left_child_next_sibling_heap_/const_point_iterator.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/left_child_next_sibling_heap_/constructors_destructor_fn_imps.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/left_child_next_sibling_heap_/debug_fn_imps.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/left_child_next_sibling_heap_/erase_fn_imps.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/left_child_next_sibling_heap_/info_fn_imps.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/left_child_next_sibling_heap_/insert_fn_imps.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/left_child_next_sibling_heap_/iterators_fn_imps.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/left_child_next_sibling_heap_/left_child_next_sibling_heap_.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/left_child_next_sibling_heap_/node.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/left_child_next_sibling_heap_/null_metadata.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/left_child_next_sibling_heap_/policy_access_fn_imps.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/left_child_next_sibling_heap_/trace_fn_imps.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/list_update_map_
-#usr/include/c++/4.4.7/ext/pb_ds/detail/list_update_map_/constructor_destructor_fn_imps.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/list_update_map_/debug_fn_imps.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/list_update_map_/entry_metadata_base.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/list_update_map_/erase_fn_imps.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/list_update_map_/find_fn_imps.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/list_update_map_/info_fn_imps.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/list_update_map_/insert_fn_imps.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/list_update_map_/iterators_fn_imps.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/list_update_map_/lu_map_.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/list_update_map_/trace_fn_imps.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/list_update_policy
-#usr/include/c++/4.4.7/ext/pb_ds/detail/list_update_policy/counter_lu_metadata.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/list_update_policy/counter_lu_policy_imp.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/list_update_policy/mtf_lu_policy_imp.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/list_update_policy/sample_update_policy.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/ov_tree_map_
-#usr/include/c++/4.4.7/ext/pb_ds/detail/ov_tree_map_/cond_dtor.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/ov_tree_map_/constructors_destructor_fn_imps.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/ov_tree_map_/debug_fn_imps.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/ov_tree_map_/erase_fn_imps.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/ov_tree_map_/info_fn_imps.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/ov_tree_map_/insert_fn_imps.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/ov_tree_map_/iterators_fn_imps.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/ov_tree_map_/node_iterators.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/ov_tree_map_/ov_tree_map_.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/ov_tree_map_/policy_access_fn_imps.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/ov_tree_map_/split_join_fn_imps.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/ov_tree_map_/traits.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/pairing_heap_
-#usr/include/c++/4.4.7/ext/pb_ds/detail/pairing_heap_/constructors_destructor_fn_imps.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/pairing_heap_/debug_fn_imps.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/pairing_heap_/erase_fn_imps.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/pairing_heap_/find_fn_imps.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/pairing_heap_/insert_fn_imps.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/pairing_heap_/pairing_heap_.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/pairing_heap_/split_join_fn_imps.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/pat_trie_
-#usr/include/c++/4.4.7/ext/pb_ds/detail/pat_trie_/child_iterator.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/pat_trie_/cond_dtor_entry_dealtor.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/pat_trie_/const_child_iterator.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/pat_trie_/constructors_destructor_fn_imps.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/pat_trie_/debug_fn_imps.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/pat_trie_/erase_fn_imps.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/pat_trie_/find_fn_imps.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/pat_trie_/head.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/pat_trie_/info_fn_imps.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/pat_trie_/insert_join_fn_imps.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/pat_trie_/internal_node.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/pat_trie_/iterators_fn_imps.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/pat_trie_/leaf.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/pat_trie_/node_base.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/pat_trie_/node_iterators.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/pat_trie_/node_metadata_base.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/pat_trie_/pat_trie_.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/pat_trie_/point_iterators.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/pat_trie_/policy_access_fn_imps.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/pat_trie_/r_erase_fn_imps.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/pat_trie_/rotate_fn_imps.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/pat_trie_/split_fn_imps.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/pat_trie_/split_join_branch_bag.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/pat_trie_/synth_e_access_traits.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/pat_trie_/trace_fn_imps.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/pat_trie_/traits.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/pat_trie_/update_fn_imps.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/priority_queue_base_dispatch.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/rb_tree_map_
-#usr/include/c++/4.4.7/ext/pb_ds/detail/rb_tree_map_/constructors_destructor_fn_imps.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/rb_tree_map_/debug_fn_imps.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/rb_tree_map_/erase_fn_imps.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/rb_tree_map_/find_fn_imps.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/rb_tree_map_/info_fn_imps.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/rb_tree_map_/insert_fn_imps.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/rb_tree_map_/node.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/rb_tree_map_/rb_tree_.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/rb_tree_map_/split_join_fn_imps.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/rb_tree_map_/traits.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/rc_binomial_heap_
-#usr/include/c++/4.4.7/ext/pb_ds/detail/rc_binomial_heap_/constructors_destructor_fn_imps.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/rc_binomial_heap_/debug_fn_imps.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/rc_binomial_heap_/erase_fn_imps.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/rc_binomial_heap_/insert_fn_imps.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/rc_binomial_heap_/rc.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/rc_binomial_heap_/rc_binomial_heap_.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/rc_binomial_heap_/split_join_fn_imps.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/rc_binomial_heap_/trace_fn_imps.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/resize_policy
-#usr/include/c++/4.4.7/ext/pb_ds/detail/resize_policy/cc_hash_max_collision_check_resize_trigger_imp.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/resize_policy/hash_exponential_size_policy_imp.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/resize_policy/hash_load_check_resize_trigger_imp.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/resize_policy/hash_load_check_resize_trigger_size_base.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/resize_policy/hash_prime_size_policy_imp.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/resize_policy/hash_standard_resize_policy_imp.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/resize_policy/sample_resize_policy.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/resize_policy/sample_resize_trigger.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/resize_policy/sample_size_policy.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/splay_tree_
-#usr/include/c++/4.4.7/ext/pb_ds/detail/splay_tree_/constructors_destructor_fn_imps.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/splay_tree_/debug_fn_imps.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/splay_tree_/erase_fn_imps.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/splay_tree_/find_fn_imps.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/splay_tree_/info_fn_imps.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/splay_tree_/insert_fn_imps.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/splay_tree_/node.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/splay_tree_/splay_fn_imps.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/splay_tree_/splay_tree_.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/splay_tree_/split_join_fn_imps.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/splay_tree_/traits.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/standard_policies.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/thin_heap_
-#usr/include/c++/4.4.7/ext/pb_ds/detail/thin_heap_/constructors_destructor_fn_imps.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/thin_heap_/debug_fn_imps.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/thin_heap_/erase_fn_imps.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/thin_heap_/find_fn_imps.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/thin_heap_/insert_fn_imps.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/thin_heap_/split_join_fn_imps.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/thin_heap_/thin_heap_.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/thin_heap_/trace_fn_imps.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/tree_policy
-#usr/include/c++/4.4.7/ext/pb_ds/detail/tree_policy/node_metadata_selector.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/tree_policy/null_node_update_imp.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/tree_policy/order_statistics_imp.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/tree_policy/sample_tree_node_update.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/tree_trace_base.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/trie_policy
-#usr/include/c++/4.4.7/ext/pb_ds/detail/trie_policy/node_metadata_selector.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/trie_policy/null_node_update_imp.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/trie_policy/order_statistics_imp.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/trie_policy/prefix_search_node_update_imp.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/trie_policy/sample_trie_e_access_traits.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/trie_policy/sample_trie_node_update.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/trie_policy/string_trie_e_access_traits_imp.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/trie_policy/trie_policy_base.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/type_utils.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/types_traits.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/unordered_iterator
-#usr/include/c++/4.4.7/ext/pb_ds/detail/unordered_iterator/const_iterator.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/unordered_iterator/const_point_iterator.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/unordered_iterator/iterator.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/detail/unordered_iterator/point_iterator.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/exception.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/hash_policy.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/list_update_policy.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/priority_queue.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/tag_and_trait.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/tree_policy.hpp
-#usr/include/c++/4.4.7/ext/pb_ds/trie_policy.hpp
-#usr/include/c++/4.4.7/ext/pod_char_traits.h
-#usr/include/c++/4.4.7/ext/pointer.h
-#usr/include/c++/4.4.7/ext/pool_allocator.h
-#usr/include/c++/4.4.7/ext/rb_tree
-#usr/include/c++/4.4.7/ext/rc_string_base.h
-#usr/include/c++/4.4.7/ext/rope
-#usr/include/c++/4.4.7/ext/ropeimpl.h
-#usr/include/c++/4.4.7/ext/slist
-#usr/include/c++/4.4.7/ext/sso_string_base.h
-#usr/include/c++/4.4.7/ext/stdio_filebuf.h
-#usr/include/c++/4.4.7/ext/stdio_sync_filebuf.h
-#usr/include/c++/4.4.7/ext/string_conversions.h
-#usr/include/c++/4.4.7/ext/throw_allocator.h
-#usr/include/c++/4.4.7/ext/type_traits.h
-#usr/include/c++/4.4.7/ext/typelist.h
-#usr/include/c++/4.4.7/ext/vstring.h
-#usr/include/c++/4.4.7/ext/vstring.tcc
-#usr/include/c++/4.4.7/ext/vstring_fwd.h
-#usr/include/c++/4.4.7/ext/vstring_util.h
-#usr/include/c++/4.4.7/fenv.h
-#usr/include/c++/4.4.7/forward_list
-#usr/include/c++/4.4.7/fstream
-#usr/include/c++/4.4.7/functional
-#usr/include/c++/4.4.7/initializer_list
-#usr/include/c++/4.4.7/iomanip
-#usr/include/c++/4.4.7/ios
-#usr/include/c++/4.4.7/iosfwd
-#usr/include/c++/4.4.7/iostream
-#usr/include/c++/4.4.7/istream
-#usr/include/c++/4.4.7/iterator
-#usr/include/c++/4.4.7/limits
-#usr/include/c++/4.4.7/list
-#usr/include/c++/4.4.7/locale
-#usr/include/c++/4.4.7/map
-#usr/include/c++/4.4.7/memory
-#usr/include/c++/4.4.7/mutex
-#usr/include/c++/4.4.7/new
-#usr/include/c++/4.4.7/numeric
-#usr/include/c++/4.4.7/ostream
-#usr/include/c++/4.4.7/parallel
-#usr/include/c++/4.4.7/parallel/algo.h
-#usr/include/c++/4.4.7/parallel/algobase.h
-#usr/include/c++/4.4.7/parallel/algorithm
-#usr/include/c++/4.4.7/parallel/algorithmfwd.h
-#usr/include/c++/4.4.7/parallel/balanced_quicksort.h
-#usr/include/c++/4.4.7/parallel/base.h
-#usr/include/c++/4.4.7/parallel/basic_iterator.h
-#usr/include/c++/4.4.7/parallel/checkers.h
-#usr/include/c++/4.4.7/parallel/compatibility.h
-#usr/include/c++/4.4.7/parallel/compiletime_settings.h
-#usr/include/c++/4.4.7/parallel/equally_split.h
-#usr/include/c++/4.4.7/parallel/features.h
-#usr/include/c++/4.4.7/parallel/find.h
-#usr/include/c++/4.4.7/parallel/find_selectors.h
-#usr/include/c++/4.4.7/parallel/for_each.h
-#usr/include/c++/4.4.7/parallel/for_each_selectors.h
-#usr/include/c++/4.4.7/parallel/iterator.h
-#usr/include/c++/4.4.7/parallel/list_partition.h
-#usr/include/c++/4.4.7/parallel/losertree.h
-#usr/include/c++/4.4.7/parallel/merge.h
-#usr/include/c++/4.4.7/parallel/multiseq_selection.h
-#usr/include/c++/4.4.7/parallel/multiway_merge.h
-#usr/include/c++/4.4.7/parallel/multiway_mergesort.h
-#usr/include/c++/4.4.7/parallel/numeric
-#usr/include/c++/4.4.7/parallel/numericfwd.h
-#usr/include/c++/4.4.7/parallel/omp_loop.h
-#usr/include/c++/4.4.7/parallel/omp_loop_static.h
-#usr/include/c++/4.4.7/parallel/par_loop.h
-#usr/include/c++/4.4.7/parallel/parallel.h
-#usr/include/c++/4.4.7/parallel/partial_sum.h
-#usr/include/c++/4.4.7/parallel/partition.h
-#usr/include/c++/4.4.7/parallel/queue.h
-#usr/include/c++/4.4.7/parallel/quicksort.h
-#usr/include/c++/4.4.7/parallel/random_number.h
-#usr/include/c++/4.4.7/parallel/random_shuffle.h
-#usr/include/c++/4.4.7/parallel/search.h
-#usr/include/c++/4.4.7/parallel/set_operations.h
-#usr/include/c++/4.4.7/parallel/settings.h
-#usr/include/c++/4.4.7/parallel/sort.h
-#usr/include/c++/4.4.7/parallel/tags.h
-#usr/include/c++/4.4.7/parallel/types.h
-#usr/include/c++/4.4.7/parallel/unique_copy.h
-#usr/include/c++/4.4.7/parallel/workstealing.h
-#usr/include/c++/4.4.7/queue
-#usr/include/c++/4.4.7/random
-#usr/include/c++/4.4.7/ratio
-#usr/include/c++/4.4.7/regex
-#usr/include/c++/4.4.7/set
-#usr/include/c++/4.4.7/sstream
-#usr/include/c++/4.4.7/stack
-#usr/include/c++/4.4.7/stdatomic.h
-#usr/include/c++/4.4.7/stdexcept
-#usr/include/c++/4.4.7/streambuf
-#usr/include/c++/4.4.7/string
-#usr/include/c++/4.4.7/system_error
-#usr/include/c++/4.4.7/tgmath.h
-#usr/include/c++/4.4.7/thread
-#usr/include/c++/4.4.7/tr1
-#usr/include/c++/4.4.7/tr1/array
-#usr/include/c++/4.4.7/tr1/bessel_function.tcc
-#usr/include/c++/4.4.7/tr1/beta_function.tcc
-#usr/include/c++/4.4.7/tr1/ccomplex
-#usr/include/c++/4.4.7/tr1/cctype
-#usr/include/c++/4.4.7/tr1/cfenv
-#usr/include/c++/4.4.7/tr1/cfloat
-#usr/include/c++/4.4.7/tr1/cinttypes
-#usr/include/c++/4.4.7/tr1/climits
-#usr/include/c++/4.4.7/tr1/cmath
-#usr/include/c++/4.4.7/tr1/complex
-#usr/include/c++/4.4.7/tr1/complex.h
-#usr/include/c++/4.4.7/tr1/cstdarg
-#usr/include/c++/4.4.7/tr1/cstdbool
-#usr/include/c++/4.4.7/tr1/cstdint
-#usr/include/c++/4.4.7/tr1/cstdio
-#usr/include/c++/4.4.7/tr1/cstdlib
-#usr/include/c++/4.4.7/tr1/ctgmath
-#usr/include/c++/4.4.7/tr1/ctime
-#usr/include/c++/4.4.7/tr1/ctype.h
-#usr/include/c++/4.4.7/tr1/cwchar
-#usr/include/c++/4.4.7/tr1/cwctype
-#usr/include/c++/4.4.7/tr1/ell_integral.tcc
-#usr/include/c++/4.4.7/tr1/exp_integral.tcc
-#usr/include/c++/4.4.7/tr1/fenv.h
-#usr/include/c++/4.4.7/tr1/float.h
-#usr/include/c++/4.4.7/tr1/functional
-#usr/include/c++/4.4.7/tr1/functional_hash.h
-#usr/include/c++/4.4.7/tr1/gamma.tcc
-#usr/include/c++/4.4.7/tr1/hashtable.h
-#usr/include/c++/4.4.7/tr1/hypergeometric.tcc
-#usr/include/c++/4.4.7/tr1/inttypes.h
-#usr/include/c++/4.4.7/tr1/legendre_function.tcc
-#usr/include/c++/4.4.7/tr1/limits.h
-#usr/include/c++/4.4.7/tr1/math.h
-#usr/include/c++/4.4.7/tr1/memory
-#usr/include/c++/4.4.7/tr1/modified_bessel_func.tcc
-#usr/include/c++/4.4.7/tr1/poly_hermite.tcc
-#usr/include/c++/4.4.7/tr1/poly_laguerre.tcc
-#usr/include/c++/4.4.7/tr1/random
-#usr/include/c++/4.4.7/tr1/regex
-#usr/include/c++/4.4.7/tr1/riemann_zeta.tcc
-#usr/include/c++/4.4.7/tr1/shared_ptr.h
-#usr/include/c++/4.4.7/tr1/special_function_util.h
-#usr/include/c++/4.4.7/tr1/stdarg.h
-#usr/include/c++/4.4.7/tr1/stdbool.h
-#usr/include/c++/4.4.7/tr1/stdint.h
-#usr/include/c++/4.4.7/tr1/stdio.h
-#usr/include/c++/4.4.7/tr1/stdlib.h
-#usr/include/c++/4.4.7/tr1/tgmath.h
-#usr/include/c++/4.4.7/tr1/tuple
-#usr/include/c++/4.4.7/tr1/type_traits
-#usr/include/c++/4.4.7/tr1/unordered_map
-#usr/include/c++/4.4.7/tr1/unordered_set
-#usr/include/c++/4.4.7/tr1/utility
-#usr/include/c++/4.4.7/tr1/wchar.h
-#usr/include/c++/4.4.7/tr1/wctype.h
-#usr/include/c++/4.4.7/tr1_impl
-#usr/include/c++/4.4.7/tr1_impl/array
-#usr/include/c++/4.4.7/tr1_impl/boost_sp_counted_base.h
-#usr/include/c++/4.4.7/tr1_impl/cctype
-#usr/include/c++/4.4.7/tr1_impl/cfenv
-#usr/include/c++/4.4.7/tr1_impl/cinttypes
-#usr/include/c++/4.4.7/tr1_impl/cmath
-#usr/include/c++/4.4.7/tr1_impl/complex
-#usr/include/c++/4.4.7/tr1_impl/cstdint
-#usr/include/c++/4.4.7/tr1_impl/cstdio
-#usr/include/c++/4.4.7/tr1_impl/cstdlib
-#usr/include/c++/4.4.7/tr1_impl/cwchar
-#usr/include/c++/4.4.7/tr1_impl/cwctype
-#usr/include/c++/4.4.7/tr1_impl/functional
-#usr/include/c++/4.4.7/tr1_impl/functional_hash.h
-#usr/include/c++/4.4.7/tr1_impl/hashtable
-#usr/include/c++/4.4.7/tr1_impl/hashtable_policy.h
-#usr/include/c++/4.4.7/tr1_impl/random
-#usr/include/c++/4.4.7/tr1_impl/random.tcc
-#usr/include/c++/4.4.7/tr1_impl/regex
-#usr/include/c++/4.4.7/tr1_impl/type_traits
-#usr/include/c++/4.4.7/tr1_impl/unordered_map
-#usr/include/c++/4.4.7/tr1_impl/unordered_set
-#usr/include/c++/4.4.7/tr1_impl/utility
-#usr/include/c++/4.4.7/tuple
-#usr/include/c++/4.4.7/type_traits
-#usr/include/c++/4.4.7/typeinfo
-#usr/include/c++/4.4.7/unordered_map
-#usr/include/c++/4.4.7/unordered_set
-#usr/include/c++/4.4.7/utility
-#usr/include/c++/4.4.7/valarray
-#usr/include/c++/4.4.7/vector
-#usr/include/c++/4.4.7/x86_64-unknown-linux-gnu
-#usr/include/c++/4.4.7/x86_64-unknown-linux-gnu/bits
-#usr/include/c++/4.4.7/x86_64-unknown-linux-gnu/bits/atomic_word.h
-#usr/include/c++/4.4.7/x86_64-unknown-linux-gnu/bits/basic_file.h
-#usr/include/c++/4.4.7/x86_64-unknown-linux-gnu/bits/c++allocator.h
-#usr/include/c++/4.4.7/x86_64-unknown-linux-gnu/bits/c++config.h
-#usr/include/c++/4.4.7/x86_64-unknown-linux-gnu/bits/c++io.h
-#usr/include/c++/4.4.7/x86_64-unknown-linux-gnu/bits/c++locale.h
-#usr/include/c++/4.4.7/x86_64-unknown-linux-gnu/bits/cpu_defines.h
-#usr/include/c++/4.4.7/x86_64-unknown-linux-gnu/bits/ctype_base.h
-#usr/include/c++/4.4.7/x86_64-unknown-linux-gnu/bits/ctype_inline.h
-#usr/include/c++/4.4.7/x86_64-unknown-linux-gnu/bits/ctype_noninline.h
-#usr/include/c++/4.4.7/x86_64-unknown-linux-gnu/bits/cxxabi_tweaks.h
-#usr/include/c++/4.4.7/x86_64-unknown-linux-gnu/bits/error_constants.h
-#usr/include/c++/4.4.7/x86_64-unknown-linux-gnu/bits/extc++.h
-#usr/include/c++/4.4.7/x86_64-unknown-linux-gnu/bits/gthr-default.h
-#usr/include/c++/4.4.7/x86_64-unknown-linux-gnu/bits/gthr-posix.h
-#usr/include/c++/4.4.7/x86_64-unknown-linux-gnu/bits/gthr-single.h
-#usr/include/c++/4.4.7/x86_64-unknown-linux-gnu/bits/gthr-tpf.h
-#usr/include/c++/4.4.7/x86_64-unknown-linux-gnu/bits/gthr.h
-#usr/include/c++/4.4.7/x86_64-unknown-linux-gnu/bits/messages_members.h
-#usr/include/c++/4.4.7/x86_64-unknown-linux-gnu/bits/os_defines.h
-#usr/include/c++/4.4.7/x86_64-unknown-linux-gnu/bits/stdc++.h
-#usr/include/c++/4.4.7/x86_64-unknown-linux-gnu/bits/stdtr1c++.h
-#usr/include/c++/4.4.7/x86_64-unknown-linux-gnu/bits/time_members.h
-#usr/info
-#usr/info/cpp.info
-#usr/info/cppinternals.info
-#usr/info/dir
-#usr/info/gcc.info
-#usr/info/gccinstall.info
-#usr/info/gccint.info
-#usr/info/libgomp.info
+#usr/include/c++/4.9.3
+#usr/include/c++/4.9.3/algorithm
+#usr/include/c++/4.9.3/array
+#usr/include/c++/4.9.3/atomic
+#usr/include/c++/4.9.3/backward
+#usr/include/c++/4.9.3/backward/auto_ptr.h
+#usr/include/c++/4.9.3/backward/backward_warning.h
+#usr/include/c++/4.9.3/backward/binders.h
+#usr/include/c++/4.9.3/backward/hash_fun.h
+#usr/include/c++/4.9.3/backward/hash_map
+#usr/include/c++/4.9.3/backward/hash_set
+#usr/include/c++/4.9.3/backward/hashtable.h
+#usr/include/c++/4.9.3/backward/strstream
+#usr/include/c++/4.9.3/bits
+#usr/include/c++/4.9.3/bits/algorithmfwd.h
+#usr/include/c++/4.9.3/bits/alloc_traits.h
+#usr/include/c++/4.9.3/bits/allocator.h
+#usr/include/c++/4.9.3/bits/atomic_base.h
+#usr/include/c++/4.9.3/bits/atomic_lockfree_defines.h
+#usr/include/c++/4.9.3/bits/basic_ios.h
+#usr/include/c++/4.9.3/bits/basic_ios.tcc
+#usr/include/c++/4.9.3/bits/basic_string.h
+#usr/include/c++/4.9.3/bits/basic_string.tcc
+#usr/include/c++/4.9.3/bits/boost_concept_check.h
+#usr/include/c++/4.9.3/bits/c++0x_warning.h
+#usr/include/c++/4.9.3/bits/c++14_warning.h
+#usr/include/c++/4.9.3/bits/char_traits.h
+#usr/include/c++/4.9.3/bits/codecvt.h
+#usr/include/c++/4.9.3/bits/concept_check.h
+#usr/include/c++/4.9.3/bits/cpp_type_traits.h
+#usr/include/c++/4.9.3/bits/cxxabi_forced.h
+#usr/include/c++/4.9.3/bits/deque.tcc
+#usr/include/c++/4.9.3/bits/enable_special_members.h
+#usr/include/c++/4.9.3/bits/exception_defines.h
+#usr/include/c++/4.9.3/bits/exception_ptr.h
+#usr/include/c++/4.9.3/bits/forward_list.h
+#usr/include/c++/4.9.3/bits/forward_list.tcc
+#usr/include/c++/4.9.3/bits/fstream.tcc
+#usr/include/c++/4.9.3/bits/functexcept.h
+#usr/include/c++/4.9.3/bits/functional_hash.h
+#usr/include/c++/4.9.3/bits/gslice.h
+#usr/include/c++/4.9.3/bits/gslice_array.h
+#usr/include/c++/4.9.3/bits/hash_bytes.h
+#usr/include/c++/4.9.3/bits/hashtable.h
+#usr/include/c++/4.9.3/bits/hashtable_policy.h
+#usr/include/c++/4.9.3/bits/indirect_array.h
+#usr/include/c++/4.9.3/bits/ios_base.h
+#usr/include/c++/4.9.3/bits/istream.tcc
+#usr/include/c++/4.9.3/bits/list.tcc
+#usr/include/c++/4.9.3/bits/locale_classes.h
+#usr/include/c++/4.9.3/bits/locale_classes.tcc
+#usr/include/c++/4.9.3/bits/locale_facets.h
+#usr/include/c++/4.9.3/bits/locale_facets.tcc
+#usr/include/c++/4.9.3/bits/locale_facets_nonio.h
+#usr/include/c++/4.9.3/bits/locale_facets_nonio.tcc
+#usr/include/c++/4.9.3/bits/localefwd.h
+#usr/include/c++/4.9.3/bits/mask_array.h
+#usr/include/c++/4.9.3/bits/memoryfwd.h
+#usr/include/c++/4.9.3/bits/move.h
+#usr/include/c++/4.9.3/bits/nested_exception.h
+#usr/include/c++/4.9.3/bits/ostream.tcc
+#usr/include/c++/4.9.3/bits/ostream_insert.h
+#usr/include/c++/4.9.3/bits/parse_numbers.h
+#usr/include/c++/4.9.3/bits/postypes.h
+#usr/include/c++/4.9.3/bits/predefined_ops.h
+#usr/include/c++/4.9.3/bits/ptr_traits.h
+#usr/include/c++/4.9.3/bits/random.h
+#usr/include/c++/4.9.3/bits/random.tcc
+#usr/include/c++/4.9.3/bits/range_access.h
+#usr/include/c++/4.9.3/bits/regex.h
+#usr/include/c++/4.9.3/bits/regex.tcc
+#usr/include/c++/4.9.3/bits/regex_automaton.h
+#usr/include/c++/4.9.3/bits/regex_automaton.tcc
+#usr/include/c++/4.9.3/bits/regex_compiler.h
+#usr/include/c++/4.9.3/bits/regex_compiler.tcc
+#usr/include/c++/4.9.3/bits/regex_constants.h
+#usr/include/c++/4.9.3/bits/regex_error.h
+#usr/include/c++/4.9.3/bits/regex_executor.h
+#usr/include/c++/4.9.3/bits/regex_executor.tcc
+#usr/include/c++/4.9.3/bits/regex_scanner.h
+#usr/include/c++/4.9.3/bits/regex_scanner.tcc
+#usr/include/c++/4.9.3/bits/shared_ptr.h
+#usr/include/c++/4.9.3/bits/shared_ptr_base.h
+#usr/include/c++/4.9.3/bits/slice_array.h
+#usr/include/c++/4.9.3/bits/sstream.tcc
+#usr/include/c++/4.9.3/bits/stl_algo.h
+#usr/include/c++/4.9.3/bits/stl_algobase.h
+#usr/include/c++/4.9.3/bits/stl_bvector.h
+#usr/include/c++/4.9.3/bits/stl_construct.h
+#usr/include/c++/4.9.3/bits/stl_deque.h
+#usr/include/c++/4.9.3/bits/stl_function.h
+#usr/include/c++/4.9.3/bits/stl_heap.h
+#usr/include/c++/4.9.3/bits/stl_iterator.h
+#usr/include/c++/4.9.3/bits/stl_iterator_base_funcs.h
+#usr/include/c++/4.9.3/bits/stl_iterator_base_types.h
+#usr/include/c++/4.9.3/bits/stl_list.h
+#usr/include/c++/4.9.3/bits/stl_map.h
+#usr/include/c++/4.9.3/bits/stl_multimap.h
+#usr/include/c++/4.9.3/bits/stl_multiset.h
+#usr/include/c++/4.9.3/bits/stl_numeric.h
+#usr/include/c++/4.9.3/bits/stl_pair.h
+#usr/include/c++/4.9.3/bits/stl_queue.h
+#usr/include/c++/4.9.3/bits/stl_raw_storage_iter.h
+#usr/include/c++/4.9.3/bits/stl_relops.h
+#usr/include/c++/4.9.3/bits/stl_set.h
+#usr/include/c++/4.9.3/bits/stl_stack.h
+#usr/include/c++/4.9.3/bits/stl_tempbuf.h
+#usr/include/c++/4.9.3/bits/stl_tree.h
+#usr/include/c++/4.9.3/bits/stl_uninitialized.h
+#usr/include/c++/4.9.3/bits/stl_vector.h
+#usr/include/c++/4.9.3/bits/stream_iterator.h
+#usr/include/c++/4.9.3/bits/streambuf.tcc
+#usr/include/c++/4.9.3/bits/streambuf_iterator.h
+#usr/include/c++/4.9.3/bits/stringfwd.h
+#usr/include/c++/4.9.3/bits/unique_ptr.h
+#usr/include/c++/4.9.3/bits/unordered_map.h
+#usr/include/c++/4.9.3/bits/unordered_set.h
+#usr/include/c++/4.9.3/bits/uses_allocator.h
+#usr/include/c++/4.9.3/bits/valarray_after.h
+#usr/include/c++/4.9.3/bits/valarray_array.h
+#usr/include/c++/4.9.3/bits/valarray_array.tcc
+#usr/include/c++/4.9.3/bits/valarray_before.h
+#usr/include/c++/4.9.3/bits/vector.tcc
+#usr/include/c++/4.9.3/bitset
+#usr/include/c++/4.9.3/cassert
+#usr/include/c++/4.9.3/ccomplex
+#usr/include/c++/4.9.3/cctype
+#usr/include/c++/4.9.3/cerrno
+#usr/include/c++/4.9.3/cfenv
+#usr/include/c++/4.9.3/cfloat
+#usr/include/c++/4.9.3/chrono
+#usr/include/c++/4.9.3/cinttypes
+#usr/include/c++/4.9.3/ciso646
+#usr/include/c++/4.9.3/climits
+#usr/include/c++/4.9.3/clocale
+#usr/include/c++/4.9.3/cmath
+#usr/include/c++/4.9.3/complex
+#usr/include/c++/4.9.3/complex.h
+#usr/include/c++/4.9.3/condition_variable
+#usr/include/c++/4.9.3/csetjmp
+#usr/include/c++/4.9.3/csignal
+#usr/include/c++/4.9.3/cstdalign
+#usr/include/c++/4.9.3/cstdarg
+#usr/include/c++/4.9.3/cstdbool
+#usr/include/c++/4.9.3/cstddef
+#usr/include/c++/4.9.3/cstdint
+#usr/include/c++/4.9.3/cstdio
+#usr/include/c++/4.9.3/cstdlib
+#usr/include/c++/4.9.3/cstring
+#usr/include/c++/4.9.3/ctgmath
+#usr/include/c++/4.9.3/ctime
+#usr/include/c++/4.9.3/cwchar
+#usr/include/c++/4.9.3/cwctype
+#usr/include/c++/4.9.3/cxxabi.h
+#usr/include/c++/4.9.3/debug
+#usr/include/c++/4.9.3/debug/array
+#usr/include/c++/4.9.3/debug/bitset
+#usr/include/c++/4.9.3/debug/debug.h
+#usr/include/c++/4.9.3/debug/deque
+#usr/include/c++/4.9.3/debug/formatter.h
+#usr/include/c++/4.9.3/debug/forward_list
+#usr/include/c++/4.9.3/debug/functions.h
+#usr/include/c++/4.9.3/debug/list
+#usr/include/c++/4.9.3/debug/macros.h
+#usr/include/c++/4.9.3/debug/map
+#usr/include/c++/4.9.3/debug/map.h
+#usr/include/c++/4.9.3/debug/multimap.h
+#usr/include/c++/4.9.3/debug/multiset.h
+#usr/include/c++/4.9.3/debug/safe_base.h
+#usr/include/c++/4.9.3/debug/safe_iterator.h
+#usr/include/c++/4.9.3/debug/safe_iterator.tcc
+#usr/include/c++/4.9.3/debug/safe_local_iterator.h
+#usr/include/c++/4.9.3/debug/safe_local_iterator.tcc
+#usr/include/c++/4.9.3/debug/safe_sequence.h
+#usr/include/c++/4.9.3/debug/safe_sequence.tcc
+#usr/include/c++/4.9.3/debug/safe_unordered_base.h
+#usr/include/c++/4.9.3/debug/safe_unordered_container.h
+#usr/include/c++/4.9.3/debug/safe_unordered_container.tcc
+#usr/include/c++/4.9.3/debug/set
+#usr/include/c++/4.9.3/debug/set.h
+#usr/include/c++/4.9.3/debug/string
+#usr/include/c++/4.9.3/debug/unordered_map
+#usr/include/c++/4.9.3/debug/unordered_set
+#usr/include/c++/4.9.3/debug/vector
+#usr/include/c++/4.9.3/decimal
+#usr/include/c++/4.9.3/decimal/decimal
+#usr/include/c++/4.9.3/decimal/decimal.h
+#usr/include/c++/4.9.3/deque
+#usr/include/c++/4.9.3/exception
+#usr/include/c++/4.9.3/experimental
+#usr/include/c++/4.9.3/experimental/optional
+#usr/include/c++/4.9.3/experimental/string_view
+#usr/include/c++/4.9.3/experimental/string_view.tcc
+#usr/include/c++/4.9.3/ext
+#usr/include/c++/4.9.3/ext/algorithm
+#usr/include/c++/4.9.3/ext/aligned_buffer.h
+#usr/include/c++/4.9.3/ext/alloc_traits.h
+#usr/include/c++/4.9.3/ext/array_allocator.h
+#usr/include/c++/4.9.3/ext/atomicity.h
+#usr/include/c++/4.9.3/ext/bitmap_allocator.h
+#usr/include/c++/4.9.3/ext/cast.h
+#usr/include/c++/4.9.3/ext/cmath
+#usr/include/c++/4.9.3/ext/codecvt_specializations.h
+#usr/include/c++/4.9.3/ext/concurrence.h
+#usr/include/c++/4.9.3/ext/debug_allocator.h
+#usr/include/c++/4.9.3/ext/enc_filebuf.h
+#usr/include/c++/4.9.3/ext/extptr_allocator.h
+#usr/include/c++/4.9.3/ext/functional
+#usr/include/c++/4.9.3/ext/hash_map
+#usr/include/c++/4.9.3/ext/hash_set
+#usr/include/c++/4.9.3/ext/iterator
+#usr/include/c++/4.9.3/ext/malloc_allocator.h
+#usr/include/c++/4.9.3/ext/memory
+#usr/include/c++/4.9.3/ext/mt_allocator.h
+#usr/include/c++/4.9.3/ext/new_allocator.h
+#usr/include/c++/4.9.3/ext/numeric
+#usr/include/c++/4.9.3/ext/numeric_traits.h
+#usr/include/c++/4.9.3/ext/pb_ds
+#usr/include/c++/4.9.3/ext/pb_ds/assoc_container.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail
+#usr/include/c++/4.9.3/ext/pb_ds/detail/bin_search_tree_
+#usr/include/c++/4.9.3/ext/pb_ds/detail/bin_search_tree_/bin_search_tree_.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/bin_search_tree_/constructors_destructor_fn_imps.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/bin_search_tree_/debug_fn_imps.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/bin_search_tree_/erase_fn_imps.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/bin_search_tree_/find_fn_imps.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/bin_search_tree_/info_fn_imps.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/bin_search_tree_/insert_fn_imps.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/bin_search_tree_/iterators_fn_imps.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/bin_search_tree_/node_iterators.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/bin_search_tree_/point_iterators.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/bin_search_tree_/policy_access_fn_imps.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/bin_search_tree_/r_erase_fn_imps.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/bin_search_tree_/rotate_fn_imps.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/bin_search_tree_/split_join_fn_imps.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/bin_search_tree_/traits.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/binary_heap_
+#usr/include/c++/4.9.3/ext/pb_ds/detail/binary_heap_/binary_heap_.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/binary_heap_/const_iterator.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/binary_heap_/constructors_destructor_fn_imps.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/binary_heap_/debug_fn_imps.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/binary_heap_/entry_cmp.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/binary_heap_/entry_pred.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/binary_heap_/erase_fn_imps.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/binary_heap_/find_fn_imps.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/binary_heap_/info_fn_imps.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/binary_heap_/insert_fn_imps.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/binary_heap_/iterators_fn_imps.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/binary_heap_/point_const_iterator.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/binary_heap_/policy_access_fn_imps.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/binary_heap_/resize_policy.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/binary_heap_/split_join_fn_imps.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/binary_heap_/trace_fn_imps.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/binomial_heap_
+#usr/include/c++/4.9.3/ext/pb_ds/detail/binomial_heap_/binomial_heap_.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/binomial_heap_/constructors_destructor_fn_imps.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/binomial_heap_/debug_fn_imps.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/binomial_heap_base_
+#usr/include/c++/4.9.3/ext/pb_ds/detail/binomial_heap_base_/binomial_heap_base_.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/binomial_heap_base_/constructors_destructor_fn_imps.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/binomial_heap_base_/debug_fn_imps.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/binomial_heap_base_/erase_fn_imps.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/binomial_heap_base_/find_fn_imps.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/binomial_heap_base_/insert_fn_imps.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/binomial_heap_base_/split_join_fn_imps.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/branch_policy
+#usr/include/c++/4.9.3/ext/pb_ds/detail/branch_policy/branch_policy.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/branch_policy/null_node_metadata.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/branch_policy/traits.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/cc_hash_table_map_
+#usr/include/c++/4.9.3/ext/pb_ds/detail/cc_hash_table_map_/cc_ht_map_.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/cc_hash_table_map_/cmp_fn_imps.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/cc_hash_table_map_/cond_key_dtor_entry_dealtor.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/cc_hash_table_map_/constructor_destructor_fn_imps.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/cc_hash_table_map_/constructor_destructor_no_store_hash_fn_imps.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/cc_hash_table_map_/constructor_destructor_store_hash_fn_imps.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/cc_hash_table_map_/debug_fn_imps.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/cc_hash_table_map_/debug_no_store_hash_fn_imps.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/cc_hash_table_map_/debug_store_hash_fn_imps.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/cc_hash_table_map_/entry_list_fn_imps.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/cc_hash_table_map_/erase_fn_imps.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/cc_hash_table_map_/erase_no_store_hash_fn_imps.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/cc_hash_table_map_/erase_store_hash_fn_imps.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/cc_hash_table_map_/find_fn_imps.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/cc_hash_table_map_/find_store_hash_fn_imps.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/cc_hash_table_map_/info_fn_imps.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/cc_hash_table_map_/insert_fn_imps.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/cc_hash_table_map_/insert_no_store_hash_fn_imps.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/cc_hash_table_map_/insert_store_hash_fn_imps.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/cc_hash_table_map_/iterators_fn_imps.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/cc_hash_table_map_/policy_access_fn_imps.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/cc_hash_table_map_/resize_fn_imps.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/cc_hash_table_map_/resize_no_store_hash_fn_imps.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/cc_hash_table_map_/resize_store_hash_fn_imps.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/cc_hash_table_map_/size_fn_imps.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/cc_hash_table_map_/trace_fn_imps.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/cond_dealtor.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/container_base_dispatch.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/debug_map_base.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/eq_fn
+#usr/include/c++/4.9.3/ext/pb_ds/detail/eq_fn/eq_by_less.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/eq_fn/hash_eq_fn.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/gp_hash_table_map_
+#usr/include/c++/4.9.3/ext/pb_ds/detail/gp_hash_table_map_/constructor_destructor_fn_imps.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/gp_hash_table_map_/constructor_destructor_no_store_hash_fn_imps.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/gp_hash_table_map_/constructor_destructor_store_hash_fn_imps.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/gp_hash_table_map_/debug_fn_imps.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/gp_hash_table_map_/debug_no_store_hash_fn_imps.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/gp_hash_table_map_/debug_store_hash_fn_imps.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/gp_hash_table_map_/erase_fn_imps.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/gp_hash_table_map_/erase_no_store_hash_fn_imps.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/gp_hash_table_map_/erase_store_hash_fn_imps.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/gp_hash_table_map_/find_fn_imps.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/gp_hash_table_map_/find_no_store_hash_fn_imps.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/gp_hash_table_map_/find_store_hash_fn_imps.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/gp_hash_table_map_/gp_ht_map_.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/gp_hash_table_map_/info_fn_imps.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/gp_hash_table_map_/insert_fn_imps.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/gp_hash_table_map_/insert_no_store_hash_fn_imps.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/gp_hash_table_map_/insert_store_hash_fn_imps.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/gp_hash_table_map_/iterator_fn_imps.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/gp_hash_table_map_/policy_access_fn_imps.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/gp_hash_table_map_/resize_fn_imps.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/gp_hash_table_map_/resize_no_store_hash_fn_imps.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/gp_hash_table_map_/resize_store_hash_fn_imps.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/gp_hash_table_map_/trace_fn_imps.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/hash_fn
+#usr/include/c++/4.9.3/ext/pb_ds/detail/hash_fn/direct_mask_range_hashing_imp.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/hash_fn/direct_mod_range_hashing_imp.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/hash_fn/linear_probe_fn_imp.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/hash_fn/mask_based_range_hashing.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/hash_fn/mod_based_range_hashing.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/hash_fn/probe_fn_base.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/hash_fn/quadratic_probe_fn_imp.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/hash_fn/ranged_hash_fn.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/hash_fn/ranged_probe_fn.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/hash_fn/sample_probe_fn.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/hash_fn/sample_range_hashing.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/hash_fn/sample_ranged_hash_fn.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/hash_fn/sample_ranged_probe_fn.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/left_child_next_sibling_heap_
+#usr/include/c++/4.9.3/ext/pb_ds/detail/left_child_next_sibling_heap_/const_iterator.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/left_child_next_sibling_heap_/constructors_destructor_fn_imps.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/left_child_next_sibling_heap_/debug_fn_imps.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/left_child_next_sibling_heap_/erase_fn_imps.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/left_child_next_sibling_heap_/info_fn_imps.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/left_child_next_sibling_heap_/insert_fn_imps.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/left_child_next_sibling_heap_/iterators_fn_imps.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/left_child_next_sibling_heap_/left_child_next_sibling_heap_.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/left_child_next_sibling_heap_/node.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/left_child_next_sibling_heap_/point_const_iterator.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/left_child_next_sibling_heap_/policy_access_fn_imps.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/left_child_next_sibling_heap_/trace_fn_imps.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/list_update_map_
+#usr/include/c++/4.9.3/ext/pb_ds/detail/list_update_map_/constructor_destructor_fn_imps.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/list_update_map_/debug_fn_imps.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/list_update_map_/entry_metadata_base.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/list_update_map_/erase_fn_imps.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/list_update_map_/find_fn_imps.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/list_update_map_/info_fn_imps.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/list_update_map_/insert_fn_imps.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/list_update_map_/iterators_fn_imps.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/list_update_map_/lu_map_.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/list_update_map_/trace_fn_imps.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/list_update_policy
+#usr/include/c++/4.9.3/ext/pb_ds/detail/list_update_policy/lu_counter_metadata.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/list_update_policy/sample_update_policy.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/ov_tree_map_
+#usr/include/c++/4.9.3/ext/pb_ds/detail/ov_tree_map_/constructors_destructor_fn_imps.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/ov_tree_map_/debug_fn_imps.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/ov_tree_map_/erase_fn_imps.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/ov_tree_map_/info_fn_imps.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/ov_tree_map_/insert_fn_imps.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/ov_tree_map_/iterators_fn_imps.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/ov_tree_map_/node_iterators.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/ov_tree_map_/ov_tree_map_.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/ov_tree_map_/policy_access_fn_imps.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/ov_tree_map_/split_join_fn_imps.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/ov_tree_map_/traits.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/pairing_heap_
+#usr/include/c++/4.9.3/ext/pb_ds/detail/pairing_heap_/constructors_destructor_fn_imps.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/pairing_heap_/debug_fn_imps.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/pairing_heap_/erase_fn_imps.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/pairing_heap_/find_fn_imps.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/pairing_heap_/insert_fn_imps.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/pairing_heap_/pairing_heap_.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/pairing_heap_/split_join_fn_imps.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/pat_trie_
+#usr/include/c++/4.9.3/ext/pb_ds/detail/pat_trie_/constructors_destructor_fn_imps.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/pat_trie_/debug_fn_imps.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/pat_trie_/erase_fn_imps.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/pat_trie_/find_fn_imps.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/pat_trie_/info_fn_imps.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/pat_trie_/insert_join_fn_imps.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/pat_trie_/iterators_fn_imps.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/pat_trie_/pat_trie_.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/pat_trie_/pat_trie_base.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/pat_trie_/policy_access_fn_imps.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/pat_trie_/r_erase_fn_imps.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/pat_trie_/rotate_fn_imps.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/pat_trie_/split_fn_imps.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/pat_trie_/synth_access_traits.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/pat_trie_/trace_fn_imps.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/pat_trie_/traits.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/pat_trie_/update_fn_imps.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/priority_queue_base_dispatch.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/rb_tree_map_
+#usr/include/c++/4.9.3/ext/pb_ds/detail/rb_tree_map_/constructors_destructor_fn_imps.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/rb_tree_map_/debug_fn_imps.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/rb_tree_map_/erase_fn_imps.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/rb_tree_map_/find_fn_imps.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/rb_tree_map_/info_fn_imps.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/rb_tree_map_/insert_fn_imps.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/rb_tree_map_/node.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/rb_tree_map_/rb_tree_.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/rb_tree_map_/split_join_fn_imps.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/rb_tree_map_/traits.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/rc_binomial_heap_
+#usr/include/c++/4.9.3/ext/pb_ds/detail/rc_binomial_heap_/constructors_destructor_fn_imps.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/rc_binomial_heap_/debug_fn_imps.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/rc_binomial_heap_/erase_fn_imps.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/rc_binomial_heap_/insert_fn_imps.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/rc_binomial_heap_/rc.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/rc_binomial_heap_/rc_binomial_heap_.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/rc_binomial_heap_/split_join_fn_imps.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/rc_binomial_heap_/trace_fn_imps.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/resize_policy
+#usr/include/c++/4.9.3/ext/pb_ds/detail/resize_policy/cc_hash_max_collision_check_resize_trigger_imp.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/resize_policy/hash_exponential_size_policy_imp.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/resize_policy/hash_load_check_resize_trigger_imp.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/resize_policy/hash_load_check_resize_trigger_size_base.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/resize_policy/hash_prime_size_policy_imp.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/resize_policy/hash_standard_resize_policy_imp.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/resize_policy/sample_resize_policy.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/resize_policy/sample_resize_trigger.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/resize_policy/sample_size_policy.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/splay_tree_
+#usr/include/c++/4.9.3/ext/pb_ds/detail/splay_tree_/constructors_destructor_fn_imps.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/splay_tree_/debug_fn_imps.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/splay_tree_/erase_fn_imps.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/splay_tree_/find_fn_imps.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/splay_tree_/info_fn_imps.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/splay_tree_/insert_fn_imps.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/splay_tree_/node.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/splay_tree_/splay_fn_imps.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/splay_tree_/splay_tree_.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/splay_tree_/split_join_fn_imps.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/splay_tree_/traits.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/standard_policies.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/thin_heap_
+#usr/include/c++/4.9.3/ext/pb_ds/detail/thin_heap_/constructors_destructor_fn_imps.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/thin_heap_/debug_fn_imps.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/thin_heap_/erase_fn_imps.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/thin_heap_/find_fn_imps.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/thin_heap_/insert_fn_imps.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/thin_heap_/split_join_fn_imps.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/thin_heap_/thin_heap_.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/thin_heap_/trace_fn_imps.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/tree_policy
+#usr/include/c++/4.9.3/ext/pb_ds/detail/tree_policy/node_metadata_selector.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/tree_policy/order_statistics_imp.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/tree_policy/sample_tree_node_update.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/tree_trace_base.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/trie_policy
+#usr/include/c++/4.9.3/ext/pb_ds/detail/trie_policy/node_metadata_selector.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/trie_policy/order_statistics_imp.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/trie_policy/prefix_search_node_update_imp.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/trie_policy/sample_trie_access_traits.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/trie_policy/sample_trie_node_update.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/trie_policy/trie_policy_base.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/trie_policy/trie_string_access_traits_imp.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/type_utils.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/types_traits.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/unordered_iterator
+#usr/include/c++/4.9.3/ext/pb_ds/detail/unordered_iterator/const_iterator.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/unordered_iterator/iterator.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/unordered_iterator/point_const_iterator.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/detail/unordered_iterator/point_iterator.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/exception.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/hash_policy.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/list_update_policy.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/priority_queue.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/tag_and_trait.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/tree_policy.hpp
+#usr/include/c++/4.9.3/ext/pb_ds/trie_policy.hpp
+#usr/include/c++/4.9.3/ext/pod_char_traits.h
+#usr/include/c++/4.9.3/ext/pointer.h
+#usr/include/c++/4.9.3/ext/pool_allocator.h
+#usr/include/c++/4.9.3/ext/random
+#usr/include/c++/4.9.3/ext/random.tcc
+#usr/include/c++/4.9.3/ext/rb_tree
+#usr/include/c++/4.9.3/ext/rc_string_base.h
+#usr/include/c++/4.9.3/ext/rope
+#usr/include/c++/4.9.3/ext/ropeimpl.h
+#usr/include/c++/4.9.3/ext/slist
+#usr/include/c++/4.9.3/ext/sso_string_base.h
+#usr/include/c++/4.9.3/ext/stdio_filebuf.h
+#usr/include/c++/4.9.3/ext/stdio_sync_filebuf.h
+#usr/include/c++/4.9.3/ext/string_conversions.h
+#usr/include/c++/4.9.3/ext/throw_allocator.h
+#usr/include/c++/4.9.3/ext/type_traits.h
+#usr/include/c++/4.9.3/ext/typelist.h
+#usr/include/c++/4.9.3/ext/vstring.h
+#usr/include/c++/4.9.3/ext/vstring.tcc
+#usr/include/c++/4.9.3/ext/vstring_fwd.h
+#usr/include/c++/4.9.3/ext/vstring_util.h
+#usr/include/c++/4.9.3/fenv.h
+#usr/include/c++/4.9.3/forward_list
+#usr/include/c++/4.9.3/fstream
+#usr/include/c++/4.9.3/functional
+#usr/include/c++/4.9.3/future
+#usr/include/c++/4.9.3/initializer_list
+#usr/include/c++/4.9.3/iomanip
+#usr/include/c++/4.9.3/ios
+#usr/include/c++/4.9.3/iosfwd
+#usr/include/c++/4.9.3/iostream
+#usr/include/c++/4.9.3/istream
+#usr/include/c++/4.9.3/iterator
+#usr/include/c++/4.9.3/limits
+#usr/include/c++/4.9.3/list
+#usr/include/c++/4.9.3/locale
+#usr/include/c++/4.9.3/map
+#usr/include/c++/4.9.3/memory
+#usr/include/c++/4.9.3/mutex
+#usr/include/c++/4.9.3/new
+#usr/include/c++/4.9.3/numeric
+#usr/include/c++/4.9.3/ostream
+#usr/include/c++/4.9.3/parallel
+#usr/include/c++/4.9.3/parallel/algo.h
+#usr/include/c++/4.9.3/parallel/algobase.h
+#usr/include/c++/4.9.3/parallel/algorithm
+#usr/include/c++/4.9.3/parallel/algorithmfwd.h
+#usr/include/c++/4.9.3/parallel/balanced_quicksort.h
+#usr/include/c++/4.9.3/parallel/base.h
+#usr/include/c++/4.9.3/parallel/basic_iterator.h
+#usr/include/c++/4.9.3/parallel/checkers.h
+#usr/include/c++/4.9.3/parallel/compatibility.h
+#usr/include/c++/4.9.3/parallel/compiletime_settings.h
+#usr/include/c++/4.9.3/parallel/equally_split.h
+#usr/include/c++/4.9.3/parallel/features.h
+#usr/include/c++/4.9.3/parallel/find.h
+#usr/include/c++/4.9.3/parallel/find_selectors.h
+#usr/include/c++/4.9.3/parallel/for_each.h
+#usr/include/c++/4.9.3/parallel/for_each_selectors.h
+#usr/include/c++/4.9.3/parallel/iterator.h
+#usr/include/c++/4.9.3/parallel/list_partition.h
+#usr/include/c++/4.9.3/parallel/losertree.h
+#usr/include/c++/4.9.3/parallel/merge.h
+#usr/include/c++/4.9.3/parallel/multiseq_selection.h
+#usr/include/c++/4.9.3/parallel/multiway_merge.h
+#usr/include/c++/4.9.3/parallel/multiway_mergesort.h
+#usr/include/c++/4.9.3/parallel/numeric
+#usr/include/c++/4.9.3/parallel/numericfwd.h
+#usr/include/c++/4.9.3/parallel/omp_loop.h
+#usr/include/c++/4.9.3/parallel/omp_loop_static.h
+#usr/include/c++/4.9.3/parallel/par_loop.h
+#usr/include/c++/4.9.3/parallel/parallel.h
+#usr/include/c++/4.9.3/parallel/partial_sum.h
+#usr/include/c++/4.9.3/parallel/partition.h
+#usr/include/c++/4.9.3/parallel/queue.h
+#usr/include/c++/4.9.3/parallel/quicksort.h
+#usr/include/c++/4.9.3/parallel/random_number.h
+#usr/include/c++/4.9.3/parallel/random_shuffle.h
+#usr/include/c++/4.9.3/parallel/search.h
+#usr/include/c++/4.9.3/parallel/set_operations.h
+#usr/include/c++/4.9.3/parallel/settings.h
+#usr/include/c++/4.9.3/parallel/sort.h
+#usr/include/c++/4.9.3/parallel/tags.h
+#usr/include/c++/4.9.3/parallel/types.h
+#usr/include/c++/4.9.3/parallel/unique_copy.h
+#usr/include/c++/4.9.3/parallel/workstealing.h
+#usr/include/c++/4.9.3/profile
+#usr/include/c++/4.9.3/profile/array
+#usr/include/c++/4.9.3/profile/base.h
+#usr/include/c++/4.9.3/profile/bitset
+#usr/include/c++/4.9.3/profile/deque
+#usr/include/c++/4.9.3/profile/forward_list
+#usr/include/c++/4.9.3/profile/impl
+#usr/include/c++/4.9.3/profile/impl/profiler.h
+#usr/include/c++/4.9.3/profile/impl/profiler_algos.h
+#usr/include/c++/4.9.3/profile/impl/profiler_container_size.h
+#usr/include/c++/4.9.3/profile/impl/profiler_hash_func.h
+#usr/include/c++/4.9.3/profile/impl/profiler_hashtable_size.h
+#usr/include/c++/4.9.3/profile/impl/profiler_list_to_slist.h
+#usr/include/c++/4.9.3/profile/impl/profiler_list_to_vector.h
+#usr/include/c++/4.9.3/profile/impl/profiler_map_to_unordered_map.h
+#usr/include/c++/4.9.3/profile/impl/profiler_node.h
+#usr/include/c++/4.9.3/profile/impl/profiler_state.h
+#usr/include/c++/4.9.3/profile/impl/profiler_trace.h
+#usr/include/c++/4.9.3/profile/impl/profiler_vector_size.h
+#usr/include/c++/4.9.3/profile/impl/profiler_vector_to_list.h
+#usr/include/c++/4.9.3/profile/iterator_tracker.h
+#usr/include/c++/4.9.3/profile/list
+#usr/include/c++/4.9.3/profile/map
+#usr/include/c++/4.9.3/profile/map.h
+#usr/include/c++/4.9.3/profile/multimap.h
+#usr/include/c++/4.9.3/profile/multiset.h
+#usr/include/c++/4.9.3/profile/set
+#usr/include/c++/4.9.3/profile/set.h
+#usr/include/c++/4.9.3/profile/unordered_base.h
+#usr/include/c++/4.9.3/profile/unordered_map
+#usr/include/c++/4.9.3/profile/unordered_set
+#usr/include/c++/4.9.3/profile/vector
+#usr/include/c++/4.9.3/queue
+#usr/include/c++/4.9.3/random
+#usr/include/c++/4.9.3/ratio
+#usr/include/c++/4.9.3/regex
+#usr/include/c++/4.9.3/scoped_allocator
+#usr/include/c++/4.9.3/set
+#usr/include/c++/4.9.3/shared_mutex
+#usr/include/c++/4.9.3/sstream
+#usr/include/c++/4.9.3/stack
+#usr/include/c++/4.9.3/stdexcept
+#usr/include/c++/4.9.3/streambuf
+#usr/include/c++/4.9.3/string
+#usr/include/c++/4.9.3/system_error
+#usr/include/c++/4.9.3/tgmath.h
+#usr/include/c++/4.9.3/thread
+#usr/include/c++/4.9.3/tr1
+#usr/include/c++/4.9.3/tr1/array
+#usr/include/c++/4.9.3/tr1/bessel_function.tcc
+#usr/include/c++/4.9.3/tr1/beta_function.tcc
+#usr/include/c++/4.9.3/tr1/ccomplex
+#usr/include/c++/4.9.3/tr1/cctype
+#usr/include/c++/4.9.3/tr1/cfenv
+#usr/include/c++/4.9.3/tr1/cfloat
+#usr/include/c++/4.9.3/tr1/cinttypes
+#usr/include/c++/4.9.3/tr1/climits
+#usr/include/c++/4.9.3/tr1/cmath
+#usr/include/c++/4.9.3/tr1/complex
+#usr/include/c++/4.9.3/tr1/complex.h
+#usr/include/c++/4.9.3/tr1/cstdarg
+#usr/include/c++/4.9.3/tr1/cstdbool
+#usr/include/c++/4.9.3/tr1/cstdint
+#usr/include/c++/4.9.3/tr1/cstdio
+#usr/include/c++/4.9.3/tr1/cstdlib
+#usr/include/c++/4.9.3/tr1/ctgmath
+#usr/include/c++/4.9.3/tr1/ctime
+#usr/include/c++/4.9.3/tr1/ctype.h
+#usr/include/c++/4.9.3/tr1/cwchar
+#usr/include/c++/4.9.3/tr1/cwctype
+#usr/include/c++/4.9.3/tr1/ell_integral.tcc
+#usr/include/c++/4.9.3/tr1/exp_integral.tcc
+#usr/include/c++/4.9.3/tr1/fenv.h
+#usr/include/c++/4.9.3/tr1/float.h
+#usr/include/c++/4.9.3/tr1/functional
+#usr/include/c++/4.9.3/tr1/functional_hash.h
+#usr/include/c++/4.9.3/tr1/gamma.tcc
+#usr/include/c++/4.9.3/tr1/hashtable.h
+#usr/include/c++/4.9.3/tr1/hashtable_policy.h
+#usr/include/c++/4.9.3/tr1/hypergeometric.tcc
+#usr/include/c++/4.9.3/tr1/inttypes.h
+#usr/include/c++/4.9.3/tr1/legendre_function.tcc
+#usr/include/c++/4.9.3/tr1/limits.h
+#usr/include/c++/4.9.3/tr1/math.h
+#usr/include/c++/4.9.3/tr1/memory
+#usr/include/c++/4.9.3/tr1/modified_bessel_func.tcc
+#usr/include/c++/4.9.3/tr1/poly_hermite.tcc
+#usr/include/c++/4.9.3/tr1/poly_laguerre.tcc
+#usr/include/c++/4.9.3/tr1/random
+#usr/include/c++/4.9.3/tr1/random.h
+#usr/include/c++/4.9.3/tr1/random.tcc
+#usr/include/c++/4.9.3/tr1/regex
+#usr/include/c++/4.9.3/tr1/riemann_zeta.tcc
+#usr/include/c++/4.9.3/tr1/shared_ptr.h
+#usr/include/c++/4.9.3/tr1/special_function_util.h
+#usr/include/c++/4.9.3/tr1/stdarg.h
+#usr/include/c++/4.9.3/tr1/stdbool.h
+#usr/include/c++/4.9.3/tr1/stdint.h
+#usr/include/c++/4.9.3/tr1/stdio.h
+#usr/include/c++/4.9.3/tr1/stdlib.h
+#usr/include/c++/4.9.3/tr1/tgmath.h
+#usr/include/c++/4.9.3/tr1/tuple
+#usr/include/c++/4.9.3/tr1/type_traits
+#usr/include/c++/4.9.3/tr1/unordered_map
+#usr/include/c++/4.9.3/tr1/unordered_map.h
+#usr/include/c++/4.9.3/tr1/unordered_set
+#usr/include/c++/4.9.3/tr1/unordered_set.h
+#usr/include/c++/4.9.3/tr1/utility
+#usr/include/c++/4.9.3/tr1/wchar.h
+#usr/include/c++/4.9.3/tr1/wctype.h
+#usr/include/c++/4.9.3/tr2
+#usr/include/c++/4.9.3/tr2/bool_set
+#usr/include/c++/4.9.3/tr2/bool_set.tcc
+#usr/include/c++/4.9.3/tr2/dynamic_bitset
+#usr/include/c++/4.9.3/tr2/dynamic_bitset.tcc
+#usr/include/c++/4.9.3/tr2/ratio
+#usr/include/c++/4.9.3/tr2/type_traits
+#usr/include/c++/4.9.3/tuple
+#usr/include/c++/4.9.3/type_traits
+#usr/include/c++/4.9.3/typeindex
+#usr/include/c++/4.9.3/typeinfo
+#usr/include/c++/4.9.3/unordered_map
+#usr/include/c++/4.9.3/unordered_set
+#usr/include/c++/4.9.3/utility
+#usr/include/c++/4.9.3/valarray
+#usr/include/c++/4.9.3/vector
+#usr/include/c++/4.9.3/x86_64-unknown-linux-gnu
+#usr/include/c++/4.9.3/x86_64-unknown-linux-gnu/bits
+#usr/include/c++/4.9.3/x86_64-unknown-linux-gnu/bits/atomic_word.h
+#usr/include/c++/4.9.3/x86_64-unknown-linux-gnu/bits/basic_file.h
+#usr/include/c++/4.9.3/x86_64-unknown-linux-gnu/bits/c++allocator.h
+#usr/include/c++/4.9.3/x86_64-unknown-linux-gnu/bits/c++config.h
+#usr/include/c++/4.9.3/x86_64-unknown-linux-gnu/bits/c++io.h
+#usr/include/c++/4.9.3/x86_64-unknown-linux-gnu/bits/c++locale.h
+#usr/include/c++/4.9.3/x86_64-unknown-linux-gnu/bits/cpu_defines.h
+#usr/include/c++/4.9.3/x86_64-unknown-linux-gnu/bits/ctype_base.h
+#usr/include/c++/4.9.3/x86_64-unknown-linux-gnu/bits/ctype_inline.h
+#usr/include/c++/4.9.3/x86_64-unknown-linux-gnu/bits/cxxabi_tweaks.h
+#usr/include/c++/4.9.3/x86_64-unknown-linux-gnu/bits/error_constants.h
+#usr/include/c++/4.9.3/x86_64-unknown-linux-gnu/bits/extc++.h
+#usr/include/c++/4.9.3/x86_64-unknown-linux-gnu/bits/gthr-default.h
+#usr/include/c++/4.9.3/x86_64-unknown-linux-gnu/bits/gthr-posix.h
+#usr/include/c++/4.9.3/x86_64-unknown-linux-gnu/bits/gthr-single.h
+#usr/include/c++/4.9.3/x86_64-unknown-linux-gnu/bits/gthr.h
+#usr/include/c++/4.9.3/x86_64-unknown-linux-gnu/bits/messages_members.h
+#usr/include/c++/4.9.3/x86_64-unknown-linux-gnu/bits/opt_random.h
+#usr/include/c++/4.9.3/x86_64-unknown-linux-gnu/bits/os_defines.h
+#usr/include/c++/4.9.3/x86_64-unknown-linux-gnu/bits/stdc++.h
+#usr/include/c++/4.9.3/x86_64-unknown-linux-gnu/bits/stdtr1c++.h
+#usr/include/c++/4.9.3/x86_64-unknown-linux-gnu/bits/time_members.h
+#usr/include/c++/4.9.3/x86_64-unknown-linux-gnu/ext
+#usr/include/c++/4.9.3/x86_64-unknown-linux-gnu/ext/opt_random.h
 #usr/lib/gcc
 #usr/lib/gcc/x86_64-unknown-linux-gnu
-#usr/lib/gcc/x86_64-unknown-linux-gnu/4.4.7
-#usr/lib/gcc/x86_64-unknown-linux-gnu/4.4.7/cc1
-#usr/lib/gcc/x86_64-unknown-linux-gnu/4.4.7/cc1plus
-#usr/lib/gcc/x86_64-unknown-linux-gnu/4.4.7/collect2
-#usr/lib/gcc/x86_64-unknown-linux-gnu/4.4.7/crtbegin.o
-#usr/lib/gcc/x86_64-unknown-linux-gnu/4.4.7/crtbeginS.o
-#usr/lib/gcc/x86_64-unknown-linux-gnu/4.4.7/crtbeginT.o
-#usr/lib/gcc/x86_64-unknown-linux-gnu/4.4.7/crtend.o
-#usr/lib/gcc/x86_64-unknown-linux-gnu/4.4.7/crtendS.o
-#usr/lib/gcc/x86_64-unknown-linux-gnu/4.4.7/crtfastmath.o
-#usr/lib/gcc/x86_64-unknown-linux-gnu/4.4.7/crtprec32.o
-#usr/lib/gcc/x86_64-unknown-linux-gnu/4.4.7/crtprec64.o
-#usr/lib/gcc/x86_64-unknown-linux-gnu/4.4.7/crtprec80.o
-#usr/lib/gcc/x86_64-unknown-linux-gnu/4.4.7/finclude
-#usr/lib/gcc/x86_64-unknown-linux-gnu/4.4.7/include
-#usr/lib/gcc/x86_64-unknown-linux-gnu/4.4.7/include-fixed
-#usr/lib/gcc/x86_64-unknown-linux-gnu/4.4.7/include-fixed/README
-#usr/lib/gcc/x86_64-unknown-linux-gnu/4.4.7/include-fixed/limits.h
-#usr/lib/gcc/x86_64-unknown-linux-gnu/4.4.7/include-fixed/syslimits.h
-#usr/lib/gcc/x86_64-unknown-linux-gnu/4.4.7/include/ammintrin.h
-#usr/lib/gcc/x86_64-unknown-linux-gnu/4.4.7/include/avxintrin.h
-#usr/lib/gcc/x86_64-unknown-linux-gnu/4.4.7/include/bmmintrin.h
-#usr/lib/gcc/x86_64-unknown-linux-gnu/4.4.7/include/cpuid.h
-#usr/lib/gcc/x86_64-unknown-linux-gnu/4.4.7/include/cross-stdarg.h
-#usr/lib/gcc/x86_64-unknown-linux-gnu/4.4.7/include/emmintrin.h
-#usr/lib/gcc/x86_64-unknown-linux-gnu/4.4.7/include/float.h
-#usr/lib/gcc/x86_64-unknown-linux-gnu/4.4.7/include/immintrin.h
-#usr/lib/gcc/x86_64-unknown-linux-gnu/4.4.7/include/iso646.h
-#usr/lib/gcc/x86_64-unknown-linux-gnu/4.4.7/include/mf-runtime.h
-#usr/lib/gcc/x86_64-unknown-linux-gnu/4.4.7/include/mm3dnow.h
-#usr/lib/gcc/x86_64-unknown-linux-gnu/4.4.7/include/mm_malloc.h
-#usr/lib/gcc/x86_64-unknown-linux-gnu/4.4.7/include/mmintrin-common.h
-#usr/lib/gcc/x86_64-unknown-linux-gnu/4.4.7/include/mmintrin.h
-#usr/lib/gcc/x86_64-unknown-linux-gnu/4.4.7/include/nmmintrin.h
-#usr/lib/gcc/x86_64-unknown-linux-gnu/4.4.7/include/omp.h
-#usr/lib/gcc/x86_64-unknown-linux-gnu/4.4.7/include/pmmintrin.h
-#usr/lib/gcc/x86_64-unknown-linux-gnu/4.4.7/include/smmintrin.h
-#usr/lib/gcc/x86_64-unknown-linux-gnu/4.4.7/include/ssp
-#usr/lib/gcc/x86_64-unknown-linux-gnu/4.4.7/include/ssp/ssp.h
-#usr/lib/gcc/x86_64-unknown-linux-gnu/4.4.7/include/ssp/stdio.h
-#usr/lib/gcc/x86_64-unknown-linux-gnu/4.4.7/include/ssp/string.h
-#usr/lib/gcc/x86_64-unknown-linux-gnu/4.4.7/include/ssp/unistd.h
-#usr/lib/gcc/x86_64-unknown-linux-gnu/4.4.7/include/stdarg.h
-#usr/lib/gcc/x86_64-unknown-linux-gnu/4.4.7/include/stdbool.h
-#usr/lib/gcc/x86_64-unknown-linux-gnu/4.4.7/include/stddef.h
-#usr/lib/gcc/x86_64-unknown-linux-gnu/4.4.7/include/stdfix.h
-#usr/lib/gcc/x86_64-unknown-linux-gnu/4.4.7/include/tmmintrin.h
-#usr/lib/gcc/x86_64-unknown-linux-gnu/4.4.7/include/unwind.h
-#usr/lib/gcc/x86_64-unknown-linux-gnu/4.4.7/include/varargs.h
-#usr/lib/gcc/x86_64-unknown-linux-gnu/4.4.7/include/wmmintrin.h
-#usr/lib/gcc/x86_64-unknown-linux-gnu/4.4.7/include/x86intrin.h
-#usr/lib/gcc/x86_64-unknown-linux-gnu/4.4.7/include/xmmintrin.h
-#usr/lib/gcc/x86_64-unknown-linux-gnu/4.4.7/install-tools
-#usr/lib/gcc/x86_64-unknown-linux-gnu/4.4.7/install-tools/fixinc.sh
-#usr/lib/gcc/x86_64-unknown-linux-gnu/4.4.7/install-tools/fixinc_list
-#usr/lib/gcc/x86_64-unknown-linux-gnu/4.4.7/install-tools/fixincl
-#usr/lib/gcc/x86_64-unknown-linux-gnu/4.4.7/install-tools/gsyslimits.h
-#usr/lib/gcc/x86_64-unknown-linux-gnu/4.4.7/install-tools/include
-#usr/lib/gcc/x86_64-unknown-linux-gnu/4.4.7/install-tools/include/README
-#usr/lib/gcc/x86_64-unknown-linux-gnu/4.4.7/install-tools/include/limits.h
-#usr/lib/gcc/x86_64-unknown-linux-gnu/4.4.7/install-tools/macro_list
-#usr/lib/gcc/x86_64-unknown-linux-gnu/4.4.7/install-tools/mkheaders
-#usr/lib/gcc/x86_64-unknown-linux-gnu/4.4.7/install-tools/mkheaders.conf
-#usr/lib/gcc/x86_64-unknown-linux-gnu/4.4.7/install-tools/mkinstalldirs
-#usr/lib/gcc/x86_64-unknown-linux-gnu/4.4.7/libgcc.a
-#usr/lib/gcc/x86_64-unknown-linux-gnu/4.4.7/libgcc_eh.a
-#usr/lib/gcc/x86_64-unknown-linux-gnu/4.4.7/libgcov.a
+#usr/lib/gcc/x86_64-unknown-linux-gnu/4.9.3
+#usr/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/cc1
+#usr/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/cc1plus
+#usr/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/collect2
+#usr/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/crtbegin.o
+#usr/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/crtbeginS.o
+#usr/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/crtbeginT.o
+#usr/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/crtend.o
+#usr/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/crtendS.o
+#usr/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/crtfastmath.o
+#usr/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/crtprec32.o
+#usr/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/crtprec64.o
+#usr/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/crtprec80.o
+#usr/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/finclude
+#usr/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/include
+#usr/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/include-fixed
+#usr/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/include-fixed/README
+#usr/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/include-fixed/limits.h
+#usr/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/include-fixed/syslimits.h
+#usr/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/include/adxintrin.h
+#usr/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/include/ammintrin.h
+#usr/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/include/avx2intrin.h
+#usr/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/include/avx512cdintrin.h
+#usr/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/include/avx512erintrin.h
+#usr/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/include/avx512fintrin.h
+#usr/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/include/avx512pfintrin.h
+#usr/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/include/avxintrin.h
+#usr/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/include/bmi2intrin.h
+#usr/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/include/bmiintrin.h
+#usr/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/include/bmmintrin.h
+#usr/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/include/cilk
+#usr/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/include/cilk/cilk.h
+#usr/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/include/cilk/cilk_api.h
+#usr/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/include/cilk/cilk_api_linux.h
+#usr/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/include/cilk/cilk_stub.h
+#usr/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/include/cilk/cilk_undocumented.h
+#usr/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/include/cilk/common.h
+#usr/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/include/cilk/holder.h
+#usr/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/include/cilk/hyperobject_base.h
+#usr/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/include/cilk/metaprogramming.h
+#usr/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/include/cilk/reducer.h
+#usr/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/include/cilk/reducer_file.h
+#usr/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/include/cilk/reducer_list.h
+#usr/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/include/cilk/reducer_max.h
+#usr/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/include/cilk/reducer_min.h
+#usr/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/include/cilk/reducer_min_max.h
+#usr/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/include/cilk/reducer_opadd.h
+#usr/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/include/cilk/reducer_opand.h
+#usr/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/include/cilk/reducer_opmul.h
+#usr/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/include/cilk/reducer_opor.h
+#usr/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/include/cilk/reducer_opxor.h
+#usr/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/include/cilk/reducer_ostream.h
+#usr/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/include/cilk/reducer_string.h
+#usr/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/include/cpuid.h
+#usr/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/include/cross-stdarg.h
+#usr/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/include/emmintrin.h
+#usr/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/include/f16cintrin.h
+#usr/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/include/float.h
+#usr/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/include/fma4intrin.h
+#usr/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/include/fmaintrin.h
+#usr/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/include/fxsrintrin.h
+#usr/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/include/ia32intrin.h
+#usr/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/include/immintrin.h
+#usr/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/include/iso646.h
+#usr/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/include/lwpintrin.h
+#usr/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/include/lzcntintrin.h
+#usr/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/include/mm3dnow.h
+#usr/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/include/mm_malloc.h
+#usr/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/include/mmintrin.h
+#usr/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/include/nmmintrin.h
+#usr/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/include/omp.h
+#usr/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/include/pmmintrin.h
+#usr/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/include/popcntintrin.h
+#usr/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/include/prfchwintrin.h
+#usr/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/include/quadmath.h
+#usr/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/include/quadmath_weak.h
+#usr/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/include/rdseedintrin.h
+#usr/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/include/rtmintrin.h
+#usr/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/include/sanitizer
+#usr/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/include/sanitizer/asan_interface.h
+#usr/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/include/sanitizer/common_interface_defs.h
+#usr/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/include/sanitizer/lsan_interface.h
+#usr/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/include/shaintrin.h
+#usr/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/include/smmintrin.h
+#usr/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/include/ssp
+#usr/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/include/ssp/ssp.h
+#usr/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/include/ssp/stdio.h
+#usr/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/include/ssp/string.h
+#usr/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/include/ssp/unistd.h
+#usr/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/include/stdalign.h
+#usr/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/include/stdarg.h
+#usr/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/include/stdatomic.h
+#usr/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/include/stdbool.h
+#usr/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/include/stddef.h
+#usr/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/include/stdfix.h
+#usr/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/include/stdint-gcc.h
+#usr/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/include/stdint.h
+#usr/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/include/stdnoreturn.h
+#usr/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/include/tbmintrin.h
+#usr/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/include/tmmintrin.h
+#usr/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/include/unwind.h
+#usr/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/include/varargs.h
+#usr/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/include/wmmintrin.h
+#usr/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/include/x86intrin.h
+#usr/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/include/xmmintrin.h
+#usr/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/include/xopintrin.h
+#usr/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/include/xsaveintrin.h
+#usr/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/include/xsaveoptintrin.h
+#usr/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/include/xtestintrin.h
+#usr/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/install-tools
+#usr/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/install-tools/fixinc.sh
+#usr/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/install-tools/fixinc_list
+#usr/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/install-tools/fixincl
+#usr/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/install-tools/gsyslimits.h
+#usr/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/install-tools/include
+#usr/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/install-tools/include/README
+#usr/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/install-tools/include/limits.h
+#usr/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/install-tools/macro_list
+#usr/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/install-tools/mkheaders
+#usr/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/install-tools/mkheaders.conf
+#usr/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/install-tools/mkinstalldirs
+#usr/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/libgcc.a
+#usr/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/libgcc_eh.a
+#usr/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/libgcov.a
+#usr/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/liblto_plugin.la
+#usr/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/liblto_plugin.so
+#usr/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/liblto_plugin.so.0
+#usr/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/liblto_plugin.so.0.0.0
+#usr/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/lto-wrapper
+#usr/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/lto1
+#usr/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/plugin
+#usr/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/plugin/gengtype
+#usr/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/plugin/gtype.state
+#usr/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/plugin/include
+#usr/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/plugin/include/ada
+#usr/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/plugin/include/ada/gcc-interface
+#usr/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/plugin/include/ada/gcc-interface/ada-tree.def
+#usr/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/plugin/include/alias.h
+#usr/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/plugin/include/all-tree.def
+#usr/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/plugin/include/alloc-pool.h
+#usr/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/plugin/include/ansidecl.h
+#usr/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/plugin/include/attribs.h
+#usr/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/plugin/include/auto-host.h
+#usr/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/plugin/include/b-header-vars
+#usr/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/plugin/include/basic-block.h
+#usr/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/plugin/include/bitmap.h
+#usr/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/plugin/include/builtins.def
+#usr/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/plugin/include/bversion.h
+#usr/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/plugin/include/c-family
+#usr/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/plugin/include/c-family/c-common.def
+#usr/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/plugin/include/c-family/c-common.h
+#usr/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/plugin/include/c-family/c-objc.h
+#usr/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/plugin/include/c-family/c-pragma.h
+#usr/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/plugin/include/c-family/c-pretty-print.h
+#usr/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/plugin/include/c-tree.h
+#usr/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/plugin/include/calls.h
+#usr/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/plugin/include/cfg-flags.def
+#usr/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/plugin/include/cfgexpand.h
+#usr/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/plugin/include/cfghooks.h
+#usr/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/plugin/include/cfgloop.h
+#usr/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/plugin/include/cgraph.h
+#usr/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/plugin/include/cif-code.def
+#usr/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/plugin/include/cilk-builtins.def
+#usr/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/plugin/include/cilkplus.def
+#usr/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/plugin/include/config
+#usr/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/plugin/include/config.h
+#usr/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/plugin/include/config/dbxelf.h
+#usr/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/plugin/include/config/elfos.h
+#usr/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/plugin/include/config/glibc-stdint.h
+#usr/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/plugin/include/config/gnu-user.h
+#usr/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/plugin/include/config/i386
+#usr/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/plugin/include/config/i386/att.h
+#usr/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/plugin/include/config/i386/biarch64.h
+#usr/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/plugin/include/config/i386/gnu-user-common.h
+#usr/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/plugin/include/config/i386/gnu-user64.h
+#usr/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/plugin/include/config/i386/i386-opts.h
+#usr/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/plugin/include/config/i386/i386-protos.h
+#usr/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/plugin/include/config/i386/i386.h
+#usr/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/plugin/include/config/i386/linux-common.h
+#usr/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/plugin/include/config/i386/linux64.h
+#usr/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/plugin/include/config/i386/stringop.def
+#usr/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/plugin/include/config/i386/unix.h
+#usr/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/plugin/include/config/i386/x86-64.h
+#usr/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/plugin/include/config/i386/x86-tune.def
+#usr/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/plugin/include/config/initfini-array.h
+#usr/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/plugin/include/config/linux-android.h
+#usr/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/plugin/include/config/linux-protos.h
+#usr/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/plugin/include/config/linux.h
+#usr/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/plugin/include/config/vxworks-dummy.h
+#usr/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/plugin/include/configargs.h
+#usr/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/plugin/include/context.h
+#usr/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/plugin/include/coretypes.h
+#usr/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/plugin/include/cp
+#usr/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/plugin/include/cp/cp-tree.def
+#usr/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/plugin/include/cp/cp-tree.h
+#usr/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/plugin/include/cp/cxx-pretty-print.h
+#usr/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/plugin/include/cp/name-lookup.h
+#usr/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/plugin/include/cp/type-utils.h
+#usr/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/plugin/include/cppdefault.h
+#usr/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/plugin/include/cpplib.h
+#usr/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/plugin/include/debug.h
+#usr/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/plugin/include/defaults.h
+#usr/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/plugin/include/df.h
+#usr/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/plugin/include/diagnostic-color.h
+#usr/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/plugin/include/diagnostic-core.h
+#usr/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/plugin/include/diagnostic.def
+#usr/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/plugin/include/diagnostic.h
+#usr/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/plugin/include/double-int.h
+#usr/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/plugin/include/dumpfile.h
+#usr/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/plugin/include/emit-rtl.h
+#usr/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/plugin/include/except.h
+#usr/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/plugin/include/filenames.h
+#usr/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/plugin/include/fixed-value.h
+#usr/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/plugin/include/flag-types.h
+#usr/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/plugin/include/flags.h
+#usr/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/plugin/include/fold-const.h
+#usr/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/plugin/include/function.h
+#usr/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/plugin/include/gcc-plugin.h
+#usr/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/plugin/include/gcc-symtab.h
+#usr/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/plugin/include/genrtl.h
+#usr/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/plugin/include/ggc.h
+#usr/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/plugin/include/gimple-builder.h
+#usr/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/plugin/include/gimple-expr.h
+#usr/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/plugin/include/gimple-fold.h
+#usr/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/plugin/include/gimple-iterator.h
+#usr/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/plugin/include/gimple-low.h
+#usr/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/plugin/include/gimple-pretty-print.h
+#usr/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/plugin/include/gimple-ssa.h
+#usr/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/plugin/include/gimple-walk.h
+#usr/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/plugin/include/gimple.def
+#usr/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/plugin/include/gimple.h
+#usr/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/plugin/include/gimplify-me.h
+#usr/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/plugin/include/gimplify.h
+#usr/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/plugin/include/gsstruct.def
+#usr/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/plugin/include/gtm-builtins.def
+#usr/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/plugin/include/gtype-desc.h
+#usr/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/plugin/include/hard-reg-set.h
+#usr/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/plugin/include/hash-table.h
+#usr/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/plugin/include/hashtab.h
+#usr/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/plugin/include/highlev-plugin-common.h
+#usr/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/plugin/include/hwint.h
+#usr/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/plugin/include/incpath.h
+#usr/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/plugin/include/input.h
+#usr/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/plugin/include/insn-codes.h
+#usr/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/plugin/include/insn-constants.h
+#usr/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/plugin/include/insn-flags.h
+#usr/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/plugin/include/insn-modes.h
+#usr/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/plugin/include/insn-notes.def
+#usr/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/plugin/include/internal-fn.def
+#usr/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/plugin/include/internal-fn.h
+#usr/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/plugin/include/intl.h
+#usr/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/plugin/include/ipa-prop.h
+#usr/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/plugin/include/ipa-ref-inline.h
+#usr/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/plugin/include/ipa-ref.h
+#usr/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/plugin/include/ipa-reference.h
+#usr/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/plugin/include/ipa-utils.h
+#usr/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/plugin/include/is-a.h
+#usr/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/plugin/include/java
+#usr/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/plugin/include/java/java-tree.def
+#usr/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/plugin/include/langhooks.h
+#usr/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/plugin/include/libiberty.h
+#usr/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/plugin/include/line-map.h
+#usr/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/plugin/include/machmode.h
+#usr/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/plugin/include/md5.h
+#usr/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/plugin/include/mode-classes.def
+#usr/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/plugin/include/objc
+#usr/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/plugin/include/objc/objc-tree.def
+#usr/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/plugin/include/obstack.h
+#usr/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/plugin/include/omp-builtins.def
+#usr/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/plugin/include/options.h
+#usr/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/plugin/include/opts.h
+#usr/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/plugin/include/output.h
+#usr/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/plugin/include/params.def
+#usr/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/plugin/include/params.h
+#usr/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/plugin/include/pass-instances.def
+#usr/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/plugin/include/pass_manager.h
+#usr/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/plugin/include/plugin-api.h
+#usr/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/plugin/include/plugin-version.h
+#usr/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/plugin/include/plugin.def
+#usr/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/plugin/include/plugin.h
+#usr/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/plugin/include/pointer-set.h
+#usr/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/plugin/include/predict.def
+#usr/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/plugin/include/predict.h
+#usr/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/plugin/include/prefix.h
+#usr/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/plugin/include/pretty-print.h
+#usr/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/plugin/include/print-rtl.h
+#usr/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/plugin/include/print-tree.h
+#usr/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/plugin/include/real.h
+#usr/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/plugin/include/realmpfr.h
+#usr/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/plugin/include/reg-notes.def
+#usr/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/plugin/include/regset.h
+#usr/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/plugin/include/resource.h
+#usr/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/plugin/include/rtl.def
+#usr/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/plugin/include/rtl.h
+#usr/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/plugin/include/safe-ctype.h
+#usr/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/plugin/include/sanitizer.def
+#usr/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/plugin/include/sbitmap.h
+#usr/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/plugin/include/splay-tree.h
+#usr/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/plugin/include/ssa-iterators.h
+#usr/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/plugin/include/statistics.h
+#usr/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/plugin/include/stmt.h
+#usr/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/plugin/include/stor-layout.h
+#usr/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/plugin/include/stringpool.h
+#usr/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/plugin/include/symtab.h
+#usr/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/plugin/include/sync-builtins.def
+#usr/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/plugin/include/system.h
+#usr/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/plugin/include/target-hooks-macros.h
+#usr/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/plugin/include/target.def
+#usr/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/plugin/include/target.h
+#usr/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/plugin/include/timevar.def
+#usr/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/plugin/include/timevar.h
+#usr/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/plugin/include/tm-preds.h
+#usr/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/plugin/include/tm.h
+#usr/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/plugin/include/tm_p.h
+#usr/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/plugin/include/toplev.h
+#usr/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/plugin/include/tree-cfg.h
+#usr/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/plugin/include/tree-cfgcleanup.h
+#usr/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/plugin/include/tree-check.h
+#usr/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/plugin/include/tree-core.h
+#usr/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/plugin/include/tree-dfa.h
+#usr/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/plugin/include/tree-dump.h
+#usr/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/plugin/include/tree-eh.h
+#usr/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/plugin/include/tree-hasher.h
+#usr/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/plugin/include/tree-inline.h
+#usr/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/plugin/include/tree-into-ssa.h
+#usr/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/plugin/include/tree-iterator.h
+#usr/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/plugin/include/tree-nested.h
+#usr/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/plugin/include/tree-object-size.h
+#usr/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/plugin/include/tree-outof-ssa.h
+#usr/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/plugin/include/tree-parloops.h
+#usr/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/plugin/include/tree-pass.h
+#usr/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/plugin/include/tree-phinodes.h
+#usr/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/plugin/include/tree-pretty-print.h
+#usr/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/plugin/include/tree-ssa-address.h
+#usr/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/plugin/include/tree-ssa-alias.h
+#usr/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/plugin/include/tree-ssa-coalesce.h
+#usr/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/plugin/include/tree-ssa-dom.h
+#usr/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/plugin/include/tree-ssa-loop-ivopts.h
+#usr/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/plugin/include/tree-ssa-loop-manip.h
+#usr/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/plugin/include/tree-ssa-loop-niter.h
+#usr/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/plugin/include/tree-ssa-loop.h
+#usr/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/plugin/include/tree-ssa-operands.h
+#usr/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/plugin/include/tree-ssa-sccvn.h
+#usr/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/plugin/include/tree-ssa-ter.h
+#usr/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/plugin/include/tree-ssa-threadedge.h
+#usr/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/plugin/include/tree-ssa-threadupdate.h
+#usr/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/plugin/include/tree-ssa.h
+#usr/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/plugin/include/tree-ssanames.h
+#usr/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/plugin/include/tree.def
+#usr/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/plugin/include/tree.h
+#usr/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/plugin/include/treestruct.def
+#usr/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/plugin/include/varasm.h
+#usr/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/plugin/include/vec.h
+#usr/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/plugin/include/version.h
+#usr/lib/libasan.a
+#usr/lib/libasan.la
+#usr/lib/libasan.so
+usr/lib/libasan.so.1
+usr/lib/libasan.so.1.0.0
+#usr/lib/libasan_preinit.o
+#usr/lib/libatomic.a
+#usr/lib/libatomic.la
+#usr/lib/libatomic.so
+usr/lib/libatomic.so.1
+usr/lib/libatomic.so.1.1.0
+#usr/lib/libcilkrts.a
+#usr/lib/libcilkrts.la
+#usr/lib/libcilkrts.so
+usr/lib/libcilkrts.so.5
+usr/lib/libcilkrts.so.5.0.0
+#usr/lib/libcilkrts.spec
 #usr/lib/libgomp.a
 #usr/lib/libgomp.la
 #usr/lib/libgomp.so
 usr/lib/libgomp.so.1
 usr/lib/libgomp.so.1.0.0
 #usr/lib/libgomp.spec
-#usr/lib/libmudflap.a
-#usr/lib/libmudflap.la
-#usr/lib/libmudflap.so
-usr/lib/libmudflap.so.0
-usr/lib/libmudflap.so.0.0.0
-#usr/lib/libmudflapth.a
-#usr/lib/libmudflapth.la
-#usr/lib/libmudflapth.so
-usr/lib/libmudflapth.so.0
-usr/lib/libmudflapth.so.0.0.0
+#usr/lib/libitm.a
+#usr/lib/libitm.la
+#usr/lib/libitm.so
+usr/lib/libitm.so.1
+usr/lib/libitm.so.1.0.0
+#usr/lib/libitm.spec
+#usr/lib/liblsan.a
+#usr/lib/liblsan.la
+#usr/lib/liblsan.so
+usr/lib/liblsan.so.0
+usr/lib/liblsan.so.0.0.0
+#usr/lib/libquadmath.a
+#usr/lib/libquadmath.la
+#usr/lib/libquadmath.so
+usr/lib/libquadmath.so.0
+usr/lib/libquadmath.so.0.0.0
+#usr/lib/libsanitizer.spec
 #usr/lib/libssp.a
 #usr/lib/libssp.la
 #usr/lib/libssp.so
@@ -786,16 +1143,44 @@ usr/lib/libmudflapth.so.0.0.0
 #usr/lib/libssp_nonshared.a
 #usr/lib/libssp_nonshared.la
 #usr/lib/libstdc++.a
-usr/lib/libstdc++.so.6.0.13
+usr/lib/libstdc++.so.6.0.20
+#usr/lib/libstdc++.so.6.0.20-gdb.py
 #usr/lib/libsupc++.a
 #usr/lib/libsupc++.la
-#usr/man
-#usr/man/man1
-#usr/man/man1/cpp.1
-#usr/man/man1/g++.1
-#usr/man/man1/gcc.1
-#usr/man/man1/gcov.1
-#usr/man/man7
-#usr/man/man7/fsf-funding.7
-#usr/man/man7/gfdl.7
-#usr/man/man7/gpl.7
+#usr/lib/libtsan.a
+#usr/lib/libtsan.la
+#usr/lib/libtsan.so
+usr/lib/libtsan.so.0
+usr/lib/libtsan.so.0.0.0
+#usr/lib/libubsan.a
+#usr/lib/libubsan.la
+#usr/lib/libubsan.so
+usr/lib/libubsan.so.0
+usr/lib/libubsan.so.0.0.0
+#usr/lib/libvtv.a
+#usr/lib/libvtv.la
+#usr/lib/libvtv.so
+usr/lib/libvtv.so.0
+usr/lib/libvtv.so.0.0.0
+#usr/share/gcc-4.9.3
+#usr/share/gcc-4.9.3/python
+#usr/share/gcc-4.9.3/python/libstdcxx
+#usr/share/gcc-4.9.3/python/libstdcxx/__init__.py
+#usr/share/gcc-4.9.3/python/libstdcxx/v6
+#usr/share/gcc-4.9.3/python/libstdcxx/v6/__init__.py
+#usr/share/gcc-4.9.3/python/libstdcxx/v6/printers.py
+#usr/share/info/cpp.info
+#usr/share/info/cppinternals.info
+#usr/share/info/gcc.info
+#usr/share/info/gccinstall.info
+#usr/share/info/gccint.info
+#usr/share/info/libgomp.info
+#usr/share/info/libitm.info
+#usr/share/info/libquadmath.info
+#usr/share/man/man1/cpp.1
+#usr/share/man/man1/g++.1
+#usr/share/man/man1/gcc.1
+#usr/share/man/man1/gcov.1
+#usr/share/man/man7/fsf-funding.7
+#usr/share/man/man7/gfdl.7
+#usr/share/man/man7/gpl.7
index aabc8a68c3c1695b0e891994bc96001496b4a114..80ae0dd2d762a3fad31bf5613775bb55fc766bd7 100644 (file)
@@ -27,6 +27,7 @@ etc/rc.d/init.d/console
 #etc/rc.d/init.d/cyrus-sasl
 etc/rc.d/init.d/dhcp
 etc/rc.d/init.d/dhcrelay
+#etc/rc.d/init.d/dnsdist
 etc/rc.d/init.d/dnsmasq
 etc/rc.d/init.d/fcron
 #etc/rc.d/init.d/fetchmail
index b4053d9b71c40a42ad15ec9062d9c5e68720bee2..8b71758ffeeb57ba6e86484d92373f997e16a1db 100644 (file)
@@ -41,7 +41,7 @@ usr/bin/xzmore
 #usr/lib/liblzma.la
 usr/lib/liblzma.so
 usr/lib/liblzma.so.5
-usr/lib/liblzma.so.5.2.1
+usr/lib/liblzma.so.5.2.2
 #usr/lib/pkgconfig/liblzma.pc
 #usr/share/doc/xz
 #usr/share/doc/xz/AUTHORS
diff --git a/config/rootfiles/core/100/filelists/bind b/config/rootfiles/core/100/filelists/bind
new file mode 120000 (symlink)
index 0000000..48a0eba
--- /dev/null
@@ -0,0 +1 @@
+../../../common/bind
\ No newline at end of file
diff --git a/config/rootfiles/core/100/filelists/files b/config/rootfiles/core/100/filelists/files
new file mode 100644 (file)
index 0000000..b3cd418
--- /dev/null
@@ -0,0 +1,24 @@
+etc/system-release
+etc/issue
+etc/dracut.conf
+etc/ppp/ip-up
+etc/rc.d/init.d/firewall
+etc/rc.d/init.d/functions
+etc/rc.d/init.d/networking/dhcpcd.exe
+etc/modprobe.d/nf_conntrack.conf
+lib/udev/rules.d/60-net.rules
+srv/web/ipfire/cgi-bin/logs.cgi/firewalllog.dat
+srv/web/ipfire/cgi-bin/logs.cgi/firewalllogcountry.dat
+srv/web/ipfire/cgi-bin/logs.cgi/firewalllogip.dat
+srv/web/ipfire/cgi-bin/logs.cgi/firewalllogport.dat
+srv/web/ipfire/cgi-bin/logs.cgi/showrequestfromcountry.dat
+srv/web/ipfire/cgi-bin/logs.cgi/showrequestfromip.dat
+srv/web/ipfire/cgi-bin/logs.cgi/showrequestfromport.dat
+srv/web/ipfire/cgi-bin/optionsfw.cgi
+srv/web/ipfire/cgi-bin/ovpnmain.cgi
+srv/web/ipfire/cgi-bin/qos.cgi
+srv/web/ipfire/cgi-bin/webaccess.cgi
+usr/bin/pgrep
+usr/local/bin/qosctrl
+usr/local/bin/timectrl
+var/ipfire/dhcpc/dhcpcd-hooks/10-mtu
diff --git a/config/rootfiles/core/100/filelists/grep b/config/rootfiles/core/100/filelists/grep
new file mode 120000 (symlink)
index 0000000..ab5ef8b
--- /dev/null
@@ -0,0 +1 @@
+../../../common/grep
\ No newline at end of file
diff --git a/config/rootfiles/core/100/filelists/openvpn b/config/rootfiles/core/100/filelists/openvpn
new file mode 120000 (symlink)
index 0000000..493f3f7
--- /dev/null
@@ -0,0 +1 @@
+../../../common/openvpn
\ No newline at end of file
diff --git a/config/rootfiles/core/100/filelists/sed b/config/rootfiles/core/100/filelists/sed
new file mode 120000 (symlink)
index 0000000..fc5f5c6
--- /dev/null
@@ -0,0 +1 @@
+../../../common/sed
\ No newline at end of file
diff --git a/config/rootfiles/core/100/filelists/squid b/config/rootfiles/core/100/filelists/squid
new file mode 120000 (symlink)
index 0000000..2dc8372
--- /dev/null
@@ -0,0 +1 @@
+../../../common/squid
\ No newline at end of file
diff --git a/config/rootfiles/core/100/filelists/tzdata b/config/rootfiles/core/100/filelists/tzdata
new file mode 120000 (symlink)
index 0000000..5a6e325
--- /dev/null
@@ -0,0 +1 @@
+../../../common/tzdata
\ No newline at end of file
diff --git a/config/rootfiles/core/100/filelists/xz b/config/rootfiles/core/100/filelists/xz
new file mode 120000 (symlink)
index 0000000..734e926
--- /dev/null
@@ -0,0 +1 @@
+../../../common/xz
\ No newline at end of file
diff --git a/config/rootfiles/core/100/update.sh b/config/rootfiles/core/100/update.sh
new file mode 100644 (file)
index 0000000..8745ff1
--- /dev/null
@@ -0,0 +1,68 @@
+#!/bin/bash
+############################################################################
+#                                                                          #
+# This file is part of the IPFire Firewall.                                #
+#                                                                          #
+# IPFire 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 3 of the License, or        #
+# (at your option) any later version.                                      #
+#                                                                          #
+# IPFire 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 IPFire; if not, write to the Free Software                    #
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA #
+#                                                                          #
+# Copyright (C) 2016 IPFire-Team <info@ipfire.org>.                        #
+#                                                                          #
+############################################################################
+#
+. /opt/pakfire/lib/functions.sh
+/usr/local/bin/backupctrl exclude >/dev/null 2>&1
+
+# Remove old core updates from pakfire cache to save space...
+core=100
+for (( i=1; i<=$core; i++ ))
+do
+       rm -f /var/cache/pakfire/core-upgrade-*-$i.ipfire
+done
+
+# Stop services
+/etc/init.d/squid stop
+/etc/init.d/dnsmasq stop
+
+# Extract files
+extract_files
+
+# Fix hardening flags in grub
+paxctl -mpexs /usr/bin/grub-script-check
+
+# Update Language cache
+# /usr/local/bin/update-lang-cache
+
+# Start services
+/etc/init.d/dnsmasq start
+/etc/init.d/sshd restart
+/etc/init.d/squid start
+
+# Delete old QoS enabled indicator
+rm -f /var/ipfire/qos/enable
+
+# This update need a reboot...
+#touch /var/run/need_reboot
+
+# Finish
+/etc/init.d/fireinfo start
+sendprofile
+# Update grub config to display new core version
+if [ -e /boot/grub/grub.cfg ]; then
+       grub-mkconfig -o /boot/grub/grub.cfg
+fi
+sync
+
+# Don't report the exitcode last command
+exit 0
diff --git a/config/rootfiles/core/98/filelists/files b/config/rootfiles/core/98/filelists/files
deleted file mode 100644 (file)
index 409e5fe..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
-etc/system-release
-etc/issue
diff --git a/config/rootfiles/oldcore/96/filelists/dnsmasq b/config/rootfiles/oldcore/96/filelists/dnsmasq
new file mode 120000 (symlink)
index 0000000..d469c74
--- /dev/null
@@ -0,0 +1 @@
+../../../common/dnsmasq
\ No newline at end of file
diff --git a/config/rootfiles/oldcore/96/filelists/ntp b/config/rootfiles/oldcore/96/filelists/ntp
new file mode 120000 (symlink)
index 0000000..7542d86
--- /dev/null
@@ -0,0 +1 @@
+../../../common/ntp
\ No newline at end of file
diff --git a/config/rootfiles/oldcore/97/filelists/files b/config/rootfiles/oldcore/97/filelists/files
new file mode 100644 (file)
index 0000000..8586e6a
--- /dev/null
@@ -0,0 +1,18 @@
+etc/system-release
+etc/issue
+etc/rc.d/init.d/firewall
+etc/modprobe.d/nf_conntrack.conf
+srv/web/ipfire/cgi-bin/logs.cgi/firewalllog.dat
+srv/web/ipfire/cgi-bin/logs.cgi/firewalllogcountry.dat
+srv/web/ipfire/cgi-bin/logs.cgi/firewalllogip.dat
+srv/web/ipfire/cgi-bin/logs.cgi/firewalllogport.dat
+srv/web/ipfire/cgi-bin/logs.cgi/showrequestfromcountry.dat
+srv/web/ipfire/cgi-bin/logs.cgi/showrequestfromip.dat
+srv/web/ipfire/cgi-bin/logs.cgi/showrequestfromport.dat
+srv/web/ipfire/cgi-bin/optionsfw.cgi
+srv/web/ipfire/cgi-bin/ovpnmain.cgi
+srv/web/ipfire/cgi-bin/qos.cgi
+srv/web/ipfire/cgi-bin/webaccess.cgi
+usr/bin/pgrep
+usr/local/bin/qosctrl
+usr/local/bin/timectrl
diff --git a/config/rootfiles/oldcore/97/filelists/openssh b/config/rootfiles/oldcore/97/filelists/openssh
new file mode 120000 (symlink)
index 0000000..d8c77fd
--- /dev/null
@@ -0,0 +1 @@
+../../../common/openssh
\ No newline at end of file
diff --git a/config/rootfiles/oldcore/98/exclude b/config/rootfiles/oldcore/98/exclude
new file mode 100644 (file)
index 0000000..d87f175
--- /dev/null
@@ -0,0 +1,25 @@
+boot/config.txt
+etc/alternatives
+etc/collectd.custom
+etc/ipsec.conf
+etc/ipsec.secrets
+etc/ipsec.user.conf
+etc/ipsec.user.secrets
+etc/localtime
+etc/shadow
+etc/snort/snort.conf
+etc/ssh/ssh_config
+etc/ssh/sshd_config
+etc/ssl/openssl.cnf
+etc/sudoers
+etc/sysconfig/firewall.local
+etc/sysconfig/rc.local
+etc/udev/rules.d/30-persistent-network.rules
+srv/web/ipfire/html/proxy.pac
+var/ipfire/dma
+var/ipfire/time
+var/ipfire/ovpn
+var/lib/alternatives
+var/log/cache
+var/state/dhcp/dhcpd.leases
+var/updatecache
diff --git a/config/rootfiles/oldcore/98/meta b/config/rootfiles/oldcore/98/meta
new file mode 100644 (file)
index 0000000..d547fa8
--- /dev/null
@@ -0,0 +1 @@
+DEPS=""
diff --git a/config/rootfiles/packages/dnsdist b/config/rootfiles/packages/dnsdist
new file mode 100644 (file)
index 0000000..ba7381f
--- /dev/null
@@ -0,0 +1,3 @@
+usr/bin/dnsdist
+#usr/share/man/man1/dnsdist.1
+etc/rc.d/init.d/dnsdist
index d31753c17c783424535d39c0a95778d67e12f3d8..3582f36184fa9afad8e6579d3ef0339d707a55d3 100644 (file)
@@ -14,6 +14,7 @@ usr/bin/rnano
 #usr/share/man/man5/nanorc.5
 #usr/share/nano
 usr/share/nano/asm.nanorc
+usr/share/nano/autoconf.nanorc
 usr/share/nano/awk.nanorc
 usr/share/nano/c.nanorc
 #usr/share/nano/changelog.nanorc
@@ -37,6 +38,7 @@ usr/share/nano/man.nanorc
 usr/share/nano/mgp.nanorc
 usr/share/nano/mutt.nanorc
 usr/share/nano/nanorc.nanorc
+usr/share/nano/nftables.nanorc
 usr/share/nano/objc.nanorc
 usr/share/nano/ocaml.nanorc
 usr/share/nano/patch.nanorc
index 5ce778929daceede65a59e9fb5092bdca1940c6b..9ea21e352811a0843d8afa4544def6d84009167c 100644 (file)
@@ -8,7 +8,6 @@ srv/web/owncloud
 #srv/web/owncloud/3rdparty/Console/Getopt.php
 #srv/web/owncloud/3rdparty/Jcrop
 #srv/web/owncloud/3rdparty/Jcrop/MIT-LICENSE.txt
-#srv/web/owncloud/3rdparty/Jcrop/README.md
 #srv/web/owncloud/3rdparty/Jcrop/css
 #srv/web/owncloud/3rdparty/Jcrop/css/Jcrop.gif
 #srv/web/owncloud/3rdparty/Jcrop/css/jquery.Jcrop.css
@@ -220,7 +219,6 @@ srv/web/owncloud
 #srv/web/owncloud/3rdparty/Patchwork/PHP/Shim/unidata/compatibilityDecomposition.ser
 #srv/web/owncloud/3rdparty/Patchwork/PHP/Shim/unidata/lowerCase.ser
 #srv/web/owncloud/3rdparty/Patchwork/PHP/Shim/unidata/upperCase.ser
-#srv/web/owncloud/3rdparty/Patchwork/README.md
 #srv/web/owncloud/3rdparty/Patchwork/Utf8
 #srv/web/owncloud/3rdparty/Patchwork/Utf8.php
 #srv/web/owncloud/3rdparty/Patchwork/Utf8/Bootup
@@ -253,13 +251,11 @@ srv/web/owncloud
 #srv/web/owncloud/3rdparty/css/chosen/chosen.css
 #srv/web/owncloud/3rdparty/css/strengthify
 #srv/web/owncloud/3rdparty/css/strengthify/LICENSE
-#srv/web/owncloud/3rdparty/css/strengthify/README.md
 #srv/web/owncloud/3rdparty/css/strengthify/strengthify.css
 #srv/web/owncloud/3rdparty/doctrine
 #srv/web/owncloud/3rdparty/doctrine/common
 #srv/web/owncloud/3rdparty/doctrine/common/.gitmodules
 #srv/web/owncloud/3rdparty/doctrine/common/LICENSE
-#srv/web/owncloud/3rdparty/doctrine/common/README.md
 #srv/web/owncloud/3rdparty/doctrine/common/UPGRADE_TO_2_1
 #srv/web/owncloud/3rdparty/doctrine/common/UPGRADE_TO_2_2
 #srv/web/owncloud/3rdparty/doctrine/common/build.properties
@@ -498,7 +494,6 @@ srv/web/owncloud
 #srv/web/owncloud/3rdparty/doctrine/dbal
 #srv/web/owncloud/3rdparty/doctrine/dbal/.gitmodules
 #srv/web/owncloud/3rdparty/doctrine/dbal/LICENSE
-#srv/web/owncloud/3rdparty/doctrine/dbal/README.md
 #srv/web/owncloud/3rdparty/doctrine/dbal/UPGRADE
 #srv/web/owncloud/3rdparty/doctrine/dbal/bin
 #srv/web/owncloud/3rdparty/doctrine/dbal/bin/doctrine-dbal
@@ -512,7 +507,6 @@ srv/web/owncloud
 #srv/web/owncloud/3rdparty/doctrine/dbal/docs/design/SHARDING.md
 #srv/web/owncloud/3rdparty/doctrine/dbal/docs/examples
 #srv/web/owncloud/3rdparty/doctrine/dbal/docs/examples/sharding
-#srv/web/owncloud/3rdparty/doctrine/dbal/docs/examples/sharding/README.md
 #srv/web/owncloud/3rdparty/doctrine/dbal/docs/examples/sharding/bootstrap.php
 #srv/web/owncloud/3rdparty/doctrine/dbal/docs/examples/sharding/composer.json
 #srv/web/owncloud/3rdparty/doctrine/dbal/docs/examples/sharding/create_schema.php
@@ -847,7 +841,6 @@ srv/web/owncloud
 #srv/web/owncloud/3rdparty/doctrine/dbal/tests/travis/pgsql.travis.xml
 #srv/web/owncloud/3rdparty/doctrine/dbal/tests/travis/sqlite.travis.xml
 #srv/web/owncloud/3rdparty/fontawesome
-#srv/web/owncloud/3rdparty/fontawesome/README.md
 #srv/web/owncloud/3rdparty/fontawesome/css
 #srv/web/owncloud/3rdparty/fontawesome/css/font-awesome-ie7.min.css
 #srv/web/owncloud/3rdparty/fontawesome/css/font-awesome.css
@@ -970,7 +963,6 @@ srv/web/owncloud
 #srv/web/owncloud/3rdparty/james-heinrich
 #srv/web/owncloud/3rdparty/james-heinrich/getid3
 #srv/web/owncloud/3rdparty/james-heinrich/getid3/.gitattributes
-#srv/web/owncloud/3rdparty/james-heinrich/getid3/README.md
 #srv/web/owncloud/3rdparty/james-heinrich/getid3/changelog.txt
 #srv/web/owncloud/3rdparty/james-heinrich/getid3/composer.json
 #srv/web/owncloud/3rdparty/james-heinrich/getid3/dependencies.txt
@@ -1061,19 +1053,16 @@ srv/web/owncloud
 #srv/web/owncloud/3rdparty/js
 #srv/web/owncloud/3rdparty/js/chosen
 #srv/web/owncloud/3rdparty/js/chosen/LICENSE.md
-#srv/web/owncloud/3rdparty/js/chosen/README.md
 #srv/web/owncloud/3rdparty/js/chosen/VERSION
 #srv/web/owncloud/3rdparty/js/chosen/chosen.jquery.js
 #srv/web/owncloud/3rdparty/js/chosen/chosen.jquery.min.js
 #srv/web/owncloud/3rdparty/js/chosen/chosen.proto.js
 #srv/web/owncloud/3rdparty/js/chosen/chosen.proto.min.js
 #srv/web/owncloud/3rdparty/js/md5
-#srv/web/owncloud/3rdparty/js/md5/README.md
 #srv/web/owncloud/3rdparty/js/md5/md5.js
 #srv/web/owncloud/3rdparty/js/md5/md5.min.js
 #srv/web/owncloud/3rdparty/js/strengthify
 #srv/web/owncloud/3rdparty/js/strengthify/LICENSE
-#srv/web/owncloud/3rdparty/js/strengthify/README.md
 #srv/web/owncloud/3rdparty/js/strengthify/jquery.strengthify.js
 #srv/web/owncloud/3rdparty/kriswallsmith
 #srv/web/owncloud/3rdparty/kriswallsmith/assetic
@@ -1083,7 +1072,6 @@ srv/web/owncloud
 #srv/web/owncloud/3rdparty/kriswallsmith/assetic/CHANGELOG-1.2.md
 #srv/web/owncloud/3rdparty/kriswallsmith/assetic/Gemfile
 #srv/web/owncloud/3rdparty/kriswallsmith/assetic/LICENSE
-#srv/web/owncloud/3rdparty/kriswallsmith/assetic/README.md
 #srv/web/owncloud/3rdparty/kriswallsmith/assetic/composer.json
 #srv/web/owncloud/3rdparty/kriswallsmith/assetic/docs
 #srv/web/owncloud/3rdparty/kriswallsmith/assetic/docs/en
@@ -1400,7 +1388,6 @@ srv/web/owncloud
 #srv/web/owncloud/3rdparty/mcnetic
 #srv/web/owncloud/3rdparty/mcnetic/phpzipstreamer
 #srv/web/owncloud/3rdparty/mcnetic/phpzipstreamer/COPYING
-#srv/web/owncloud/3rdparty/mcnetic/phpzipstreamer/README.md
 #srv/web/owncloud/3rdparty/mcnetic/phpzipstreamer/ZipStreamer.php
 #srv/web/owncloud/3rdparty/miniColors
 #srv/web/owncloud/3rdparty/miniColors/GPL-LICENSE.txt
@@ -1421,7 +1408,6 @@ srv/web/owncloud
 #srv/web/owncloud/3rdparty/phpmailer/phpmailer
 #srv/web/owncloud/3rdparty/phpmailer/phpmailer/LICENSE
 #srv/web/owncloud/3rdparty/phpmailer/phpmailer/PHPMailerAutoload.php
-#srv/web/owncloud/3rdparty/phpmailer/phpmailer/README.md
 #srv/web/owncloud/3rdparty/phpmailer/phpmailer/changelog.md
 #srv/web/owncloud/3rdparty/phpmailer/phpmailer/class.phpmailer.php
 #srv/web/owncloud/3rdparty/phpmailer/phpmailer/class.pop3.php
@@ -1538,7 +1524,6 @@ srv/web/owncloud
 #srv/web/owncloud/3rdparty/phpseclib/phpseclib/.gitattributes
 #srv/web/owncloud/3rdparty/phpseclib/phpseclib/AUTHORS
 #srv/web/owncloud/3rdparty/phpseclib/phpseclib/LICENSE
-#srv/web/owncloud/3rdparty/phpseclib/phpseclib/README.md
 #srv/web/owncloud/3rdparty/phpseclib/phpseclib/build
 #srv/web/owncloud/3rdparty/phpseclib/phpseclib/build/code-sniffer-ruleset-tests.xml
 #srv/web/owncloud/3rdparty/phpseclib/phpseclib/build/code-sniffer-ruleset.xml
@@ -1606,7 +1591,6 @@ srv/web/owncloud
 #srv/web/owncloud/3rdparty/rackspace/php-opencloud/.coveralls.yml
 #srv/web/owncloud/3rdparty/rackspace/php-opencloud/CONTRIBUTING.md
 #srv/web/owncloud/3rdparty/rackspace/php-opencloud/LICENSE
-#srv/web/owncloud/3rdparty/rackspace/php-opencloud/README.md
 #srv/web/owncloud/3rdparty/rackspace/php-opencloud/composer.json
 #srv/web/owncloud/3rdparty/rackspace/php-opencloud/docs
 #srv/web/owncloud/3rdparty/rackspace/php-opencloud/docs/changelog
@@ -1647,7 +1631,6 @@ srv/web/owncloud
 #srv/web/owncloud/3rdparty/rackspace/php-opencloud/docs/userguide/Identity/Users.md
 #srv/web/owncloud/3rdparty/rackspace/php-opencloud/docs/userguide/Iterators.md
 #srv/web/owncloud/3rdparty/rackspace/php-opencloud/docs/userguide/LoadBalancer
-#srv/web/owncloud/3rdparty/rackspace/php-opencloud/docs/userguide/LoadBalancer/README.md
 #srv/web/owncloud/3rdparty/rackspace/php-opencloud/docs/userguide/LoadBalancer/USERGUIDE.md
 #srv/web/owncloud/3rdparty/rackspace/php-opencloud/docs/userguide/ObjectStore
 #srv/web/owncloud/3rdparty/rackspace/php-opencloud/docs/userguide/ObjectStore/Access.md
@@ -2186,7 +2169,6 @@ srv/web/owncloud
 #srv/web/owncloud/3rdparty/sabre/dav
 #srv/web/owncloud/3rdparty/sabre/dav/ChangeLog
 #srv/web/owncloud/3rdparty/sabre/dav/LICENSE
-#srv/web/owncloud/3rdparty/sabre/dav/README.md
 #srv/web/owncloud/3rdparty/sabre/dav/bin
 #srv/web/owncloud/3rdparty/sabre/dav/bin/googlecode_upload.py
 #srv/web/owncloud/3rdparty/sabre/dav/bin/migrateto17.php
@@ -2645,7 +2627,6 @@ srv/web/owncloud
 #srv/web/owncloud/3rdparty/sabre/vobject
 #srv/web/owncloud/3rdparty/sabre/vobject/ChangeLog
 #srv/web/owncloud/3rdparty/sabre/vobject/LICENSE
-#srv/web/owncloud/3rdparty/sabre/vobject/README.md
 #srv/web/owncloud/3rdparty/sabre/vobject/bin
 #srv/web/owncloud/3rdparty/sabre/vobject/bin/bench.php
 #srv/web/owncloud/3rdparty/sabre/vobject/bin/generateicalendardata.php
@@ -2786,7 +2767,6 @@ srv/web/owncloud
 #srv/web/owncloud/3rdparty/symfony/console/Symfony/Component/Console/Output/Output.php
 #srv/web/owncloud/3rdparty/symfony/console/Symfony/Component/Console/Output/OutputInterface.php
 #srv/web/owncloud/3rdparty/symfony/console/Symfony/Component/Console/Output/StreamOutput.php
-#srv/web/owncloud/3rdparty/symfony/console/Symfony/Component/Console/README.md
 #srv/web/owncloud/3rdparty/symfony/console/Symfony/Component/Console/Shell.php
 #srv/web/owncloud/3rdparty/symfony/console/Symfony/Component/Console/Tester
 #srv/web/owncloud/3rdparty/symfony/console/Symfony/Component/Console/Tester/ApplicationTester.php
@@ -2939,7 +2919,6 @@ srv/web/owncloud
 #srv/web/owncloud/3rdparty/symfony/event-dispatcher/Symfony/Component/EventDispatcher/GenericEvent.php
 #srv/web/owncloud/3rdparty/symfony/event-dispatcher/Symfony/Component/EventDispatcher/ImmutableEventDispatcher.php
 #srv/web/owncloud/3rdparty/symfony/event-dispatcher/Symfony/Component/EventDispatcher/LICENSE
-#srv/web/owncloud/3rdparty/symfony/event-dispatcher/Symfony/Component/EventDispatcher/README.md
 #srv/web/owncloud/3rdparty/symfony/event-dispatcher/Symfony/Component/EventDispatcher/Tests
 #srv/web/owncloud/3rdparty/symfony/event-dispatcher/Symfony/Component/EventDispatcher/Tests/ContainerAwareEventDispatcherTest.php
 #srv/web/owncloud/3rdparty/symfony/event-dispatcher/Symfony/Component/EventDispatcher/Tests/Debug
@@ -2973,7 +2952,6 @@ srv/web/owncloud
 #srv/web/owncloud/3rdparty/symfony/process/Symfony/Component/Process/ProcessBuilder.php
 #srv/web/owncloud/3rdparty/symfony/process/Symfony/Component/Process/ProcessPipes.php
 #srv/web/owncloud/3rdparty/symfony/process/Symfony/Component/Process/ProcessUtils.php
-#srv/web/owncloud/3rdparty/symfony/process/Symfony/Component/Process/README.md
 #srv/web/owncloud/3rdparty/symfony/process/Symfony/Component/Process/Tests
 #srv/web/owncloud/3rdparty/symfony/process/Symfony/Component/Process/Tests/AbstractProcessTest.php
 #srv/web/owncloud/3rdparty/symfony/process/Symfony/Component/Process/Tests/NonStopableProcess.php
@@ -3034,7 +3012,6 @@ srv/web/owncloud
 #srv/web/owncloud/3rdparty/symfony/routing/Symfony/Component/Routing/Matcher/RedirectableUrlMatcherInterface.php
 #srv/web/owncloud/3rdparty/symfony/routing/Symfony/Component/Routing/Matcher/UrlMatcher.php
 #srv/web/owncloud/3rdparty/symfony/routing/Symfony/Component/Routing/Matcher/UrlMatcherInterface.php
-#srv/web/owncloud/3rdparty/symfony/routing/Symfony/Component/Routing/README.md
 #srv/web/owncloud/3rdparty/symfony/routing/Symfony/Component/Routing/RequestContext.php
 #srv/web/owncloud/3rdparty/symfony/routing/Symfony/Component/Routing/RequestContextAwareInterface.php
 #srv/web/owncloud/3rdparty/symfony/routing/Symfony/Component/Routing/Route.php
@@ -3107,7 +3084,6 @@ srv/web/owncloud
 #srv/web/owncloud/3rdparty/timepicker/releases.txt
 #srv/web/owncloud/3rdparty/zxcvbn
 #srv/web/owncloud/3rdparty/zxcvbn/LICENSE.txt
-#srv/web/owncloud/3rdparty/zxcvbn/README.md
 #srv/web/owncloud/3rdparty/zxcvbn/js
 #srv/web/owncloud/3rdparty/zxcvbn/js/zxcvbn.js
 #srv/web/owncloud/3rdparty/zxcvbn/js/zxcvbn.min.js
@@ -3115,7 +3091,6 @@ srv/web/owncloud
 #srv/web/owncloud/COPYING-AGPL
 #srv/web/owncloud/apps
 #srv/web/owncloud/apps/activity
-#srv/web/owncloud/apps/activity/README.md
 #srv/web/owncloud/apps/activity/ajax
 #srv/web/owncloud/apps/activity/ajax/fetch.php
 #srv/web/owncloud/apps/activity/ajax/rssfeed.php
@@ -3124,6 +3099,7 @@ srv/web/owncloud
 #srv/web/owncloud/apps/activity/appinfo/app.php
 #srv/web/owncloud/apps/activity/appinfo/database.xml
 #srv/web/owncloud/apps/activity/appinfo/info.xml
+#srv/web/owncloud/apps/activity/appinfo/preupdate.php
 #srv/web/owncloud/apps/activity/appinfo/routes.php
 #srv/web/owncloud/apps/activity/appinfo/update.php
 #srv/web/owncloud/apps/activity/appinfo/version
@@ -3296,78 +3272,6 @@ srv/web/owncloud
 #srv/web/owncloud/apps/activity/tests/parameterhelpertest.php
 #srv/web/owncloud/apps/activity/tests/phpunit.xml
 #srv/web/owncloud/apps/activity/tests/usersettingstest.php
-#srv/web/owncloud/apps/admin_dependencies_chk
-#srv/web/owncloud/apps/admin_dependencies_chk/appinfo
-#srv/web/owncloud/apps/admin_dependencies_chk/appinfo/app.php
-#srv/web/owncloud/apps/admin_dependencies_chk/appinfo/info.xml
-#srv/web/owncloud/apps/admin_dependencies_chk/appinfo/version
-#srv/web/owncloud/apps/admin_dependencies_chk/css
-#srv/web/owncloud/apps/admin_dependencies_chk/css/style.css
-#srv/web/owncloud/apps/admin_dependencies_chk/l10n
-#srv/web/owncloud/apps/admin_dependencies_chk/l10n/ar.php
-#srv/web/owncloud/apps/admin_dependencies_chk/l10n/ast.php
-#srv/web/owncloud/apps/admin_dependencies_chk/l10n/bg_BG.php
-#srv/web/owncloud/apps/admin_dependencies_chk/l10n/bn_BD.php
-#srv/web/owncloud/apps/admin_dependencies_chk/l10n/ca.php
-#srv/web/owncloud/apps/admin_dependencies_chk/l10n/cs_CZ.php
-#srv/web/owncloud/apps/admin_dependencies_chk/l10n/da.php
-#srv/web/owncloud/apps/admin_dependencies_chk/l10n/de.php
-#srv/web/owncloud/apps/admin_dependencies_chk/l10n/de_CH.php
-#srv/web/owncloud/apps/admin_dependencies_chk/l10n/de_DE.php
-#srv/web/owncloud/apps/admin_dependencies_chk/l10n/el.php
-#srv/web/owncloud/apps/admin_dependencies_chk/l10n/en_GB.php
-#srv/web/owncloud/apps/admin_dependencies_chk/l10n/eo.php
-#srv/web/owncloud/apps/admin_dependencies_chk/l10n/es.php
-#srv/web/owncloud/apps/admin_dependencies_chk/l10n/es_AR.php
-#srv/web/owncloud/apps/admin_dependencies_chk/l10n/es_CL.php
-#srv/web/owncloud/apps/admin_dependencies_chk/l10n/es_MX.php
-#srv/web/owncloud/apps/admin_dependencies_chk/l10n/et_EE.php
-#srv/web/owncloud/apps/admin_dependencies_chk/l10n/eu.php
-#srv/web/owncloud/apps/admin_dependencies_chk/l10n/eu_ES.php
-#srv/web/owncloud/apps/admin_dependencies_chk/l10n/fa.php
-#srv/web/owncloud/apps/admin_dependencies_chk/l10n/fi_FI.php
-#srv/web/owncloud/apps/admin_dependencies_chk/l10n/fr.php
-#srv/web/owncloud/apps/admin_dependencies_chk/l10n/gl.php
-#srv/web/owncloud/apps/admin_dependencies_chk/l10n/hu_HU.php
-#srv/web/owncloud/apps/admin_dependencies_chk/l10n/id.php
-#srv/web/owncloud/apps/admin_dependencies_chk/l10n/is.php
-#srv/web/owncloud/apps/admin_dependencies_chk/l10n/it.php
-#srv/web/owncloud/apps/admin_dependencies_chk/l10n/ja.php
-#srv/web/owncloud/apps/admin_dependencies_chk/l10n/ja_JP.php
-#srv/web/owncloud/apps/admin_dependencies_chk/l10n/jv.php
-#srv/web/owncloud/apps/admin_dependencies_chk/l10n/ka_GE.php
-#srv/web/owncloud/apps/admin_dependencies_chk/l10n/km.php
-#srv/web/owncloud/apps/admin_dependencies_chk/l10n/ko.php
-#srv/web/owncloud/apps/admin_dependencies_chk/l10n/lb.php
-#srv/web/owncloud/apps/admin_dependencies_chk/l10n/lt_LT.php
-#srv/web/owncloud/apps/admin_dependencies_chk/l10n/lv.php
-#srv/web/owncloud/apps/admin_dependencies_chk/l10n/mk.php
-#srv/web/owncloud/apps/admin_dependencies_chk/l10n/nb_NO.php
-#srv/web/owncloud/apps/admin_dependencies_chk/l10n/nl.php
-#srv/web/owncloud/apps/admin_dependencies_chk/l10n/nn_NO.php
-#srv/web/owncloud/apps/admin_dependencies_chk/l10n/pl.php
-#srv/web/owncloud/apps/admin_dependencies_chk/l10n/pt_BR.php
-#srv/web/owncloud/apps/admin_dependencies_chk/l10n/pt_PT.php
-#srv/web/owncloud/apps/admin_dependencies_chk/l10n/ro.php
-#srv/web/owncloud/apps/admin_dependencies_chk/l10n/ru.php
-#srv/web/owncloud/apps/admin_dependencies_chk/l10n/si_LK.php
-#srv/web/owncloud/apps/admin_dependencies_chk/l10n/sk_SK.php
-#srv/web/owncloud/apps/admin_dependencies_chk/l10n/sl.php
-#srv/web/owncloud/apps/admin_dependencies_chk/l10n/sq.php
-#srv/web/owncloud/apps/admin_dependencies_chk/l10n/sr.php
-#srv/web/owncloud/apps/admin_dependencies_chk/l10n/sr@latin.php
-#srv/web/owncloud/apps/admin_dependencies_chk/l10n/sv.php
-#srv/web/owncloud/apps/admin_dependencies_chk/l10n/ta_LK.php
-#srv/web/owncloud/apps/admin_dependencies_chk/l10n/th_TH.php
-#srv/web/owncloud/apps/admin_dependencies_chk/l10n/tr.php
-#srv/web/owncloud/apps/admin_dependencies_chk/l10n/ug.php
-#srv/web/owncloud/apps/admin_dependencies_chk/l10n/uk.php
-#srv/web/owncloud/apps/admin_dependencies_chk/l10n/vi.php
-#srv/web/owncloud/apps/admin_dependencies_chk/l10n/zh_CN.php
-#srv/web/owncloud/apps/admin_dependencies_chk/l10n/zh_TW.php
-#srv/web/owncloud/apps/admin_dependencies_chk/settings.php
-#srv/web/owncloud/apps/admin_dependencies_chk/templates
-#srv/web/owncloud/apps/admin_dependencies_chk/templates/settings.php
 #srv/web/owncloud/apps/bookmarks
 #srv/web/owncloud/apps/bookmarks/3rdparty
 #srv/web/owncloud/apps/bookmarks/3rdparty/css
@@ -3375,7 +3279,6 @@ srv/web/owncloud
 #srv/web/owncloud/apps/bookmarks/3rdparty/js
 #srv/web/owncloud/apps/bookmarks/3rdparty/js/js_tpl.js
 #srv/web/owncloud/apps/bookmarks/3rdparty/js/tag-it.js
-#srv/web/owncloud/apps/bookmarks/README.md
 #srv/web/owncloud/apps/bookmarks/addBm.php
 #srv/web/owncloud/apps/bookmarks/ajax
 #srv/web/owncloud/apps/bookmarks/ajax/delBookmark.php
@@ -3640,7 +3543,6 @@ srv/web/owncloud
 #srv/web/owncloud/apps/calendar/3rdparty/fullcalendar/js/fullcalendar.js
 #srv/web/owncloud/apps/calendar/3rdparty/fullcalendar/js/fullcalendar.min.js
 #srv/web/owncloud/apps/calendar/3rdparty/fullcalendar/js/gcal.js
-#srv/web/owncloud/apps/calendar/README.md
 #srv/web/owncloud/apps/calendar/ajax
 #srv/web/owncloud/apps/calendar/ajax/cache
 #srv/web/owncloud/apps/calendar/ajax/cache/rescan.php
@@ -4073,10 +3975,8 @@ srv/web/owncloud
 #srv/web/owncloud/apps/calendar/tests
 #srv/web/owncloud/apps/calendar/tests/calendar.php
 #srv/web/owncloud/apps/contacts
-#srv/web/owncloud/apps/contacts/.jshintrc
 #srv/web/owncloud/apps/contacts/COPYING-README
 #srv/web/owncloud/apps/contacts/Changelog
-#srv/web/owncloud/apps/contacts/README.md
 #srv/web/owncloud/apps/contacts/admin.php
 #srv/web/owncloud/apps/contacts/appinfo
 #srv/web/owncloud/apps/contacts/appinfo/app.php
@@ -4551,7 +4451,6 @@ srv/web/owncloud
 #srv/web/owncloud/apps/contacts/tests/preseed-config.php
 #srv/web/owncloud/apps/contacts/tests/setup_owncloud.sh
 #srv/web/owncloud/apps/documents
-#srv/web/owncloud/apps/documents/README.md
 #srv/web/owncloud/apps/documents/admin.php
 #srv/web/owncloud/apps/documents/ajax
 #srv/web/owncloud/apps/documents/ajax/admin.php
@@ -5154,6 +5053,8 @@ srv/web/owncloud
 #srv/web/owncloud/apps/documents/js/3rdparty/resources/dojo/resources/images/dndNoCopy.png
 #srv/web/owncloud/apps/documents/js/3rdparty/resources/dojo/resources/images/dndNoMove.png
 #srv/web/owncloud/apps/documents/js/3rdparty/resources/dojox
+#srv/web/owncloud/apps/documents/js/3rdparty/resources/dojox/html
+#srv/web/owncloud/apps/documents/js/3rdparty/resources/dojox/html/entities.js
 #srv/web/owncloud/apps/documents/js/3rdparty/resources/dojox/layout
 #srv/web/owncloud/apps/documents/js/3rdparty/resources/dojox/layout/resources
 #srv/web/owncloud/apps/documents/js/3rdparty/resources/dojox/layout/resources/DndGridContainer.css
@@ -6008,6 +5909,7 @@ srv/web/owncloud
 #srv/web/owncloud/apps/files_encryption/tests/proxy.php
 #srv/web/owncloud/apps/files_encryption/tests/share.php
 #srv/web/owncloud/apps/files_encryption/tests/stream.php
+#srv/web/owncloud/apps/files_encryption/tests/testcase.php
 #srv/web/owncloud/apps/files_encryption/tests/trashbin.php
 #srv/web/owncloud/apps/files_encryption/tests/util.php
 #srv/web/owncloud/apps/files_encryption/tests/webdav.php
@@ -6028,7 +5930,6 @@ srv/web/owncloud
 #srv/web/owncloud/apps/files_external/3rdparty/Dropbox/OAuth/Consumer
 #srv/web/owncloud/apps/files_external/3rdparty/Dropbox/OAuth/Consumer/Dropbox.php
 #srv/web/owncloud/apps/files_external/3rdparty/Dropbox/OAuth/Curl.php
-#srv/web/owncloud/apps/files_external/3rdparty/Dropbox/README.md
 #srv/web/owncloud/apps/files_external/3rdparty/Dropbox/autoload.php
 #srv/web/owncloud/apps/files_external/3rdparty/aws-sdk-php
 #srv/web/owncloud/apps/files_external/3rdparty/aws-sdk-php/Aws
@@ -7142,7 +7043,6 @@ srv/web/owncloud
 #srv/web/owncloud/apps/files_pdfviewer/3rdparty/pdfjs/pdf.worker.js
 #srv/web/owncloud/apps/files_pdfviewer/3rdparty/pdfjs/viewer.css
 #srv/web/owncloud/apps/files_pdfviewer/3rdparty/pdfjs/viewer.js
-#srv/web/owncloud/apps/files_pdfviewer/README.md
 #srv/web/owncloud/apps/files_pdfviewer/appinfo
 #srv/web/owncloud/apps/files_pdfviewer/appinfo/app.php
 #srv/web/owncloud/apps/files_pdfviewer/appinfo/info.xml
@@ -7281,6 +7181,7 @@ srv/web/owncloud
 #srv/web/owncloud/apps/files_sharing/lib/proxy.php
 #srv/web/owncloud/apps/files_sharing/lib/readonlycache.php
 #srv/web/owncloud/apps/files_sharing/lib/readonlywrapper.php
+#srv/web/owncloud/apps/files_sharing/lib/scanner.php
 #srv/web/owncloud/apps/files_sharing/lib/share
 #srv/web/owncloud/apps/files_sharing/lib/share/file.php
 #srv/web/owncloud/apps/files_sharing/lib/share/folder.php
@@ -7310,6 +7211,7 @@ srv/web/owncloud
 #srv/web/owncloud/apps/files_sharing/tests/js/shareSpec.js
 #srv/web/owncloud/apps/files_sharing/tests/js/sharedfilelistSpec.js
 #srv/web/owncloud/apps/files_sharing/tests/permissions.php
+#srv/web/owncloud/apps/files_sharing/tests/propagation.php
 #srv/web/owncloud/apps/files_sharing/tests/proxy.php
 #srv/web/owncloud/apps/files_sharing/tests/share.php
 #srv/web/owncloud/apps/files_sharing/tests/sharedmount.php
@@ -7318,7 +7220,6 @@ srv/web/owncloud
 #srv/web/owncloud/apps/files_sharing/tests/updater.php
 #srv/web/owncloud/apps/files_sharing/tests/watcher.php
 #srv/web/owncloud/apps/files_texteditor
-#srv/web/owncloud/apps/files_texteditor/README.md
 #srv/web/owncloud/apps/files_texteditor/ajax
 #srv/web/owncloud/apps/files_texteditor/ajax/loadfile.php
 #srv/web/owncloud/apps/files_texteditor/ajax/savefile.php
@@ -7677,6 +7578,7 @@ srv/web/owncloud
 #srv/web/owncloud/apps/files_trashbin/appinfo/app.php
 #srv/web/owncloud/apps/files_trashbin/appinfo/database.xml
 #srv/web/owncloud/apps/files_trashbin/appinfo/info.xml
+#srv/web/owncloud/apps/files_trashbin/appinfo/preupdate.php
 #srv/web/owncloud/apps/files_trashbin/appinfo/routes.php
 #srv/web/owncloud/apps/files_trashbin/appinfo/update.php
 #srv/web/owncloud/apps/files_trashbin/appinfo/version
@@ -7923,7 +7825,6 @@ srv/web/owncloud
 #srv/web/owncloud/apps/files_videoviewer/src/silverlight/SilverlightMediaElement.csproj.user
 #srv/web/owncloud/apps/files_videoviewer/src/silverlight/SilverlightMediaElement.sln
 #srv/web/owncloud/apps/firstrunwizard
-#srv/web/owncloud/apps/firstrunwizard/README.md
 #srv/web/owncloud/apps/firstrunwizard/ajax
 #srv/web/owncloud/apps/firstrunwizard/ajax/disable.php
 #srv/web/owncloud/apps/firstrunwizard/ajax/enable.php
@@ -8016,7 +7917,6 @@ srv/web/owncloud
 #srv/web/owncloud/apps/firstrunwizard/templates/wizard.php
 #srv/web/owncloud/apps/firstrunwizard/wizard.php
 #srv/web/owncloud/apps/gallery
-#srv/web/owncloud/apps/gallery/README.md
 #srv/web/owncloud/apps/gallery/ajax
 #srv/web/owncloud/apps/gallery/ajax/gallery.php
 #srv/web/owncloud/apps/gallery/ajax/getimages.php
@@ -8696,7 +8596,6 @@ srv/web/owncloud
 #srv/web/owncloud/apps/templateeditor/templates/settings-admin.php
 #srv/web/owncloud/apps/updater
 #srv/web/owncloud/apps/updater/COPYING-AGPL
-#srv/web/owncloud/apps/updater/README.md
 #srv/web/owncloud/apps/updater/admin.php
 #srv/web/owncloud/apps/updater/ajax
 #srv/web/owncloud/apps/updater/ajax/backup
@@ -8817,7 +8716,6 @@ srv/web/owncloud
 #srv/web/owncloud/apps/updater/templates/update.php
 #srv/web/owncloud/apps/updater/update.php
 #srv/web/owncloud/apps/user_external
-#srv/web/owncloud/apps/user_external/README.md
 #srv/web/owncloud/apps/user_external/appinfo
 #srv/web/owncloud/apps/user_external/appinfo/app.php
 #srv/web/owncloud/apps/user_external/appinfo/database.xml
@@ -8851,8 +8749,11 @@ srv/web/owncloud
 #srv/web/owncloud/apps/user_ldap/appinfo/update.php
 #srv/web/owncloud/apps/user_ldap/appinfo/version
 #srv/web/owncloud/apps/user_ldap/command
+#srv/web/owncloud/apps/user_ldap/command/checkuser.php
+#srv/web/owncloud/apps/user_ldap/command/search.php
 #srv/web/owncloud/apps/user_ldap/command/setconfig.php
 #srv/web/owncloud/apps/user_ldap/command/showconfig.php
+#srv/web/owncloud/apps/user_ldap/command/showremnants.php
 #srv/web/owncloud/apps/user_ldap/command/testconfig.php
 #srv/web/owncloud/apps/user_ldap/css
 #srv/web/owncloud/apps/user_ldap/css/settings.css
@@ -8986,14 +8887,18 @@ srv/web/owncloud
 #srv/web/owncloud/apps/user_ldap/lib/filesystemhelper.php
 #srv/web/owncloud/apps/user_ldap/lib/helper.php
 #srv/web/owncloud/apps/user_ldap/lib/ildapwrapper.php
+#srv/web/owncloud/apps/user_ldap/lib/jobs
 #srv/web/owncloud/apps/user_ldap/lib/jobs.php
+#srv/web/owncloud/apps/user_ldap/lib/jobs/cleanup.php
 #srv/web/owncloud/apps/user_ldap/lib/ldap.php
 #srv/web/owncloud/apps/user_ldap/lib/ldaputility.php
 #srv/web/owncloud/apps/user_ldap/lib/logwrapper.php
 #srv/web/owncloud/apps/user_ldap/lib/proxy.php
 #srv/web/owncloud/apps/user_ldap/lib/user
+#srv/web/owncloud/apps/user_ldap/lib/user/deletedusersindex.php
 #srv/web/owncloud/apps/user_ldap/lib/user/iusertools.php
 #srv/web/owncloud/apps/user_ldap/lib/user/manager.php
+#srv/web/owncloud/apps/user_ldap/lib/user/offlineuser.php
 #srv/web/owncloud/apps/user_ldap/lib/user/user.php
 #srv/web/owncloud/apps/user_ldap/lib/wizard.php
 #srv/web/owncloud/apps/user_ldap/lib/wizardresult.php
@@ -9009,10 +8914,10 @@ srv/web/owncloud
 #srv/web/owncloud/apps/user_ldap/tests
 #srv/web/owncloud/apps/user_ldap/tests/access.php
 #srv/web/owncloud/apps/user_ldap/tests/connection.php
-#srv/web/owncloud/apps/user_ldap/tests/data
-#srv/web/owncloud/apps/user_ldap/tests/data/sid.dat
 #srv/web/owncloud/apps/user_ldap/tests/group_ldap.php
 #srv/web/owncloud/apps/user_ldap/tests/helper.php
+#srv/web/owncloud/apps/user_ldap/tests/jobs
+#srv/web/owncloud/apps/user_ldap/tests/jobs/cleanup.php
 #srv/web/owncloud/apps/user_ldap/tests/user
 #srv/web/owncloud/apps/user_ldap/tests/user/manager.php
 #srv/web/owncloud/apps/user_ldap/tests/user/user.php
@@ -9132,6 +9037,7 @@ srv/web/owncloud
 #srv/web/owncloud/core/command/status.php
 #srv/web/owncloud/core/command/upgrade.php
 #srv/web/owncloud/core/command/user
+#srv/web/owncloud/core/command/user/delete.php
 #srv/web/owncloud/core/command/user/lastseen.php
 #srv/web/owncloud/core/command/user/report.php
 #srv/web/owncloud/core/command/user/resetpassword.php
@@ -9170,243 +9076,277 @@ srv/web/owncloud
 #srv/web/owncloud/core/css/styles.css
 #srv/web/owncloud/core/doc
 #srv/web/owncloud/core/doc/admin
-#srv/web/owncloud/core/doc/admin/_images
-#srv/web/owncloud/core/doc/admin/_images/antivirus-app.png
-#srv/web/owncloud/core/doc/admin/_images/antivirus-config.png
-#srv/web/owncloud/core/doc/admin/_images/antivirus-daemon-socket.png
-#srv/web/owncloud/core/doc/admin/_images/antivirus-executable.png
-#srv/web/owncloud/core/doc/admin/_images/antivirus-logging.png
-#srv/web/owncloud/core/doc/admin/_images/create_public_share.png
-#srv/web/owncloud/core/doc/admin/_images/documents_app_enable.png
-#srv/web/owncloud/core/doc/admin/_images/encryption1.png
-#srv/web/owncloud/core/doc/admin/_images/encryption2.png
-#srv/web/owncloud/core/doc/admin/_images/encryption3.png
-#srv/web/owncloud/core/doc/admin/_images/encryption4.png
-#srv/web/owncloud/core/doc/admin/_images/encryption5.png
-#srv/web/owncloud/core/doc/admin/_images/encryption6.png
-#srv/web/owncloud/core/doc/admin/_images/encryption7.png
-#srv/web/owncloud/core/doc/admin/_images/encryption8.png
-#srv/web/owncloud/core/doc/admin/_images/encryption9.png
-#srv/web/owncloud/core/doc/admin/_images/external-storage-amazons3.png
-#srv/web/owncloud/core/doc/admin/_images/external-storage-app-add.png
-#srv/web/owncloud/core/doc/admin/_images/external-storage-app-enable.png
-#srv/web/owncloud/core/doc/admin/_images/external-storage-app-local.png
-#srv/web/owncloud/core/doc/admin/_images/external-storage-app-usermounts.png
-#srv/web/owncloud/core/doc/admin/_images/external-storage-dropbox-allowshare.png
-#srv/web/owncloud/core/doc/admin/_images/external-storage-dropbox-app.png
-#srv/web/owncloud/core/doc/admin/_images/external-storage-dropbox-configapp.png
-#srv/web/owncloud/core/doc/admin/_images/external-storage-dropbox-oc.png
-#srv/web/owncloud/core/doc/admin/_images/external-storage-dropbox.png
-#srv/web/owncloud/core/doc/admin/_images/external-storage-ftp.png
-#srv/web/owncloud/core/doc/admin/_images/external-storage-google-drive-0auth.png
-#srv/web/owncloud/core/doc/admin/_images/external-storage-google-drive-9.png
-#srv/web/owncloud/core/doc/admin/_images/external-storage-google-drive-sdk.png
-#srv/web/owncloud/core/doc/admin/_images/external-storage-google-drive.png
-#srv/web/owncloud/core/doc/admin/_images/external-storage-google-drive1.png
-#srv/web/owncloud/core/doc/admin/_images/external-storage-google-drive2.png
-#srv/web/owncloud/core/doc/admin/_images/external-storage-google-drive5.png
-#srv/web/owncloud/core/doc/admin/_images/external-storage-google-drive7.png
-#srv/web/owncloud/core/doc/admin/_images/external-storage-google-drive8.png
-#srv/web/owncloud/core/doc/admin/_images/external-storage-smb.png
-#srv/web/owncloud/core/doc/admin/_images/external-storage-webdav.png
-#srv/web/owncloud/core/doc/admin/_images/install-wizard-advanced.png
-#srv/web/owncloud/core/doc/admin/_images/install-wizard.png
-#srv/web/owncloud/core/doc/admin/_images/ldap-advanced-1-connection.png
-#srv/web/owncloud/core/doc/admin/_images/ldap-advanced-2-directory.png
-#srv/web/owncloud/core/doc/admin/_images/ldap-advanced-3-attributes.png
-#srv/web/owncloud/core/doc/admin/_images/ldap-expert.png
-#srv/web/owncloud/core/doc/admin/_images/ldap-fetched-avatar.png
-#srv/web/owncloud/core/doc/admin/_images/ldap-settings-invalid-oc45.png
-#srv/web/owncloud/core/doc/admin/_images/ldap-settings-valid-oc45.png
-#srv/web/owncloud/core/doc/admin/_images/ldap-wizard-1-server.png
-#srv/web/owncloud/core/doc/admin/_images/ldap-wizard-2-user.png
-#srv/web/owncloud/core/doc/admin/_images/ldap-wizard-3-login.png
-#srv/web/owncloud/core/doc/admin/_images/ldap-wizard-4-group.png
-#srv/web/owncloud/core/doc/admin/_images/lucene-search-enable.png
-#srv/web/owncloud/core/doc/admin/_images/lucene-search-user.png
-#srv/web/owncloud/core/doc/admin/_images/oc_admin_app_page.png
-#srv/web/owncloud/core/doc/admin/_images/preview_images.png
-#srv/web/owncloud/core/doc/admin/_images/remote_shares.png
-#srv/web/owncloud/core/doc/admin/_images/sharing-admin.png
-#srv/web/owncloud/core/doc/admin/_images/sharing-user-local.png
-#srv/web/owncloud/core/doc/admin/_images/sharing-user.png
-#srv/web/owncloud/core/doc/admin/_images/smtp-config-php-sendmail.png
-#srv/web/owncloud/core/doc/admin/_images/smtp-config-smtp.png
-#srv/web/owncloud/core/doc/admin/_images/smtp-config-wizard.png
-#srv/web/owncloud/core/doc/admin/_images/ucs-app-center-install.png
-#srv/web/owncloud/core/doc/admin/_images/ucs-app-center-module.png
-#srv/web/owncloud/core/doc/admin/_images/ucsint.png
-#srv/web/owncloud/core/doc/admin/_images/ucsint1.png
-#srv/web/owncloud/core/doc/admin/_images/ucsint2.png
-#srv/web/owncloud/core/doc/admin/_images/untrusted-domain.png
-#srv/web/owncloud/core/doc/admin/_images/updater-1.png
-#srv/web/owncloud/core/doc/admin/_images/updater-2.png
-#srv/web/owncloud/core/doc/admin/_images/updater-3.png
-#srv/web/owncloud/core/doc/admin/_images/updater-4.png
-#srv/web/owncloud/core/doc/admin/_images/updater-5.png
-#srv/web/owncloud/core/doc/admin/_images/updater-6.png
-#srv/web/owncloud/core/doc/admin/_images/updater-7.png
-#srv/web/owncloud/core/doc/admin/_images/users-config.png
-#srv/web/owncloud/core/doc/admin/_images/users-create.png
-#srv/web/owncloud/core/doc/admin/_images/users-groups.png
-#srv/web/owncloud/core/doc/admin/_images/win7features.jpg
-#srv/web/owncloud/core/doc/admin/_images/winserverroles.jpg
-#srv/web/owncloud/core/doc/admin/_sources
-#srv/web/owncloud/core/doc/admin/_sources/configuration
-#srv/web/owncloud/core/doc/admin/_sources/configuration/auth_ldap.txt
-#srv/web/owncloud/core/doc/admin/_sources/configuration/background_jobs.txt
-#srv/web/owncloud/core/doc/admin/_sources/configuration/configuration-antivirus.txt
-#srv/web/owncloud/core/doc/admin/_sources/configuration/configuration_3rdparty.txt
-#srv/web/owncloud/core/doc/admin/_sources/configuration/configuration_apps.txt
-#srv/web/owncloud/core/doc/admin/_sources/configuration/configuration_assets.txt
-#srv/web/owncloud/core/doc/admin/_sources/configuration/configuration_automation.txt
-#srv/web/owncloud/core/doc/admin/_sources/configuration/configuration_config_sample_php.txt
-#srv/web/owncloud/core/doc/admin/_sources/configuration/configuration_custom_clients.txt
-#srv/web/owncloud/core/doc/admin/_sources/configuration/configuration_database.txt
-#srv/web/owncloud/core/doc/admin/_sources/configuration/configuration_encryption.txt
-#srv/web/owncloud/core/doc/admin/_sources/configuration/configuration_file_sharing.txt
-#srv/web/owncloud/core/doc/admin/_sources/configuration/configuration_files_locking.txt
-#srv/web/owncloud/core/doc/admin/_sources/configuration/configuration_knowledgebase.txt
-#srv/web/owncloud/core/doc/admin/_sources/configuration/configuration_language.txt
-#srv/web/owncloud/core/doc/admin/_sources/configuration/configuration_logging.txt
-#srv/web/owncloud/core/doc/admin/_sources/configuration/configuration_mail.txt
-#srv/web/owncloud/core/doc/admin/_sources/configuration/configuration_preview.txt
-#srv/web/owncloud/core/doc/admin/_sources/configuration/configuration_reverseproxy.txt
-#srv/web/owncloud/core/doc/admin/_sources/configuration/configuration_users.txt
-#srv/web/owncloud/core/doc/admin/_sources/configuration/configuring_big_file_upload.txt
-#srv/web/owncloud/core/doc/admin/_sources/configuration/configuring_documents.txt
-#srv/web/owncloud/core/doc/admin/_sources/configuration/configuring_search.txt
-#srv/web/owncloud/core/doc/admin/_sources/configuration/custom_mount_config.txt
-#srv/web/owncloud/core/doc/admin/_sources/configuration/custom_mount_config_gui.txt
-#srv/web/owncloud/core/doc/admin/_sources/configuration/custom_user_backend.txt
-#srv/web/owncloud/core/doc/admin/_sources/configuration/index.txt
-#srv/web/owncloud/core/doc/admin/_sources/configuration/server_to_server_managing.txt
-#srv/web/owncloud/core/doc/admin/_sources/configuration/xsendfile.txt
-#srv/web/owncloud/core/doc/admin/_sources/contents.txt
-#srv/web/owncloud/core/doc/admin/_sources/index.txt
-#srv/web/owncloud/core/doc/admin/_sources/installation
-#srv/web/owncloud/core/doc/admin/_sources/installation/configuration_hiawatha.txt
-#srv/web/owncloud/core/doc/admin/_sources/installation/configuration_lighttpd.txt
-#srv/web/owncloud/core/doc/admin/_sources/installation/configuration_nginx.txt
-#srv/web/owncloud/core/doc/admin/_sources/installation/configuration_yaws.txt
-#srv/web/owncloud/core/doc/admin/_sources/installation/index.txt
-#srv/web/owncloud/core/doc/admin/_sources/installation/installation_appliance.txt
-#srv/web/owncloud/core/doc/admin/_sources/installation/installation_linux.txt
-#srv/web/owncloud/core/doc/admin/_sources/installation/installation_macos.txt
-#srv/web/owncloud/core/doc/admin/_sources/installation/installation_others.txt
-#srv/web/owncloud/core/doc/admin/_sources/installation/installation_source.txt
-#srv/web/owncloud/core/doc/admin/_sources/installation/installation_ucs.txt
-#srv/web/owncloud/core/doc/admin/_sources/installation/installation_windows.txt
-#srv/web/owncloud/core/doc/admin/_sources/installation/installation_wizard.txt
-#srv/web/owncloud/core/doc/admin/_sources/issues
-#srv/web/owncloud/core/doc/admin/_sources/issues/index.txt
-#srv/web/owncloud/core/doc/admin/_sources/maintenance
-#srv/web/owncloud/core/doc/admin/_sources/maintenance/backup.txt
-#srv/web/owncloud/core/doc/admin/_sources/maintenance/convert_db.txt
-#srv/web/owncloud/core/doc/admin/_sources/maintenance/enable_maintenance.txt
-#srv/web/owncloud/core/doc/admin/_sources/maintenance/index.txt
-#srv/web/owncloud/core/doc/admin/_sources/maintenance/migrating.txt
-#srv/web/owncloud/core/doc/admin/_sources/maintenance/restore.txt
-#srv/web/owncloud/core/doc/admin/_sources/maintenance/update.txt
-#srv/web/owncloud/core/doc/admin/_sources/maintenance/upgrade.txt
-#srv/web/owncloud/core/doc/admin/_sources/whats_new_admin.txt
-#srv/web/owncloud/core/doc/admin/_static
-#srv/web/owncloud/core/doc/admin/_static/ajax-loader.gif
-#srv/web/owncloud/core/doc/admin/_static/basic.css
-#srv/web/owncloud/core/doc/admin/_static/bootstrap-responsive.css
-#srv/web/owncloud/core/doc/admin/_static/bootstrap-sphinx.css
-#srv/web/owncloud/core/doc/admin/_static/bootstrap.css
-#srv/web/owncloud/core/doc/admin/_static/bootstrap.js
-#srv/web/owncloud/core/doc/admin/_static/comment-bright.png
-#srv/web/owncloud/core/doc/admin/_static/comment-close.png
-#srv/web/owncloud/core/doc/admin/_static/comment.png
-#srv/web/owncloud/core/doc/admin/_static/doctools.js
-#srv/web/owncloud/core/doc/admin/_static/down-pressed.png
-#srv/web/owncloud/core/doc/admin/_static/down.png
-#srv/web/owncloud/core/doc/admin/_static/file.png
-#srv/web/owncloud/core/doc/admin/_static/img
-#srv/web/owncloud/core/doc/admin/_static/img/glyphicons-halflings-white.png
-#srv/web/owncloud/core/doc/admin/_static/img/glyphicons-halflings.png
-#srv/web/owncloud/core/doc/admin/_static/img/note.svg
-#srv/web/owncloud/core/doc/admin/_static/img/todo.svg
-#srv/web/owncloud/core/doc/admin/_static/jquery.js
-#srv/web/owncloud/core/doc/admin/_static/logo-blue.pdf
-#srv/web/owncloud/core/doc/admin/_static/logo-blue.png
-#srv/web/owncloud/core/doc/admin/_static/minus.png
-#srv/web/owncloud/core/doc/admin/_static/plus.png
-#srv/web/owncloud/core/doc/admin/_static/pygments.css
-#srv/web/owncloud/core/doc/admin/_static/searchtools.js
-#srv/web/owncloud/core/doc/admin/_static/style.css
-#srv/web/owncloud/core/doc/admin/_static/underscore.js
-#srv/web/owncloud/core/doc/admin/_static/up-pressed.png
-#srv/web/owncloud/core/doc/admin/_static/up.png
-#srv/web/owncloud/core/doc/admin/_static/websupport.js
-#srv/web/owncloud/core/doc/admin/configuration
-#srv/web/owncloud/core/doc/admin/configuration/auth_ldap.html
-#srv/web/owncloud/core/doc/admin/configuration/background_jobs.html
-#srv/web/owncloud/core/doc/admin/configuration/configuration-antivirus.html
-#srv/web/owncloud/core/doc/admin/configuration/configuration_3rdparty.html
-#srv/web/owncloud/core/doc/admin/configuration/configuration_apps.html
-#srv/web/owncloud/core/doc/admin/configuration/configuration_assets.html
-#srv/web/owncloud/core/doc/admin/configuration/configuration_automation.html
-#srv/web/owncloud/core/doc/admin/configuration/configuration_config_sample_php.html
-#srv/web/owncloud/core/doc/admin/configuration/configuration_custom_clients.html
-#srv/web/owncloud/core/doc/admin/configuration/configuration_database.html
-#srv/web/owncloud/core/doc/admin/configuration/configuration_encryption.html
-#srv/web/owncloud/core/doc/admin/configuration/configuration_file_sharing.html
-#srv/web/owncloud/core/doc/admin/configuration/configuration_files_locking.html
-#srv/web/owncloud/core/doc/admin/configuration/configuration_knowledgebase.html
-#srv/web/owncloud/core/doc/admin/configuration/configuration_language.html
-#srv/web/owncloud/core/doc/admin/configuration/configuration_logging.html
-#srv/web/owncloud/core/doc/admin/configuration/configuration_mail.html
-#srv/web/owncloud/core/doc/admin/configuration/configuration_preview.html
-#srv/web/owncloud/core/doc/admin/configuration/configuration_reverseproxy.html
-#srv/web/owncloud/core/doc/admin/configuration/configuration_users.html
-#srv/web/owncloud/core/doc/admin/configuration/configuring_big_file_upload.html
-#srv/web/owncloud/core/doc/admin/configuration/configuring_documents.html
-#srv/web/owncloud/core/doc/admin/configuration/configuring_search.html
-#srv/web/owncloud/core/doc/admin/configuration/custom_mount_config.html
-#srv/web/owncloud/core/doc/admin/configuration/custom_mount_config_gui.html
-#srv/web/owncloud/core/doc/admin/configuration/custom_user_backend.html
-#srv/web/owncloud/core/doc/admin/configuration/index.html
-#srv/web/owncloud/core/doc/admin/configuration/server_to_server_managing.html
-#srv/web/owncloud/core/doc/admin/configuration/xsendfile.html
-#srv/web/owncloud/core/doc/admin/contents.html
-#srv/web/owncloud/core/doc/admin/genindex.html
 #srv/web/owncloud/core/doc/admin/index.html
-#srv/web/owncloud/core/doc/admin/installation
-#srv/web/owncloud/core/doc/admin/installation/configuration_hiawatha.html
-#srv/web/owncloud/core/doc/admin/installation/configuration_lighttpd.html
-#srv/web/owncloud/core/doc/admin/installation/configuration_nginx.html
-#srv/web/owncloud/core/doc/admin/installation/configuration_yaws.html
-#srv/web/owncloud/core/doc/admin/installation/index.html
-#srv/web/owncloud/core/doc/admin/installation/installation_appliance.html
-#srv/web/owncloud/core/doc/admin/installation/installation_linux.html
-#srv/web/owncloud/core/doc/admin/installation/installation_macos.html
-#srv/web/owncloud/core/doc/admin/installation/installation_others.html
-#srv/web/owncloud/core/doc/admin/installation/installation_source.html
-#srv/web/owncloud/core/doc/admin/installation/installation_ucs.html
-#srv/web/owncloud/core/doc/admin/installation/installation_windows.html
-#srv/web/owncloud/core/doc/admin/installation/installation_wizard.html
-#srv/web/owncloud/core/doc/admin/issues
-#srv/web/owncloud/core/doc/admin/issues/index.html
-#srv/web/owncloud/core/doc/admin/maintenance
-#srv/web/owncloud/core/doc/admin/maintenance/backup.html
-#srv/web/owncloud/core/doc/admin/maintenance/convert_db.html
-#srv/web/owncloud/core/doc/admin/maintenance/enable_maintenance.html
-#srv/web/owncloud/core/doc/admin/maintenance/index.html
-#srv/web/owncloud/core/doc/admin/maintenance/migrating.html
-#srv/web/owncloud/core/doc/admin/maintenance/restore.html
-#srv/web/owncloud/core/doc/admin/maintenance/update.html
-#srv/web/owncloud/core/doc/admin/maintenance/upgrade.html
-#srv/web/owncloud/core/doc/admin/objects.inv
-#srv/web/owncloud/core/doc/admin/search.html
-#srv/web/owncloud/core/doc/admin/searchindex.js
-#srv/web/owncloud/core/doc/admin/whats_new_admin.html
+#srv/web/owncloud/core/doc/admin/release
+#srv/web/owncloud/core/doc/admin/release/.buildinfo
+#srv/web/owncloud/core/doc/admin/release/_images
+#srv/web/owncloud/core/doc/admin/release/_images/antivirus-app.png
+#srv/web/owncloud/core/doc/admin/release/_images/antivirus-config.png
+#srv/web/owncloud/core/doc/admin/release/_images/antivirus-daemon-socket.png
+#srv/web/owncloud/core/doc/admin/release/_images/antivirus-executable.png
+#srv/web/owncloud/core/doc/admin/release/_images/antivirus-logging.png
+#srv/web/owncloud/core/doc/admin/release/_images/create_public_share.png
+#srv/web/owncloud/core/doc/admin/release/_images/documents_app_enable.png
+#srv/web/owncloud/core/doc/admin/release/_images/documents_apply_test.png
+#srv/web/owncloud/core/doc/admin/release/_images/encryption1.png
+#srv/web/owncloud/core/doc/admin/release/_images/encryption2.png
+#srv/web/owncloud/core/doc/admin/release/_images/encryption3.png
+#srv/web/owncloud/core/doc/admin/release/_images/encryption4.png
+#srv/web/owncloud/core/doc/admin/release/_images/encryption5.png
+#srv/web/owncloud/core/doc/admin/release/_images/encryption6.png
+#srv/web/owncloud/core/doc/admin/release/_images/encryption7.png
+#srv/web/owncloud/core/doc/admin/release/_images/encryption8.png
+#srv/web/owncloud/core/doc/admin/release/_images/encryption9.png
+#srv/web/owncloud/core/doc/admin/release/_images/external-sites-1.png
+#srv/web/owncloud/core/doc/admin/release/_images/external-sites-2.png
+#srv/web/owncloud/core/doc/admin/release/_images/external-sites-3.png
+#srv/web/owncloud/core/doc/admin/release/_images/external-sites-4.png
+#srv/web/owncloud/core/doc/admin/release/_images/external-sites-5.png
+#srv/web/owncloud/core/doc/admin/release/_images/external-storage-amazons3.png
+#srv/web/owncloud/core/doc/admin/release/_images/external-storage-app-add.png
+#srv/web/owncloud/core/doc/admin/release/_images/external-storage-app-enable.png
+#srv/web/owncloud/core/doc/admin/release/_images/external-storage-app-local.png
+#srv/web/owncloud/core/doc/admin/release/_images/external-storage-app-usermounts.png
+#srv/web/owncloud/core/doc/admin/release/_images/external-storage-dropbox-allowshare.png
+#srv/web/owncloud/core/doc/admin/release/_images/external-storage-dropbox-app.png
+#srv/web/owncloud/core/doc/admin/release/_images/external-storage-dropbox-configapp.png
+#srv/web/owncloud/core/doc/admin/release/_images/external-storage-dropbox-oc.png
+#srv/web/owncloud/core/doc/admin/release/_images/external-storage-dropbox.png
+#srv/web/owncloud/core/doc/admin/release/_images/external-storage-ftp.png
+#srv/web/owncloud/core/doc/admin/release/_images/external-storage-google-drive-0auth.png
+#srv/web/owncloud/core/doc/admin/release/_images/external-storage-google-drive-9.png
+#srv/web/owncloud/core/doc/admin/release/_images/external-storage-google-drive-sdk.png
+#srv/web/owncloud/core/doc/admin/release/_images/external-storage-google-drive.png
+#srv/web/owncloud/core/doc/admin/release/_images/external-storage-google-drive1.png
+#srv/web/owncloud/core/doc/admin/release/_images/external-storage-google-drive2.png
+#srv/web/owncloud/core/doc/admin/release/_images/external-storage-google-drive5.png
+#srv/web/owncloud/core/doc/admin/release/_images/external-storage-google-drive7.png
+#srv/web/owncloud/core/doc/admin/release/_images/external-storage-google-drive8.png
+#srv/web/owncloud/core/doc/admin/release/_images/external-storage-smb.png
+#srv/web/owncloud/core/doc/admin/release/_images/external-storage-webdav.png
+#srv/web/owncloud/core/doc/admin/release/_images/install-wizard-advanced.png
+#srv/web/owncloud/core/doc/admin/release/_images/install-wizard.png
+#srv/web/owncloud/core/doc/admin/release/_images/ldap-advanced-1-connection.png
+#srv/web/owncloud/core/doc/admin/release/_images/ldap-advanced-2-directory.png
+#srv/web/owncloud/core/doc/admin/release/_images/ldap-advanced-3-attributes.png
+#srv/web/owncloud/core/doc/admin/release/_images/ldap-expert.png
+#srv/web/owncloud/core/doc/admin/release/_images/ldap-fetched-avatar.png
+#srv/web/owncloud/core/doc/admin/release/_images/ldap-settings-invalid-oc45.png
+#srv/web/owncloud/core/doc/admin/release/_images/ldap-settings-valid-oc45.png
+#srv/web/owncloud/core/doc/admin/release/_images/ldap-wizard-1-server.png
+#srv/web/owncloud/core/doc/admin/release/_images/ldap-wizard-2-user.png
+#srv/web/owncloud/core/doc/admin/release/_images/ldap-wizard-3-login.png
+#srv/web/owncloud/core/doc/admin/release/_images/ldap-wizard-4-group.png
+#srv/web/owncloud/core/doc/admin/release/_images/lucene-search-enable.png
+#srv/web/owncloud/core/doc/admin/release/_images/lucene-search-user.png
+#srv/web/owncloud/core/doc/admin/release/_images/oc-video-1.png
+#srv/web/owncloud/core/doc/admin/release/_images/oc-video-2.png
+#srv/web/owncloud/core/doc/admin/release/_images/oc_admin_app_page.png
+#srv/web/owncloud/core/doc/admin/release/_images/preview_images.png
+#srv/web/owncloud/core/doc/admin/release/_images/remote_shares.png
+#srv/web/owncloud/core/doc/admin/release/_images/sharing-admin.png
+#srv/web/owncloud/core/doc/admin/release/_images/sharing-user-local.png
+#srv/web/owncloud/core/doc/admin/release/_images/sharing-user.png
+#srv/web/owncloud/core/doc/admin/release/_images/smtp-config-php-sendmail.png
+#srv/web/owncloud/core/doc/admin/release/_images/smtp-config-smtp.png
+#srv/web/owncloud/core/doc/admin/release/_images/smtp-config-wizard.png
+#srv/web/owncloud/core/doc/admin/release/_images/ucs-app-center-install.png
+#srv/web/owncloud/core/doc/admin/release/_images/ucs-app-center-module.png
+#srv/web/owncloud/core/doc/admin/release/_images/ucsint.png
+#srv/web/owncloud/core/doc/admin/release/_images/ucsint1.png
+#srv/web/owncloud/core/doc/admin/release/_images/ucsint2.png
+#srv/web/owncloud/core/doc/admin/release/_images/untrusted-domain.png
+#srv/web/owncloud/core/doc/admin/release/_images/updater-1.png
+#srv/web/owncloud/core/doc/admin/release/_images/updater-2.png
+#srv/web/owncloud/core/doc/admin/release/_images/updater-3.png
+#srv/web/owncloud/core/doc/admin/release/_images/updater-4.png
+#srv/web/owncloud/core/doc/admin/release/_images/updater-5.png
+#srv/web/owncloud/core/doc/admin/release/_images/updater-6.png
+#srv/web/owncloud/core/doc/admin/release/_images/updater-7.png
+#srv/web/owncloud/core/doc/admin/release/_images/users-config.png
+#srv/web/owncloud/core/doc/admin/release/_images/users-create.png
+#srv/web/owncloud/core/doc/admin/release/_images/users-groups.png
+#srv/web/owncloud/core/doc/admin/release/_images/win7features.jpg
+#srv/web/owncloud/core/doc/admin/release/_images/winserverroles.jpg
+#srv/web/owncloud/core/doc/admin/release/_sources
+#srv/web/owncloud/core/doc/admin/release/_sources/configuration
+#srv/web/owncloud/core/doc/admin/release/_sources/configuration/activity_configuration.txt
+#srv/web/owncloud/core/doc/admin/release/_sources/configuration/antivirus_configuration.txt
+#srv/web/owncloud/core/doc/admin/release/_sources/configuration/automatic_configuration.txt
+#srv/web/owncloud/core/doc/admin/release/_sources/configuration/background_jobs_configuration.txt
+#srv/web/owncloud/core/doc/admin/release/_sources/configuration/big_file_upload_configuration.txt
+#srv/web/owncloud/core/doc/admin/release/_sources/configuration/collaborative_documents_configuration.txt
+#srv/web/owncloud/core/doc/admin/release/_sources/configuration/config_sample_php_parameters.txt
+#srv/web/owncloud/core/doc/admin/release/_sources/configuration/custom_client_configuration.txt
+#srv/web/owncloud/core/doc/admin/release/_sources/configuration/database_configuration.txt
+#srv/web/owncloud/core/doc/admin/release/_sources/configuration/email_configuration.txt
+#srv/web/owncloud/core/doc/admin/release/_sources/configuration/encryption_configuration.txt
+#srv/web/owncloud/core/doc/admin/release/_sources/configuration/external_sites.txt
+#srv/web/owncloud/core/doc/admin/release/_sources/configuration/external_storage_configuration.txt
+#srv/web/owncloud/core/doc/admin/release/_sources/configuration/external_storage_configuration_gui.txt
+#srv/web/owncloud/core/doc/admin/release/_sources/configuration/file_sharing_configuration.txt
+#srv/web/owncloud/core/doc/admin/release/_sources/configuration/files_locking_enabling.txt
+#srv/web/owncloud/core/doc/admin/release/_sources/configuration/harden_server.txt
+#srv/web/owncloud/core/doc/admin/release/_sources/configuration/index.txt
+#srv/web/owncloud/core/doc/admin/release/_sources/configuration/js_css_asset_management_configuration.txt
+#srv/web/owncloud/core/doc/admin/release/_sources/configuration/knowledgebase_configuration.txt
+#srv/web/owncloud/core/doc/admin/release/_sources/configuration/language_configuration.txt
+#srv/web/owncloud/core/doc/admin/release/_sources/configuration/logging_configuration.txt
+#srv/web/owncloud/core/doc/admin/release/_sources/configuration/occ_command.txt
+#srv/web/owncloud/core/doc/admin/release/_sources/configuration/performance_tips.txt
+#srv/web/owncloud/core/doc/admin/release/_sources/configuration/previews_configuration.txt
+#srv/web/owncloud/core/doc/admin/release/_sources/configuration/reset_admin_password.txt
+#srv/web/owncloud/core/doc/admin/release/_sources/configuration/reverse_proxy_configuration.txt
+#srv/web/owncloud/core/doc/admin/release/_sources/configuration/search_configuration.txt
+#srv/web/owncloud/core/doc/admin/release/_sources/configuration/server_to_server_configuration.txt
+#srv/web/owncloud/core/doc/admin/release/_sources/configuration/serving_static_files_configuration.txt
+#srv/web/owncloud/core/doc/admin/release/_sources/configuration/thirdparty_php_configuration.txt
+#srv/web/owncloud/core/doc/admin/release/_sources/configuration/user_auth_ftp_smb_imap.txt
+#srv/web/owncloud/core/doc/admin/release/_sources/configuration/user_auth_ldap.txt
+#srv/web/owncloud/core/doc/admin/release/_sources/configuration/user_auth_ldap_cleanup.txt
+#srv/web/owncloud/core/doc/admin/release/_sources/configuration/user_configuration.txt
+#srv/web/owncloud/core/doc/admin/release/_sources/contents.txt
+#srv/web/owncloud/core/doc/admin/release/_sources/index.txt
+#srv/web/owncloud/core/doc/admin/release/_sources/installation
+#srv/web/owncloud/core/doc/admin/release/_sources/installation/appliance_installation.txt
+#srv/web/owncloud/core/doc/admin/release/_sources/installation/apps_management_installation.txt
+#srv/web/owncloud/core/doc/admin/release/_sources/installation/hiawatha_configuration.txt
+#srv/web/owncloud/core/doc/admin/release/_sources/installation/index.txt
+#srv/web/owncloud/core/doc/admin/release/_sources/installation/installation_wizard.txt
+#srv/web/owncloud/core/doc/admin/release/_sources/installation/lighttpd_configuration.txt
+#srv/web/owncloud/core/doc/admin/release/_sources/installation/linux_installation.txt
+#srv/web/owncloud/core/doc/admin/release/_sources/installation/macos_installation.txt
+#srv/web/owncloud/core/doc/admin/release/_sources/installation/nginx_configuration.txt
+#srv/web/owncloud/core/doc/admin/release/_sources/installation/others_installation.txt
+#srv/web/owncloud/core/doc/admin/release/_sources/installation/selinux_configuration.txt
+#srv/web/owncloud/core/doc/admin/release/_sources/installation/source_installation.txt
+#srv/web/owncloud/core/doc/admin/release/_sources/installation/ucs_installation.txt
+#srv/web/owncloud/core/doc/admin/release/_sources/installation/windows_installation.txt
+#srv/web/owncloud/core/doc/admin/release/_sources/installation/yaws_configuration.txt
+#srv/web/owncloud/core/doc/admin/release/_sources/issues
+#srv/web/owncloud/core/doc/admin/release/_sources/issues/index.txt
+#srv/web/owncloud/core/doc/admin/release/_sources/maintenance
+#srv/web/owncloud/core/doc/admin/release/_sources/maintenance/backup.txt
+#srv/web/owncloud/core/doc/admin/release/_sources/maintenance/convert_db.txt
+#srv/web/owncloud/core/doc/admin/release/_sources/maintenance/enable_maintenance.txt
+#srv/web/owncloud/core/doc/admin/release/_sources/maintenance/index.txt
+#srv/web/owncloud/core/doc/admin/release/_sources/maintenance/migrating.txt
+#srv/web/owncloud/core/doc/admin/release/_sources/maintenance/restore.txt
+#srv/web/owncloud/core/doc/admin/release/_sources/maintenance/update.txt
+#srv/web/owncloud/core/doc/admin/release/_sources/maintenance/upgrade.txt
+#srv/web/owncloud/core/doc/admin/release/_sources/release_notes.txt
+#srv/web/owncloud/core/doc/admin/release/_sources/videos.txt
+#srv/web/owncloud/core/doc/admin/release/_sources/whats_new_admin.txt
+#srv/web/owncloud/core/doc/admin/release/_static
+#srv/web/owncloud/core/doc/admin/release/_static/ajax-loader.gif
+#srv/web/owncloud/core/doc/admin/release/_static/basic.css
+#srv/web/owncloud/core/doc/admin/release/_static/bootstrap-responsive.css
+#srv/web/owncloud/core/doc/admin/release/_static/bootstrap-sphinx.css
+#srv/web/owncloud/core/doc/admin/release/_static/bootstrap.css
+#srv/web/owncloud/core/doc/admin/release/_static/bootstrap.js
+#srv/web/owncloud/core/doc/admin/release/_static/comment-bright.png
+#srv/web/owncloud/core/doc/admin/release/_static/comment-close.png
+#srv/web/owncloud/core/doc/admin/release/_static/comment.png
+#srv/web/owncloud/core/doc/admin/release/_static/doctools.js
+#srv/web/owncloud/core/doc/admin/release/_static/down-pressed.png
+#srv/web/owncloud/core/doc/admin/release/_static/down.png
+#srv/web/owncloud/core/doc/admin/release/_static/file.png
+#srv/web/owncloud/core/doc/admin/release/_static/img
+#srv/web/owncloud/core/doc/admin/release/_static/img/glyphicons-halflings-white.png
+#srv/web/owncloud/core/doc/admin/release/_static/img/glyphicons-halflings.png
+#srv/web/owncloud/core/doc/admin/release/_static/img/note.svg
+#srv/web/owncloud/core/doc/admin/release/_static/img/todo.svg
+#srv/web/owncloud/core/doc/admin/release/_static/jquery.js
+#srv/web/owncloud/core/doc/admin/release/_static/logo-blue.pdf
+#srv/web/owncloud/core/doc/admin/release/_static/logo-blue.png
+#srv/web/owncloud/core/doc/admin/release/_static/minus.png
+#srv/web/owncloud/core/doc/admin/release/_static/plus.png
+#srv/web/owncloud/core/doc/admin/release/_static/pygments.css
+#srv/web/owncloud/core/doc/admin/release/_static/searchtools.js
+#srv/web/owncloud/core/doc/admin/release/_static/style.css
+#srv/web/owncloud/core/doc/admin/release/_static/underscore.js
+#srv/web/owncloud/core/doc/admin/release/_static/up-pressed.png
+#srv/web/owncloud/core/doc/admin/release/_static/up.png
+#srv/web/owncloud/core/doc/admin/release/_static/websupport.js
+#srv/web/owncloud/core/doc/admin/release/configuration
+#srv/web/owncloud/core/doc/admin/release/configuration/activity_configuration.html
+#srv/web/owncloud/core/doc/admin/release/configuration/antivirus_configuration.html
+#srv/web/owncloud/core/doc/admin/release/configuration/automatic_configuration.html
+#srv/web/owncloud/core/doc/admin/release/configuration/background_jobs_configuration.html
+#srv/web/owncloud/core/doc/admin/release/configuration/big_file_upload_configuration.html
+#srv/web/owncloud/core/doc/admin/release/configuration/collaborative_documents_configuration.html
+#srv/web/owncloud/core/doc/admin/release/configuration/config_sample_php_parameters.html
+#srv/web/owncloud/core/doc/admin/release/configuration/custom_client_configuration.html
+#srv/web/owncloud/core/doc/admin/release/configuration/database_configuration.html
+#srv/web/owncloud/core/doc/admin/release/configuration/email_configuration.html
+#srv/web/owncloud/core/doc/admin/release/configuration/encryption_configuration.html
+#srv/web/owncloud/core/doc/admin/release/configuration/external_sites.html
+#srv/web/owncloud/core/doc/admin/release/configuration/external_storage_configuration.html
+#srv/web/owncloud/core/doc/admin/release/configuration/external_storage_configuration_gui.html
+#srv/web/owncloud/core/doc/admin/release/configuration/file_sharing_configuration.html
+#srv/web/owncloud/core/doc/admin/release/configuration/files_locking_enabling.html
+#srv/web/owncloud/core/doc/admin/release/configuration/harden_server.html
+#srv/web/owncloud/core/doc/admin/release/configuration/index.html
+#srv/web/owncloud/core/doc/admin/release/configuration/js_css_asset_management_configuration.html
+#srv/web/owncloud/core/doc/admin/release/configuration/knowledgebase_configuration.html
+#srv/web/owncloud/core/doc/admin/release/configuration/language_configuration.html
+#srv/web/owncloud/core/doc/admin/release/configuration/logging_configuration.html
+#srv/web/owncloud/core/doc/admin/release/configuration/occ_command.html
+#srv/web/owncloud/core/doc/admin/release/configuration/performance_tips.html
+#srv/web/owncloud/core/doc/admin/release/configuration/previews_configuration.html
+#srv/web/owncloud/core/doc/admin/release/configuration/reset_admin_password.html
+#srv/web/owncloud/core/doc/admin/release/configuration/reverse_proxy_configuration.html
+#srv/web/owncloud/core/doc/admin/release/configuration/search_configuration.html
+#srv/web/owncloud/core/doc/admin/release/configuration/server_to_server_configuration.html
+#srv/web/owncloud/core/doc/admin/release/configuration/serving_static_files_configuration.html
+#srv/web/owncloud/core/doc/admin/release/configuration/thirdparty_php_configuration.html
+#srv/web/owncloud/core/doc/admin/release/configuration/user_auth_ftp_smb_imap.html
+#srv/web/owncloud/core/doc/admin/release/configuration/user_auth_ldap.html
+#srv/web/owncloud/core/doc/admin/release/configuration/user_auth_ldap_cleanup.html
+#srv/web/owncloud/core/doc/admin/release/configuration/user_configuration.html
+#srv/web/owncloud/core/doc/admin/release/contents.html
+#srv/web/owncloud/core/doc/admin/release/genindex.html
+#srv/web/owncloud/core/doc/admin/release/index.html
+#srv/web/owncloud/core/doc/admin/release/installation
+#srv/web/owncloud/core/doc/admin/release/installation/appliance_installation.html
+#srv/web/owncloud/core/doc/admin/release/installation/apps_management_installation.html
+#srv/web/owncloud/core/doc/admin/release/installation/hiawatha_configuration.html
+#srv/web/owncloud/core/doc/admin/release/installation/index.html
+#srv/web/owncloud/core/doc/admin/release/installation/installation_wizard.html
+#srv/web/owncloud/core/doc/admin/release/installation/lighttpd_configuration.html
+#srv/web/owncloud/core/doc/admin/release/installation/linux_installation.html
+#srv/web/owncloud/core/doc/admin/release/installation/macos_installation.html
+#srv/web/owncloud/core/doc/admin/release/installation/nginx_configuration.html
+#srv/web/owncloud/core/doc/admin/release/installation/others_installation.html
+#srv/web/owncloud/core/doc/admin/release/installation/selinux_configuration.html
+#srv/web/owncloud/core/doc/admin/release/installation/source_installation.html
+#srv/web/owncloud/core/doc/admin/release/installation/ucs_installation.html
+#srv/web/owncloud/core/doc/admin/release/installation/windows_installation.html
+#srv/web/owncloud/core/doc/admin/release/installation/yaws_configuration.html
+#srv/web/owncloud/core/doc/admin/release/issues
+#srv/web/owncloud/core/doc/admin/release/issues/index.html
+#srv/web/owncloud/core/doc/admin/release/maintenance
+#srv/web/owncloud/core/doc/admin/release/maintenance/backup.html
+#srv/web/owncloud/core/doc/admin/release/maintenance/convert_db.html
+#srv/web/owncloud/core/doc/admin/release/maintenance/enable_maintenance.html
+#srv/web/owncloud/core/doc/admin/release/maintenance/index.html
+#srv/web/owncloud/core/doc/admin/release/maintenance/migrating.html
+#srv/web/owncloud/core/doc/admin/release/maintenance/restore.html
+#srv/web/owncloud/core/doc/admin/release/maintenance/update.html
+#srv/web/owncloud/core/doc/admin/release/maintenance/upgrade.html
+#srv/web/owncloud/core/doc/admin/release/objects.inv
+#srv/web/owncloud/core/doc/admin/release/release_notes.html
+#srv/web/owncloud/core/doc/admin/release/search.html
+#srv/web/owncloud/core/doc/admin/release/searchindex.js
+#srv/web/owncloud/core/doc/admin/release/videos.html
+#srv/web/owncloud/core/doc/admin/release/whats_new_admin.html
 #srv/web/owncloud/core/doc/user
 #srv/web/owncloud/core/doc/user/_images
 #srv/web/owncloud/core/doc/user/_images/bookmark_addurl.png
 #srv/web/owncloud/core/doc/user/_images/bookmark_setting.png
+#srv/web/owncloud/core/doc/user/_images/calendar_caldav_icon.png
+#srv/web/owncloud/core/doc/user/_images/calendar_caldav_ios.png
+#srv/web/owncloud/core/doc/user/_images/calendar_caldav_link.png
 #srv/web/owncloud/core/doc/user/_images/calendar_create_event.png
 #srv/web/owncloud/core/doc/user/_images/calendar_create_event_repeat.png
 #srv/web/owncloud/core/doc/user/_images/calendar_create_event_share.png
@@ -9431,9 +9371,7 @@ srv/web/owncloud
 #srv/web/owncloud/core/doc/user/_images/contact_vcfpick.jpg
 #srv/web/owncloud/core/doc/user/_images/contacts_empty.png
 #srv/web/owncloud/core/doc/user/_images/contacts_settings.png
-#srv/web/owncloud/core/doc/user/_images/deleted_files.png
 #srv/web/owncloud/core/doc/user/_images/documents_personal_settings.png
-#srv/web/owncloud/core/doc/user/_images/dolphin_webdav.png
 #srv/web/owncloud/core/doc/user/_images/download.png
 #srv/web/owncloud/core/doc/user/_images/email_address_personal_settings.png
 #srv/web/owncloud/core/doc/user/_images/encryption1.png
@@ -9444,7 +9382,7 @@ srv/web/owncloud
 #srv/web/owncloud/core/doc/user/_images/explorer_webdav.png
 #srv/web/owncloud/core/doc/user/_images/files_versioning.png
 #srv/web/owncloud/core/doc/user/_images/full_name.png
-#srv/web/owncloud/core/doc/user/_images/gnome3_nautilus_webdav.png
+#srv/web/owncloud/core/doc/user/_images/gear.png
 #srv/web/owncloud/core/doc/user/_images/kdes.png
 #srv/web/owncloud/core/doc/user/_images/kdes1.png
 #srv/web/owncloud/core/doc/user/_images/kdes2.png
@@ -9484,6 +9422,10 @@ srv/web/owncloud
 #srv/web/owncloud/core/doc/user/_images/users-share-local.png
 #srv/web/owncloud/core/doc/user/_images/users-share-local2.png
 #srv/web/owncloud/core/doc/user/_images/users-share-public.png
+#srv/web/owncloud/core/doc/user/_images/users-share-public2.jpg
+#srv/web/owncloud/core/doc/user/_images/users-share-public3.jpg
+#srv/web/owncloud/core/doc/user/_images/webdav_dolphin.png
+#srv/web/owncloud/core/doc/user/_images/webdav_gnome3_nautilus.png
 #srv/web/owncloud/core/doc/user/_sources
 #srv/web/owncloud/core/doc/user/_sources/bookmarks.txt
 #srv/web/owncloud/core/doc/user/_sources/contents.txt
@@ -9502,7 +9444,6 @@ srv/web/owncloud
 #srv/web/owncloud/core/doc/user/_sources/files/sync.txt
 #srv/web/owncloud/core/doc/user/_sources/files/versioncontrol.txt
 #srv/web/owncloud/core/doc/user/_sources/index.txt
-#srv/web/owncloud/core/doc/user/_sources/installing_apps.txt
 #srv/web/owncloud/core/doc/user/_sources/pim
 #srv/web/owncloud/core/doc/user/_sources/pim/calendar.txt
 #srv/web/owncloud/core/doc/user/_sources/pim/contacts.txt
@@ -9564,7 +9505,6 @@ srv/web/owncloud
 #srv/web/owncloud/core/doc/user/files/versioncontrol.html
 #srv/web/owncloud/core/doc/user/genindex.html
 #srv/web/owncloud/core/doc/user/index.html
-#srv/web/owncloud/core/doc/user/installing_apps.html
 #srv/web/owncloud/core/doc/user/objects.inv
 #srv/web/owncloud/core/doc/user/pim
 #srv/web/owncloud/core/doc/user/pim/calendar.html
@@ -9840,7 +9780,6 @@ srv/web/owncloud
 #srv/web/owncloud/core/js/placeholders.js
 #srv/web/owncloud/core/js/select2
 #srv/web/owncloud/core/js/select2/LICENSE
-#srv/web/owncloud/core/js/select2/README.md
 #srv/web/owncloud/core/js/select2/bower.json
 #srv/web/owncloud/core/js/select2/component.json
 #srv/web/owncloud/core/js/select2/composer.json
@@ -10083,6 +10022,8 @@ srv/web/owncloud
 #srv/web/owncloud/core/templates/untrustedDomain.php
 #srv/web/owncloud/core/templates/update.admin.php
 #srv/web/owncloud/core/templates/update.user.php
+#srv/web/owncloud/core/user
+#srv/web/owncloud/core/user/controller.php
 #srv/web/owncloud/cron.php
 #srv/web/owncloud/data
 #srv/web/owncloud/db_structure.xml
@@ -11650,7 +11591,6 @@ srv/web/owncloud
 #srv/web/owncloud/lib/l10n/tzm.php
 #srv/web/owncloud/lib/l10n/ug.php
 #srv/web/owncloud/lib/l10n/uk.php
-#srv/web/owncloud/lib/l10n/ur.php
 #srv/web/owncloud/lib/l10n/ur_PK.php
 #srv/web/owncloud/lib/l10n/uz.php
 #srv/web/owncloud/lib/l10n/vi.php
@@ -11897,7 +11837,7 @@ srv/web/owncloud
 #srv/web/owncloud/lib/private/preview
 #srv/web/owncloud/lib/private/preview.php
 #srv/web/owncloud/lib/private/preview/image.php
-#srv/web/owncloud/lib/private/preview/movies.php
+#srv/web/owncloud/lib/private/preview/movie.php
 #srv/web/owncloud/lib/private/preview/mp3.php
 #srv/web/owncloud/lib/private/preview/office-cl.php
 #srv/web/owncloud/lib/private/preview/office.php
@@ -11923,7 +11863,11 @@ srv/web/owncloud
 #srv/web/owncloud/lib/private/search/result/file.php
 #srv/web/owncloud/lib/private/search/result/folder.php
 #srv/web/owncloud/lib/private/search/result/image.php
+#srv/web/owncloud/lib/private/security
+#srv/web/owncloud/lib/private/security/crypto.php
+#srv/web/owncloud/lib/private/security/stringutils.php
 #srv/web/owncloud/lib/private/server.php
+#srv/web/owncloud/lib/private/servernotavailableexception.php
 #srv/web/owncloud/lib/private/serviceunavailableexception.php
 #srv/web/owncloud/lib/private/session
 #srv/web/owncloud/lib/private/session/internal.php
@@ -11956,6 +11900,7 @@ srv/web/owncloud
 #srv/web/owncloud/lib/private/template/resourcelocator.php
 #srv/web/owncloud/lib/private/template/templatefilelocator.php
 #srv/web/owncloud/lib/private/templatelayout.php
+#srv/web/owncloud/lib/private/tempmanager.php
 #srv/web/owncloud/lib/private/updater.php
 #srv/web/owncloud/lib/private/urlgenerator.php
 #srv/web/owncloud/lib/private/user
@@ -11967,6 +11912,7 @@ srv/web/owncloud
 #srv/web/owncloud/lib/private/user/http.php
 #srv/web/owncloud/lib/private/user/interface.php
 #srv/web/owncloud/lib/private/user/manager.php
+#srv/web/owncloud/lib/private/user/nouserexception.php
 #srv/web/owncloud/lib/private/user/session.php
 #srv/web/owncloud/lib/private/user/user.php
 #srv/web/owncloud/lib/private/util.php
@@ -12057,6 +12003,7 @@ srv/web/owncloud
 #srv/web/owncloud/lib/public/isession.php
 #srv/web/owncloud/lib/public/itagmanager.php
 #srv/web/owncloud/lib/public/itags.php
+#srv/web/owncloud/lib/public/itempmanager.php
 #srv/web/owncloud/lib/public/iurlgenerator.php
 #srv/web/owncloud/lib/public/iuser.php
 #srv/web/owncloud/lib/public/iusermanager.php
@@ -12069,6 +12016,9 @@ srv/web/owncloud
 #srv/web/owncloud/lib/public/search
 #srv/web/owncloud/lib/public/search/provider.php
 #srv/web/owncloud/lib/public/search/result.php
+#srv/web/owncloud/lib/public/security
+#srv/web/owncloud/lib/public/security/icrypto.php
+#srv/web/owncloud/lib/public/security/stringutils.php
 #srv/web/owncloud/lib/public/share.php
 #srv/web/owncloud/lib/public/template.php
 #srv/web/owncloud/lib/public/user.php
@@ -12078,6 +12028,7 @@ srv/web/owncloud
 #srv/web/owncloud/lib/repair/collation.php
 #srv/web/owncloud/lib/repair/innodb.php
 #srv/web/owncloud/lib/repair/preview.php
+#srv/web/owncloud/lib/repair/repairconfig.php
 #srv/web/owncloud/lib/repair/repairmimetypes.php
 #srv/web/owncloud/lib/repair/searchlucenetables.php
 #srv/web/owncloud/occ
index dc39ff09b3c6440ef314cf0a8d11fb9460e3cc19..e82320cfe4ddb344cab26f2895ecb9ac0a276a2c 100644 (file)
@@ -4,4 +4,4 @@ ACTION=="add", SUBSYSTEM=="net", PROGRAM="/lib/udev/network-hotplug-rename", RES
 
 # Call a script that will create all virtual devices for a parent device
 # that has just come up.
-ACTION=="add", SUBSYSTEM=="net", PROGRAM="/lib/udev/network-hotplug-vlan"
+ACTION=="add", SUBSYSTEM=="net", RUN+="/lib/udev/network-hotplug-vlan"
index 36603567e0ff21abd2af028d91cf27a96cf7ae14..421c40eca3a9bc555953c2f870ec1a1ba917b79b 100644 (file)
@@ -34,13 +34,11 @@ WARNING: translation string unused: advproxy chgwebpwd new password
 WARNING: translation string unused: advproxy chgwebpwd new password confirm
 WARNING: translation string unused: advproxy chgwebpwd old password
 WARNING: translation string unused: advproxy chgwebpwd username
-WARNING: translation string unused: advproxy cre disabled
 WARNING: translation string unused: advproxy errmsg change fail
 WARNING: translation string unused: advproxy errmsg change success
 WARNING: translation string unused: advproxy errmsg invalid user
 WARNING: translation string unused: advproxy errmsg no password
 WARNING: translation string unused: advproxy errmsg password incorrect
-WARNING: translation string unused: advproxy no cre groups
 WARNING: translation string unused: advproxy ssadvanced proxy
 WARNING: translation string unused: advproxy update notification
 WARNING: translation string unused: again
index a419afa9d3b438676c617e9746bee3dfc6ecb7b5..0a1756f563513f350a249a6a1095a431be48e31e 100644 (file)
@@ -33,13 +33,11 @@ WARNING: translation string unused: advproxy chgwebpwd new password
 WARNING: translation string unused: advproxy chgwebpwd new password confirm
 WARNING: translation string unused: advproxy chgwebpwd old password
 WARNING: translation string unused: advproxy chgwebpwd username
-WARNING: translation string unused: advproxy cre disabled
 WARNING: translation string unused: advproxy errmsg change fail
 WARNING: translation string unused: advproxy errmsg change success
 WARNING: translation string unused: advproxy errmsg invalid user
 WARNING: translation string unused: advproxy errmsg no password
 WARNING: translation string unused: advproxy errmsg password incorrect
-WARNING: translation string unused: advproxy no cre groups
 WARNING: translation string unused: advproxy ssadvanced proxy
 WARNING: translation string unused: advproxy update information
 WARNING: translation string unused: advproxy update notification
index d375f69623c2f6c35a80d7a68b4981ecf5346554..17347f665ab2c0c84000d1ff612cf9c1bd2a049a 100644 (file)
@@ -33,13 +33,11 @@ WARNING: translation string unused: advproxy chgwebpwd new password
 WARNING: translation string unused: advproxy chgwebpwd new password confirm
 WARNING: translation string unused: advproxy chgwebpwd old password
 WARNING: translation string unused: advproxy chgwebpwd username
-WARNING: translation string unused: advproxy cre disabled
 WARNING: translation string unused: advproxy errmsg change fail
 WARNING: translation string unused: advproxy errmsg change success
 WARNING: translation string unused: advproxy errmsg invalid user
 WARNING: translation string unused: advproxy errmsg no password
 WARNING: translation string unused: advproxy errmsg password incorrect
-WARNING: translation string unused: advproxy no cre groups
 WARNING: translation string unused: advproxy ssadvanced proxy
 WARNING: translation string unused: advproxy update information
 WARNING: translation string unused: advproxy update notification
@@ -640,6 +638,7 @@ WARNING: untranslated string: advproxy group access control
 WARNING: untranslated string: advproxy group required
 WARNING: untranslated string: advproxy proxy port transparent
 WARNING: untranslated string: age second
+WARNING: untranslated string: application layer gateways
 WARNING: untranslated string: atm device
 WARNING: untranslated string: attention
 WARNING: untranslated string: bit
index f0f5ec4e40847e3b0c1a9773abe42924edc64b9b..a93453f01517cf32b3477fba11835a1d847fad69 100644 (file)
@@ -33,13 +33,11 @@ WARNING: translation string unused: advproxy chgwebpwd new password
 WARNING: translation string unused: advproxy chgwebpwd new password confirm
 WARNING: translation string unused: advproxy chgwebpwd old password
 WARNING: translation string unused: advproxy chgwebpwd username
-WARNING: translation string unused: advproxy cre disabled
 WARNING: translation string unused: advproxy errmsg change fail
 WARNING: translation string unused: advproxy errmsg change success
 WARNING: translation string unused: advproxy errmsg invalid user
 WARNING: translation string unused: advproxy errmsg no password
 WARNING: translation string unused: advproxy errmsg password incorrect
-WARNING: translation string unused: advproxy no cre groups
 WARNING: translation string unused: advproxy ssadvanced proxy
 WARNING: translation string unused: advproxy update information
 WARNING: translation string unused: advproxy update notification
@@ -647,6 +645,7 @@ WARNING: untranslated string: advproxy group access control
 WARNING: untranslated string: advproxy group required
 WARNING: untranslated string: advproxy proxy port transparent
 WARNING: untranslated string: age second
+WARNING: untranslated string: application layer gateways
 WARNING: untranslated string: atm device
 WARNING: untranslated string: attention
 WARNING: untranslated string: bit
index 65643e8757bf5a4c4f568a342e962116c73efd66..776b9328bf471f6307ce2fcd84eeff6dd4e65fd5 100644 (file)
@@ -33,13 +33,11 @@ WARNING: translation string unused: advproxy chgwebpwd new password
 WARNING: translation string unused: advproxy chgwebpwd new password confirm
 WARNING: translation string unused: advproxy chgwebpwd old password
 WARNING: translation string unused: advproxy chgwebpwd username
-WARNING: translation string unused: advproxy cre disabled
 WARNING: translation string unused: advproxy errmsg change fail
 WARNING: translation string unused: advproxy errmsg change success
 WARNING: translation string unused: advproxy errmsg invalid user
 WARNING: translation string unused: advproxy errmsg no password
 WARNING: translation string unused: advproxy errmsg password incorrect
-WARNING: translation string unused: advproxy no cre groups
 WARNING: translation string unused: advproxy ssadvanced proxy
 WARNING: translation string unused: advproxy update information
 WARNING: translation string unused: advproxy update notification
@@ -700,6 +698,7 @@ WARNING: untranslated string: advproxy AUTH method ntlm auth
 WARNING: untranslated string: advproxy basic authentication
 WARNING: untranslated string: advproxy group access control
 WARNING: untranslated string: advproxy group required
+WARNING: untranslated string: application layer gateways
 WARNING: untranslated string: bytes
 WARNING: untranslated string: check all
 WARNING: untranslated string: dhcp dns enable update
index 3b57bdfe93de3391115223613756ea50a88b31dd..77fa1f58d47581be17d6319a37207bd6d29a7003 100644 (file)
@@ -33,13 +33,11 @@ WARNING: translation string unused: advproxy chgwebpwd new password
 WARNING: translation string unused: advproxy chgwebpwd new password confirm
 WARNING: translation string unused: advproxy chgwebpwd old password
 WARNING: translation string unused: advproxy chgwebpwd username
-WARNING: translation string unused: advproxy cre disabled
 WARNING: translation string unused: advproxy errmsg change fail
 WARNING: translation string unused: advproxy errmsg change success
 WARNING: translation string unused: advproxy errmsg invalid user
 WARNING: translation string unused: advproxy errmsg no password
 WARNING: translation string unused: advproxy errmsg password incorrect
-WARNING: translation string unused: advproxy no cre groups
 WARNING: translation string unused: advproxy ssadvanced proxy
 WARNING: translation string unused: advproxy update information
 WARNING: translation string unused: advproxy update notification
@@ -697,6 +695,7 @@ WARNING: untranslated string: advproxy AUTH method ntlm auth
 WARNING: untranslated string: advproxy basic authentication
 WARNING: untranslated string: advproxy group access control
 WARNING: untranslated string: advproxy group required
+WARNING: untranslated string: application layer gateways
 WARNING: untranslated string: atm device
 WARNING: untranslated string: bytes
 WARNING: untranslated string: capabilities
index d375f69623c2f6c35a80d7a68b4981ecf5346554..17347f665ab2c0c84000d1ff612cf9c1bd2a049a 100644 (file)
@@ -33,13 +33,11 @@ WARNING: translation string unused: advproxy chgwebpwd new password
 WARNING: translation string unused: advproxy chgwebpwd new password confirm
 WARNING: translation string unused: advproxy chgwebpwd old password
 WARNING: translation string unused: advproxy chgwebpwd username
-WARNING: translation string unused: advproxy cre disabled
 WARNING: translation string unused: advproxy errmsg change fail
 WARNING: translation string unused: advproxy errmsg change success
 WARNING: translation string unused: advproxy errmsg invalid user
 WARNING: translation string unused: advproxy errmsg no password
 WARNING: translation string unused: advproxy errmsg password incorrect
-WARNING: translation string unused: advproxy no cre groups
 WARNING: translation string unused: advproxy ssadvanced proxy
 WARNING: translation string unused: advproxy update information
 WARNING: translation string unused: advproxy update notification
@@ -640,6 +638,7 @@ WARNING: untranslated string: advproxy group access control
 WARNING: untranslated string: advproxy group required
 WARNING: untranslated string: advproxy proxy port transparent
 WARNING: untranslated string: age second
+WARNING: untranslated string: application layer gateways
 WARNING: untranslated string: atm device
 WARNING: untranslated string: attention
 WARNING: untranslated string: bit
index 05d9e91194c494849c4323e2a4bcd081d8472d2c..6446a7425c21a1cc06297f13d56f098a3de8b54e 100644 (file)
@@ -33,13 +33,11 @@ WARNING: translation string unused: advproxy chgwebpwd new password
 WARNING: translation string unused: advproxy chgwebpwd new password confirm
 WARNING: translation string unused: advproxy chgwebpwd old password
 WARNING: translation string unused: advproxy chgwebpwd username
-WARNING: translation string unused: advproxy cre disabled
 WARNING: translation string unused: advproxy errmsg change fail
 WARNING: translation string unused: advproxy errmsg change success
 WARNING: translation string unused: advproxy errmsg invalid user
 WARNING: translation string unused: advproxy errmsg no password
 WARNING: translation string unused: advproxy errmsg password incorrect
-WARNING: translation string unused: advproxy no cre groups
 WARNING: translation string unused: advproxy ssadvanced proxy
 WARNING: translation string unused: advproxy update information
 WARNING: translation string unused: advproxy update notification
@@ -640,6 +638,7 @@ WARNING: untranslated string: advproxy group access control
 WARNING: untranslated string: advproxy group required
 WARNING: untranslated string: advproxy proxy port transparent
 WARNING: untranslated string: age second
+WARNING: untranslated string: application layer gateways
 WARNING: untranslated string: atm device
 WARNING: untranslated string: attention
 WARNING: untranslated string: bit
index a419afa9d3b438676c617e9746bee3dfc6ecb7b5..547985901f05571713dc4d11a50c11698197586c 100644 (file)
@@ -33,13 +33,11 @@ WARNING: translation string unused: advproxy chgwebpwd new password
 WARNING: translation string unused: advproxy chgwebpwd new password confirm
 WARNING: translation string unused: advproxy chgwebpwd old password
 WARNING: translation string unused: advproxy chgwebpwd username
-WARNING: translation string unused: advproxy cre disabled
 WARNING: translation string unused: advproxy errmsg change fail
 WARNING: translation string unused: advproxy errmsg change success
 WARNING: translation string unused: advproxy errmsg invalid user
 WARNING: translation string unused: advproxy errmsg no password
 WARNING: translation string unused: advproxy errmsg password incorrect
-WARNING: translation string unused: advproxy no cre groups
 WARNING: translation string unused: advproxy ssadvanced proxy
 WARNING: translation string unused: advproxy update information
 WARNING: translation string unused: advproxy update notification
@@ -703,6 +701,7 @@ WARNING: translation string unused: xtaccess bad transfert
 WARNING: translation string unused: year-graph
 WARNING: translation string unused: yearly firewallhits
 WARNING: untranslated string: Scan for Songs
+WARNING: untranslated string: application layer gateways
 WARNING: untranslated string: bytes
 WARNING: untranslated string: fwhost cust geoipgrp
 WARNING: untranslated string: fwhost err hostip
index c490f2df95f11a3565d3dd017a76786c5127578f..32e1e48ecc43d8d8f6774a23363397606fcc8ab4 100644 (file)
@@ -26,6 +26,7 @@
 < age shour
 < age sminute
 < age ssecond
+< application layer gateways
 < atm device
 < attention
 < bit
 < age shour
 < age sminute
 < age ssecond
+< application layer gateways
 < Async logging enabled
 < atm device
 < attention
 < age shour
 < age sminute
 < age ssecond
+< application layer gateways
 < atm device
 < attention
 < bit
 < age shour
 < age sminute
 < age ssecond
+< application layer gateways
 < atm device
 < attention
 < bit
index 5a584d60debb6bdcd9709ea0525ca273e4db4bdc..5c9722b8521f4df04e0c317968df849811492fe7 100644 (file)
@@ -41,11 +41,11 @@ my %logsettings=();
 my $errormessage = '';
 
 my @shortmonths = ( 'Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug',
-        'Sep', 'Oct', 'Nov', 'Dec' );
+       'Sep', 'Oct', 'Nov', 'Dec' );
 my @longmonths = ( $Lang::tr{'january'}, $Lang::tr{'february'}, $Lang::tr{'march'},
-        $Lang::tr{'april'}, $Lang::tr{'may'}, $Lang::tr{'june'}, $Lang::tr{'july'}, $Lang::tr{'august'},
-        $Lang::tr{'september'}, $Lang::tr{'october'}, $Lang::tr{'november'},
-        $Lang::tr{'december'} );
+       $Lang::tr{'april'}, $Lang::tr{'may'}, $Lang::tr{'june'}, $Lang::tr{'july'}, $Lang::tr{'august'},
+       $Lang::tr{'september'}, $Lang::tr{'october'}, $Lang::tr{'november'},
+       $Lang::tr{'december'} );
 
 my @now = localtime();
 my $dow = $now[6];
@@ -66,55 +66,55 @@ my $start = ($logsettings{'LOGVIEW_REVERSE'} eq 'on') ? 0x7FFFF000 : 0; #index o
 
 if ($ENV{'QUERY_STRING'} && $cgiparams{'ACTION'} ne $Lang::tr{'update'})
 {
-        my @temp = split(',',$ENV{'QUERY_STRING'});
-        $start = $temp[0];
-        $cgiparams{'MONTH'} = $temp[1];
-        $cgiparams{'DAY'} = $temp[2];
+       my @temp = split(',',$ENV{'QUERY_STRING'});
+       $start = $temp[0];
+       $cgiparams{'MONTH'} = $temp[1];
+       $cgiparams{'DAY'} = $temp[2];
 }
 
 if (!($cgiparams{'MONTH'} =~ /^(0|1|2|3|4|5|6|7|8|9|10|11)$/) ||
-        !($cgiparams{'DAY'} =~ /^(0|1|2|3|4|5|6|7|8|9|10|11|12|13|14|15|16|17|18|19|20|21|22|23|24|25|26|27|28|29|30|31)$/))
+       !($cgiparams{'DAY'} =~ /^(0|1|2|3|4|5|6|7|8|9|10|11|12|13|14|15|16|17|18|19|20|21|22|23|24|25|26|27|28|29|30|31)$/))
 {
-        $cgiparams{'DAY'} = $now[3];
-        $cgiparams{'MONTH'} = $now[4];
+       $cgiparams{'DAY'} = $now[3];
+       $cgiparams{'MONTH'} = $now[4];
 }
 elsif($cgiparams{'ACTION'} eq '>>')
 {
-        my @temp_then=();
-        my @temp_now = localtime(time);
-        $temp_now[4] = $cgiparams{'MONTH'};
-        $temp_now[3] = $cgiparams{'DAY'};
-        if ($cgiparams{'DAY'}) {
-            @temp_then = localtime(POSIX::mktime(@temp_now) + 86400);
-            ## Retrieve the same time on the next day +
-            ## 86400 seconds in a day
-        } else {
-            $temp_now[3] = 1;
-            $temp_now[4] = ($temp_now[4]+1) %12;
-            @temp_then = localtime(POSIX::mktime(@temp_now) );
-            $temp_then[3] = 0;
-        }
-        $cgiparams{'MONTH'} = $temp_then[4];
-        $cgiparams{'DAY'} = $temp_then[3];
+       my @temp_then=();
+       my @temp_now = localtime(time);
+       $temp_now[4] = $cgiparams{'MONTH'};
+       $temp_now[3] = $cgiparams{'DAY'};
+       if ($cgiparams{'DAY'}) {
+               @temp_then = localtime(POSIX::mktime(@temp_now) + 86400);
+               ## Retrieve the same time on the next day +
+               ## 86400 seconds in a day
+       } else {
+               $temp_now[3] = 1;
+               $temp_now[4] = ($temp_now[4]+1) %12;
+               @temp_then = localtime(POSIX::mktime(@temp_now) );
+               $temp_then[3] = 0;
+       }
+       $cgiparams{'MONTH'} = $temp_then[4];
+       $cgiparams{'DAY'} = $temp_then[3];
 }
 elsif($cgiparams{'ACTION'} eq '<<')
 {
-        my @temp_then=();
-        my @temp_now = localtime(time);
-        $temp_now[4] = $cgiparams{'MONTH'};
-        $temp_now[3] = $cgiparams{'DAY'};
-        if ($cgiparams{'DAY'}) {
-            @temp_then = localtime(POSIX::mktime(@temp_now) - 86400);
-            ## Retrieve the same time on the next day -
-            ## 86400 seconds in a day
-        } else {
-            $temp_now[3] = 1;
-            $temp_now[4] = ($temp_now[4]-1) %12;
-            @temp_then = localtime(POSIX::mktime(@temp_now) );
-            $temp_then[3] = 0;
-        }
-        $cgiparams{'MONTH'} = $temp_then[4];
-        $cgiparams{'DAY'} = $temp_then[3];
+       my @temp_then=();
+       my @temp_now = localtime(time);
+       $temp_now[4] = $cgiparams{'MONTH'};
+       $temp_now[3] = $cgiparams{'DAY'};
+       if ($cgiparams{'DAY'}) {
+               @temp_then = localtime(POSIX::mktime(@temp_now) - 86400);
+               ## Retrieve the same time on the next day -
+               ## 86400 seconds in a day
+       } else {
+               $temp_now[3] = 1;
+               $temp_now[4] = ($temp_now[4]-1) %12;
+               @temp_then = localtime(POSIX::mktime(@temp_now) );
+               $temp_then[3] = 0;
+       }
+       $cgiparams{'MONTH'} = $temp_then[4];
+       $cgiparams{'DAY'} = $temp_then[3];
 }
 
 # Find in which file.gz is the log. Can be calculated because WEEKLY ROTATING of access.log
@@ -122,104 +122,104 @@ my $gzindex;
 my $date = $cgiparams{'DAY'} == 0 ? '' :  $cgiparams{'DAY'} <= 9 ? "0$cgiparams{'DAY'}" : "$cgiparams{'DAY'}";
 
 {
-    my $xday;
-    
-    # Calculate time. If future date, calculate for past year !!!
-    if (( $cgiparams{'MONTH'} eq $now[4]) && ($cgiparams{'DAY'} > $now[3]) ||
-        ( $cgiparams{'MONTH'}  > $now[4] ) ) {
-        $xday = POSIX::mktime( 0, 0, 0, $cgiparams{'DAY'}, $cgiparams{'MONTH'}, $year - 1901 );
-        $date = "$longmonths[$cgiparams{'MONTH'}] $date, ". int($year-1);
-    } else {
-        $xday = POSIX::mktime( 0, 0, 0, $cgiparams{'DAY'}, $cgiparams{'MONTH'}, $year - 1900 );
-        $date = "$longmonths[$cgiparams{'MONTH'}] $date, $year";
-    }
-
-    # calculate end of active week (saturday 23H59)
-    my @then = ();
-    @then = localtime(time());
-    my $sunday = POSIX::mktime( 0, 0, 0, @then[3], @then[4], @then[5]);
-    $sunday += (6-$then[6]) * 86400;
-
-    # Convert delta in second to full weeks
-        $gzindex = int (($sunday-$xday)/604800 );
+       my $xday;
+       
+       # Calculate time. If future date, calculate for past year !!!
+       if (( $cgiparams{'MONTH'} eq $now[4]) && ($cgiparams{'DAY'} > $now[3]) ||
+       ( $cgiparams{'MONTH'}  > $now[4] ) ) {
+               $xday = POSIX::mktime( 0, 0, 0, $cgiparams{'DAY'}, $cgiparams{'MONTH'}, $year - 1901 );
+               $date = "$longmonths[$cgiparams{'MONTH'}] $date, ". int($year-1);
+       } else {
+               $xday = POSIX::mktime( 0, 0, 0, $cgiparams{'DAY'}, $cgiparams{'MONTH'}, $year - 1900 );
+               $date = "$longmonths[$cgiparams{'MONTH'}] $date, $year";
+       }
+
+       # calculate end of active week (saturday 23H59)
+       my @then = ();
+       @then = localtime(time());
+       my $sunday = POSIX::mktime( 0, 0, 0, @then[3], @then[4], @then[5]);
+       $sunday += (6-$then[6]) * 86400;
+
+       # Convert delta in second to full weeks
+       $gzindex = int (($sunday-$xday)/604800 );
 }
-                                                                                           
+
 my $monthstr = $shortmonths[$cgiparams{'MONTH'}];
 my $daystr =  $cgiparams{'DAY'} == 0 ?  '..' : $cgiparams{'DAY'} <= 9 ? " $cgiparams{'DAY'}" : "$cgiparams{'DAY'}";
-       
+
 my $lines = 0;
 my @log=();
 
 my $loop = 1;
 my $filestr = 0;
-my $lastdatetime;           # for debug
+my $lastdatetime;      # for debug
 my $search_for_end = 0;
-            
+
 while ($gzindex >=0 && $loop) {
-        # calculate file name
-        if ($gzindex == 0) {
-            $filestr = "/var/log/messages";
-        } else {
-            $filestr = "/var/log/messages.$gzindex";
-            $filestr = "$filestr.gz" if -f "$filestr.gz";
-        }
-        # now read file if existing
-        if (open (FILE,($filestr =~ /.gz$/ ? "gzip -dc $filestr |" : $filestr))) {
-            #&General::log("reading $filestr");
-            READ:while (<FILE>) {
-                my $line = $_;
-                if ($line =~ /^${monthstr} ${daystr} ..:..:.. [\w\-]+ kernel:.*IN=.*$/) {
-                    # when standart viewing, just keep in memory the correct slice
-                    # it starts a '$start' and size is $viewport
-                    # If export, then keep all lines...
-                    if ($cgiparams{'ACTION'} eq $Lang::tr{'export'}){
-                        $log[$lines++] = "$line";
-                    } else {
-                        if ($lines++ < ($start + $Header::viewsize)) {
-                            push(@log,"$line");
-                            if (@log > $Header::viewsize) {
-                                shift (@log);
-                            }
-                        #} else { dont do this optimisation, need to count lines !
-                            #    $datetime = $maxtime; # we have read viewsize lines, stop main loop
-                            #    last READ;           # exit read file
-                        }
-                    }
-                    $search_for_end = 1;        # we find the start of slice, can look for end now
-                } else {
-                    if ($search_for_end == 1) {
-                        #finish read files when date is over (test month equality only)
-                        $line =~ /^(...) (..) ..:..:..*$/;
-                        $loop = 0 if ( ($1 ne $monthstr) || ( ($daystr ne '..') && ($daystr ne $2) ) );
-                    }
-                }
-            }
-            close (FILE);
-        }
-        $gzindex--;     # will try next gz file eg 40,39,38,.... because it may have holes when ipcop stopped
-                        # for a long time
+       # calculate file name
+       if ($gzindex == 0) {
+               $filestr = "/var/log/messages";
+       } else {
+               $filestr = "/var/log/messages.$gzindex";
+               $filestr = "$filestr.gz" if -f "$filestr.gz";
+       }
+       # now read file if existing
+       if (open (FILE,($filestr =~ /.gz$/ ? "gzip -dc $filestr |" : $filestr))) {
+               #&General::log("reading $filestr");
+               READ:while (<FILE>) {
+                       my $line = $_;
+                       if ($line =~ /^${monthstr} ${daystr} ..:..:.. [\w\-]+ kernel:.*IN=.*$/) {
+                               # when standart viewing, just keep in memory the correct slice
+                               # it starts a '$start' and size is $viewport
+                               # If export, then keep all lines...
+                               if ($cgiparams{'ACTION'} eq $Lang::tr{'export'}){
+                                       $log[$lines++] = "$line";
+                               } else {
+                                       if ($lines++ < ($start + $Header::viewsize)) {
+                                               push(@log,"$line");
+                                               if (@log > $Header::viewsize) {
+                                                       shift (@log);
+                                               }
+                                       #} else { dont do this optimisation, need to count lines !
+                                       #       $datetime = $maxtime; # we have read viewsize lines, stop main loop
+                                       #       last READ;         # exit read file
+                                       }
+                               }
+                               $search_for_end = 1;    # we find the start of slice, can look for end now
+                       } else {
+                               if ($search_for_end == 1) {
+                                       #finish read files when date is over (test month equality only)
+                                       $line =~ /^(...) (..) ..:..:..*$/;
+                                       $loop = 0 if ( ($1 ne $monthstr) || ( ($daystr ne '..') && ($daystr ne $2) ) );
+                               }
+                       }
+               }
+               close (FILE);
+       }
+       $gzindex--;     # will try next gz file eg 40,39,38,.... because it may have holes when ipcop stopped
+                       # for a long time
 }# while
 
 #  $errormessage = "$Lang::tr{'date not in logs'}: $filestr $Lang::tr{'could not be opened'}";
 
 if ($cgiparams{'ACTION'} eq $Lang::tr{'export'})
 {
-        print "Content-type: text/plain\n\n";
-        print "IPFire firewall log\r\n";
-        print "$Lang::{'date'}: $date\r\n\r\n";
-
-        if ($logsettings{'LOGVIEW_REVERSE'} eq 'on') { @log = reverse @log; }
-
-        foreach $_ (@log)
-        {
-                /^... (..) (..:..:..) [\w\-]+ kernel:.*(IN=.*)$/;
-                my $day =  $1;
-                $day =~ tr / /0/;
-                my $time = $cgiparams{'DAY'} ? "$2" : "$day/$2" ;
-                print "$time $3\r\n";
-                
-        }
-        exit 0;
+       print "Content-type: text/plain\n\n";
+       print "IPFire firewall log\r\n";
+       print "$Lang::{'date'}: $date\r\n\r\n";
+
+       if ($logsettings{'LOGVIEW_REVERSE'} eq 'on') { @log = reverse @log; }
+
+       foreach $_ (@log)
+       {
+               /^... (..) (..:..:..) [\w\-]+ kernel:.*(IN=.*)$/;
+               my $day =  $1;
+               $day =~ tr / /0/;
+               my $time = $cgiparams{'DAY'} ? "$2" : "$day/$2" ;
+               print "$time $3\r\n";
+               
+       }
+       exit 0;
 }
 
 &Header::showhttpheaders();
@@ -229,9 +229,9 @@ if ($cgiparams{'ACTION'} eq $Lang::tr{'export'})
 &Header::openbigbox('100%', 'left', '', $errormessage);
 
 if ($errormessage) {
-        &Header::openbox('100%', 'left', $Lang::tr{'error messages'});
-        print "<font class='base'>$errormessage&nbsp;</font>\n";
-        &Header::closebox();
+       &Header::openbox('100%', 'left', $Lang::tr{'error messages'});
+       print "<font class='base'>$errormessage&nbsp;</font>\n";
+       &Header::closebox();
 }
 
 &Header::openbox('100%', 'left', "$Lang::tr{'settings'}");
@@ -240,33 +240,35 @@ print <<END
 <form method='post' action='$ENV{'SCRIPT_NAME'}'>
 <table width='100%'>
 <tr>
-        <td width='10%' class='base'>$Lang::tr{'month'}:&nbsp;</td>
-        <td width='10%'>
-        <select name='MONTH'>
+       <td width='10%' class='base'>$Lang::tr{'month'}:&nbsp;</td>
+       <td width='10%'>
+       <select name='MONTH'>
 END
 ;
 for (my $month = 0; $month < 12; $month++)
 {
-        print "\t<option ";
-        if ($month == $cgiparams{'MONTH'}) {
-                print "selected='selected' "; }
-        print "value='$month'>$longmonths[$month]</option>\n";
+       print "\t<option ";
+       if ($month == $cgiparams{'MONTH'}) {
+               print "selected='selected' "; 
+       }
+       print "value='$month'>$longmonths[$month]</option>\n";
 }
 print <<END
-        </select>
-        </td>
-        <td width='10%' class='base' align='right'>&nbsp;$Lang::tr{'day'}:&nbsp;</td>
-        <td width='40%'>
-        <select name='DAY'>
+       </select>
+       </td>
+       <td width='10%' class='base' align='right'>&nbsp;$Lang::tr{'day'}:&nbsp;</td>
+       <td width='40%'>
+       <select name='DAY'>
 END
 ;
 print "<option value='0'>$Lang::tr{'all'}</option>\n";
 for (my $day = 1; $day <= 31; $day++) 
 {
-        print "\t<option ";
-        if ($day == $cgiparams{'DAY'}) {
-                print "selected='selected' "; }
-        print "value='$day'>$day</option>\n";
+       print "\t<option ";
+       if ($day == $cgiparams{'DAY'}) {
+               print "selected='selected' "; 
+       }
+       print "value='$day'>$day</option>\n";
 }
 print <<END
 </select>
@@ -291,20 +293,20 @@ $start = $lastPageIndex if ($start >= $lastPageIndex);
 $start = 0 if ($start < 0);
 
 my $prev;
-    if ($start == 0) {
-        $prev = -1;
-    } else {
-        $prev = $start - ${Header::viewsize};
-        $prev = 0 if ( $prev < 0);
-    }
-                                    
+if ($start == 0) {
+       $prev = -1;
+} else {
+       $prev = $start - ${Header::viewsize};
+       $prev = 0 if ( $prev < 0);
+}
+                                       
 my $next;
-    if ($start == $lastPageIndex) {
-        $next = -1;
-    } else {
-        $next = $start + ${Header::viewsize};
-        $next = $lines - ${Header::viewsize} if ($next >= $lines - ${Header::viewsize});
-    }
+if ($start == $lastPageIndex) {
+       $next = -1;
+} else {
+       $next = $start + ${Header::viewsize};
+       $next = $lines - ${Header::viewsize} if ($next >= $lines - ${Header::viewsize});
+}
 
 if ($logsettings{'LOGVIEW_REVERSE'} eq 'on') { @log = reverse @log; }
 if ($lines != 0) { &oldernewer(); }
@@ -312,14 +314,14 @@ if ($lines != 0) { &oldernewer(); }
 print <<END
 <table width='100%' class='tbl'>
 <tr>
-        <th align='center' class='boldbase'><b>$Lang::tr{'time'}</b></th>
-        <th align='center' class='boldbase'><b>$Lang::tr{'chain'}</b></th>
-        <th align='center' class='boldbase'><b>$Lang::tr{'iface'}</b></th>
-        <th align='center' class='boldbase'><b>$Lang::tr{'proto'}</b></th>
-        <th align='center' class='boldbase'><b>$Lang::tr{'source'}<br/>$Lang::tr{'destination'}</b></th>
-        <th align='center' class='boldbase'><b>$Lang::tr{'src port'}<br />$Lang::tr{'dst port'}</b></th>
-        <th align='center' class='boldbase'><b>$Lang::tr{'country'}</b></th>
-        <th align='center' class='boldbase'><b>$Lang::tr{'mac address'}</b></th>
+       <th align='center' class='boldbase'><b>$Lang::tr{'time'}</b></th>
+       <th align='center' class='boldbase'><b>$Lang::tr{'chain'}</b></th>
+       <th align='center' class='boldbase'><b>$Lang::tr{'iface'}</b></th>
+       <th align='center' class='boldbase'><b>$Lang::tr{'proto'}</b></th>
+       <th align='center' class='boldbase'><b>$Lang::tr{'source'}<br/>$Lang::tr{'destination'}</b></th>
+       <th align='center' class='boldbase'><b>$Lang::tr{'src port'}<br />$Lang::tr{'dst port'}</b></th>
+       <th align='center' class='boldbase'><b>$Lang::tr{'country'}</b></th>
+       <th align='center' class='boldbase'><b>$Lang::tr{'mac address'}</b></th>
 </tr>
 END
 ;
@@ -328,66 +330,76 @@ END
 $lines = 0;
 foreach $_ (@log)
 {
-        /^... (..) (..:..:..) [\w\-]+ kernel:(.*)(IN=.*)$/;
-        my $day =  $1;
-        $day =~ tr / /0/;
-        my $time = $cgiparams{'DAY'} ? "$2" : "$day/$2" ;
-        my $comment = $3; 
-        my $packet = $4;
-
-               my ($iface, $srcaddr, $dstaddr, $macaddr, $proto, $srcport, $dstport);
-               $iface=$1   if $packet =~ /IN=(\w+)/;
-               $srcaddr=$1 if $packet =~ /SRC=([\d\.]+)/;
-               $dstaddr=$1 if $packet =~ /DST=([\d\.]+)/;
-               $macaddr=$1 if $packet =~ /MAC=([\w+\:]+)/;
-               $proto=$1   if $packet =~ /PROTO=(\w+)/;
-               $srcport=$1 if $packet =~ /SPT=(\d+)/;
-               $dstport=$1 if $packet =~ /DPT=(\d+)/;
-
-        my $gi = Geo::IP::PurePerl->new();
-        my $ccode = $gi->country_code_by_name($srcaddr);
-        my $fcode = lc($ccode);
-
-        my $servi = uc(getservbyport($srcport, lc($proto)));
-        if ($servi ne '' && $srcport < 1024) {
-                $srcport = "$srcport($servi)"; }
-        $servi = uc(getservbyport($dstport, lc($proto)));
-        if ($servi ne '' && $dstport < 1024) {
-                $dstport = "$dstport($servi)";}
-        my @mactemp = split(/:/,$macaddr);
-        $macaddr = "$mactemp[6]:$mactemp[7]:$mactemp[8]:$mactemp[9]:$mactemp[10]:$mactemp[11]";
-        my $col="";
-        if ($lines % 2) {
-                print "<tr>";
-                $col="bgcolor='$color{'color20'}'"; }
-        else {
-                print "<tr>";
-                $col="bgcolor='$color{'color22'}'"; }
-        print <<END
-
-        <td align='center' $col>$time</td>
-        <td align='center' $col>$comment</td>
-        <td align='center' $col>$iface</td>
-        <td align='center' $col>$proto</td>
-        <td align='center' $col><a href='/cgi-bin/ipinfo.cgi?ip=$srcaddr'>$srcaddr</a><br /><a href='/cgi-bin/ipinfo.cgi?ip=$dstaddr'>$dstaddr</a></td>
-        <td align='center' $col>$srcport<br/>$dstport</td>
+       # If ipv6 uses a bridge, PHYSIN= contains the relevant iface information
+       # otherwise use IN=
+       my $packet = '';
+       if ($_ =~ /^... (..) (..:..:..) [\w\-]+ kernel:(.*)(IN=.*)(PHYSIN=.*)$/) { $packet = $5; }
+       elsif ($_ =~ /^... (..) (..:..:..) [\w\-]+ kernel:(.*)(IN=.*)$/) { $packet = $4; }
+       my $day =  $1;
+       $day =~ tr / /0/;
+       my $time = $cgiparams{'DAY'} ? "$2" : "$day/$2" ;
+       my $chain = $3; 
+
+       my ($iface, $srcaddr, $dstaddr, $macaddr, $proto, $srcport, $dstport);
+       if ($packet =~ /PHYSIN=(\w+)/) { $iface=$1; } elsif ($packet =~ /IN=(\w+)/) { $iface = $1; }
+       # Identify whether ipv4 or ipv6. Both are mutally exclusive.
+       if ($packet =~ /SRC\=(([\d]{1,3})(\.([\d]{1,3})){3})/) { $srcaddr=$1; }
+       if ($packet =~ /SRC\=(([0-9a-fA-F]{0,4})(\:([0-9a-fA-F]{0,4})){2,7})/) { $srcaddr=$1; }
+       if ($packet =~ /DST\=(([\d]{1,3})(\.([\d]{1,3})){3})/) { $dstaddr=$1; }
+       if ($packet =~ /DST\=(([0-9a-fA-F]{0,4})(\:([0-9a-fA-F]{0,4})){2,7})/) { $dstaddr=$1; }
+       $macaddr=$1 if $packet =~ /MAC=([\w+\:]+)/;
+       $proto=$1   if $packet =~ /PROTO=(\w+)/;
+       $srcport=$1 if $packet =~ /SPT=(\d+)/;
+       $dstport=$1 if $packet =~ /DPT=(\d+)/;
+
+       my $gi = Geo::IP::PurePerl->new();
+       my $ccode = $gi->country_code_by_name($srcaddr);
+       my $fcode = lc($ccode);
+
+       my $servi = uc(getservbyport($srcport, lc($proto)));
+       if ($servi ne '' && $srcport < 1024) {
+               $srcport = "$srcport($servi)"; 
+       }
+       $servi = uc(getservbyport($dstport, lc($proto)));
+       if ($servi ne '' && $dstport < 1024) {
+               $dstport = "$dstport($servi)";
+       }
+       my @mactemp = split(/:/,$macaddr);
+       $macaddr = "$mactemp[6]:$mactemp[7]:$mactemp[8]:$mactemp[9]:$mactemp[10]:$mactemp[11]";
+       my $col="";
+       if ($lines % 2) {
+               print "<tr>";
+               $col="bgcolor='$color{'color20'}'"; 
+       }
+       else {
+               print "<tr>";
+               $col="bgcolor='$color{'color22'}'"; 
+       }
+       print <<END
+
+       <td align='center' $col>$time</td>
+       <td align='center' $col>$chain</td>
+       <td align='center' $col>$iface</td>
+       <td align='center' $col>$proto</td>
+       <td align='center' $col><a href='/cgi-bin/ipinfo.cgi?ip=$srcaddr'>$srcaddr</a><br /><a href='/cgi-bin/ipinfo.cgi?ip=$dstaddr'>$dstaddr</a></td>
+       <td align='center' $col>$srcport<br/>$dstport</td>
 END
-;
+       ;
        # Get flag icon for of the country.
        my $flag_icon = &GeoIP::get_flag_icon($fcode);
 
-        if ( $flag_icon) {
+       if ( $flag_icon) {
                print "<td align='center' $col><a href='../country.cgi#$fcode'><img src='$flag_icon' border='0' align='absmiddle' alt='$ccode'></a></td>";
        } else {
                print "<td align='center' $col></td>";
        }
 
-        print <<END
-        <td align='center' $col>$macaddr</td>
-</tr>
+       print <<END
+       <td align='center' $col>$macaddr</td>
+       </tr>
 END
-        ;
-        $lines++;
+       ;
+       $lines++;
 }
 
 print "</table>";
@@ -402,32 +414,36 @@ print "</table>";
 
 sub oldernewer
 {
-print <<END
-<table width='100%'>
-<tr>
+       print <<END
+       <table width='100%'>
+       <tr>
 END
-;
+       ;
 
-print "<td align='center' width='50%'>";
-if ($prev != -1) {
-        print "<a href='/cgi-bin/logs.cgi/firewalllog.dat?0,$cgiparams{'MONTH'},$cgiparams{'DAY'}'>$Lang::tr{'first'}</a> "; 
-        print "<a href='/cgi-bin/logs.cgi/firewalllog.dat?$prev,$cgiparams{'MONTH'},$cgiparams{'DAY'}'>$Lang::tr{'older'}</a>"; }
-else {
-        print "$Lang::tr{'first'} $Lang::tr{'older'}"; }
-print "</td>\n";
-
-print "<td align='center' width='50%'>";
-if ($next >= 0) {
-        print "<a href='/cgi-bin/logs.cgi/firewalllog.dat?$next,$cgiparams{'MONTH'},$cgiparams{'DAY'}'>$Lang::tr{'newer'}</a> ";
-        print "<a href='/cgi-bin/logs.cgi/firewalllog.dat?$lastPageIndex,$cgiparams{'MONTH'},$cgiparams{'DAY'}'>$Lang::tr{'last'}</a>"; }      
-else {
-        print "$Lang::tr{'newer'} $Lang::tr{'last'} "; }
-print "</td>\n";
+       print "<td align='center' width='50%'>";
+       if ($prev != -1) {
+               print "<a href='/cgi-bin/logs.cgi/firewalllog.dat?0,$cgiparams{'MONTH'},$cgiparams{'DAY'}'>$Lang::tr{'first'}</a> "; 
+               print "<a href='/cgi-bin/logs.cgi/firewalllog.dat?$prev,$cgiparams{'MONTH'},$cgiparams{'DAY'}'>$Lang::tr{'older'}</a>"; 
+       }
+       else {
+               print "$Lang::tr{'first'} $Lang::tr{'older'}"; 
+       }
+       print "</td>\n";
 
-print <<END
-</tr>
-</table>
+       print "<td align='center' width='50%'>";
+       if ($next >= 0) {
+               print "<a href='/cgi-bin/logs.cgi/firewalllog.dat?$next,$cgiparams{'MONTH'},$cgiparams{'DAY'}'>$Lang::tr{'newer'}</a> ";
+               print "<a href='/cgi-bin/logs.cgi/firewalllog.dat?$lastPageIndex,$cgiparams{'MONTH'},$cgiparams{'DAY'}'>$Lang::tr{'last'}</a>"; 
+       }
+       else {
+               print "$Lang::tr{'newer'} $Lang::tr{'last'} "; 
+       }
+       print "</td>\n";
+
+       print <<END
+       </tr>
+       </table>
 END
-;
+       ;
 }
 
index f998a6201f344b01a56a3d4e137a3828fd0c3556..26920b5da0dd97b2831da177cd70c418018f5e27 100644 (file)
@@ -8,7 +8,7 @@
 # page inspired from the initial firewalllog.dat
 #
 # Modified for IPFire by Christian Schmidt
-#                            and Michael Tremer (www.ipfire.org)
+#                          and Michael Tremer (www.ipfire.org)
 
 use strict;
 use Geo::IP::PurePerl;
@@ -39,11 +39,11 @@ $cgiparams{'showpie'} = 1;
 $cgiparams{'sortcolumn'} = 1;
 
 my @shortmonths = ( 'Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug',
-        'Sep', 'Oct', 'Nov', 'Dec' );
+       'Sep', 'Oct', 'Nov', 'Dec' );
 my @longmonths = ( $Lang::tr{'january'}, $Lang::tr{'february'}, $Lang::tr{'march'},
-        $Lang::tr{'april'}, $Lang::tr{'may'}, $Lang::tr{'june'}, $Lang::tr{'july'}, $Lang::tr{'august'},
-        $Lang::tr{'september'}, $Lang::tr{'october'}, $Lang::tr{'november'},
-        $Lang::tr{'december'} );
+       $Lang::tr{'april'}, $Lang::tr{'may'}, $Lang::tr{'june'}, $Lang::tr{'july'}, $Lang::tr{'august'},
+       $Lang::tr{'september'}, $Lang::tr{'october'}, $Lang::tr{'november'},
+       $Lang::tr{'december'} );
 
 my @now = localtime();
 my $dow = $now[6];
@@ -69,81 +69,81 @@ if ($cgiparams{'sortcolumn'} != 0) { $settings{'sortcolumn'} = $cgiparams{'sortc
 
 if ($cgiparams{'ACTION'} eq $Lang::tr{'save'})
 {
-   &General::writehash("${General::swroot}/fwlogs/ipsettings", \%settings);
+        &General::writehash("${General::swroot}/fwlogs/ipsettings", \%settings);
 }
 
 my $start = -1;
 if ($ENV{'QUERY_STRING'} && $cgiparams{'ACTION'} ne $Lang::tr{'update'})
 {
-        my @temp = split(',',$ENV{'QUERY_STRING'});
-        $start = $temp[0];
-        $cgiparams{'MONTH'} = $temp[1];
-        $cgiparams{'DAY'} = $temp[2];
+       my @temp = split(',',$ENV{'QUERY_STRING'});
+       $start = $temp[0];
+       $cgiparams{'MONTH'} = $temp[1];
+       $cgiparams{'DAY'} = $temp[2];
 }
 
 if (!($cgiparams{'MONTH'} =~ /^(0|1|2|3|4|5|6|7|8|9|10|11)$/) ||
     !($cgiparams{'DAY'} =~ /^(1|2|3|4|5|6|7|8|9|10|11|12|13|14|15|16|17|18|19|20|21|22|23|24|25|26|27|28|29|30|31)$/))
 {
-        $cgiparams{'DAY'} = $now[3];
-        $cgiparams{'MONTH'} = $now[4];
+       $cgiparams{'DAY'} = $now[3];
+       $cgiparams{'MONTH'} = $now[4];
 }
 elsif($cgiparams{'ACTION'} eq '>>')
 {
-        my @temp_then=();
-        my @temp_now = localtime(time);
-        $temp_now[4] = $cgiparams{'MONTH'};
-        $temp_now[3] = $cgiparams{'DAY'};
-        @temp_then = localtime(POSIX::mktime(@temp_now) + 86400);
-           ## Retrieve the same time on the next day -
-           ## 86400 seconds in a day
-        $cgiparams{'MONTH'} = $temp_then[4];
-        $cgiparams{'DAY'} = $temp_then[3];
+       my @temp_then=();
+       my @temp_now = localtime(time);
+       $temp_now[4] = $cgiparams{'MONTH'};
+       $temp_now[3] = $cgiparams{'DAY'};
+       @temp_then = localtime(POSIX::mktime(@temp_now) + 86400);
+       ## Retrieve the same time on the next day -
+       ## 86400 seconds in a day
+       $cgiparams{'MONTH'} = $temp_then[4];
+       $cgiparams{'DAY'} = $temp_then[3];
 }
 elsif($cgiparams{'ACTION'} eq '<<')
 {
-        my @temp_then=();
-        my @temp_now = localtime(time);
-        $temp_now[4] = $cgiparams{'MONTH'};
-        $temp_now[3] = $cgiparams{'DAY'};
-        @temp_then = localtime(POSIX::mktime(@temp_now) - 86400);
-           ## Retrieve the same time on the previous day -
-           ## 86400 seconds in a day
-        $cgiparams{'MONTH'} = $temp_then[4];
-        $cgiparams{'DAY'} = $temp_then[3];
+       my @temp_then=();
+       my @temp_now = localtime(time);
+       $temp_now[4] = $cgiparams{'MONTH'};
+       $temp_now[3] = $cgiparams{'DAY'};
+       @temp_then = localtime(POSIX::mktime(@temp_now) - 86400);
+       ## Retrieve the same time on the previous day -
+       ## 86400 seconds in a day
+       $cgiparams{'MONTH'} = $temp_then[4];
+       $cgiparams{'DAY'} = $temp_then[3];
 }
 
 if (($cgiparams{'DAY'} ne $now[3]) || ($cgiparams{'MONTH'} ne $now[4]))
 {
-        my @then = ();
-        if ( (  $cgiparams{'MONTH'} eq $now[4]) && ($cgiparams{'DAY'} > $now[3]) ||
-                        ( $cgiparams{'MONTH'} > $now[4] ) ) {
-                @then = localtime(POSIX::mktime( 0, 0, 0, $cgiparams{'DAY'}, $cgiparams{'MONTH'}, $year - 1901 ));
-        } else {
-                @then = localtime(POSIX::mktime( 0, 0, 0, $cgiparams{'DAY'}, $cgiparams{'MONTH'}, $year - 1900 ));
-        }
-        $tdoy = $then[7];
-        my $lastleap=($year-1)%4;
-        if ($tdoy>$doy) {
-                if ($lastleap == 0 && $tdoy < 60) {
-                        $doy=$tdoy+366;
-                } else {
-                        $doy=$doy+365;
-                }
-        }
+       my @then = ();
+       if ( (  $cgiparams{'MONTH'} eq $now[4]) && ($cgiparams{'DAY'} > $now[3]) ||
+                       ( $cgiparams{'MONTH'} > $now[4] ) ) {
+               @then = localtime(POSIX::mktime( 0, 0, 0, $cgiparams{'DAY'}, $cgiparams{'MONTH'}, $year - 1901 ));
+       } else {
+               @then = localtime(POSIX::mktime( 0, 0, 0, $cgiparams{'DAY'}, $cgiparams{'MONTH'}, $year - 1900 ));
+       }
+       $tdoy = $then[7];
+       my $lastleap=($year-1)%4;
+       if ($tdoy>$doy) {
+               if ($lastleap == 0 && $tdoy < 60) {
+                       $doy=$tdoy+366;
+               } else {
+                       $doy=$doy+365;
+               }
+       }
 }
 
 my $datediff=0;
 my $dowd=0;
 my $multifile=0;
 if ($tdoy ne $doy) {
-        $datediff=int(($doy-$tdoy)/7);
-        $dowd=($doy-$tdoy)%7;
-        if (($dow-$dowd)<1) {
-                $datediff=$datediff+1;
-        }
-        if (($dow-$dowd)==0) {
-                $multifile=1;
-        }
+       $datediff=int(($doy-$tdoy)/7);
+       $dowd=($doy-$tdoy)%7;
+       if (($dow-$dowd)<1) {
+               $datediff=$datediff+1;
+       }
+       if (($dow-$dowd)==0) {
+               $multifile=1;
+       }
 }
 
 my $monthstr = $shortmonths[$cgiparams{'MONTH'}];
@@ -151,62 +151,63 @@ my $longmonthstr = $longmonths[$cgiparams{'MONTH'}];
 my $day = $cgiparams{'DAY'};
 my $daystr='';
 if ($day <= 9) {
-        $daystr = " $day"; }
+       $daystr = " $day"; 
+}
 else {
-        $daystr = $day;
+       $daystr = $day;
 }
 
 my $skip=0;
 my $filestr='';
 if ($datediff==0) {
-        $filestr="/var/log/messages";
+       $filestr="/var/log/messages";
 } else {
-       $filestr="/var/log/messages.$datediff";
-       $filestr = "$filestr.gz" if -f "$filestr.gz";
+                        $filestr="/var/log/messages.$datediff";
+                        $filestr = "$filestr.gz" if -f "$filestr.gz";
 }
 
 if (!(open (FILE,($filestr =~ /.gz$/ ? "gzip -dc $filestr |" : $filestr)))) {
-        $errormessage = "$Lang::tr{'date not in logs'}: $filestr $Lang::tr{'could not be opened'}";
-        $skip=1;
-        # Note: This is in case the log does not exist for that date
+       $errormessage = "$Lang::tr{'date not in logs'}: $filestr $Lang::tr{'could not be opened'}";
+       $skip=1;
+       # Note: This is in case the log does not exist for that date
 }
 my $lines = 0;
 my @log=();
 
 if (!$skip)
 {
-        while (<FILE>)
-        {
-                if (/(^${monthstr} ${daystr} ..:..:..) [\w\-]+ kernel:.*(IN=.*)$/) {
-                        $log[$lines] = $_;
-                        $lines++;
-                }
-        }
-        close (FILE);   
+       while (<FILE>)
+       {
+               if (/(^${monthstr} ${daystr} ..:..:..) [\w\-]+ kernel:.*(IN=.*)$/) {
+                       $log[$lines] = $_;
+                       $lines++;
+               }
+       }
+       close (FILE);   
 }
 
 $skip=0;
 if ($multifile) {
-        $datediff=$datediff-1;
-        if ($datediff==0) {
-                $filestr="/var/log/messages";
-        } else {
-                $filestr="/var/log/messages.$datediff";
-                $filestr = "$filestr.gz" if -f "$filestr.gz";
-        }
-        if (!(open (FILE,($filestr =~ /.gz$/ ? "gzip -dc $filestr |" : $filestr)))) {
-                $errormessage="$Lang::tr{'date not in logs'}: $filestr $Lang::tr{'could not be opened'}";
-                $skip=1;
-        }
-        if (!$skip) {
-                while (<FILE>) {
-                        if (/(^${monthstr} ${daystr} ..:..:..) [\w\-]+ kernel:.*(IN=.*)$/) {
-                                $log[$lines] = $_;
-                                $lines++;
-                        }
-                }
-                close (FILE);
-        }
+       $datediff=$datediff-1;
+       if ($datediff==0) {
+               $filestr="/var/log/messages";
+       } else {
+               $filestr="/var/log/messages.$datediff";
+               $filestr = "$filestr.gz" if -f "$filestr.gz";
+       }
+       if (!(open (FILE,($filestr =~ /.gz$/ ? "gzip -dc $filestr |" : $filestr)))) {
+               $errormessage="$Lang::tr{'date not in logs'}: $filestr $Lang::tr{'could not be opened'}";
+               $skip=1;
+       }
+       if (!$skip) {
+               while (<FILE>) {
+                       if (/(^${monthstr} ${daystr} ..:..:..) [\w\-]+ kernel:.*(IN=.*)$/) {
+                               $log[$lines] = $_;
+                               $lines++;
+                       }
+               }
+               close (FILE);
+       }
 }
 
 my $MODNAME="fwlogs";
@@ -217,9 +218,9 @@ my $MODNAME="fwlogs";
 
 
 if ($errormessage) {
-        &Header::openbox('100%', 'left', $Lang::tr{'error messages'});
-        print "<font class='base'>$errormessage&nbsp;</font>\n";
-        &Header::closebox();
+       &Header::openbox('100%', 'left', $Lang::tr{'error messages'});
+       print "<font class='base'>$errormessage&nbsp;</font>\n";
+       &Header::closebox();
 }
 
 &Header::openbox('100%', 'left', "$Lang::tr{'settings'}");
@@ -228,40 +229,39 @@ print <<END
 <form method='post' action='$ENV{'SCRIPT_NAME'}'>
 <table width='100%'>
 <tr>
-        <td width='10%' class='base'>$Lang::tr{'month'}:&nbsp;</td>
-        <td width='10%'>
-        <select name='MONTH'>
+       <td width='10%' class='base'>$Lang::tr{'month'}:&nbsp;</td>
+       <td width='10%'>
+       <select name='MONTH'>
 END
 ;
 my $month;
 for ($month = 0; $month < 12; $month++)
 {
-        print "\t<option ";
-        if ($month == $cgiparams{'MONTH'}) {
-                print "selected='selected' "; }
-        print "value='$month'>$longmonths[$month]</option>\n";
+       print "\t<option ";
+       if ($month == $cgiparams{'MONTH'}) {
+               print "selected='selected' "; }
+       print "value='$month'>$longmonths[$month]</option>\n";
 }
 print <<END
-        </select>
-        </td>
-        <td width='10%' class='base' align='right'>&nbsp;$Lang::tr{'day'}:&nbsp;</td>
-        <td width='40%'>
-        <select name='DAY'>
+       </select>
+       </td>
+       <td width='10%' class='base' align='right'>&nbsp;$Lang::tr{'day'}:&nbsp;</td>
+       <td width='40%'>
+       <select name='DAY'>
 END
 ;
 for ($day = 1; $day <= 31; $day++) 
 {
-        print "\t<option ";
-        if ($day == $cgiparams{'DAY'}) {
-                print "selected='selected' "; }
-        print "value='$day'>$day</option>\n";
+       print "\t<option ";
+       if ($day == $cgiparams{'DAY'}) {
+               print "selected='selected' "; }
+       print "value='$day'>$day</option>\n";
 }
 
 if( $cgiparams{'pienumber'} != 0){$pienumber=$cgiparams{'pienumber'};}
 if( $cgiparams{'otherspie'} != 0){$otherspie=$cgiparams{'otherspie'};}
 if( $cgiparams{'showpie'} != 0){$showpie=$cgiparams{'showpie'};}
 if( $cgiparams{'sortcolumn'} != 0){$sortcolumn=$cgiparams{'sortcolumn'};}
-
 print <<END
 </select>
 </td>
@@ -294,29 +294,43 @@ $lines = 0;
 
 foreach $_ (@log)
 {
-  /^... (..) (..:..:..) [\w\-]+ kernel:(.*)(IN=.*)$/;
-  my $packet = $4;
-  $packet =~ /IN=(\w+)/;       my $iface=$1; if ( $1 =~ /2./ ){ $iface="";}
-  $packet =~ /SRC=([\d\.]+)/;  my $srcaddr=$1;
-
-  if($iface eq $red_interface) {
-    if($srcaddr ne '') {
-      my $ccode = $gi->country_code_by_name($srcaddr);
-      if( $ccode eq '') {
-          $ccode = 'unknown';
-      }
-      $tabjc{$ccode} = $tabjc{$ccode} + 1 ;
-      if(($tabjc{$ccode} == 1) && ($lines < $pienumber)) { $lines = $lines + 1; }
-      $linesjc++;
-    }
-  }
-  else {
-    if($iface ne '') {
-        $tabjc{$iface} = $tabjc{$iface} + 1 ;
-        if(($tabjc{$iface} == 1) && ($lines < $pienumber)) { $lines = $lines + 1; }
-        $linesjc++;
-    }
-  }
+       # If ipv6 uses bridge, use PHYSIN for iface, otherwise IN
+       if    (/^... (..) (..:..:..) [\w\-]+ kernel:(.*)(PHYSIN=.*)$/) {}
+       elsif (/^... (..) (..:..:..) [\w\-]+ kernel:(.*)(IN=.*)$/) {}
+       my $packet = $4;
+       my $iface  = '';
+       if ($packet =~ /PHYSIN=(\w+)/) { $iface = $1; } elsif ($packet =~ /IN=(\w+)/) { $iface = $1; }
+       if ( $1 =~ /2./ ) { $iface=''; }
+       my $srcaddr = '';
+       # Find ipv4 and ipv6 addresses
+       if    ($packet =~ /SRC\=(([\d]{1,3})(\.([\d]{1,3})){3})/) { $srcaddr = $1; }
+       elsif ($packet =~ /SRC\=(([0-9a-fA-F]{0,4})(\:([0-9a-fA-F]{0,4})){2,7})/) { $srcaddr = $1; }
+
+       if($iface eq $red_interface) {
+               # Traffic from red
+               if($srcaddr ne '') {
+                       # srcaddr is set
+                       my $ccode = $gi->country_code_by_name($srcaddr);
+                       if ($ccode eq '') {
+                               $ccode = 'unknown';
+                       }
+                       $tabjc{$ccode} = $tabjc{$ccode} + 1;
+                       if(($tabjc{$ccode} == 1) && ($lines < $pienumber)) { $lines = $lines + 1; }
+                       $linesjc++;
+               }
+       }
+       else {
+               # Traffic not from red
+               if($iface ne '') {
+                       $tabjc{$iface} = $tabjc{$iface} + 1 ;
+                       if(($tabjc{$iface} == 1) && ($lines < $pienumber)) { $lines = $lines + 1; }
+                       $linesjc++;
+               }
+               else {
+                       # What to do with empty iface lines?
+                       # This probably is traffic from ipfire itself (IN= OUT=XY)?
+               }
+       }
 }
 
 $pienumber = $lines;
@@ -336,13 +350,11 @@ my @value;
 my $indice=0;
 my @tabjc2;
 
-if ($sortcolumn == 1)
-{
-        @tabjc2 = sort { $b <=> $a } values (%tabjc);
+if ($sortcolumn == 1) {
+       @tabjc2 = sort { $b <=> $a } values (%tabjc);
 }
-else
-{
-        @tabjc2 = sort { $a <=> $b } keys (%tabjc);
+else {
+       @tabjc2 = sort { $a <=> $b } keys (%tabjc);
 }
 
 my $colour=1;
@@ -354,19 +366,17 @@ use GD::Graph::colour;
 #ips sort by hits number
 my $v;
 
-if ($sortcolumn == 1)
-{
-        for ($v=0;$v<$pienumber;$v++){
-          findkey($tabjc2[$v]);
-        }
+if ($sortcolumn == 1) {
+       for ($v=0;$v<$pienumber;$v++){
+               findkey($tabjc2[$v]);
+       }
 }
-else
-{
-        foreach $v (@tabjc2) {
-          $key[$indice] = $v;
-          $value[$indice] = $tabjc{$v};
-          $indice++;
-        }
+else {
+       foreach $v (@tabjc2) {
+               $key[$indice] = $v;
+               $value[$indice] = $tabjc{$v};
+               $indice++;
+       }
 }
 
 my @ips;
@@ -379,15 +389,15 @@ my $o;
 
 if($cgiparams{'otherspie'} == 2 ){}
 else{ 
-        my $numothers;
-        for($o=0;$o<$pienumber;$o++){
-          $numothers = $numothers + $numb[$o];
-        }
-        $numothers =  $linesjc - $numothers;
-        if ($numothers > 0) {
-                $ips[$pienumber]="$Lang::tr{'otherip'}";
-                $numb[$pienumber] =  $numothers;
-        }
+       my $numothers;
+       for($o=0;$o<$pienumber;$o++){
+               $numothers = $numothers + $numb[$o];
+       }
+       $numothers = $linesjc - $numothers;
+       if ($numothers > 0) {
+               $ips[$pienumber]="$Lang::tr{'otherip'}";
+               $numb[$pienumber] = $numothers;
+       }
 }
 
 my @data = (\@ips,\@numb);
@@ -400,30 +410,29 @@ my %mainsettings = ();
 &General::readhash("/srv/web/ipfire/html/themes/".$mainsettings{'THEME'}."/include/colors.txt", \%color);
 
 if ($showpie != 2 && $pienumber <= 50 && $pienumber != 0) {
-        my $mygraph = GD::Graph::pie->new(500, 350);
-        $mygraph->set(
-              'title' => '',
-              'pie_height' => 50,
-              'start_angle' => 89
-             ) or warn $mygraph->error;
-
-        $mygraph->set_value_font(GD::gdMediumBoldFont);
-        $mygraph->set( dclrs => [ "$color{'color1'}" , "$color{'color2'}" , "$color{'color3'}" , "$color{'color4'}" , "$color{'color5'}" , "$color{'color6'}" , "$color{'color7'}" , "$color{'color8'}" , "$color{'color9'}" , "$color{'color10'}" ] );
-        my $myimage = $mygraph->plot(\@data) or die $mygraph->error;
-
-        my @filenames = glob("/srv/web/ipfire/html/graphs/fwlog-country*.png");
-        unlink(@filenames);
-        my $imagerandom = rand(1000000);
-        my $imagename = "/srv/web/ipfire/html/graphs/fwlog-country$imagerandom.png";
-        open(FILE,">$imagename");
-        print FILE $myimage->png;
-        close(FILE);
-        #####################################################
-        print "<div style='text-align:center;'>";
-        print "<img src='/graphs/fwlog-country$imagerandom.png'>";
-        print "</div>";
+       my $mygraph = GD::Graph::pie->new(500, 350);
+       $mygraph->set(
+               'title' => '',
+               'pie_height' => 50,
+               'start_angle' => 89
+       ) or warn $mygraph->error;
+
+       $mygraph->set_value_font(GD::gdMediumBoldFont);
+       $mygraph->set( dclrs => [ "$color{'color1'}" , "$color{'color2'}" , "$color{'color3'}" , "$color{'color4'}" , "$color{'color5'}" , "$color{'color6'}" , "$color{'color7'}" , "$color{'color8'}" , "$color{'color9'}" , "$color{'color10'}" ] );
+       my $myimage = $mygraph->plot(\@data) or die $mygraph->error;
+
+       my @filenames = glob("/srv/web/ipfire/html/graphs/fwlog-country*.png");
+       unlink(@filenames);
+       my $imagerandom = rand(1000000);
+       my $imagename = "/srv/web/ipfire/html/graphs/fwlog-country$imagerandom.png";
+       open(FILE,">$imagename");
+       print FILE $myimage->png;
+       close(FILE);
+       #####################################################
+       print "<div style='text-align:center;'>";
+       print "<img src='/graphs/fwlog-country$imagerandom.png'>";
+       print "</div>";
 }
-
 print <<END
 <table width='100%' class='tbl'>
 <tr>
@@ -444,73 +453,72 @@ my $col="";
 
 for($s=0;$s<$lines;$s++)
 {
-  $show++;
-  $percent = $value[$s] * 100 / $linesjc;
-  $percent = sprintf("%.f", $percent);
-  $total = $total + $value[$s];
-  my $colorIndex = $color % 10;
-  if($colorIndex == 0) {
-    $colorIndex = 10;
-  }
-  $col="bgcolor='$color{\"color$colorIndex\"}'";
-  $color++;
-  print "<tr>";
-
-  print "<td align='center' $col>";
-
-  # Dont show details button for "unknown" location.
-  if ($key[$s] ne 'unknown') {
-       print"<form method='post' action='showrequestfromcountry.dat'>";
-       print"<input type='hidden' name='MONTH' value='$cgiparams{'MONTH'}'>";
-       print"<input type='hidden' name='DAY' value='$cgiparams{'DAY'}'>";
-       print"<input type='hidden' name='country' value='$key[$s]'>";
-       print"<input type='submit' value='details'></form>";
-  }
-
-  if($key[$s] eq 'blue0' || $key[$s] eq 'green0' || $key[$s] eq 'orange0') {
-      print "<td align='center' $col>$key[$s]</td>";
-  }
-  else {
-       my $fcode = lc($key[$s]);
-
-       # Get flag icon for of the country.
-       my $flag_icon = &GeoIP::get_flag_icon($fcode);
-
-       if($flag_icon) {
-               print "<td align='center' $col><a href='/cgi-bin/country.cgi#$fcode'><img src='$flag_icon' border='0' align='absmiddle' alt='$key[$s]' title='$key[$s]'></a></td>";
-       } else {
+       $show++;
+       $percent = $value[$s] * 100 / $linesjc;
+       $percent = sprintf("%.f", $percent);
+       $total = $total + $value[$s];
+       # colors are numbered 1 to 10
+       my $colorIndex = ($color % 10) + 1;
+       $col="bgcolor='$color{\"color$colorIndex\"}'";
+       $color++;
+       print "<tr>";
+
+       print "<td align='center' $col>";
+
+       # Dont show details button for "unknown" location.
+       if ($key[$s] ne 'unknown') {
+               print"<form method='post' action='showrequestfromcountry.dat'>";
+               print"<input type='hidden' name='MONTH' value='$cgiparams{'MONTH'}'>";
+               print"<input type='hidden' name='DAY' value='$cgiparams{'DAY'}'>";
+               print"<input type='hidden' name='country' value='$key[$s]'>";
+               print"<input type='submit' value='details'></form>";
+       }
+       elsif ($key[$s] eq 'unknown') {
+               print "unknown";
+       }
+       # Looks dangerous to use hardcoded interface names here. Probably needs fixing.
+       if ($key[$s] eq 'blue0' || $key[$s] eq 'green0' || $key[$s] eq 'orange0' ) {
                print "<td align='center' $col>$key[$s]</td>";
-      }
-  }
-  print "<td align='center' $col>$value[$s]</td>";
-  print "<td align='center' $col>$percent</td>";
-  print "</tr>";
+       }
+       else {
+               my $fcode = lc($key[$s]);
+
+               # Get flag icon for of the country.
+               my $flag_icon = &GeoIP::get_flag_icon($fcode);
+
+               if($flag_icon) {
+                       print "<td align='center' $col><a href='/cgi-bin/country.cgi#$fcode'><img src='$flag_icon' border='0' align='absmiddle' alt='$key[$s]' title='$key[$s]'></a></td>";
+               } else {
+                       print "<td align='center' $col>$key[$s]</td>";
+               }
+       }
+       print "<td align='center' $col>$value[$s]</td>";
+       print "<td align='center' $col>$percent</td>";
+       print "</tr>";
 }
 
 if($cgiparams{'otherspie'} == 2 ){}
 else{
-  my $colorIndex = $color % 10;
-  if($colorIndex == 0) {
-    $colorIndex = 10;
-  }
-  $col="bgcolor='$color{\"color$colorIndex\"}'";
-  print "<tr>";
-
-if ( $linesjc ne "0")
-{
-my $dif;
-$dif = $linesjc - $total;
-$percent = $dif * 100 / $linesjc;
-$percent = sprintf("%.f", $percent);
-print <<END
-<td align='center' $col></TD>
-<td align='center' $col>$Lang::tr{'other countries'}</td>
-<td align='center' $col>$dif</TD>
-<td align='center' $col>$percent</TD>
-</tr>
+       # colors are numbered 1 to 10
+       my $colorIndex = ($color % 10) + 1;
+       $col="bgcolor='$color{\"color$colorIndex\"}'";
+       print "<tr>";
+
+       if ( $linesjc ne "0")
+       {
+               my $dif;
+               $dif = $linesjc - $total;
+               $percent = $dif * 100 / $linesjc;
+               $percent = sprintf("%.f", $percent);
+               print <<END
+               <td align='center' $col></TD>
+               <td align='center' $col>$Lang::tr{'other countries'}</td>
+               <td align='center' $col>$dif</TD>
+               <td align='center' $col>$percent</TD>
+               </tr>
 END
-;
-}
+               ;
+       }
 }
 print <<END
 </TABLE>
@@ -522,19 +530,19 @@ END
 &Header::closepage();
 
 sub findkey {
-  my $v;
-  foreach $v (@keytabjc) {
-    if ($tabjc{$v} eq $_[0]) {
-      delete $tabjc{$v};
-      $key[$indice] = "$v";
-      $value[$indice] = $_[0];
-      $indice++;
-      last;
-    }
-  }
+       my $v;
+       foreach $v (@keytabjc) {
+               if ($tabjc{$v} eq $_[0]) {
+                       delete $tabjc{$v};
+                       $key[$indice] = "$v";
+                       $value[$indice] = $_[0];
+                       $indice++;
+                       last;
+               }
+       }
 }
 sub checkversion {
-        #Automatic Updates is disabled
-        return "0","0";
+       #Automatic Updates is disabled
+       return "0","0";
 }
 
index 7d82d20e725e07f3569921a51ef030650b5e2510..08ef1c4be1425246971658939cb9c73171b63d45 100644 (file)
@@ -8,7 +8,7 @@
 # page inspired from the initial firewalllog.dat
 #
 # Modified for IPFire by Christian Schmidt
-#                            and Michael Tremer (www.ipfire.org)
+#                          and Michael Tremer (www.ipfire.org)
 
 use strict;
 use Geo::IP::PurePerl;
@@ -39,11 +39,11 @@ $cgiparams{'showpie'} = 1;
 $cgiparams{'sortcolumn'} = 1;
 
 my @shortmonths = ( 'Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug',
-        'Sep', 'Oct', 'Nov', 'Dec' );
+       'Sep', 'Oct', 'Nov', 'Dec' );
 my @longmonths = ( $Lang::tr{'january'}, $Lang::tr{'february'}, $Lang::tr{'march'},
-        $Lang::tr{'april'}, $Lang::tr{'may'}, $Lang::tr{'june'}, $Lang::tr{'july'}, $Lang::tr{'august'},
-        $Lang::tr{'september'}, $Lang::tr{'october'}, $Lang::tr{'november'},
-        $Lang::tr{'december'} );
+       $Lang::tr{'april'}, $Lang::tr{'may'}, $Lang::tr{'june'}, $Lang::tr{'july'}, $Lang::tr{'august'},
+       $Lang::tr{'september'}, $Lang::tr{'october'}, $Lang::tr{'november'},
+       $Lang::tr{'december'} );
 
 my @now = localtime();
 my $dow = $now[6];
@@ -69,81 +69,81 @@ if ($cgiparams{'sortcolumn'} != 0) { $settings{'sortcolumn'} = $cgiparams{'sortc
 
 if ($cgiparams{'ACTION'} eq $Lang::tr{'save'})
 {
-   &General::writehash("${General::swroot}/fwlogs/ipsettings", \%settings);
+       &General::writehash("${General::swroot}/fwlogs/ipsettings", \%settings);
 }
 
 my $start = -1;
 if ($ENV{'QUERY_STRING'} && $cgiparams{'ACTION'} ne $Lang::tr{'update'})
 {
-        my @temp = split(',',$ENV{'QUERY_STRING'});
-        $start = $temp[0];
-        $cgiparams{'MONTH'} = $temp[1];
-        $cgiparams{'DAY'} = $temp[2];
+       my @temp = split(',',$ENV{'QUERY_STRING'});
+       $start = $temp[0];
+       $cgiparams{'MONTH'} = $temp[1];
+       $cgiparams{'DAY'} = $temp[2];
 }
 
 if (!($cgiparams{'MONTH'} =~ /^(0|1|2|3|4|5|6|7|8|9|10|11)$/) ||
     !($cgiparams{'DAY'} =~ /^(1|2|3|4|5|6|7|8|9|10|11|12|13|14|15|16|17|18|19|20|21|22|23|24|25|26|27|28|29|30|31)$/))
 {
-        $cgiparams{'DAY'} = $now[3];
-        $cgiparams{'MONTH'} = $now[4];
+       $cgiparams{'DAY'} = $now[3];
+       $cgiparams{'MONTH'} = $now[4];
 }
 elsif($cgiparams{'ACTION'} eq '>>')
 {
-        my @temp_then=();
-        my @temp_now = localtime(time);
-        $temp_now[4] = $cgiparams{'MONTH'};
-        $temp_now[3] = $cgiparams{'DAY'};
-        @temp_then = localtime(POSIX::mktime(@temp_now) + 86400);
-           ## Retrieve the same time on the next day -
-           ## 86400 seconds in a day
-        $cgiparams{'MONTH'} = $temp_then[4];
-        $cgiparams{'DAY'} = $temp_then[3];
+       my @temp_then=();
+       my @temp_now = localtime(time);
+       $temp_now[4] = $cgiparams{'MONTH'};
+       $temp_now[3] = $cgiparams{'DAY'};
+       @temp_then = localtime(POSIX::mktime(@temp_now) + 86400);
+       ## Retrieve the same time on the next day -
+       ## 86400 seconds in a day
+       $cgiparams{'MONTH'} = $temp_then[4];
+       $cgiparams{'DAY'} = $temp_then[3];
 }
 elsif($cgiparams{'ACTION'} eq '<<')
 {
-        my @temp_then=();
-        my @temp_now = localtime(time);
-        $temp_now[4] = $cgiparams{'MONTH'};
-        $temp_now[3] = $cgiparams{'DAY'};
-        @temp_then = localtime(POSIX::mktime(@temp_now) - 86400);
-           ## Retrieve the same time on the previous day -
-           ## 86400 seconds in a day
-        $cgiparams{'MONTH'} = $temp_then[4];
-        $cgiparams{'DAY'} = $temp_then[3];
+       my @temp_then=();
+       my @temp_now = localtime(time);
+       $temp_now[4] = $cgiparams{'MONTH'};
+       $temp_now[3] = $cgiparams{'DAY'};
+       @temp_then = localtime(POSIX::mktime(@temp_now) - 86400);
+       ## Retrieve the same time on the previous day -
+       ## 86400 seconds in a day
+       $cgiparams{'MONTH'} = $temp_then[4];
+       $cgiparams{'DAY'} = $temp_then[3];
 }
 
 if (($cgiparams{'DAY'} ne $now[3]) || ($cgiparams{'MONTH'} ne $now[4]))
 {
-        my @then = ();
-        if ( (  $cgiparams{'MONTH'} eq $now[4]) && ($cgiparams{'DAY'} > $now[3]) ||
-                        ( $cgiparams{'MONTH'} > $now[4] ) ) {
-                @then = localtime(POSIX::mktime( 0, 0, 0, $cgiparams{'DAY'}, $cgiparams{'MONTH'}, $year - 1901 ));
-        } else {
-                @then = localtime(POSIX::mktime( 0, 0, 0, $cgiparams{'DAY'}, $cgiparams{'MONTH'}, $year - 1900 ));
-        }
-        $tdoy = $then[7];
-        my $lastleap=($year-1)%4;
-        if ($tdoy>$doy) {
-                if ($lastleap == 0 && $tdoy < 60) {
-                        $doy=$tdoy+366;
-                } else {
-                        $doy=$doy+365;
-                }
-        }
+       my @then = ();
+       if ( (  $cgiparams{'MONTH'} eq $now[4]) && ($cgiparams{'DAY'} > $now[3]) ||
+            ( $cgiparams{'MONTH'} > $now[4] ) ) {
+               @then = localtime(POSIX::mktime( 0, 0, 0, $cgiparams{'DAY'}, $cgiparams{'MONTH'}, $year - 1901 ));
+       } else {
+               @then = localtime(POSIX::mktime( 0, 0, 0, $cgiparams{'DAY'}, $cgiparams{'MONTH'}, $year - 1900 ));
+       }
+       $tdoy = $then[7];
+       my $lastleap=($year-1)%4;
+       if ($tdoy>$doy) {
+               if ($lastleap == 0 && $tdoy < 60) {
+                       $doy=$tdoy+366;
+               } else {
+                       $doy=$doy+365;
+               }
+       }
 }
 
 my $datediff=0;
 my $dowd=0;
 my $multifile=0;
 if ($tdoy ne $doy) {
-        $datediff=int(($doy-$tdoy)/7);
-        $dowd=($doy-$tdoy)%7;
-        if (($dow-$dowd)<1) {
-                $datediff=$datediff+1;
-        }
-        if (($dow-$dowd)==0) {
-                $multifile=1;
-        }
+       $datediff=int(($doy-$tdoy)/7);
+       $dowd=($doy-$tdoy)%7;
+       if (($dow-$dowd)<1) {
+               $datediff=$datediff+1;
+       }
+       if (($dow-$dowd)==0) {
+               $multifile=1;
+       }
 }
 
 my $monthstr = $shortmonths[$cgiparams{'MONTH'}];
@@ -151,62 +151,62 @@ my $longmonthstr = $longmonths[$cgiparams{'MONTH'}];
 my $day = $cgiparams{'DAY'};
 my $daystr='';
 if ($day <= 9) {
-        $daystr = " $day"; }
+       $daystr = " $day"; }
 else {
-        $daystr = $day;
+       $daystr = $day;
 }
 
 my $skip=0;
 my $filestr='';
 if ($datediff==0) {
-        $filestr="/var/log/messages";
+       $filestr="/var/log/messages";
 } else {
        $filestr="/var/log/messages.$datediff";
        $filestr = "$filestr.gz" if -f "$filestr.gz";
 }
 
 if (!(open (FILE,($filestr =~ /.gz$/ ? "gzip -dc $filestr |" : $filestr)))) {
-        $errormessage = "$Lang::tr{'date not in logs'}: $filestr $Lang::tr{'could not be opened'}";
-        $skip=1;
-        # Note: This is in case the log does not exist for that date
+       $errormessage = "$Lang::tr{'date not in logs'}: $filestr $Lang::tr{'could not be opened'}";
+       $skip=1;
+       # Note: This is in case the log does not exist for that date
 }
 my $lines = 0;
 my @log=();
 
 if (!$skip)
 {
-        while (<FILE>)
-        {
-                if (/(^${monthstr} ${daystr} ..:..:..) [\w\-]+ kernel:.*(IN=.*)$/) {
-                        $log[$lines] = $_;
-                        $lines++;
-                }
-        }
-        close (FILE);   
+       while (<FILE>)
+       {
+               if (/(^${monthstr} ${daystr} ..:..:..) [\w\-]+ kernel:.*(IN=.*)$/) {
+                       $log[$lines] = $_;
+                       $lines++;
+               }
+       }
+       close (FILE);   
 }
 
 $skip=0;
 if ($multifile) {
-        $datediff=$datediff-1;
-        if ($datediff==0) {
-                $filestr="/var/log/messages";
-        } else {
-                $filestr="/var/log/messages.$datediff";
-                $filestr = "$filestr.gz" if -f "$filestr.gz";
-        }
-        if (!(open (FILE,($filestr =~ /.gz$/ ? "gzip -dc $filestr |" : $filestr)))) {
-                $errormessage="$Lang::tr{'date not in logs'}: $filestr $Lang::tr{'could not be opened'}";
-                $skip=1;
-        }
-        if (!$skip) {
-                while (<FILE>) {
-                        if (/(^${monthstr} ${daystr} ..:..:..) [\w\-]+ kernel:.*(IN=.*)$/) {
-                                $log[$lines] = $_;
-                                $lines++;
-                        }
-                }
-                close (FILE);
-        }
+       $datediff=$datediff-1;
+       if ($datediff==0) {
+               $filestr="/var/log/messages";
+       } else {
+               $filestr="/var/log/messages.$datediff";
+               $filestr = "$filestr.gz" if -f "$filestr.gz";
+       }
+       if (!(open (FILE,($filestr =~ /.gz$/ ? "gzip -dc $filestr |" : $filestr)))) {
+               $errormessage="$Lang::tr{'date not in logs'}: $filestr $Lang::tr{'could not be opened'}";
+               $skip=1;
+       }
+       if (!$skip) {
+               while (<FILE>) {
+                       if (/(^${monthstr} ${daystr} ..:..:..) [\w\-]+ kernel:.*(IN=.*)$/) {
+                               $log[$lines] = $_;
+                               $lines++;
+                       }
+               }
+               close (FILE);
+       }
 }
 
 my $MODNAME="fwlogs";
@@ -217,9 +217,9 @@ my $MODNAME="fwlogs";
 
 
 if ($errormessage) {
-        &Header::openbox('100%', 'left', $Lang::tr{'error messages'});
-        print "<font class='base'>$errormessage&nbsp;</font>\n";
-        &Header::closebox();
+       &Header::openbox('100%', 'left', $Lang::tr{'error messages'});
+       print "<font class='base'>$errormessage&nbsp;</font>\n";
+       &Header::closebox();
 }
 
 &Header::openbox('100%', 'left', "$Lang::tr{'settings'}");
@@ -228,33 +228,35 @@ print <<END
 <form method='post' action='$ENV{'SCRIPT_NAME'}'>
 <table width='100%'>
 <tr>
-        <td width='10%' class='base'>$Lang::tr{'month'}:&nbsp;</td>
-        <td width='10%'>
-        <select name='MONTH'>
+       <td width='10%' class='base'>$Lang::tr{'month'}:&nbsp;</td>
+       <td width='10%'>
+       <select name='MONTH'>
 END
 ;
 my $month;
 for ($month = 0; $month < 12; $month++)
 {
-        print "\t<option ";
-        if ($month == $cgiparams{'MONTH'}) {
-                print "selected='selected' "; }
-        print "value='$month'>$longmonths[$month]</option>\n";
+       print "\t<option ";
+       if ($month == $cgiparams{'MONTH'}) {
+               print "selected='selected' "; 
+       }
+       print "value='$month'>$longmonths[$month]</option>\n";
 }
 print <<END
-        </select>
-        </td>
-        <td width='10%' class='base' align='right'>&nbsp;$Lang::tr{'day'}:&nbsp;</td>
-        <td width='40%'>
-        <select name='DAY'>
+       </select>
+       </td>
+       <td width='10%' class='base' align='right'>&nbsp;$Lang::tr{'day'}:&nbsp;</td>
+       <td width='40%'>
+       <select name='DAY'>
 END
 ;
 for ($day = 1; $day <= 31; $day++) 
 {
-        print "\t<option ";
-        if ($day == $cgiparams{'DAY'}) {
-                print "selected='selected' "; }
-        print "value='$day'>$day</option>\n";
+       print "\t<option ";
+       if ($day == $cgiparams{'DAY'}) {
+               print "selected='selected' "; 
+       }
+       print "value='$day'>$day</option>\n";
 }
 
 if( $cgiparams{'pienumber'} != 0){$pienumber=$cgiparams{'pienumber'};}
@@ -291,11 +293,12 @@ if ($pienumber == -1 || $pienumber > $lines || $sortcolumn == 2) { $pienumber =
 $lines = 0;
 foreach $_ (@log)
 {
-  if($_ =~  /SRC\=([\d\.]+)/){
-    $tabjc{$1} = $tabjc{$1} + 1 ;
-    if(($tabjc{$1} == 1) && ($lines < $pienumber)) { $lines = $lines + 1; }
-    $linesjc++;
-  }
+       # Extract ipv4 or ipv6 address
+       if (($_ =~  /SRC\=(([\d]{1,3})(\.([\d]{1,3})){3})/) or ($_ =~ /SRC\=(([0-9a-fA-F]{0,4})(\:([0-9a-fA-F]{0,4})){2,7})/)) {
+               $tabjc{$1} = $tabjc{$1} + 1 ;
+               if(($tabjc{$1} == 1) && ($lines < $pienumber)) { $lines = $lines + 1; }
+               $linesjc++;
+       }
 }
 
 $pienumber = $lines;
@@ -317,11 +320,11 @@ my @tabjc2;
 
 if ($sortcolumn == 1)
 {
-        @tabjc2 = sort { $b <=> $a } values (%tabjc);
+       @tabjc2 = sort { $b <=> $a } values (%tabjc);
 }
 else
 {
-        @tabjc2 = sort { $a <=> $b } keys (%tabjc);
+       @tabjc2 = sort { $a <=> $b } keys (%tabjc);
 }
 
 my $colour=1;
@@ -335,17 +338,17 @@ my $v;
 
 if ($sortcolumn == 1)
 {
-        for ($v=0;$v<$pienumber;$v++){
-          findkey($tabjc2[$v]);
-        }
+       for ($v=0;$v<$pienumber;$v++){
+               findkey($tabjc2[$v]);
+       }
 }
 else
 {
-        foreach $v (@tabjc2) {
-          $key[$indice] = $v;
-          $value[$indice] = $tabjc{$v};
-          $indice++;
-        }
+       foreach $v (@tabjc2) {
+               $key[$indice] = $v;
+               $value[$indice] = $tabjc{$v};
+               $indice++;
+       }
 }
 
 my @ips;
@@ -358,15 +361,15 @@ my $o;
 
 if($cgiparams{'otherspie'} == 2 ){}
 else{ 
-        my $numothers;
-        for($o=0;$o<$pienumber;$o++){
-          $numothers = $numothers + $numb[$o];
-        }
-        $numothers =  $linesjc - $numothers;
-        if ($numothers > 0) {
-                $ips[$pienumber]="$Lang::tr{'otherip'}";
-                $numb[$pienumber] =  $numothers;
-        }
+       my $numothers;
+       for($o=0;$o<$pienumber;$o++){
+               $numothers = $numothers + $numb[$o];
+       }
+       $numothers =  $linesjc - $numothers;
+       if ($numothers > 0) {
+               $ips[$pienumber]="$Lang::tr{'otherip'}";
+               $numb[$pienumber] =  $numothers;
+       }
 }
 
 my @data = (\@ips,\@numb);
@@ -379,28 +382,28 @@ my %mainsettings = ();
 &General::readhash("/srv/web/ipfire/html/themes/".$mainsettings{'THEME'}."/include/colors.txt", \%color);
 
 if ($showpie != 2 && $pienumber <= 50 && $pienumber != 0) {
-        my $mygraph = GD::Graph::pie->new(500, 350);
-        $mygraph->set(
-              'title' => '',
-              'pie_height' => 50,
-              'start_angle' => 89
-             ) or warn $mygraph->error;
-
-        $mygraph->set_value_font(GD::gdMediumBoldFont);
-        $mygraph->set( dclrs => [ "$color{'color1'}" , "$color{'color2'}" , "$color{'color3'}" , "$color{'color4'}" , "$color{'color5'}" , "$color{'color6'}" , "$color{'color7'}" , "$color{'color8'}" , "$color{'color9'}" , "$color{'color10'}" ] );
-        my $myimage = $mygraph->plot(\@data) or die $mygraph->error;
-
-        my @filenames = glob("/srv/web/ipfire/html/graphs/fwlog-ip*.png");
-        unlink(@filenames);
-        my $imagerandom = rand(1000000);
-        my $imagename = "/srv/web/ipfire/html/graphs/fwlog-ip$imagerandom.png";
-        open(FILE,">$imagename");
-        print FILE $myimage->png;
-        close(FILE);
-        #####################################################
-        print "<div style='text-align:center'>";
-        print "<img src='/graphs/fwlog-ip$imagerandom.png'>";
-        print "</div>";
+       my $mygraph = GD::Graph::pie->new(500, 350);
+       $mygraph->set(
+             'title' => '',
+             'pie_height' => 50,
+             'start_angle' => 89
+       ) or warn $mygraph->error;
+
+       $mygraph->set_value_font(GD::gdMediumBoldFont);
+       $mygraph->set( dclrs => [ "$color{'color1'}" , "$color{'color2'}" , "$color{'color3'}" , "$color{'color4'}" , "$color{'color5'}" , "$color{'color6'}" , "$color{'color7'}" , "$color{'color8'}" , "$color{'color9'}" , "$color{'color10'}" ] );
+       my $myimage = $mygraph->plot(\@data) or die $mygraph->error;
+
+       my @filenames = glob("/srv/web/ipfire/html/graphs/fwlog-ip*.png");
+       unlink(@filenames);
+       my $imagerandom = rand(1000000);
+       my $imagename = "/srv/web/ipfire/html/graphs/fwlog-ip$imagerandom.png";
+       open(FILE,">$imagename");
+       print FILE $myimage->png;
+       close(FILE);
+       #####################################################
+       print "<div style='text-align:center'>";
+       print "<img src='/graphs/fwlog-ip$imagerandom.png'>";
+       print "</div>";
 }
 
 print <<END
@@ -424,64 +427,60 @@ my $col="";
 
 for($s=0;$s<$lines;$s++)
 {
-  $show++;
-  $percent = $value[$s] * 100 / $linesjc;
-  $percent = sprintf("%.f", $percent);
-  $total = $total + $value[$s];
-  my $colorIndex = $color % 10;
-  if($colorIndex == 0) {
-    $colorIndex = 10;
-  }
-  $col="bgcolor='$color{\"color$colorIndex\"}'";
-  print "<tr>";
+       $show++;
+       $percent = $value[$s] * 100 / $linesjc;
+       $percent = sprintf("%.f", $percent);
+       $total = $total + $value[$s];
+       # colors are numbered 1 to 10
+       my $colorIndex = ($color % 10) + 1;
+       $col="bgcolor='$color{\"color$colorIndex\"}'";
+       print "<tr>";
+
+       my $gi = Geo::IP::PurePerl->new();
+       my $ccode = $gi->country_code_by_name($key[$s]);
+       my $fcode = lc($ccode);
   
-  my $gi = Geo::IP::PurePerl->new();
-  my $ccode = $gi->country_code_by_name($key[$s]);
-  my $fcode = lc($ccode);
-  
-  $color++;
-  print "<td align='center' $col><form method='post' action='showrequestfromip.dat'><input type='hidden' name='MONTH' value='$cgiparams{'MONTH'}'> <input type='hidden' name='DAY' value='$cgiparams{'DAY'}'> <input type='hidden' name='ip' value='$key[$s]'> <input type='submit' value='$Lang::tr{'details'}'></form></td>";
-  print "<td align='center' $col><a href='/cgi-bin/ipinfo.cgi?ip=$key[$s]'>$key[$s]</a></td>";
-
-  # Get flag icon for of the country.
-  my $flag_icon = &GeoIP::get_flag_icon($ccode);
-
-  if ( $flag_icon ) {
-       print "<td align='center' $col><a href='/cgi-bin/country.cgi#$fcode'><img src='$flag_icon' border='0' align='absmiddle' alt='$ccode' title='$ccode'></a></td>";
-  } else {
-       print "<td align='center' $col></td>";
-  }
-
-  print "<td align='center' $col>$value[$s]</td>";
-  print "<td align='center' $col>$percent</td>";
-  print "</tr>";
-  }
+       $color++;
+       print "<td align='center' $col><form method='post' action='showrequestfromip.dat'><input type='hidden' name='MONTH' value='$cgiparams{'MONTH'}'> <input type='hidden' name='DAY' value='$cgiparams{'DAY'}'> <input type='hidden' name='ip' value='$key[$s]'> <input type='submit' value='$Lang::tr{'details'}'></form></td>";
+       print "<td align='center' $col><a href='/cgi-bin/ipinfo.cgi?ip=$key[$s]'>$key[$s]</a></td>";
+
+       # Get flag icon for of the country.
+       my $flag_icon = &GeoIP::get_flag_icon($ccode);
+
+       if ( $flag_icon ) {
+               print "<td align='center' $col><a href='/cgi-bin/country.cgi#$fcode'><img src='$flag_icon' border='0' align='absmiddle' alt='$ccode' title='$ccode'></a></td>";
+       } else {
+               print "<td align='center' $col></td>";
+       }
+
+       print "<td align='center' $col>$value[$s]</td>";
+       print "<td align='center' $col>$percent</td>";
+       print "</tr>";
+}
 
 if($cgiparams{'otherspie'} == 2 ){}
 else{
-  my $colorIndex = $color % 10;
-  if($colorIndex == 0) {
-    $colorIndex = 10;
-  }
-  $col="bgcolor='$color{\"color$colorIndex\"}'";
-  print "<tr>";
-
-if ( $linesjc ne "0")
-{
-my $dif;
-$dif = $linesjc - $total;
-$percent = $dif * 100 / $linesjc;
-$percent = sprintf("%.f", $percent);
-print <<END
-<td align='center' $col></td>
-<td align='center' $col>$Lang::tr{'otherip'}</td>
-<td align='center' $col></td>
-<td align='center' $col>$dif</td>
-<td align='center' $col>$percent</td>
-</tr>
+       # colors are numbered 1 to 10
+       my $colorIndex = ($color % 10) + 1;
+       $col="bgcolor='$color{\"color$colorIndex\"}'";
+       print "<tr>";
+
+       if ( $linesjc ne "0")
+       {
+               my $dif;
+               $dif = $linesjc - $total;
+               $percent = $dif * 100 / $linesjc;
+               $percent = sprintf("%.f", $percent);
+               print <<END
+               <td align='center' $col></td>
+               <td align='center' $col>$Lang::tr{'otherip'}</td>
+               <td align='center' $col></td>
+               <td align='center' $col>$dif</td>
+               <td align='center' $col>$percent</td>
+               </tr>
 END
-;
-}
+               ;
+       }
 }
 print <<END
 </table>
@@ -493,20 +492,20 @@ END
 &Header::closepage();
 
 sub findkey {
-  my $v;
-  foreach $v (@keytabjc) {
-    if ($tabjc{$v} eq $_[0]) {
-      delete $tabjc{$v};
-      $key[$indice] = "$v";
-      $value[$indice] = $_[0];
-      $indice++;
-      last;
-    }
-  }
+       my $v;
+       foreach $v (@keytabjc) {
+               if ($tabjc{$v} eq $_[0]) {
+                       delete $tabjc{$v};
+                       $key[$indice] = "$v";
+                       $value[$indice] = $_[0];
+                       $indice++;
+                       last;
+               }
+       }
 }
 
 sub checkversion {
-    #Automatic Updates is disabled
-    return "0","0";
+       #Automatic Updates is disabled
+       return "0","0";
 }
 
index 5b0db62314df237f3db248040b7e14815e722caa..fbc92e43bbc09173ebb5ad59f9c26365698a24b0 100644 (file)
@@ -8,7 +8,7 @@
 # page inspired from the initial firewalllog.dat
 #
 # Modified for IPFire by Christian Schmidt
-#                            and Michael Tremer (www.ipfire.org)
+#                       and Michael Tremer (www.ipfire.org)
 
 use strict;
 
@@ -40,11 +40,11 @@ $cgiparams{'showpie'} = 1;
 $cgiparams{'sortcolumn'} = 1;
 
 my @shortmonths = ( 'Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug',
-        'Sep', 'Oct', 'Nov', 'Dec' );
+       'Sep', 'Oct', 'Nov', 'Dec' );
 my @longmonths = ( $Lang::tr{'january'}, $Lang::tr{'february'}, $Lang::tr{'march'},
-        $Lang::tr{'april'}, $Lang::tr{'may'}, $Lang::tr{'june'}, $Lang::tr{'july'}, $Lang::tr{'august'},
-        $Lang::tr{'september'}, $Lang::tr{'october'}, $Lang::tr{'november'},
-        $Lang::tr{'december'} );
+       $Lang::tr{'april'}, $Lang::tr{'may'}, $Lang::tr{'june'}, $Lang::tr{'july'}, $Lang::tr{'august'},
+       $Lang::tr{'september'}, $Lang::tr{'october'}, $Lang::tr{'november'},
+       $Lang::tr{'december'} );
 
 my @now = localtime();
 my $dow = $now[6];
@@ -70,81 +70,81 @@ if ($cgiparams{'sortcolumn'} != 0) { $settings{'sortcolumn'} = $cgiparams{'sortc
 
 if ($cgiparams{'ACTION'} eq $Lang::tr{'save'})
 {
-   &General::writehash("${General::swroot}/fwlogs/portsettings", \%settings);
+       &General::writehash("${General::swroot}/fwlogs/portsettings", \%settings);
 }
 
 my $start = -1;
 if ($ENV{'QUERY_STRING'} && $cgiparams{'ACTION'} ne $Lang::tr{'update'})
 {
-        my @temp = split(',',$ENV{'QUERY_STRING'});
-        $start = $temp[0];
-        $cgiparams{'MONTH'} = $temp[1];
-        $cgiparams{'DAY'} = $temp[2];
+       my @temp = split(',',$ENV{'QUERY_STRING'});
+       $start = $temp[0];
+       $cgiparams{'MONTH'} = $temp[1];
+       $cgiparams{'DAY'} = $temp[2];
 }
 
 if (!($cgiparams{'MONTH'} =~ /^(0|1|2|3|4|5|6|7|8|9|10|11)$/) ||
     !($cgiparams{'DAY'} =~ /^(1|2|3|4|5|6|7|8|9|10|11|12|13|14|15|16|17|18|19|20|21|22|23|24|25|26|27|28|29|30|31)$/))
 {
-        $cgiparams{'DAY'} = $now[3];
-        $cgiparams{'MONTH'} = $now[4];
+       $cgiparams{'DAY'} = $now[3];
+       $cgiparams{'MONTH'} = $now[4];
 }
 elsif($cgiparams{'ACTION'} eq '>>')
 {
-        my @temp_then=();
-        my @temp_now = localtime(time);
-        $temp_now[4] = $cgiparams{'MONTH'};
-        $temp_now[3] = $cgiparams{'DAY'};
-        @temp_then = localtime(POSIX::mktime(@temp_now) + 86400);
-           ## Retrieve the same time on the next day -
-           ## 86400 seconds in a day
-        $cgiparams{'MONTH'} = $temp_then[4];
-        $cgiparams{'DAY'} = $temp_then[3];
+       my @temp_then=();
+       my @temp_now = localtime(time);
+       $temp_now[4] = $cgiparams{'MONTH'};
+       $temp_now[3] = $cgiparams{'DAY'};
+       @temp_then = localtime(POSIX::mktime(@temp_now) + 86400);
+          ## Retrieve the same time on the next day -
+          ## 86400 seconds in a day
+       $cgiparams{'MONTH'} = $temp_then[4];
+       $cgiparams{'DAY'} = $temp_then[3];
 }
 elsif($cgiparams{'ACTION'} eq '<<')
 {
-        my @temp_then=();
-        my @temp_now = localtime(time);
-        $temp_now[4] = $cgiparams{'MONTH'};
-        $temp_now[3] = $cgiparams{'DAY'};
-        @temp_then = localtime(POSIX::mktime(@temp_now) - 86400);
-           ## Retrieve the same time on the previous day -
-           ## 86400 seconds in a day
-        $cgiparams{'MONTH'} = $temp_then[4];
-        $cgiparams{'DAY'} = $temp_then[3];
+       my @temp_then=();
+       my @temp_now = localtime(time);
+       $temp_now[4] = $cgiparams{'MONTH'};
+       $temp_now[3] = $cgiparams{'DAY'};
+       @temp_then = localtime(POSIX::mktime(@temp_now) - 86400);
+          ## Retrieve the same time on the previous day -
+          ## 86400 seconds in a day
+       $cgiparams{'MONTH'} = $temp_then[4];
+       $cgiparams{'DAY'} = $temp_then[3];
 }
 
 if (($cgiparams{'DAY'} ne $now[3]) || ($cgiparams{'MONTH'} ne $now[4]))
 {
-        my @then = ();
-        if ( (  $cgiparams{'MONTH'} eq $now[4]) && ($cgiparams{'DAY'} > $now[3]) ||
-                        ( $cgiparams{'MONTH'} > $now[4] ) ) {
-                @then = localtime(POSIX::mktime( 0, 0, 0, $cgiparams{'DAY'}, $cgiparams{'MONTH'}, $year - 1901 ));
-        } else {
-                @then = localtime(POSIX::mktime( 0, 0, 0, $cgiparams{'DAY'}, $cgiparams{'MONTH'}, $year - 1900 ));
-        }
-        $tdoy = $then[7];
-        my $lastleap=($year-1)%4;
-        if ($tdoy>$doy) {
-                if ($lastleap == 0 && $tdoy < 60) {
-                        $doy=$tdoy+366;
-                } else {
-                        $doy=$doy+365;
-                }
-        }
+       my @then = ();
+       if ( (  $cgiparams{'MONTH'} eq $now[4]) && ($cgiparams{'DAY'} > $now[3]) ||
+            ( $cgiparams{'MONTH'} > $now[4] ) ) {
+               @then = localtime(POSIX::mktime( 0, 0, 0, $cgiparams{'DAY'}, $cgiparams{'MONTH'}, $year - 1901 ));
+       } else {
+               @then = localtime(POSIX::mktime( 0, 0, 0, $cgiparams{'DAY'}, $cgiparams{'MONTH'}, $year - 1900 ));
+       }
+       $tdoy = $then[7];
+       my $lastleap=($year-1)%4;
+       if ($tdoy>$doy) {
+               if ($lastleap == 0 && $tdoy < 60) {
+                       $doy=$tdoy+366;
+               } else {
+                       $doy=$doy+365;
+               }
+       }
 }
 
 my $datediff=0;
 my $dowd=0;
 my $multifile=0;
 if ($tdoy ne $doy) {
-        $datediff=int(($doy-$tdoy)/7);
-        $dowd=($doy-$tdoy)%7;
-        if (($dow-$dowd)<1) {
-                $datediff=$datediff+1;
-        }
-        if (($dow-$dowd)==0) {
-                $multifile=1;
-        }
+       $datediff=int(($doy-$tdoy)/7);
+       $dowd=($doy-$tdoy)%7;
+       if (($dow-$dowd)<1) {
+               $datediff=$datediff+1;
+       }
+       if (($dow-$dowd)==0) {
+               $multifile=1;
+       }
 }
 
 my $monthstr = $shortmonths[$cgiparams{'MONTH'}];
@@ -152,62 +152,62 @@ my $longmonthstr = $longmonths[$cgiparams{'MONTH'}];
 my $day = $cgiparams{'DAY'};
 my $daystr='';
 if ($day <= 9) {
-        $daystr = " $day"; }
+       $daystr = " $day"; }
 else {
-        $daystr = $day;
+       $daystr = $day;
 }
 
 my $skip=0;
 my $filestr='';
 if ($datediff==0) {
-        $filestr="/var/log/messages";
+       $filestr="/var/log/messages";
 } else {
-       $filestr="/var/log/messages.$datediff";
-       $filestr = "$filestr.gz" if -f "$filestr.gz";
+       $filestr="/var/log/messages.$datediff";
+       $filestr = "$filestr.gz" if -f "$filestr.gz";
 }
 
 if (!(open (FILE,($filestr =~ /.gz$/ ? "gzip -dc $filestr |" : $filestr)))) {
-        $errormessage = "$Lang::tr{'date not in logs'}: $filestr $Lang::tr{'could not be opened'}";
-        $skip=1;
-        # Note: This is in case the log does not exist for that date
+       $errormessage = "$Lang::tr{'date not in logs'}: $filestr $Lang::tr{'could not be opened'}";
+       $skip=1;
+       # Note: This is in case the log does not exist for that date
 }
 my $lines = 0;
 my @log=();
 
 if (!$skip)
 {
-        while (<FILE>)
-        {
-                if (/(^${monthstr} ${daystr} ..:..:..) [\w\-]+ kernel:.*(IN=.*)$/) {
-                        $log[$lines] = $_;
-                        $lines++;
-                }
-        }
-        close (FILE);   
+       while (<FILE>)
+       {
+               if (/(^${monthstr} ${daystr} ..:..:..) [\w\-]+ kernel:.*(IN=.*)$/) {
+                       $log[$lines] = $_;
+                       $lines++;
+               }
+       }
+       close (FILE);
 }
 
 $skip=0;
 if ($multifile) {
-        $datediff=$datediff-1;
-        if ($datediff==0) {
-                $filestr="/var/log/messages";
-        } else {
-                $filestr="/var/log/messages.$datediff";
-                $filestr = "$filestr.gz" if -f "$filestr.gz";
-        }
-        if (!(open (FILE,($filestr =~ /.gz$/ ? "gzip -dc $filestr |" : $filestr)))) {
-                $errormessage="$Lang::tr{'date not in logs'}: $filestr $Lang::tr{'could not be opened'}";
-                $skip=1;
-        }
-        if (!$skip) {
-                while (<FILE>) {
-                        if (/(^${monthstr} ${daystr} ..:..:..) [\w\-]+ kernel:.*(IN=.*)$/) {
-                                $log[$lines] = $_;
-                                $lines++;
-                        }
-                }
-                close (FILE);
-        }
+       $datediff=$datediff-1;
+       if ($datediff==0) {
+               $filestr="/var/log/messages";
+       } else {
+               $filestr="/var/log/messages.$datediff";
+               $filestr = "$filestr.gz" if -f "$filestr.gz";
+       }
+       if (!(open (FILE,($filestr =~ /.gz$/ ? "gzip -dc $filestr |" : $filestr)))) {
+               $errormessage="$Lang::tr{'date not in logs'}: $filestr $Lang::tr{'could not be opened'}";
+               $skip=1;
+       }
+       if (!$skip) {
+               while (<FILE>) {
+                       if (/(^${monthstr} ${daystr} ..:..:..) [\w\-]+ kernel:.*(IN=.*)$/) {
+                               $log[$lines] = $_;
+                               $lines++;
+                       }
+               }
+               close (FILE);
+       }
 }
 
 my $MODNAME="fwlogs";
@@ -217,9 +217,9 @@ my $MODNAME="fwlogs";
 &Header::openbigbox('100%', 'left', '', $errormessage);
 
 if ($errormessage) {
-        &Header::openbox('100%', 'left', $Lang::tr{'error messages'});
-        print "<font class='base'>$errormessage&nbsp;</font>\n";
-        &Header::closebox();
+       &Header::openbox('100%', 'left', $Lang::tr{'error messages'});
+       print "<font class='base'>$errormessage&nbsp;</font>\n";
+       &Header::closebox();
 }
 
 &Header::openbox('100%', 'left', "$Lang::tr{'settings'}");
@@ -228,33 +228,33 @@ print <<END
 <form method='post' action='$ENV{'SCRIPT_NAME'}'>
 <table width='100%'>
 <tr>
-        <td width='10%' class='base'>$Lang::tr{'month'}:&nbsp;</td>
-        <td width='10%'>
-        <select name='MONTH'>
+       <td width='10%' class='base'>$Lang::tr{'month'}:&nbsp;</td>
+       <td width='10%'>
+       <select name='MONTH'>
 END
 ;
 my $month;
 for ($month = 0; $month < 12; $month++)
 {
-        print "\t<option ";
-        if ($month == $cgiparams{'MONTH'}) {
-                print "selected='selected' "; }
-        print "value='$month'>$longmonths[$month]</option>\n";
+       print "\t<option ";
+       if ($month == $cgiparams{'MONTH'}) {
+               print "selected='selected' "; }
+       print "value='$month'>$longmonths[$month]</option>\n";
 }
 print <<END
-        </select>
-        </td>
-        <td width='10%' class='base' align='right'>&nbsp;$Lang::tr{'day'}:&nbsp;</td>
-        <td width='40%'>
-        <select name='DAY'>
+       </select>
+       </td>
+       <td width='10%' class='base' align='right'>&nbsp;$Lang::tr{'day'}:&nbsp;</td>
+       <td width='40%'>
+       <select name='DAY'>
 END
 ;
 for ($day = 1; $day <= 31; $day++) 
 {
-        print "\t<option ";
-        if ($day == $cgiparams{'DAY'}) {
-                print "selected='selected' "; }
-        print "value='$day'>$day</option>\n";
+       print "\t<option ";
+       if ($day == $cgiparams{'DAY'}) {
+               print "selected='selected' "; }
+       print "value='$day'>$day</option>\n";
 }
 
 if( $cgiparams{'pienumber'} != 0){$pienumber=$cgiparams{'pienumber'};}
@@ -291,11 +291,11 @@ if ($pienumber == -1 || $pienumber > $lines || $sortcolumn == 2) { $pienumber =
 $lines = 0;
 foreach $_ (@log)
 {
-  if($_ =~  /DPT\=([\d\.]+)/){
-    $tabjc{$1} = $tabjc{$1} + 1 ;
-    if(($tabjc{$1} == 1) && ($lines < $pienumber)) { $lines = $lines + 1; }
-    $linesjc++;
-  }
+       if($_ =~  /DPT\=([\d\.]+)/){
+               $tabjc{$1} = $tabjc{$1} + 1 ;
+               if(($tabjc{$1} == 1) && ($lines < $pienumber)) { $lines = $lines + 1; }
+               $linesjc++;
+       }
 }
 
 $pienumber = $lines;
@@ -317,11 +317,11 @@ my @tabjc2;
 
 if ($sortcolumn == 1)
 {
-        @tabjc2 = sort { $b <=> $a } values (%tabjc);
+       @tabjc2 = sort { $b <=> $a } values (%tabjc);
 }
 else
 {
-        @tabjc2 = sort { $a <=> $b } keys (%tabjc);
+       @tabjc2 = sort { $a <=> $b } keys (%tabjc);
 }
 
 my $color=10;
@@ -338,17 +338,17 @@ my $v;
 
 if ($sortcolumn == 1)
 {
-        for ($v=0;$v<$pienumber;$v++){
-          findkey($tabjc2[$v]);
-        }
+       for ($v=0;$v<$pienumber;$v++){
+               findkey($tabjc2[$v]);
+       }
 }
 else
 {
-        foreach $v (@tabjc2) {
-          $key[$indice] = $v;
-          $value[$indice] = $tabjc{$v};
-          $indice++;
-        }
+       foreach $v (@tabjc2) {
+               $key[$indice] = $v;
+               $value[$indice] = $tabjc{$v};
+               $indice++;
+       }
 }
 
 my @ports;
@@ -361,15 +361,15 @@ my $o;
 
 if($cgiparams{'otherspie'} == 2 ){}
 else{ 
-        my $numothers;
-        for($o=0;$o<$pienumber;$o++){
-          $numothers = $numothers + $numb[$o];
-        }
-        $numothers =  $linesjc - $numothers;
-        if ($numothers > 0) {
-                $ports[$pienumber]="$Lang::tr{'otherport'}";
-                $numb[$pienumber] =  $numothers;
-        }
+       my $numothers;
+       for($o=0;$o<$pienumber;$o++){
+               $numothers = $numothers + $numb[$o];
+       }
+       $numothers =  $linesjc - $numothers;
+       if ($numothers > 0) {
+               $ports[$pienumber]="$Lang::tr{'otherport'}";
+               $numb[$pienumber] =  $numothers;
+       }
 }
 
 my @data = (\@ports,\@numb);
@@ -381,28 +381,28 @@ my %mainsettings = ();
 &General::readhash("/srv/web/ipfire/html/themes/".$mainsettings{'THEME'}."/include/colors.txt", \%color);
 
 if ($showpie != 2 && $pienumber <= 50 && $pienumber != 0) {
-        my $mygraph = GD::Graph::pie->new(500, 350);
-        $mygraph->set(
-              'title' => '',
-              'pie_height' => 50,
-              'start_angle' => 89
-             ) or warn $mygraph->error;
-
-        $mygraph->set_value_font(GD::gdMediumBoldFont);
-        $mygraph->set( dclrs => [ "$color{'color1'}" , "$color{'color2'}" , "$color{'color3'}" , "$color{'color4'}" , "$color{'color5'}" , "$color{'color6'}" , "$color{'color7'}" , "$color{'color8'}" , "$color{'color9'}" , "$color{'color10'}" ] );
-        my $myimage = $mygraph->plot(\@data) or die $mygraph->error;
-
-        my @filenames = glob("/srv/web/ipfire/html/graphs/fwlog-port*.png");
-        unlink(@filenames);
-        my $imagerandom = rand(1000000);
-        my $imagename = "/srv/web/ipfire/html/graphs/fwlog-port$imagerandom.png";
-        open(FILE,">$imagename");
-        print FILE $myimage->png;
-        close(FILE);
-        #####################################################
-        print "<div style='text-align:center'>";
-        print "<img src='/graphs/fwlog-port$imagerandom.png'>";
-        print "</div>";
+       my $mygraph = GD::Graph::pie->new(500, 350);
+       $mygraph->set(
+               'title' => '',
+               'pie_height' => 50,
+               'start_angle' => 89
+       ) or warn $mygraph->error;
+
+       $mygraph->set_value_font(GD::gdMediumBoldFont);
+       $mygraph->set( dclrs => [ "$color{'color1'}" , "$color{'color2'}" , "$color{'color3'}" , "$color{'color4'}" , "$color{'color5'}" , "$color{'color6'}" , "$color{'color7'}" , "$color{'color8'}" , "$color{'color9'}" , "$color{'color10'}" ] );
+       my $myimage = $mygraph->plot(\@data) or die $mygraph->error;
+
+       my @filenames = glob("/srv/web/ipfire/html/graphs/fwlog-port*.png");
+       unlink(@filenames);
+       my $imagerandom = rand(1000000);
+       my $imagename = "/srv/web/ipfire/html/graphs/fwlog-port$imagerandom.png";
+       open(FILE,">$imagename");
+       print FILE $myimage->png;
+       close(FILE);
+       #####################################################
+       print "<div style='text-align:center'>";
+       print "<img src='/graphs/fwlog-port$imagerandom.png'>";
+       print "</div>";
 }
 
 print <<END
@@ -425,49 +425,44 @@ my $col="";
 
 for($s=0;$s<$lines;$s++)
 {
-  $show++;
-  $percent = $value[$s] * 100 / $linesjc;
-  $percent = sprintf("%.f", $percent);
-  $total = $total + $value[$s];
-  my $colorIndex = $color % 10;
-  if($colorIndex == 0) {
-    $colorIndex = 10;
-  }
-  $col="bgcolor='$color{\"color$colorIndex\"}'";
-  print "<tr>";
-
-  $color++;
-  print "<td align='center' $col><form method='post' action='showrequestfromport.dat'><input type='hidden' name='MONTH' value='$cgiparams{'MONTH'}'> <input type='hidden' name='DAY' value='$cgiparams{'DAY'}'> <input type='hidden' name='port' value='$key[$s]'> <input type='submit' value='$Lang::tr{'details'}'></form></td>";
-  print "<td align='center' $col>$key[$s]</td>";
-  print "<td align='center' $col>$value[$s]</td>";
-  print "<td align='center' $col>$percent</td>";
-  print "</tr>";
+       $show++;
+       $percent = $value[$s] * 100 / $linesjc;
+       $percent = sprintf("%.f", $percent);
+       $total = $total + $value[$s];
+       # colors are numbered 1 to 10
+       my $colorIndex = ($color % 10) + 1;
+       $col="bgcolor='$color{\"color$colorIndex\"}'";
+       print "<tr>";
+
+       $color++;
+       print "<td align='center' $col><form method='post' action='showrequestfromport.dat'><input type='hidden' name='MONTH' value='$cgiparams{'MONTH'}'> <input type='hidden' name='DAY' value='$cgiparams{'DAY'}'> <input type='hidden' name='port' value='$key[$s]'> <input type='submit' value='$Lang::tr{'details'}'></form></td>";
+       print "<td align='center' $col>$key[$s]</td>";
+       print "<td align='center' $col>$value[$s]</td>";
+       print "<td align='center' $col>$percent</td>";
+       print "</tr>";
 }
 
 if($cgiparams{'otherspie'} == 2 ){}
 else{
-  my $colorIndex = $color % 10;
-  if($colorIndex == 0) {
-    $colorIndex = 10;
-  }
-  $col="bgcolor='$color{\"color$colorIndex\"}'";
-  print "<tr>";
-
-if ( $linesjc ne "0")
-{
-my $dif;
-$dif = $linesjc - $total;
-$percent = $dif * 100 / $linesjc;
-$percent = sprintf("%.f", $percent);
-print <<END
-<td align='center' $col></td>
-<td align='center' $col>$Lang::tr{'otherport'}</td>
-<td align='center' $col>$dif</td>
-<td align='center' $col>$percent</td>
-</tr>
+       # colors are numbered 1 to 10
+       my $colorIndex = ($color % 10) + 1;
+       $col="bgcolor='$color{\"color$colorIndex\"}'";
+       print "<tr>";
+
+       if ( $linesjc ne "0") {
+               my $dif;
+               $dif = $linesjc - $total;
+               $percent = $dif * 100 / $linesjc;
+               $percent = sprintf("%.f", $percent);
+               print <<END
+               <td align='center' $col></td>
+               <td align='center' $col>$Lang::tr{'otherport'}</td>
+               <td align='center' $col>$dif</td>
+               <td align='center' $col>$percent</td>
+               </tr>
 END
-;
-}
+               ;
+       }
 }
 print <<END
 </table>
@@ -479,20 +474,20 @@ END
 &Header::closepage();
 
 sub findkey {
-  my $v;
-  foreach $v (@keytabjc) {
-    if ($tabjc{$v} eq $_[0]) {
-      delete $tabjc{$v};
-      $key[$indice] = "$v";
-      $value[$indice] = $_[0];
-      $indice++;
-      last;
-    }
-  }
+       my $v;
+       foreach $v (@keytabjc) {
+               if ($tabjc{$v} eq $_[0]) {
+                       delete $tabjc{$v};
+                       $key[$indice] = "$v";
+                       $value[$indice] = $_[0];
+                       $indice++;
+                       last;
+               }
+       }
 }
 
 sub checkversion {
-    #Automatic Updates is disabled
-    return "0","0";
+               #Automatic Updates is disabled
+               return "0","0";
 }
 
index 5283c426b88de0e9059231fa829c4030b646cb35..cd97f878075b30de5b32376d3fccdcbb056303cf 100644 (file)
@@ -69,60 +69,60 @@ if (!($cgiparams{'MONTH'} =~ /^(0|1|2|3|4|5|6|7|8|9|10|11)$/) ||
 }
 elsif($cgiparams{'ACTION'} eq '>>')
 {
-        my @temp_then=();
-        my @temp_now = localtime(time);
-        $temp_now[4] = $cgiparams{'MONTH'};
-        $temp_now[3] = $cgiparams{'DAY'};
-        @temp_then = localtime(POSIX::mktime(@temp_now) + 86400);
-           ## Retrieve the same time on the next day -
-           ## 86400 seconds in a day
-        $cgiparams{'MONTH'} = $temp_then[4];
-        $cgiparams{'DAY'} = $temp_then[3];
+       my @temp_then=();
+       my @temp_now = localtime(time);
+       $temp_now[4] = $cgiparams{'MONTH'};
+       $temp_now[3] = $cgiparams{'DAY'};
+       @temp_then = localtime(POSIX::mktime(@temp_now) + 86400);
+          ## Retrieve the same time on the next day -
+          ## 86400 seconds in a day
+       $cgiparams{'MONTH'} = $temp_then[4];
+       $cgiparams{'DAY'} = $temp_then[3];
 }
 elsif($cgiparams{'ACTION'} eq '<<')
 {
-        my @temp_then=();
-        my @temp_now = localtime(time);
-        $temp_now[4] = $cgiparams{'MONTH'};
-        $temp_now[3] = $cgiparams{'DAY'};
-        @temp_then = localtime(POSIX::mktime(@temp_now) - 86400);
-           ## Retrieve the same time on the previous day -
-           ## 86400 seconds in a day
-        $cgiparams{'MONTH'} = $temp_then[4];
-        $cgiparams{'DAY'} = $temp_then[3];
+       my @temp_then=();
+       my @temp_now = localtime(time);
+       $temp_now[4] = $cgiparams{'MONTH'};
+       $temp_now[3] = $cgiparams{'DAY'};
+       @temp_then = localtime(POSIX::mktime(@temp_now) - 86400);
+          ## Retrieve the same time on the previous day -
+          ## 86400 seconds in a day
+       $cgiparams{'MONTH'} = $temp_then[4];
+       $cgiparams{'DAY'} = $temp_then[3];
 }
 
 if (($cgiparams{'DAY'} ne $now[3]) || ($cgiparams{'MONTH'} ne $now[4]))
 {
-        my @then = ();
-        if ( (  $cgiparams{'MONTH'} eq $now[4]) && ($cgiparams{'DAY'} > $now[3]) ||
-                        ( $cgiparams{'MONTH'} > $now[4] ) ) {
-                @then = localtime(POSIX::mktime( 0, 0, 0, $cgiparams{'DAY'}, $cgiparams{'MONTH'}, $year - 1901 ));
-        } else {
-                @then = localtime(POSIX::mktime( 0, 0, 0, $cgiparams{'DAY'}, $cgiparams{'MONTH'}, $year - 1900 ));
-        }
-        $tdoy = $then[7];
-        my $lastleap=($year-1)%4;
-        if ($tdoy>$doy) {
-                if ($lastleap == 0 && $tdoy < 60) {
-                        $doy=$tdoy+366;
-                } else {
-                        $doy=$doy+365;
-                }
-        }
+       my @then = ();
+       if ( (  $cgiparams{'MONTH'} eq $now[4]) && ($cgiparams{'DAY'} > $now[3]) ||
+                       ( $cgiparams{'MONTH'} > $now[4] ) ) {
+               @then = localtime(POSIX::mktime( 0, 0, 0, $cgiparams{'DAY'}, $cgiparams{'MONTH'}, $year - 1901 ));
+       } else {
+               @then = localtime(POSIX::mktime( 0, 0, 0, $cgiparams{'DAY'}, $cgiparams{'MONTH'}, $year - 1900 ));
+       }
+       $tdoy = $then[7];
+       my $lastleap=($year-1)%4;
+       if ($tdoy>$doy) {
+               if ($lastleap == 0 && $tdoy < 60) {
+                       $doy=$tdoy+366;
+               } else {
+                       $doy=$doy+365;
+               }
+       }
 }
 my $datediff=0;
 my $dowd=0;
 my $multifile=0;
 if ($tdoy ne $doy) {
-        $datediff=int(($doy-$tdoy)/7);
-        $dowd=($doy-$tdoy)%7;
-        if (($dow-$dowd)<1) {
-                $datediff=$datediff+1;
-        }
-        if (($dow-$dowd)==0) {
-                $multifile=1;
-        }
+       $datediff=int(($doy-$tdoy)/7);
+       $dowd=($doy-$tdoy)%7;
+       if (($dow-$dowd)<1) {
+               $datediff=$datediff+1;
+       }
+       if (($dow-$dowd)==0) {
+               $multifile=1;
+       }
 }
 
 my $monthstr = $shortmonths[$cgiparams{'MONTH'}];
@@ -138,16 +138,16 @@ else {
 my $skip=0;
 my $filestr='';
 if ($datediff==0) {
-        $filestr="/var/log/messages";
+       $filestr="/var/log/messages";
 } else {
-       $filestr="/var/log/messages.$datediff";
-       $filestr = "$filestr.gz" if -f "$filestr.gz";
+       $filestr="/var/log/messages.$datediff";
+       $filestr = "$filestr.gz" if -f "$filestr.gz";
 }
 
 if (!(open (FILE,($filestr =~ /.gz$/ ? "gzip -dc $filestr |" : $filestr)))) {
-        $errormessage = "$Lang::tr{'date not in logs'}: $filestr $Lang::tr{'could not be opened'}";
-        $skip=1;
-        # Note: This is in case the log does not exist for that date
+       $errormessage = "$Lang::tr{'date not in logs'}: $filestr $Lang::tr{'could not be opened'}";
+       $skip=1;
+       # Note: This is in case the log does not exist for that date
 }
 my $lines = 0;
 my @log=();
@@ -156,24 +156,35 @@ my $gi = Geo::IP::PurePerl->new();
 
 if (!$skip)
 {
-    while (<FILE>)
-    {
-               if (/(^${monthstr} ${daystr} ..:..:..) [\w\-]+ kernel:.*(IN=.*)$/) {
-            my $packet = $2;
-            $packet =~ /IN=(\w+)/;       my $iface=$1; if ( $1 =~ /2./ ){ $iface="";}
-            $packet =~ /SRC=([\d\.]+)/;  my $srcaddr=$1;
-
-            if($iface eq $country) {
-                $log[$lines] = $_;
-                $lines++;
-            }
-            elsif($srcaddr ne '') {
-                my $ccode = $gi->country_code_by_name($srcaddr);
-                if($ccode eq $country){
-                    $log[$lines] = $_;
-                    $lines++;
-                }
-            }
+       while (<FILE>) {
+               # First check whether valid log line (date, day)
+               if (/(^${monthstr} ${daystr} ..:..:..) [\w\-]+ kernel:.*(IN=.*)$/) {
+                       # If ipv6 uses bridge, then use PHYSIN otherwise use IN
+                       if    (/(^${monthstr} ${daystr} ..:..:..) [\w\-]+ kernel:.*(PHYSIN=.*)$/) {}
+                       elsif (/(^${monthstr} ${daystr} ..:..:..) [\w\-]+ kernel:.*(IN=.*)$/) {}
+                       my $packet      = $2;
+                       my $iface = '';
+                       my $srcaddr = '';
+                       # If ipv6 uses bridge, use PHYSIN otherwise IN
+                       if ($packet =~ /PHYSIN=(\w+)/) { $iface = $1; } elsif ($packet =~ /IN=(\w+)/) { $iface = $1; }
+                       # Extract ipv4 and ipv6 addresses
+                       if (($packet =~ /SRC\=(([\d]{1,3})(\.([\d]{1,3})){3})/) or ($packet =~ /SRC\=(([0-9a-fA-F]{0,4})(\:([0-9a-fA-F]{0,4})){2,7})/)) {
+                               $srcaddr = $1; 
+                       }
+
+                       if($iface eq $country) {
+                               # iface matches country code
+                               $log[$lines] = $_;
+                               $lines++;
+                       }
+                       elsif($srcaddr ne '') {
+                               # or srcaddr matches country code
+                               my $ccode = $gi->country_code_by_name($srcaddr);
+                               if($ccode eq uc($country)){
+                                       $log[$lines] = $_;
+                                       $lines++;
+                               }
+                       }
                }
        }
        close (FILE);   
@@ -181,28 +192,40 @@ if (!$skip)
 
 $skip=0;
 if ($multifile) {
-        $datediff=$datediff-1;
-        if ($datediff==0) {
-                $filestr="/var/log/messages";
-        } else {
-                $filestr="/var/log/messages.$datediff";
-                $filestr = "$filestr.gz" if -f "$filestr.gz";
-        }
-        if (!(open (FILE,($filestr =~ /.gz$/ ? "gzip -dc $filestr |" : $filestr)))) {
-                $errormessage="$Lang::tr{'date not in logs'}: $filestr $Lang::tr{'could not be opened'}";
-                $skip=1;
-        }
-        if (!$skip) {
+       $datediff=$datediff-1;
+       if ($datediff==0) {
+               $filestr="/var/log/messages";
+       } else {
+               $filestr="/var/log/messages.$datediff";
+               $filestr = "$filestr.gz" if -f "$filestr.gz";
+       }
+       if (!(open (FILE,($filestr =~ /.gz$/ ? "gzip -dc $filestr |" : $filestr)))) {
+               $errormessage="$Lang::tr{'date not in logs'}: $filestr $Lang::tr{'could not be opened'}";
+               $skip=1;
+       }
+       if (!$skip) {
                while (<FILE>) {
-                       if (/(^${monthstr} ${daystr} ..:..:..) [\w\-]+ kernel:.*(IN=.*)$/) {
-                if($_ =~  /SRC\=([\d\.]+)/){
-                    my $srcaddr=$1;
-                    my $ccode = $gi->country_code_by_name($srcaddr);
-                    if($ccode eq $country){
-                        $log[$lines] = $_;
-                        $lines++;
-                    }
-                }
+                       # Check if valid log line (date, day)
+                       if (/(^${monthstr} ${daystr} ..:..:..) [\w\-]+ kernel:.*(IN=.*)$/) {
+                               my $iface = '';
+                               # If ipv6 uses bridge, then use PHYSIN otherwise IN
+                               if ($_ =~ /PHYSIN=(\w+)/) { $iface = $1; } elsif ($_ =~ /IN=(\w+)/) { $iface = $1; }
+
+                               if($iface eq $country) {
+                                       # iface matches country code
+                                       $log[$lines] = $_;
+                                       $lines++;
+                               }
+                               # extract ipv4 and ipv6 address
+                               elsif (($_ =~ /SRC\=(([\d]{1,3})(\.([\d]{1,3})){3})/) or ($_ =~ /SRC\=(([0-9a-fA-F]{0,4})(\:([0-9a-fA-F]{0,4})){2,7})/)) {
+                                       my $srcaddr=$1;
+                                       my $ccode = $gi->country_code_by_name($srcaddr);
+                                       if($ccode eq uc($country)){
+                                               # or srcaddr matches country code
+                                               $log[$lines] = $_;
+                                               $lines++;
+                                       }
+                               }
                        }
                }
                close (FILE);
@@ -235,7 +258,8 @@ for ($month = 0; $month < 12; $month++)
 {
        print "\t<option ";
        if ($month == $cgiparams{'MONTH'}) {
-               print "selected='selected' "; }
+               print "selected='selected' "; 
+       }
        print "value='$month'>$longmonths[$month]</option>\n";
 }
 print <<END
@@ -272,7 +296,8 @@ END
 print "<p><b>$Lang::tr{'firewall hits'} $longmonthstr $daystr: $lines</b></p>";
 
 if ($start == -1) {
-        $start = $lines - ${Header::viewsize}; }
+       $start = $lines - ${Header::viewsize}; 
+}
 if ($start >= $lines - ${Header::viewsize}) { $start = $lines - ${Header::viewsize}; };
 if ($start < 0) { $start = 0; }
 
@@ -307,65 +332,80 @@ if ($logsettings{'LOGVIEW_REVERSE'} eq 'on') { @slice = reverse @slice; }
 $lines = 0;
 foreach $_ (@slice)
 {
-  $a = $_;
-  /^... (..) (..:..:..) [\w\-]+ kernel:(.*)(IN=.*)$/;
-  my $packet = $4;
-  $packet =~ /IN=(\w+)/;       my $iface=$1; if ( $1 =~ /2./ ){ $iface="";}
-  $packet =~ /SRC=([\d\.]+)/;  my $srcaddr=$1;
-
-  if($iface eq $country || $srcaddr ne '') {
-    my $ccode;
-    if($iface ne $country) {
-      $ccode = $gi->country_code_by_name($srcaddr);
-    }
-    if($iface eq $country || $ccode eq $country) {
-         my $chain = '';
-      my $in = '-'; my $out = '-';
-      my $srcaddr = ''; my $dstaddr = '';
-      my $protostr = '';
-      my $srcport = ''; my $dstport = '';
-
-      $_ =~ /(^.* ..:..:..) [\w\-]+ kernel:(.*)(IN=.*)$/;
-      my $timestamp = $1; my $chain = $2; my $packet = $3;
-      $timestamp =~ /(...) (..) (..:..:..)/;
-      my $month = $1; my $day = $2; my $time = $3;
-
-      if ($a =~ /IN\=(\w+)/) { $iface = $1; }
-      if ($a =~ /OUT\=(\w+)/) { $out = $1; }
-      if ($a =~ /SRC\=([\d\.]+)/) { $srcaddr = $1; }
-      if ($a =~ /DST\=([\d\.]+)/) { $dstaddr = $1; }
-      if ($a =~ /PROTO\=(\w+)/) { $protostr = $1; }
-      my $protostrlc = lc($protostr);
-      if ($a =~  /SPT\=([\d\.]+)/){ $srcport = $1; }
-      if ($a =~  /DPT\=([\d\.]+)/){ $dstport = $1; }
-
-      if ($lines % 2) {
-        print "<tr bgcolor='${Header::table1colour}'>\n"; }
-      else {
-        print "<tr bgcolor='${Header::table2colour}'>\n"; }
-      print <<END
-      <td align='center'>$time</td>
-      <td align='center'>$chain</td>
-      <td align='center'>$iface</td>
-      <td align='center'>$protostr</td>
-      <td align='center'>
-      <table width='100%' cellpadding='0' cellspacing='0'><tr>
-      <td align='center'><a href='/cgi-bin/ipinfo.cgi?ip=$srcaddr'>$srcaddr</a></td>
-      </tr></table>
-      </td>
-      <td align='center'>$srcport</td>
-      <td align='center'>
-      <table width='100%' cellpadding='0' cellspacing='0'><tr>
-      <td align='center'><a href='/cgi-bin/ipinfo.cgi?ip=$dstaddr'>$dstaddr</a></td>
-      </tr></table>
-      </td>
-      <td align='center'>$dstport</td>
-      </tr>
+       $a = $_;
+       # If ipv6 uses bridge, use PHYSIN otherwise use IN
+       if    (/^... (..) (..:..:..) [\w\-]+ kernel:(.*)(PHYSIN=.*)$/) {}
+       elsif (/^... (..) (..:..:..) [\w\-]+ kernel:(.*)(IN=.*)$/) {};
+       my $packet = $4;
+       my $iface = ''; 
+       # If ipv6 uses bridge, use PHYSIN otherwise use IN
+       if ($packet =~ /PHYSIN=(\w+)/) { $iface = $1; } elsif ($packet =~ /IN=(\w+)/) { $iface = $1; }  
+       if ( $1 =~ /2./ ){ $iface=""; }
+       my $srcaddr = '';
+       # Extract ipv4 and ipv6 addresses
+       if (($packet =~ /SRC\=(([\d]{1,3})(\.([\d]{1,3})){3})/) or ($packet =~ /SRC\=(([0-9a-fA-F]{0,4})(\:([0-9a-fA-F]{0,4})){2,7})/)) {
+               $srcaddr = $1;
+       };
+
+       if($iface eq $country || $srcaddr ne '') {
+               my $ccode='';
+               if($iface ne $country) {
+                       $ccode = $gi->country_code_by_name($srcaddr);
+               }
+               if($iface eq $country || $ccode eq uc($country)) {
+                       my $chain = '';
+                       my $in = '-'; my $out = '-';
+                       my $srcaddr = ''; my $dstaddr = '';
+                       my $protostr = '';
+                       my $srcport = ''; my $dstport = '';
+
+                       # If ipv6 uses bridge, the use PHYSIN otherwise use IN
+                       if    ($_ =~ /(^.* ..:..:..) [\w\-]+ kernel:(.*)(IN=.*)(PHYSIN=.*)$/) {}
+                       elsif ($_ =~ /(^.* ..:..:..) [\w\-]+ kernel:(.*)(IN=.*)$/) {}
+                       my $timestamp = $1; my $chain = $2; my $packet = $3;
+                       $timestamp =~ /(...) (..) (..:..:..)/;
+                       my $month = $1; my $day = $2; my $time = $3;
+
+                       # If ipv6 uses bridge, use PHYSIN and PHYSOUT, otherwise use IN and OUT
+                       if ($a =~ /PHYSIN=(\w+)/)  { $iface = $1; } elsif ($a =~ /IN=(\w+)/)  { $iface = $1; }
+                       if ($a =~ /PHYSOUT=(\w+)/) { $out = $1; }   elsif ($a =~ /OUT=(\w+)/) { $out = $1; }
+                       # Extract ipv4 and ipv6 addresses
+                       if (($a =~ /SRC\=(([\d]{1,3})(\.([\d]{1,3})){3})/) or ($a =~ /SRC\=(([0-9a-fA-F]{0,4})(\:([0-9a-fA-F]{0,4})){2,7})/)) { $srcaddr = $1; }
+                       if (($a =~ /DST\=(([\d]{1,3})(\.([\d]{1,3})){3})/) or ($a =~ /DST\=(([0-9a-fA-F]{0,4})(\:([0-9a-fA-F]{0,4})){2,7})/)) { $dstaddr = $1; }
+                       if ($a =~ /PROTO\=(\w+)/) { $protostr = $1; }
+                       my $protostrlc = lc($protostr);
+                       if ($a =~ /SPT\=([\d\.]+)/){ $srcport = $1; }
+                       if ($a =~ /DPT\=([\d\.]+)/){ $dstport = $1; }
+
+                       if ($lines % 2) {
+                               print "<tr bgcolor='${Header::table1colour}'>\n"; 
+                       }
+                       else {
+                               print "<tr bgcolor='${Header::table2colour}'>\n"; 
+                       }
+                       print <<END
+                       <td align='center'>$time</td>
+                       <td align='center'>$chain</td>
+                       <td align='center'>$iface</td>
+                       <td align='center'>$protostr</td>
+                       <td align='center'>
+                       <table width='100%' cellpadding='0' cellspacing='0'><tr>
+                       <td align='center'><a href='/cgi-bin/ipinfo.cgi?ip=$srcaddr'>$srcaddr</a></td>
+                       </tr></table>
+                       </td>
+                       <td align='center'>$srcport</td>
+                       <td align='center'>
+                       <table width='100%' cellpadding='0' cellspacing='0'><tr>
+                       <td align='center'><a href='/cgi-bin/ipinfo.cgi?ip=$dstaddr'>$dstaddr</a></td>
+                       </tr></table>
+                       </td>
+                       <td align='center'>$dstport</td>
+                       </tr>
 END
-       ;
-      $lines++;
-    }
-  }
+                       ;
+                       $lines++;
+               }
+       }
 }
 
 print <<END
@@ -383,30 +423,34 @@ END
 
 sub oldernewer
 {
-  print <<END
-  <table width='100%'>
-  <tr>
+       print <<END
+       <table width='100%'>
+       <tr>
 END
-;
+       ;
 
-  print "<td align='center' width='50%'>";
-  if ($prev != -1) {
-    print "<a href='/cgi-bin/logs.cgi/showrequestfromcountry.dat?$prev,$cgiparams{'MONTH'},$cgiparams{'DAY'},$cgiparams{country}'>$Lang::tr{'older'}</a>"; }
-  else {
-    print "$Lang::tr{'older'}"; }
-  print "</td>\n";
+       print "<td align='center' width='50%'>";
+       if ($prev != -1) {
+               print "<a href='/cgi-bin/logs.cgi/showrequestfromcountry.dat?$prev,$cgiparams{'MONTH'},$cgiparams{'DAY'},$cgiparams{country}'>$Lang::tr{'older'}</a>"; 
+       }
+       else {
+               print "$Lang::tr{'older'}"; 
+       }
+       print "</td>\n";
 
-  print "<td align='center' width='50%'>";
-  if ($next != -1) {
-    print "<a href='/cgi-bin/logs.cgi/showrequestfromcountry.dat?$next,$cgiparams{'MONTH'},$cgiparams{'DAY'},$cgiparams{country}'>$Lang::tr{'newer'}</a>"; }
-  else {
-   print "$Lang::tr{'newer'}"; }
-  print "</td>\n";
+       print "<td align='center' width='50%'>";
+       if ($next != -1) {
+               print "<a href='/cgi-bin/logs.cgi/showrequestfromcountry.dat?$next,$cgiparams{'MONTH'},$cgiparams{'DAY'},$cgiparams{country}'>$Lang::tr{'newer'}</a>"; 
+       }
+       else {
+               print "$Lang::tr{'newer'}"; 
+       }
 
-print <<END
-  </tr>
-  </table>
+       print "</td>\n";
+       print <<END
+       </tr>
+       </table>
 END
-;
+       ;
 }
 
index 09a60b519bc1fb6ad20bea38253775ea023b32d5..154fa40309dcc36d1ebb45bd0622757fdb64677c 100644 (file)
@@ -66,60 +66,60 @@ if (!($cgiparams{'MONTH'} =~ /^(0|1|2|3|4|5|6|7|8|9|10|11)$/) ||
 }
 elsif($cgiparams{'ACTION'} eq '>>')
 {
-        my @temp_then=();
-        my @temp_now = localtime(time);
-        $temp_now[4] = $cgiparams{'MONTH'};
-        $temp_now[3] = $cgiparams{'DAY'};
-        @temp_then = localtime(POSIX::mktime(@temp_now) + 86400);
-           ## Retrieve the same time on the next day -
-           ## 86400 seconds in a day
-        $cgiparams{'MONTH'} = $temp_then[4];
-        $cgiparams{'DAY'} = $temp_then[3];
+       my @temp_then=();
+       my @temp_now = localtime(time);
+       $temp_now[4] = $cgiparams{'MONTH'};
+       $temp_now[3] = $cgiparams{'DAY'};
+       @temp_then = localtime(POSIX::mktime(@temp_now) + 86400);
+          ## Retrieve the same time on the next day -
+          ## 86400 seconds in a day
+       $cgiparams{'MONTH'} = $temp_then[4];
+       $cgiparams{'DAY'} = $temp_then[3];
 }
 elsif($cgiparams{'ACTION'} eq '<<')
 {
-        my @temp_then=();
-        my @temp_now = localtime(time);
-        $temp_now[4] = $cgiparams{'MONTH'};
-        $temp_now[3] = $cgiparams{'DAY'};
-        @temp_then = localtime(POSIX::mktime(@temp_now) - 86400);
-           ## Retrieve the same time on the previous day -
-           ## 86400 seconds in a day
-        $cgiparams{'MONTH'} = $temp_then[4];
-        $cgiparams{'DAY'} = $temp_then[3];
+       my @temp_then=();
+       my @temp_now = localtime(time);
+       $temp_now[4] = $cgiparams{'MONTH'};
+       $temp_now[3] = $cgiparams{'DAY'};
+       @temp_then = localtime(POSIX::mktime(@temp_now) - 86400);
+          ## Retrieve the same time on the previous day -
+          ## 86400 seconds in a day
+       $cgiparams{'MONTH'} = $temp_then[4];
+       $cgiparams{'DAY'} = $temp_then[3];
 }
 
 if (($cgiparams{'DAY'} ne $now[3]) || ($cgiparams{'MONTH'} ne $now[4]))
 {
-        my @then = ();
-        if ( (  $cgiparams{'MONTH'} eq $now[4]) && ($cgiparams{'DAY'} > $now[3]) ||
-                        ( $cgiparams{'MONTH'} > $now[4] ) ) {
-                @then = localtime(POSIX::mktime( 0, 0, 0, $cgiparams{'DAY'}, $cgiparams{'MONTH'}, $year - 1901 ));
-        } else {
-                @then = localtime(POSIX::mktime( 0, 0, 0, $cgiparams{'DAY'}, $cgiparams{'MONTH'}, $year - 1900 ));
-        }
-        $tdoy = $then[7];
-        my $lastleap=($year-1)%4;
-        if ($tdoy>$doy) {
-                if ($lastleap == 0 && $tdoy < 60) {
-                        $doy=$tdoy+366;
-                } else {
-                        $doy=$doy+365;
-                }
-        }
+       my @then = ();
+       if ( (  $cgiparams{'MONTH'} eq $now[4]) && ($cgiparams{'DAY'} > $now[3]) ||
+                       ( $cgiparams{'MONTH'} > $now[4] ) ) {
+               @then = localtime(POSIX::mktime( 0, 0, 0, $cgiparams{'DAY'}, $cgiparams{'MONTH'}, $year - 1901 ));
+       } else {
+               @then = localtime(POSIX::mktime( 0, 0, 0, $cgiparams{'DAY'}, $cgiparams{'MONTH'}, $year - 1900 ));
+       }
+       $tdoy = $then[7];
+       my $lastleap=($year-1)%4;
+       if ($tdoy>$doy) {
+               if ($lastleap == 0 && $tdoy < 60) {
+                       $doy=$tdoy+366;
+               } else {
+                       $doy=$doy+365;
+               }
+       }
 }
 my $datediff=0;
 my $dowd=0;
 my $multifile=0;
 if ($tdoy ne $doy) {
-        $datediff=int(($doy-$tdoy)/7);
-        $dowd=($doy-$tdoy)%7;
-        if (($dow-$dowd)<1) {
-                $datediff=$datediff+1;
-        }
-        if (($dow-$dowd)==0) {
-                $multifile=1;
-        }
+       $datediff=int(($doy-$tdoy)/7);
+       $dowd=($doy-$tdoy)%7;
+       if (($dow-$dowd)<1) {
+               $datediff=$datediff+1;
+       }
+       if (($dow-$dowd)==0) {
+               $multifile=1;
+       }
 }
 
 my $monthstr = $shortmonths[$cgiparams{'MONTH'}];
@@ -135,16 +135,16 @@ else {
 my $skip=0;
 my $filestr='';
 if ($datediff==0) {
-        $filestr="/var/log/messages";
+       $filestr="/var/log/messages";
 } else {
        $filestr="/var/log/messages.$datediff";
        $filestr = "$filestr.gz" if -f "$filestr.gz";
 }
 
 if (!(open (FILE,($filestr =~ /.gz$/ ? "gzip -dc $filestr |" : $filestr)))) {
-        $errormessage = "$Lang::tr{'date not in logs'}: $filestr $Lang::tr{'could not be opened'}";
-        $skip=1;
-        # Note: This is in case the log does not exist for that date
+       $errormessage = "$Lang::tr{'date not in logs'}: $filestr $Lang::tr{'could not be opened'}";
+       $skip=1;
+       # Note: This is in case the log does not exist for that date
 }
 my $lines = 0;
 my @log=();
@@ -152,15 +152,14 @@ my $ip = $cgiparams{ip};
 
 if (!$skip)
 {
-        while (<FILE>)
-        {
+       while (<FILE>) {
                if (/(^${monthstr} ${daystr} ..:..:..) [\w\-]+ kernel:.*(IN=.*)$/) {
-                if($_ =~  /SRC\=([\d\.]+)/){
-                  if($1 eq $ip){
-                       $log[$lines] = $_;
-                       $lines++;
-                  }
-                }
+                       if (($_ =~ /SRC\=(([\d]{1,3})(\.([\d]{1,3})){3})/) or ($_ =~ /SRC\=(([0-9a-fA-F]{0,4})(\:([0-9a-fA-F]{0,4})){2,7})/)) {
+                               if($1 eq $ip){
+                                       $log[$lines] = $_;
+                                       $lines++;
+                               }
+                       }
                }
        }
        close (FILE);   
@@ -168,26 +167,26 @@ if (!$skip)
 
 $skip=0;
 if ($multifile) {
-        $datediff=$datediff-1;
-        if ($datediff==0) {
-                $filestr="/var/log/messages";
-        } else {
-                $filestr="/var/log/messages.$datediff";
-                $filestr = "$filestr.gz" if -f "$filestr.gz";
-        }
-        if (!(open (FILE,($filestr =~ /.gz$/ ? "gzip -dc $filestr |" : $filestr)))) {
-                $errormessage="$Lang::tr{'date not in logs'}: $filestr $Lang::tr{'could not be opened'}";
-                $skip=1;
-        }
-        if (!$skip) {
+       $datediff=$datediff-1;
+       if ($datediff==0) {
+               $filestr="/var/log/messages";
+       } else {
+               $filestr="/var/log/messages.$datediff";
+               $filestr = "$filestr.gz" if -f "$filestr.gz";
+       }
+       if (!(open (FILE,($filestr =~ /.gz$/ ? "gzip -dc $filestr |" : $filestr)))) {
+               $errormessage="$Lang::tr{'date not in logs'}: $filestr $Lang::tr{'could not be opened'}";
+               $skip=1;
+       }
+       if (!$skip) {
                while (<FILE>) {
-                       if (/(^${monthstr} ${daystr} ..:..:..) [\w\-]+ kernel:.*(IN=.*)$/) {
-                       if($_ =~  /SRC\=([\d\.]+)/){
-                         if($1 eq $ip){
-                               $log[$lines] = $_;
-                               $lines++;
-                         }
-                       }
+                       if (/(^${monthstr} ${daystr} ..:..:..) [\w\-]+ kernel:.*(IN=.*)$/) {
+                               if (($_ =~ /SRC\=(([\d]{1,3})(\.([\d]{1,3})){3})/) or ($_ =~ /SRC\=(([0-9a-fA-F]{0,4})(\:([0-9a-fA-F]{0,4})){2,7})/)) {
+                                       if($1 eq $ip){
+                                               $log[$lines] = $_;
+                                               $lines++;
+                                       }
+                               }
                        }
                }
                close (FILE);
@@ -257,7 +256,8 @@ END
 print "<p><b>$Lang::tr{'firewall hits'} $longmonthstr $daystr: $lines</b></p>";
 
 if ($start == -1) {
-        $start = $lines - ${Header::viewsize}; }
+       $start = $lines - ${Header::viewsize}; 
+}
 if ($start >= $lines - ${Header::viewsize}) { $start = $lines - ${Header::viewsize}; };
 if ($start < 0) { $start = 0; }
 
@@ -290,58 +290,64 @@ my @slice = splice(@log, $start, ${Header::viewsize});
 if ($logsettings{'LOGVIEW_REVERSE'} eq 'on') { @slice = reverse @slice; }
 
 $lines = 0;
-foreach $_ (@slice)
-{
-  $a = $_;
-  if($_ =~  /SRC\=([\d\.]+)/){
-    if($1 eq $ip){
-       my $chain = '';
-       my $in = '-'; my $out = '-';
-       my $srcaddr = ''; my $dstaddr = '';
-       my $protostr = '';
-       my $srcport = ''; my $dstport = '';
-
-       $_ =~ /(^.* ..:..:..) [\w\-]+ kernel:(.*)(IN=.*)$/;
-       my $timestamp = $1; my $chain = $2; my $packet = $3;
-       $timestamp =~ /(...) (..) (..:..:..)/;
-       my $month = $1; my $day = $2; my $time = $3;
-
-       if ($a =~ /IN\=(\w+)/) { $iface = $1; }
-       if ($a =~ /OUT\=(\w+)/) { $out = $1; }
-       if ($a =~ /SRC\=([\d\.]+)/) { $srcaddr = $1; }
-       if ($a =~ /DST\=([\d\.]+)/) { $dstaddr = $1; }
-       if ($a =~ /PROTO\=(\w+)/) { $protostr = $1; }
-       my $protostrlc = lc($protostr);
-       if ($a =~  /SPT\=([\d\.]+)/){ $srcport = $1; }
-       if ($a =~  /DPT\=([\d\.]+)/){ $dstport = $1; }
-
-       if ($lines % 2) {
-               print "<tr bgcolor='${Header::table1colour}'>\n"; }
-       else {
-               print "<tr bgcolor='${Header::table2colour}'>\n"; }
-       print <<END
-       <td align='center'>$time</td>
-       <td align='center'>$chain</td>
-       <td align='center'>$iface</td>
-       <td align='center'>$protostr</td>
-       <td align='center'>
-       <table width='100%' cellpadding='0' cellspacing='0'><tr>
-       <td align='center'><a href='/cgi-bin/ipinfo.cgi?ip=$srcaddr'>$srcaddr</a></td>
-       </tr></table>
-       </td>
-       <td align='center'>$srcport</td>
-       <td align='center'>
-       <table width='100%' cellpadding='0' cellspacing='0'><tr>
-       <td align='center'><a href='/cgi-bin/ipinfo.cgi?ip=$dstaddr'>$dstaddr</a></td>
-       </tr></table>
-       </td>
-       <td align='center'>$dstport</td>
-</tr>
+foreach $_ (@slice) {
+       $a = $_;
+       # Check whether valid ipv4 or ipv6 address
+       if (($_ =~ /SRC\=(([\d]{1,3})(\.([\d]{1,3})){3})/) or ($_ =~ /SRC\=(([0-9a-fA-F]{0,4})(\:([0-9a-fA-F]{0,4})){2,7})/)) {
+               if($1 eq $ip) {
+                       my $chain = '';
+                       my $in = '-'; my $out = '-';
+                       my $srcaddr = ''; my $dstaddr = '';
+                       my $protostr = '';
+                       my $srcport = ''; my $dstport = '';
+
+                       # If ipv6 uses bridge, the use PHYSIN, otherwise use IN
+                       if    ($_ =~ /(^.* ..:..:..) [\w\-]+ kernel:(.*)(IN=.*)(PHYSIN=.*)$/) {}
+                       elsif ($_ =~ /(^.* ..:..:..) [\w\-]+ kernel:(.*)(IN=.*)$/) {}
+                       my $timestamp = $1; my $chain = $2; my $packet = $3;
+                       $timestamp =~ /(...) (..) (..:..:..)/;
+                       my $month = $1; my $day = $2; my $time = $3;
+
+                       # If ipv6 uses bridge, the use PHYSIN and PHYSOUT, otherwise use IN and OUT
+                       if ($a =~ /PHYSIN=(\w+)/)  { $iface = $1; } elsif ($a =~ /IN=(\w+)/)  { $iface = $1; }
+                       if ($a =~ /PHYSOUT=(\w+)/) { $out = $1; }   elsif ($a =~ /OUT=(\w+)/) { $out = $1; }
+                       # Detect ipv4 and ipv6 addresses
+                       if (($a =~ /SRC\=(([\d]{1,3})(\.([\d]{1,3})){3})/) or ($a =~ /SRC\=(([0-9a-fA-F]{0,4})(\:([0-9a-fA-F]{0,4})){2,7})/)) { $srcaddr = $1; }
+                       if (($a =~ /DST\=(([\d]{1,3})(\.([\d]{1,3})){3})/) or ($a =~ /DST\=(([0-9a-fA-F]{0,4})(\:([0-9a-fA-F]{0,4})){2,7})/)) { $dstaddr = $1; }
+                       if ($a =~ /PROTO\=(\w+)/) { $protostr = $1; }
+                       my $protostrlc = lc($protostr);
+                       if ($a =~  /SPT\=([\d\.]+)/){ $srcport = $1; }
+                       if ($a =~  /DPT\=([\d\.]+)/){ $dstport = $1; }
+
+                       if ($lines % 2) {
+                               print "<tr bgcolor='${Header::table1colour}'>\n"; 
+                       }
+                       else {
+                               print "<tr bgcolor='${Header::table2colour}'>\n"; 
+                       }
+                       print <<END
+                       <td align='center'>$time</td>
+                       <td align='center'>$chain</td>
+                       <td align='center'>$iface</td>
+                       <td align='center'>$protostr</td>
+                       <td align='center'>
+                       <table width='100%' cellpadding='0' cellspacing='0'><tr>
+                       <td align='center'><a href='/cgi-bin/ipinfo.cgi?ip=$srcaddr'>$srcaddr</a></td>
+                       </tr></table>
+                       </td>
+                       <td align='center'>$srcport</td>
+                       <td align='center'>
+                       <table width='100%' cellpadding='0' cellspacing='0'><tr>
+                       <td align='center'><a href='/cgi-bin/ipinfo.cgi?ip=$dstaddr'>$dstaddr</a></td>
+                       </tr></table>
+                       </td>
+                       <td align='center'>$dstport</td>
+                       </tr>
 END
-       ;
-       $lines++;
-    }
-  }
+                       ;
+                       $lines++;
+               }
+       }
 }
 
 print <<END
@@ -359,29 +365,33 @@ END
 
 sub oldernewer
 {
-print <<END
-<table width='100%'>
-<tr>
+       print <<END
+       <table width='100%'>
+       <tr>
 END
-;
+       ;
 
-print "<td align='center' width='50%'>";
-if ($prev != -1) {
-       print "<a href='/cgi-bin/logs.cgi/showrequestfromip.dat?$prev,$cgiparams{'MONTH'},$cgiparams{'DAY'},$cgiparams{ip}'>$Lang::tr{'older'}</a>"; }
-else {
-       print "$Lang::tr{'older'}"; }
-print "</td>\n";
+       print "<td align='center' width='50%'>";
+       if ($prev != -1) {
+               print "<a href='/cgi-bin/logs.cgi/showrequestfromip.dat?$prev,$cgiparams{'MONTH'},$cgiparams{'DAY'},$cgiparams{ip}'>$Lang::tr{'older'}</a>"; 
+       }
+       else {
+               print "$Lang::tr{'older'}"; 
+       }
+       print "</td>\n";
 
-print "<td align='center' width='50%'>";
-if ($next != -1) {
-       print "<a href='/cgi-bin/logs.cgi/showrequestfromip.dat?$next,$cgiparams{'MONTH'},$cgiparams{'DAY'},$cgiparams{ip}'>$Lang::tr{'newer'}</a>"; }
-else {
-       print "$Lang::tr{'newer'}"; }
-print "</td>\n";
+       print "<td align='center' width='50%'>";
+       if ($next != -1) {
+               print "<a href='/cgi-bin/logs.cgi/showrequestfromip.dat?$next,$cgiparams{'MONTH'},$cgiparams{'DAY'},$cgiparams{ip}'>$Lang::tr{'newer'}</a>"; 
+       }
+       else {
+               print "$Lang::tr{'newer'}"; 
+       }
+       print "</td>\n";
 
-print <<END
-</tr>
-</table>
+       print <<END
+       </tr>
+       </table>
 END
-;
+       ;
 }
index ad9823cde7fc0183d49b901ce04ccac368b065be..e1f00aed8fb26fdd222db0c68b576c44ca727a2a 100644 (file)
@@ -73,60 +73,60 @@ if (!($cgiparams{'MONTH'} =~ /^(0|1|2|3|4|5|6|7|8|9|10|11)$/) ||
 }
 elsif($cgiparams{'ACTION'} eq '>>')
 {
-        my @temp_then=();
-        my @temp_now = localtime(time);
-        $temp_now[4] = $cgiparams{'MONTH'};
-        $temp_now[3] = $cgiparams{'DAY'};
-        @temp_then = localtime(POSIX::mktime(@temp_now) + 86400);
-           ## Retrieve the same time on the next day -
-           ## 86400 seconds in a day
-        $cgiparams{'MONTH'} = $temp_then[4];
-        $cgiparams{'DAY'} = $temp_then[3];
+       my @temp_then=();
+       my @temp_now = localtime(time);
+       $temp_now[4] = $cgiparams{'MONTH'};
+       $temp_now[3] = $cgiparams{'DAY'};
+       @temp_then = localtime(POSIX::mktime(@temp_now) + 86400);
+          ## Retrieve the same time on the next day -
+          ## 86400 seconds in a day
+       $cgiparams{'MONTH'} = $temp_then[4];
+       $cgiparams{'DAY'} = $temp_then[3];
 }
 elsif($cgiparams{'ACTION'} eq '<<')
 {
-        my @temp_then=();
-        my @temp_now = localtime(time);
-        $temp_now[4] = $cgiparams{'MONTH'};
-        $temp_now[3] = $cgiparams{'DAY'};
-        @temp_then = localtime(POSIX::mktime(@temp_now) - 86400);
-           ## Retrieve the same time on the previous day -
-           ## 86400 seconds in a day
-        $cgiparams{'MONTH'} = $temp_then[4];
-        $cgiparams{'DAY'} = $temp_then[3];
+       my @temp_then=();
+       my @temp_now = localtime(time);
+       $temp_now[4] = $cgiparams{'MONTH'};
+       $temp_now[3] = $cgiparams{'DAY'};
+       @temp_then = localtime(POSIX::mktime(@temp_now) - 86400);
+          ## Retrieve the same time on the previous day -
+          ## 86400 seconds in a day
+       $cgiparams{'MONTH'} = $temp_then[4];
+       $cgiparams{'DAY'} = $temp_then[3];
 }
 
 if (($cgiparams{'DAY'} ne $now[3]) || ($cgiparams{'MONTH'} ne $now[4]))
 {
-        my @then = ();
-        if ( (  $cgiparams{'MONTH'} eq $now[4]) && ($cgiparams{'DAY'} > $now[3]) ||
-                        ( $cgiparams{'MONTH'} > $now[4] ) ) {
-                @then = localtime(POSIX::mktime( 0, 0, 0, $cgiparams{'DAY'}, $cgiparams{'MONTH'}, $year - 1901 ));
-        } else {
-                @then = localtime(POSIX::mktime( 0, 0, 0, $cgiparams{'DAY'}, $cgiparams{'MONTH'}, $year - 1900 ));
-        }
-        $tdoy = $then[7];
-        my $lastleap=($year-1)%4;
-        if ($tdoy>$doy) {
-                if ($lastleap == 0 && $tdoy < 60) {
-                        $doy=$tdoy+366;
-                } else {
-                        $doy=$doy+365;
-                }
-        }
+       my @then = ();
+       if ( (  $cgiparams{'MONTH'} eq $now[4]) && ($cgiparams{'DAY'} > $now[3]) ||
+                       ( $cgiparams{'MONTH'} > $now[4] ) ) {
+               @then = localtime(POSIX::mktime( 0, 0, 0, $cgiparams{'DAY'}, $cgiparams{'MONTH'}, $year - 1901 ));
+       } else {
+               @then = localtime(POSIX::mktime( 0, 0, 0, $cgiparams{'DAY'}, $cgiparams{'MONTH'}, $year - 1900 ));
+       }
+       $tdoy = $then[7];
+       my $lastleap=($year-1)%4;
+       if ($tdoy>$doy) {
+               if ($lastleap == 0 && $tdoy < 60) {
+                       $doy=$tdoy+366;
+               } else {
+                       $doy=$doy+365;
+               }
+       }
 }
 my $datediff=0;
 my $dowd=0;
 my $multifile=0;
 if ($tdoy ne $doy) {
-        $datediff=int(($doy-$tdoy)/7);
-        $dowd=($doy-$tdoy)%7;
-        if (($dow-$dowd)<1) {
-                $datediff=$datediff+1;
-        }
-        if (($dow-$dowd)==0) {
-                $multifile=1;
-        }
+       $datediff=int(($doy-$tdoy)/7);
+       $dowd=($doy-$tdoy)%7;
+       if (($dow-$dowd)<1) {
+               $datediff=$datediff+1;
+       }
+       if (($dow-$dowd)==0) {
+               $multifile=1;
+       }
 }
 
 my $monthstr = $shortmonths[$cgiparams{'MONTH'}];
@@ -142,16 +142,16 @@ else {
 my $skip=0;
 my $filestr='';
 if ($datediff==0) {
-        $filestr="/var/log/messages";
+       $filestr="/var/log/messages";
 } else {
        $filestr="/var/log/messages.$datediff";
        $filestr = "$filestr.gz" if -f "$filestr.gz";
 }
 
 if (!(open (FILE,($filestr =~ /.gz$/ ? "gzip -dc $filestr |" : $filestr)))) {
-        $errormessage = "$Lang::tr{'date not in logs'}: $filestr $Lang::tr{'could not be opened'}";
-        $skip=1;
-        # Note: This is in case the log does not exist for that date
+       $errormessage = "$Lang::tr{'date not in logs'}: $filestr $Lang::tr{'could not be opened'}";
+       $skip=1;
+       # Note: This is in case the log does not exist for that date
 }
 my $lines = 0;
 my @log=();
@@ -159,15 +159,15 @@ my $port = $cgiparams{port};
 
 if (!$skip)
 {
-        while (<FILE>)
-        {
-               if (/(^${monthstr} ${daystr} ..:..:..) [\w\-]+ kernel:.*(IN=.*)$/) {
-                if($_ =~  /DPT\=([\d\.]+)/){
-                  if($1 eq $port){
-                       $log[$lines] = $_;
-                       $lines++;
-                  }
-                }
+       while (<FILE>)
+       {
+               if (/(^${monthstr} ${daystr} ..:..:..) [\w\-]+ kernel:.*(IN=.*)$/) {
+                       if($_ =~  /DPT\=([\d\.]+)/){
+                               if($1 eq $port){
+                                       $log[$lines] = $_;
+                                       $lines++;
+                               }
+                       }
                }
        }
        close (FILE);   
@@ -175,26 +175,26 @@ if (!$skip)
 
 $skip=0;
 if ($multifile) {
-        $datediff=$datediff-1;
-        if ($datediff==0) {
-                $filestr="/var/log/messages";
-        } else {
-                $filestr="/var/log/messages.$datediff";
-                $filestr = "$filestr.gz" if -f "$filestr.gz";
-        }
-        if (!(open (FILE,($filestr =~ /.gz$/ ? "gzip -dc $filestr |" : $filestr)))) {
-                $errormessage="$Lang::tr{'date not in logs'}: $filestr $Lang::tr{'could not be opened'}";
-                $skip=1;
-        }
-        if (!$skip) {
+       $datediff=$datediff-1;
+       if ($datediff==0) {
+               $filestr="/var/log/messages";
+       } else {
+               $filestr="/var/log/messages.$datediff";
+               $filestr = "$filestr.gz" if -f "$filestr.gz";
+       }
+       if (!(open (FILE,($filestr =~ /.gz$/ ? "gzip -dc $filestr |" : $filestr)))) {
+               $errormessage="$Lang::tr{'date not in logs'}: $filestr $Lang::tr{'could not be opened'}";
+               $skip=1;
+       }
+       if (!$skip) {
                while (<FILE>) {
-                       if (/(^${monthstr} ${daystr} ..:..:..) [\w\-]+ kernel:.*(IN=.*)$/) {
-                       if($_ =~  /DPT\=([\d\.]+)/){
-                         if($1 eq $port){
-                               $log[$lines] = $_;
-                               $lines++;
-                         }
-                       }
+                       if (/(^${monthstr} ${daystr} ..:..:..) [\w\-]+ kernel:.*(IN=.*)$/) {
+                               if($_ =~  /DPT\=([\d\.]+)/){
+                                       if($1 eq $port){
+                                               $log[$lines] = $_;
+                                               $lines++;
+                                       }
+                               }
                        }
                }
                close (FILE);
@@ -264,7 +264,8 @@ END
 print "<p><b>$Lang::tr{'firewall hits'} $longmonthstr $daystr: $lines</b></p>";
 
 if ($start == -1) {
-        $start = $lines - ${Header::viewsize}; }
+       $start = $lines - ${Header::viewsize}; 
+}
 if ($start >= $lines - ${Header::viewsize}) { $start = $lines - ${Header::viewsize}; };
 if ($start < 0) { $start = 0; }
 
@@ -298,56 +299,65 @@ if ($logsettings{'LOGVIEW_REVERSE'} eq 'on') { @slice = reverse @slice; }
 $lines = 0;
 foreach $_ (@slice)
 {
-  $a = $_;
-  if($_ =~  /DPT\=([\d\.]+)/){
-    if($1 eq $port){
-       my $chain = '';
-       my $in = '-'; my $out = '-';
-       my $srcaddr = ''; my $dstaddr = '';
-       my $protostr = '';
-       my $srcport = ''; my $dstport = '';
-
-       $_ =~ /(^.* ..:..:..) [\w\-]+ kernel:(.*)(IN=.*)$/;
-       my $timestamp = $1; my $chain = $2; my $packet = $3;
-       $timestamp =~ /(...) (..) (..:..:..)/;
-       my $month = $1; my $day = $2; my $time = $3; my $iface;
-
-       if ($a =~ /IN\=(\w+)/) { $iface = $1; }
-       if ($a =~ /OUT\=(\w+)/) { $out = $1; }
-       if ($a =~ /SRC\=([\d\.]+)/) { $srcaddr = $1; }
-       if ($a =~ /DST\=([\d\.]+)/) { $dstaddr = $1; }
-       if ($a =~ /PROTO\=(\w+)/) { $protostr = $1; }
-       my $protostrlc = lc($protostr);
-       if ($a =~  /SPT\=([\d\.]+)/){ $srcport = $1; }
-       if ($a =~  /DPT\=([\d\.]+)/){ $dstport = $1; }
-
-       if ($lines % 2) {
-               print "<tr bgcolor='${Header::table1colour}'>\n"; }
-       else {
-               print "<tr bgcolor='${Header::table2colour}'>\n"; }
-       print <<END
-       <td align='center'>$time</td>
-       <td align='center'>$chain</td>
-       <td align='center'>$iface</td>
-       <td align='center'>$protostr</td>
-       <td align='center'>
-       <table width='100%' cellpadding='0' cellspacing='0'><tr>
-       <td align='center'><a href='/cgi-bin/ipinfo.cgi?ip=$srcaddr'>$srcaddr</a></td>
-       </tr></table>
-       </td>
-       <td align='center'>$srcport</td>
-       <td align='center'>
-       <table width='100%' cellpadding='0' cellspacing='0'><tr>
-       <td align='center'><a href='/cgi-bin/ipinfo.cgi?ip=$dstaddr'>$dstaddr</a></td>
-       </tr></table>
-       </td>
-       <td align='center'>$dstport</td>
-</tr>
+       $a = $_;
+       if($_ =~  /DPT\=([\d\.]+)/){
+               if($1 eq $port){
+                       my $chain = '';
+                       my $in = '-';
+                       my $out = '-';
+                       my $srcaddr = '';
+                       my $dstaddr = '';
+                       my $protostr = '';
+                       my $srcport = '';
+                       my $dstport = '';
+
+                       # If ipv6 uses bridge, the use PHYSIN, otherwise use IN
+                       if    ($_ =~ /(^.* ..:..:..) [\w\-]+ kernel:(.*)(IN=.*)(PHYSIN=.*)$/) {}
+                       elsif ($_ =~ /(^.* ..:..:..) [\w\-]+ kernel:(.*)(IN=.*)$/) {}
+                       my $timestamp = $1; my $chain = $2; my $packet = $3;
+                       $timestamp =~ /(...) (..) (..:..:..)/;
+                       my $month = $1; my $day = $2; my $time = $3; my $iface;
+
+                       # If ipv6 uses bridge, the use PHYSIN and PHYSOUT, otherwise use IN and OUT
+                       if ($a =~ /PHYSIN\=(\w+)/)  { $iface = $1; } elsif ($a =~ /IN\=(\w+)/)  { $iface = $1; }
+                       if ($a =~ /PHYSOUT\=(\w+)/) { $out = $1;   } elsif ($a =~ /OUT\=(\w+)/) { $out = $1; }
+                       # Detect ipv4 and ipv6 addresses
+                       if (($a =~ /SRC\=(([\d]{1,3})(\.([\d]{1,3})){3})/) or ($a =~ /SRC\=(([0-9a-fA-F]{0,4})(\:([0-9a-fA-F]{0,4})){2,7})/)) { $srcaddr = $1; }
+                       if (($a =~ /DST\=(([\d]{1,3})(\.([\d]{1,3})){3})/) or ($a =~ /DST\=(([0-9a-fA-F]{0,4})(\:([0-9a-fA-F]{0,4})){2,7})/)) { $dstaddr = $1; }
+                       if ($a =~ /PROTO\=(\w+)/) { $protostr = $1; }
+                       my $protostrlc = lc($protostr);
+                       if ($a =~  /SPT\=([\d\.]+)/){ $srcport = $1; }
+                       if ($a =~  /DPT\=([\d\.]+)/){ $dstport = $1; }
+
+                       if ($lines % 2) {
+                               print "<tr bgcolor='${Header::table1colour}'>\n"; 
+                       }
+                       else {
+                               print "<tr bgcolor='${Header::table2colour}'>\n"; 
+                       }
+                       print <<END
+                       <td align='center'>$time</td>
+                       <td align='center'>$chain</td>
+                       <td align='center'>$iface</td>
+                       <td align='center'>$protostr</td>
+                       <td align='center'>
+                       <table width='100%' cellpadding='0' cellspacing='0'><tr>
+                       <td align='center'><a href='/cgi-bin/ipinfo.cgi?ip=$srcaddr'>$srcaddr</a></td>
+                       </tr></table>
+                       </td>
+                               <td align='center'>$srcport</td>
+                       <td align='center'>
+                       <table width='100%' cellpadding='0' cellspacing='0'><tr>
+                       <td align='center'><a href='/cgi-bin/ipinfo.cgi?ip=$dstaddr'>$dstaddr</a></td>
+                       </tr></table>
+                       </td>
+                       <td align='center'>$dstport</td>
+                       </tr>
 END
-       ;
-       $lines++;
-    }
-  }
+                       ;
+                       $lines++;
+               }
+       }
 }
 
 print <<END
@@ -365,30 +375,34 @@ END
 
 sub oldernewer
 {
-print <<END
-<table width='100%'>
-<tr>
+       print <<END
+       <table width='100%'>
+       <tr>
 END
-;
+       ;
 
-print "<td align='center' width='50%'>";
-if ($prev != -1) {
-       print "<a href='/cgi-bin/logs.cgi/showrequestfromport.dat?$prev,$cgiparams{'MONTH'},$cgiparams{'DAY'},$cgiparams{port}'>$Lang::tr{'older'}</a>"; }
-else {
-       print "$Lang::tr{'older'}"; }
-print "</td>\n";
+       print "<td align='center' width='50%'>";
+       if ($prev != -1) {
+               print "<a href='/cgi-bin/logs.cgi/showrequestfromport.dat?$prev,$cgiparams{'MONTH'},$cgiparams{'DAY'},$cgiparams{port}'>$Lang::tr{'older'}</a>"; 
+       }
+       else {
+               print "$Lang::tr{'older'}"; 
+       }
+       print "</td>\n";
 
-print "<td align='center' width='50%'>";
-if ($next != -1) {
-       print "<a href='/cgi-bin/logs.cgi/showrequestfromport.dat?$next,$cgiparams{'MONTH'},$cgiparams{'DAY'},$cgiparams{port}'>$Lang::tr{'newer'}</a>"; }
-else {
-       print "$Lang::tr{'newer'}"; }
-print "</td>\n";
+       print "<td align='center' width='50%'>";
+       if ($next != -1) {
+               print "<a href='/cgi-bin/logs.cgi/showrequestfromport.dat?$next,$cgiparams{'MONTH'},$cgiparams{'DAY'},$cgiparams{port}'>$Lang::tr{'newer'}</a>"; 
+       }
+       else {
+               print "$Lang::tr{'newer'}"; 
+       }
+       print "</td>\n";
 
-print <<END
-</tr>
-</table>
+       print <<END
+       </tr>
+       </table>
 END
-;
+       ;
 }
 
index 34e0cdcabac6a8bb037faa65441f6d36226034a5..7a0e8e0c4ebc4cc455a239e84455c808e41b2e45 100644 (file)
@@ -120,6 +120,21 @@ $checked{'SHOWTABLES'}{$settings{'SHOWTABLES'}} = "checked='checked'";
 $checked{'SHOWDROPDOWN'}{'off'} = '';
 $checked{'SHOWDROPDOWN'}{'on'} = '';
 $checked{'SHOWDROPDOWN'}{$settings{'SHOWDROPDOWN'}} = "checked='checked'";
+$checked{'CONNTRACK_FTP'}{'off'} = '';
+$checked{'CONNTRACK_FTP'}{'on'} = '';
+$checked{'CONNTRACK_FTP'}{$settings{'CONNTRACK_FTP'}} = "checked='checked'";
+$checked{'CONNTRACK_H323'}{'off'} = '';
+$checked{'CONNTRACK_H323'}{'on'} = '';
+$checked{'CONNTRACK_H323'}{$settings{'CONNTRACK_H323'}} = "checked='checked'";
+$checked{'CONNTRACK_IRC'}{'off'} = '';
+$checked{'CONNTRACK_IRC'}{'on'} = '';
+$checked{'CONNTRACK_IRC'}{$settings{'CONNTRACK_IRC'}} = "checked='checked'";
+$checked{'CONNTRACK_SIP'}{'off'} = '';
+$checked{'CONNTRACK_SIP'}{'on'} = '';
+$checked{'CONNTRACK_SIP'}{$settings{'CONNTRACK_SIP'}} = "checked='checked'";
+$checked{'CONNTRACK_TFTP'}{'off'} = '';
+$checked{'CONNTRACK_TFTP'}{'on'} = '';
+$checked{'CONNTRACK_TFTP'}{$settings{'CONNTRACK_TFTP'}} = "checked='checked'";
 $selected{'FWPOLICY'}{$settings{'FWPOLICY'}}= 'selected';
 $selected{'FWPOLICY1'}{$settings{'FWPOLICY1'}}= 'selected';
 $selected{'FWPOLICY2'}{$settings{'FWPOLICY2'}}= 'selected';
@@ -223,7 +238,22 @@ END
                                                                                                                                                                                <input type='radio' name='SHOWTABLES' value='off' $checked{'SHOWTABLES'}{'off'} /> off</td></tr>
 <tr><td align='left' width='60%'>$Lang::tr{'fw settings dropdown'}</td><td align='left'>on <input type='radio' name='SHOWDROPDOWN' value='on' $checked{'SHOWDROPDOWN'}{'on'} />/
                                                                                                                                                                                <input type='radio' name='SHOWDROPDOWN' value='off' $checked{'SHOWDROPDOWN'}{'off'} /> off</td></tr>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            
-</table>                                                                                                                                                                               
+</table>
+<br />
+<table width='95%' cellspacing='0'>
+<tr bgcolor='$color{'color20'}'><td colspan='2' align='left'><b>$Lang::tr{'application layer gateways'}</b></td></tr>
+<tr><td align='left' width='60%'>FTP</td><td align='left'>on <input type='radio' name='CONNTRACK_FTP' value='on' $checked{'CONNTRACK_FTP'}{'on'} />/
+                                                                                                                                                                               <input type='radio' name='CONNTRACK_FTP' value='off' $checked{'CONNTRACK_FTP'}{'off'} /> off</td></tr>
+<tr><td align='left' width='60%'>H.323</td><td align='left'>on <input type='radio' name='CONNTRACK_H323' value='on' $checked{'CONNTRACK_H323'}{'on'} />/
+                                                                                                                                                                               <input type='radio' name='CONNTRACK_H323' value='off' $checked{'CONNTRACK_H323'}{'off'} /> off</td></tr>
+<tr><td align='left' width='60%'>IRC</td><td align='left'>on <input type='radio' name='CONNTRACK_IRC' value='on' $checked{'CONNTRACK_IRC'}{'on'} />/
+                                                                                                                                                                               <input type='radio' name='CONNTRACK_IRC' value='off' $checked{'CONNTRACK_IRC'}{'off'} /> off</td></tr>
+<tr><td align='left' width='60%'>SIP</td><td align='left'>on <input type='radio' name='CONNTRACK_SIP' value='on' $checked{'CONNTRACK_SIP'}{'on'} />/
+                                                                                                                                                                               <input type='radio' name='CONNTRACK_SIP' value='off' $checked{'CONNTRACK_SIP'}{'off'} /> off</td></tr>
+<tr><td align='left' width='60%'>TFTP</td><td align='left'>on <input type='radio' name='CONNTRACK_TFTP' value='on' $checked{'CONNTRACK_TFTP'}{'on'} />/
+                                                                                                                                                                               <input type='radio' name='CONNTRACK_TFTP' value='off' $checked{'CONNTRACK_TFTP'}{'off'} /> off</td></tr>
+
+</table>
 <br />
 <table width='95%' cellspacing='0'>
 <tr bgcolor='$color{'color20'}'><td colspan='2' align='left'><b>$Lang::tr{'fw default drop'}</b></td></tr>
index 62af54ed8a1c6e0b294e4545666af34cae904310..037894d50bf941d870e55e311932a71c04dbf94b 100644 (file)
@@ -2333,7 +2333,7 @@ else
     }
     print CLIENTCONF "verb 3\r\n";
     print CLIENTCONF "ns-cert-type server\r\n";
-    print CLIENTCONF "tls-remote $vpnsettings{ROOTCERT_HOSTNAME}\r\n"; 
+    print CLIENTCONF "verify-x509-name $vpnsettings{ROOTCERT_HOSTNAME} name\r\n";
     if ($vpnsettings{MSSFIX} eq 'on') {
        print CLIENTCONF "mssfix\r\n";
     }
index 39c3ed8431155b0ebf422cfa6d00adf4f8eccd4f..590ad15bff37e60e45b8fa2b8a34b0763d56da8b 100644 (file)
@@ -463,18 +463,16 @@ if ($qossettings{'ACTION'} eq $Lang::tr{'start'})
        $qossettings{'ENABLED'} = 'on';
        &General::writehash("${General::swroot}/qos/settings", \%qossettings);
        system("/usr/local/bin/qosctrl generate >/dev/null 2>&1");
-       system("/usr/bin/touch /var/ipfire/qos/enable");
        system("/usr/local/bin/qosctrl start >/dev/null 2>&1");
        system("logger -t ipfire 'QoS started'");
 }
 elsif ($qossettings{'ACTION'} eq $Lang::tr{'stop'})
 {
-       system("/usr/local/bin/qosctrl stop >/dev/null 2>&1");
-       unlink "/var/ipfire/qos/bin/qos.sh";
-       unlink "/var/ipfire/qos/enable";
-       system("logger -t ipfire 'QoS stopped'");
        $qossettings{'ENABLED'} = 'off';
        &General::writehash("${General::swroot}/qos/settings", \%qossettings);
+       system("/usr/local/bin/qosctrl stop >/dev/null 2>&1");
+       system("/usr/local/bin/qosctrl generate >/dev/null 2>&1");
+       system("logger -t ipfire 'QoS stopped'");
 }
 elsif ($qossettings{'ACTION'} eq $Lang::tr{'restart'})
 {
@@ -587,7 +585,6 @@ END
                $qossettings{'ENABLED'} = 'on';
                &General::writehash("${General::swroot}/qos/settings", \%qossettings);
                system("/usr/local/bin/qosctrl generate >/dev/null 2>&1");
-               system("/usr/bin/touch /var/ipfire/qos/enable");
                system("/usr/local/bin/qosctrl start >/dev/null 2>&1");
                system("logger -t ipfire 'QoS started'");
        } else {
index afa3770cf93f05a7bd2635e30b0c08a8093952ad..0d50f01b1b49f9d15b2fd9749630d639b781ec45 100644 (file)
 #                                                                             #
 ###############################################################################
 
+use strict;
+
+#usable only the following on debugging purpose
+#use warnings;
+#use CGI::Carp 'fatalsToBrowser';
 use CGI;
 
+require '/var/ipfire/general-functions.pl';
+require "${General::swroot}/lang.pl";
+require "${General::swroot}/header.pl";
+
+
 my $swroot = "/var/ipfire";
 my $apdir  = "$swroot/proxy/advanced";
 my $group_def_file = "$apdir/cre/classrooms";
@@ -31,6 +41,7 @@ my $acl_src_noaccess_mac = "$apdir/acls/src_noaccess_mac.acl";
 my $banner = "A D V A N C E D &nbsp; P R O X Y &nbsp; - &nbsp; W E B &nbsp; A C C E S S &nbsp; M A N A G E R";
 my %cgiparams;
 my %proxysettings;
+my %temp;
 
 my %acl=();
 my @group_defs=();
@@ -49,8 +60,8 @@ require "${swroot}/lang.pl";
 
 foreach (@groups)
 {
-       if ($cgiparams{$_} eq $tr{'advproxy mode deny'})  { $acl{$_}='on'; }
-       if ($cgiparams{$_} eq $tr{'advproxy mode allow'}) { $acl{$_}='off'; }
+       if ($cgiparams{$_} eq $Lang::tr{'advproxy mode deny'}) { $acl{$_}='on'; }
+       if ($cgiparams{$_} eq $Lang::tr{'advproxy mode allow'}) { $acl{$_}='off'; }
 }
 
 &read_all_groups;
@@ -144,7 +155,7 @@ if (($is_supervisor) && ((defined($proxysettings{'SUPERVISOR_PASSWORD'})) && (!(
 {
 print <<END
                   <td align='center'>
-                     <font face='verdana,arial,helvetica' color='#000000' size='2'>$tr{'advproxy supervisor password'}:</font>
+                     <font face='verdana,arial,helvetica' color='#000000' size='2'>$Lang::tr{'advproxy supervisor password'}:</font>
                   </td>
                   <td align='center'><input type='password' name='PASSWORD' size='15'></td>
 END
@@ -176,11 +187,11 @@ END
                        if ((defined($acl{$_})) && ($acl{$_} eq 'on'))
                        {
                        print "</td><td width='120' align='center'>";
-                               print "<input type='submit' name='$_' value=' $tr{'advproxy mode allow'} '>";
+                               print "<input type='submit' name='$_' value=' $Lang::tr{'advproxy mode allow'} '>";
                        print "</td><td width='16' bgcolor='#D00000'>&nbsp;</td>\n";
                        } else {
                        print "</td><td width='120' align='center'>";
-                               print "<input type='submit' name='$_' value=' $tr{'advproxy mode deny'} '>";
+                               print "<input type='submit' name='$_' value=' $Lang::tr{'advproxy mode deny'} '>";
                        print "</td><td width='16' bgcolor='#00A000'>&nbsp;</td>\n";
                        }
                }
@@ -199,14 +210,14 @@ END
 } else {
             print "      <tr>\n";
             print "         <td align='center'>\n";
-            print "            <font face='verdana,arial,helvetica' color='#000000' size='2'>$tr{'advproxy no cre groups'}</font>\n";
+            print "            <font face='verdana,arial,helvetica' color='#000000' size='2'>$Lang::tr{'advproxy no cre groups'}</font>\n";
             print "         </td>\n";
             print "      </tr>\n";
 }
 } else {
             print "      <tr>\n";
             print "         <td align='center'>\n";
-            print "            <font face='verdana,arial,helvetica' color='#000000' size='2'>$tr{'advproxy cre disabled'}</font>\n";
+            print "            <font face='verdana,arial,helvetica' color='#000000' size='2'>$Lang::tr{'advproxy cre disabled'}</font>\n";
             print "         </td>\n";
             print "      </tr>\n";
 }
index 2bca854ff1aadcb4ef0c76604dc6a5df5135e4f6..7c330bb0fe1d00e8e0eccb09ea9a124eeae89445 100644 (file)
 'alt vpn' => 'VPNs',
 'and' => 'Und',
 'apcupsd' => 'APC-UPS Status',
+'application layer gateways' => 'Application-Layer-Gateways',
 'apply' => 'Jetzt anwenden',
 'april' => 'April',
 'archive not exist' => 'Konfigurationsarchiv existiert nicht',
index 4c523921ce6633816130ca355a03b2d5757754f9..23f63102bf014ec57d3949aee5ac3adaa9f0746d 100644 (file)
 'and' => 'And',
 'ansi t1.483' => 'TO BE REMOVED',
 'apcupsd' => 'APC-UPS status',
+'application layer gateways' => 'Application Layer Gateways',
 'apply' => 'Apply now',
 'april' => 'April',
 'archive not exist' => 'Configuration archive does not exist',
index a65b0cf4e410950858222ab0895e71a835548f93..75867ff137e0f104584ae890181432089731292f 100644 (file)
@@ -35,7 +35,7 @@
 #
 URL_IPFIRE  = http://source.ipfire.org/source-2.x
 URL_TOOLCHAIN = http://source.ipfire.org/toolchains
-URL_SOURCE = source.ipfire.org:/pub/source/source-2.x
+URL_SOURCE = git.ipfire.org:/pub/source/source-2.x
 
 # Don't change this; it will be overridden by other makefiles where necessary.
 #
@@ -57,6 +57,9 @@ DIR_CONF    = $(LFS_BASEDIR)/config
 DIR_INFO    = $(LFS_BASEDIR)/log
 DIR_TMP     = /tmp
 
+# Add the compiler location and version and specs to the ccache hash
+CCACHE_COMPILERCHECK += $(shell gcc -dumpspecs 2>/dev/null | md5sum | cut -d ' ' -f1)
+
 ###############################################################################
 # Common Macro Definitions
 ###############################################################################
index ab6fbdccd9784922ef80ca67150e20b8026ad41d..39fa9b26bf783c44db92c3fd83ba4226d44984fe 100644 (file)
@@ -1,7 +1,7 @@
 ###############################################################################
 #                                                                             #
 # IPFire.org - A linux based firewall                                         #
-# Copyright (C) 2007-2015  IPFire Team <info@ipfire.org>                      #
+# Copyright (C) 2007-2016  IPFire Team <info@ipfire.org>                      #
 #                                                                             #
 # 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        #
@@ -26,7 +26,7 @@ include Config
 
 VERSUFIX   = ipfire$(KCFG)
 
-VER        = 3.18.1-1
+VER        = 4.2.6-1
 
 THISAPP    = backports-$(VER)
 DL_FILE    = $(THISAPP).tar.xz
@@ -46,7 +46,7 @@ objects = $(DL_FILE)
 
 $(DL_FILE) = $(DL_FROM)/$(DL_FILE)
 
-$(DL_FILE)_MD5 = 6cef5f2c800e12441d2cba9fa42b6a5b
+$(DL_FILE)_MD5 = 3f978eb56473d9289cf21ebbcb5aa80b
 
 install : $(TARGET)
 
@@ -78,23 +78,28 @@ $(subst %,%_MD5,$(objects)) :
 
 $(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects))
        @$(PREBUILD)
+
+       # remove replaced kernel modules
+       rm -rf /lib/modules/$(KVER)-$(VERSUFIX)/kernel/drivers/net/wireless/rtl818x/rtl8180/rtl8180.ko
+       rm -rf /lib/modules/$(KVER)-$(VERSUFIX)/kernel/drivers/media
+
        @rm -rf $(DIR_APP) && cd $(DIR_SRC) && tar Jxf $(DIR_DL)/$(DL_FILE)
        cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/backports-3.18.1-1-ipfire-build.patch
-       cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/backports-3.18.1-1-grsecurity.patch
-       cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/backports-3.18.1-1-add_usbnet_modules.patch
+       cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/backports-4.2.6-1-grsecurity.patch
+       cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/backports-4.2.6-1-add_usbnet_modules.patch
 ifeq "$(MACHINE)" "x86_64"
        cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/backports-3.18.1-1_no_dma_sgtable_on_x86_64.patch
 endif
 
        # DVB patches
        cd $(DIR_APP) && patch -Np2 < $(DIR_SRC)/src/patches/v4l-dvb_fix_tua6034_pll.patch
-       cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/linux-3.10-dvb_tevi_s482.patch
 
        # Wlan patches
        cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/compat-drivers-3.8.3-ath_ignore_eeprom_regdomain.patch
        cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/linux-3.14.22-iwlwifi-noibss_only_on_radar_chan.patch
        cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/linux-3.10.37-rt2800usb_add_dlink_dwa137_usbid.patch
        cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/backports-3.18.1-1_rt2x00usb_suppress_queue_warnings.patch
+       cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/backports-4.2.6-1-mt7601_upstream_fixes.patch
        cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/backports-3.18.1-1_add_libertas_uap.patch
 
        # smsc mac address patch for pandaboard and raspberry pi
@@ -110,9 +115,6 @@ endif
 
        # Disable some settings
        cd $(DIR_APP) && sed -i -e "s/CPTCFG_CFG80211_DEVELOPER_WARNINGS=y/# CPTCFG_CFG80211_DEVELOPER_WARNINGS is not set/g" .config
-       cd $(DIR_APP) && sed -i -e "s/CPTCFG_CFG80211_CERTIFICATION_ONUS=y/# CPTCFG_CFG80211_CERTIFICATION_ONUS is not set/g" .config
-       cd $(DIR_APP) && sed -i -e "s/CPTCFG_CFG80211_REG_CELLULAR_HINTS=y/# CPTCFG_CFG80211_REG_CELLULAR_HINTS is not set/g" .config
-       cd $(DIR_APP) && sed -i -e "s/CPTCFG_CFG80211_REG_RELAX_NO_IR=y/# CPTCFG_CFG80211_REG_RELAX_NO_IR is not set/g" .config
        cd $(DIR_APP) && sed -i -e "s/CPTCFG_CFG80211_INTERNAL_REGDB=y/# CPTCFG_CFG80211_INTERNAL_REGDB is not set/g" .config
        cd $(DIR_APP) && sed -i -e "s/CPTCFG_CFG80211_DEFAULT_PS=y/# CPTCFG_CFG80211_DEFAULT_PS is not set/g" .config
        cd $(DIR_APP) && sed -i -e "s/CPTCFG_NFC=m/# CPTCFG_NFC is not set/g" .config
@@ -121,21 +123,19 @@ ifeq "$(MACHINE)" "x86_64"
        cd $(DIR_APP) && sed -i -e "s/CPTCFG_LIBERTAS_UAP=m/# CPTCFG_LIBERTAS_UAP is not set/g" .config
 endif
 
-       # Disable some modules (build fail)
+       # Disable some modules (build fail/missing symbols)
+       cd $(DIR_APP) && sed -i -e "s/CPTCFG_VIDEO_AM437X_VPFE=m/# CPTCFG_VIDEO_AM437X_VPFE is not set/g" .config
        cd $(DIR_APP) && sed -i -e "s/CPTCFG_VIDEO_VIA_CAMERA=m/# CPTCFG_VIDEO_VIA_CAMERA is not set/g" .config
+       cd $(DIR_APP) && sed -i -e "s/CPTCFG_VIDEO_XILINX=m/# CPTCFG_VIDEO_XILINX is not set/g" .config
+       cd $(DIR_APP) && sed -i -e "s/CPTCFG_IR_SUNXI=m/# CPTCFG_IR_SUNXI is not set/g" .config
+       cd $(DIR_APP) && sed -i -e "s/CPTCFG_BT_6LOWPAN=m/# CPTCFG_BT_6LOWPAN is not set/g" .config
 
        # Disable DEBUG
        cd $(DIR_APP) && sed -i -e "s/.*DEBUG=y/# & is not set/g" .config
        cd $(DIR_APP) && sed -i -e "s/.*DEBUGFS=y/# & is not set/g" .config
        cd $(DIR_APP) && sed -i -e "s/=y is not set/ is not set/g" .config
 
-       # Disable OF_GRAPH (not supported by kernel 3.14)
-       cd $(DIR_APP) && sed -i -e "s/CONFIG_OF/CONFIG_OF_IGNORE/g" include/linux/of_graph.h
-
        cd $(DIR_APP) && make $(MAKETUNING) KLIB=/lib/modules/$(KVER)-$(VERSUFIX)/ install
 
-       # Remove vsp1 module (not mach to our platforms)
-       rm -rf /lib/modules/$(KVER)-$(VERSUFIX)/kernel/drivers/media/platform/vsp1
-
        @rm -rf $(DIR_APP)
        @$(POSTBUILD)
index 0814cde1889b6d2ce90dc99aae8b23886afd6c9c..b0d518554bce87eba8818673623f908089fcd753 100644 (file)
--- a/lfs/bind
+++ b/lfs/bind
@@ -25,7 +25,7 @@
 
 include Config
 
-VER        = 9.10.2-P4
+VER        = 9.10.3-P2
 
 THISAPP    = bind-$(VER)
 DL_FILE    = $(THISAPP).tar.gz
@@ -43,7 +43,7 @@ objects = $(DL_FILE)
 
 $(DL_FILE) = $(DL_FROM)/$(DL_FILE)
 
-$(DL_FILE)_MD5 = 8b1f5064837756c938eadc1537dec5c7
+$(DL_FILE)_MD5 = 672dd3c2796b12ac8440f55bcaecfa82
 
 install : $(TARGET)
 
index 27c83fb45be12662151d36a22b6765eb905c39ec..5afaeec2fbceae60413ee1a622599f52eeef6ce9 100644 (file)
@@ -1,7 +1,7 @@
 ###############################################################################
 #                                                                             #
 # IPFire.org - A linux based firewall                                         #
-# Copyright (C) 2007-2015  IPFire Team  <info@ipfire.org>                     #
+# Copyright (C) 2007-2016  IPFire Team  <info@ipfire.org>                     #
 #                                                                             #
 # 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        #
@@ -24,7 +24,7 @@
 
 include Config
 
-VER        = 2.22
+VER        = 2.24
 
 THISAPP    = binutils-$(VER)
 DL_FILE    = $(THISAPP).tar.bz2
@@ -38,17 +38,21 @@ ifeq "$(ROOT)" ""
   EXTRA_CONFIG = \
        --prefix=/usr \
        --enable-shared \
-       --disable-nls
+       --disable-nls \
+       --disable-werror
   EXTRA_MAKE = tooldir=/usr
   EXTRA_INSTALL = tooldir=/usr
 else
 ifeq "$(PASS)" "1"
   CFLAGS := $(patsubst -march=%,,$(CFLAGS))
   CFLAGS := $(patsubst -mfloat-abi=%,,$(CFLAGS))
+  CFLAGS := $(patsubst -fstack-protector-strong,-fstack-protector-all,$(CFLAGS))
   TARGET = $(DIR_INFO)/$(THISAPP)-tools1
   EXTRA_CONFIG = \
        --target=$(CROSSTARGET) \
        --prefix=/tools \
+       --with-sysroot=$(ROOT) \
+       --with-lib-path=/tools/lib \
        --disable-nls \
        --disable-werror
   EXTRA_MAKE =
@@ -64,7 +68,8 @@ else
        --build=$(BUILDTARGET) \
        --prefix=/tools \
        --with-lib-path=/tools/lib \
-       --disable-nls
+       --disable-nls \
+       --disable-werror
   EXTRA_MAKE = 
   EXTRA_INSTALL = 
 endif
@@ -87,7 +92,7 @@ objects = $(DL_FILE)
 
 $(DL_FILE) = $(DL_FROM)/$(DL_FILE)
 
-$(DL_FILE)_MD5 = ee0f10756c84979622b992a4a61ea3f5
+$(DL_FILE)_MD5 = e0f71a7b2ddab0f8612336ac81d9636b
 
 install : $(TARGET)
 
@@ -117,11 +122,7 @@ $(subst %,%_MD5,$(objects)) :
 $(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects))
        @$(PREBUILD)
        @rm -rf $(DIR_APP) $(DIR_SRC)/binutils-build && cd $(DIR_SRC) && tar jxf $(DIR_DL)/$(DL_FILE)
-       cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/binutils-2.22-pt-pax-flags-20111121.patch
-
-       # texinfo 5 syntax-fix.
-       cd $(DIR_APP) && sed -i -e "s/@colophon/@@colophon/" \
-                               -e "s/doc@cygnus/doc@@cygnus/" bfd/doc/bfd.texinfo
+       cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/binutils-2.24-pt-pax-flags-20131231.patch
 
        @mkdir $(DIR_SRC)/binutils-build
 
index 6b84f419eaec3ff215ba95539a3211ea4aec74c6..322dd26f05fcf133bf8406e1088214808c2ca817 100644 (file)
--- a/lfs/bison
+++ b/lfs/bison
 
 include Config
 
-VER        = 2.5.1
+VER        = 3.0.4
 
 THISAPP    = bison-$(VER)
-DL_FILE    = $(THISAPP).tar.gz
+DL_FILE    = $(THISAPP).tar.xz
 DL_FROM    = $(URL_IPFIRE)
 DIR_APP    = $(DIR_SRC)/$(THISAPP)
 TARGET     = $(DIR_INFO)/$(THISAPP)
@@ -40,7 +40,7 @@ objects =$(DL_FILE)
 
 $(DL_FILE) = $(DL_FROM)/$(DL_FILE)
 
-$(DL_FILE)_MD5 = 8fedf916f1aa2c4a31441d8f8bbc603c
+$(DL_FILE)_MD5 = c342201de104cc9ce0a21e0ad10d4021
 
 install : $(TARGET)
 
@@ -69,10 +69,8 @@ $(subst %,%_MD5,$(objects)) :
 
 $(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects))
        @$(PREBUILD)
-       @rm -rf $(DIR_APP) && cd $(DIR_SRC) && tar zxf $(DIR_DL)/$(DL_FILE)
-       cd $(DIR_APP) && ./configure --prefix=/usr --disable-nls
-       # Disable NLS
-       #cd $(DIR_APP) && echo '#define YYENABLE_NLS 1' >> config.h
+       @rm -rf $(DIR_APP) && cd $(DIR_SRC) && tar axf $(DIR_DL)/$(DL_FILE)
+       cd $(DIR_APP) && ./configure --prefix=/usr --disable-nls --docdir=/usr/share/doc/$(THISAPP)
        cd $(DIR_APP) && make $(MAKETUNING)
        cd $(DIR_APP) && make $(EXTRA_INSTALL) install
        @rm -rf $(DIR_APP)
index 64b09d1fa34a6529aa403d6fd524896c75708e7f..682f4998a67ebccfc9efb5701e442b1146bf01b3 100644 (file)
@@ -1,7 +1,7 @@
 ###############################################################################
 #                                                                             #
 # IPFire.org - A linux based firewall                                         #
-# Copyright (C) 2010  IPFire Team  <info@ipfire.org>                          #
+# Copyright (C) 2007-2016  IPFire Team  <info@ipfire.org>                     #
 #                                                                             #
 # 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        #
@@ -35,6 +35,7 @@ TARGET     = $(DIR_INFO)/$(THISAPP)-pass$(PASS)
 ifeq "$(PASS)" "1"
        CFLAGS := $(patsubst -march=%,,$(CFLAGS))
        CFLAGS := $(patsubst -mfloat-abi=%,,$(CFLAGS))
+       CFLAGS := $(patsubst -fstack-protector-strong,-fstack-protector-all,$(CFLAGS))
 endif
 
 # Set max cache size to 5GB
index 0b3252f9f4f23185f2696d32e88d1ad543f7f718..90369889d95e1539172c2fab9c09fc35423ddf7a 100644 (file)
@@ -54,7 +54,6 @@ $(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects))
 ifeq "$(PASS)" "1"
        SPECS=$$(dirname $$(/tools/bin/$(CROSSTARGET)-gcc -print-libgcc-file-name))/specs; \
        /tools/bin/$(CROSSTARGET)-gcc -dumpspecs | sed \
-               -e 's@/lib\(64\)\?/ld@/tools&@g' \
                -e "/^\*cpp:$$/{n;s,$$, -isystem /tools/include,}" > $$SPECS
 endif
 
index e3d211910cb9b999017f544245d7a42add480f2b..a9ada50ca8570536c1fb2270c36a31f1b144c489 100644 (file)
--- a/lfs/cmake
+++ b/lfs/cmake
@@ -32,9 +32,7 @@ DL_FROM    = $(URL_IPFIRE)
 DIR_APP    = $(DIR_SRC)/$(THISAPP)
 TARGET     = $(DIR_INFO)/$(THISAPP)
 
-ifeq "$(MACHINE)" "armv5tel"
-       MAKETUNING = -j2
-endif
+MAKETUNING = -j2
 
 ###############################################################################
 # Top-level Rules
index cb749969446fdb0e048fcf16e381c5fbe0c9f860..f8e9ce417197f5d1acbcd110465eb1575f2469e1 100644 (file)
@@ -135,6 +135,16 @@ $(TARGET) :
        echo  "POLICY=MODE2"            >> $(CONFIG_ROOT)/firewall/settings
        echo  "POLICY1=MODE2"           >> $(CONFIG_ROOT)/firewall/settings
 
+       # Add conntrack helper default settings
+       for proto in FTP H323 IRC SIP TFTP; do \
+               echo "CONNTRACK_$${proto}=on" >> $(CONFIG_ROOT)/optionsfw/settings; \
+       done
+
+       # Do not enable these by default because these are broken
+       for proto in AMANDA PPTP; do \
+               echo "CONNTRACK_$${proto}=off" >> $(CONFIG_ROOT)/optionsfw/settings; \
+       done
+
        # set converters executable
        chmod 755 /usr/sbin/convert-*
 
index ff31821f60af3d3b9f144b46e1016a856abcfeea..3b9a094ce17876d20449cbcf319831f682ebd4df 100644 (file)
@@ -85,9 +85,9 @@ $(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects))
        rm -f $(CONFIG_ROOT)/dhcpc/dhcpcd-hooks/50-yp.conf
        rm -f $(CONFIG_ROOT)/dhcpc/dhcpcd-hooks/50-ypbind
 
-       sed -i -e "s|-ge 576|-gt 576|g" $(CONFIG_ROOT)/dhcpc/dhcpcd-hooks/10-mtu
-
        install -m 644 $(DIR_SRC)/config/dhcpc/dhcpcd.conf $(CONFIG_ROOT)/dhcpc/
+       install -m 444 $(DIR_SRC)/config/dhcpc/dhcpcd-hooks/10-mtu $(CONFIG_ROOT)/dhcpc/dhcpcd-hooks
+
        chown root:root $(CONFIG_ROOT)/dhcpc/dhcpcd.conf
 
        @rm -rf $(DIR_APP)
diff --git a/lfs/dnsdist b/lfs/dnsdist
new file mode 100644 (file)
index 0000000..62c17cf
--- /dev/null
@@ -0,0 +1,86 @@
+###############################################################################
+#                                                                             #
+# IPFire.org - A linux based firewall                                         #
+# Copyright (C) 2015  IPFire Team  <info@ipfire.org>                          #
+#                                                                             #
+# 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 3 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, see <http://www.gnu.org/licenses/>.       #
+#                                                                             #
+###############################################################################
+
+###############################################################################
+# Definitions
+###############################################################################
+
+include Config
+
+VER        = 0.0.498gac688af
+
+THISAPP    = dnsdist-$(VER)
+DL_FILE    = $(THISAPP).tar.bz2
+DL_FROM    = $(URL_IPFIRE)
+DIR_APP    = $(DIR_SRC)/$(THISAPP)
+TARGET     = $(DIR_INFO)/$(THISAPP)
+SUP_ARCH   = x86_64 i586
+PROG       = dnsdist
+PAK_VER    = 1
+
+DEPS       = ""
+
+###############################################################################
+# Top-level Rules
+###############################################################################
+
+objects = $(DL_FILE)
+
+$(DL_FILE) = $(DL_FROM)/$(DL_FILE)
+
+$(DL_FILE)_MD5 = b1bc53b3a35aef7006b74086919847bf
+
+install : $(TARGET)
+
+check : $(patsubst %,$(DIR_CHK)/%,$(objects))
+
+download :$(patsubst %,$(DIR_DL)/%,$(objects))
+
+md5 : $(subst %,%_MD5,$(objects))
+
+dist: 
+       @$(PAK)
+
+###############################################################################
+# Downloading, checking, md5sum
+###############################################################################
+
+$(patsubst %,$(DIR_CHK)/%,$(objects)) :
+       @$(CHECK)
+
+$(patsubst %,$(DIR_DL)/%,$(objects)) :
+       @$(LOAD)
+
+$(subst %,%_MD5,$(objects)) :
+       @$(MD5)
+
+###############################################################################
+# Installation Details
+###############################################################################
+
+$(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects))
+       @$(PREBUILD)
+       @rm -rf $(DIR_APP) && cd $(DIR_SRC) && tar axf $(DIR_DL)/$(DL_FILE)
+       cd $(DIR_APP) && ./configure --prefix=/usr --sysconfdir=/etc
+       cd $(DIR_APP) && make $(MAKETUNING)
+       cd $(DIR_APP) && make install
+       @rm -rf $(DIR_APP)
+       @$(POSTBUILD)
+
index c8fd7db7555e4cb8e33b2d7aa34325ce3bf4d283..84585c1e02b3981dfc3e5a1ce143f59b255c4b10 100644 (file)
@@ -1,7 +1,7 @@
 ###############################################################################
 #                                                                             #
 # IPFire.org - A linux based firewall                                         #
-# Copyright (C) 2015  Michael Tremer & Christian Schmidt                      #
+# Copyright (C) 2016  Michael Tremer & Christian Schmidt                      #
 #                                                                             #
 # 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        #
@@ -24,7 +24,7 @@
 
 include Config
 
-VER        = 2.75
+VER        = 2.76test10
 
 THISAPP    = dnsmasq-$(VER)
 DL_FILE    = $(THISAPP).tar.xz
@@ -43,7 +43,7 @@ objects = $(DL_FILE)
 
 $(DL_FILE) = $(DL_FROM)/$(DL_FILE)
 
-$(DL_FILE)_MD5 = 887236f1ddde6eb57cdb9d01916c9f72
+$(DL_FILE)_MD5 = 4b51474ed6081b18c61407077f254cf7
 
 install : $(TARGET)
 
@@ -73,30 +73,11 @@ $(subst %,%_MD5,$(objects)) :
 $(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects))
        @$(PREBUILD)
        @rm -rf $(DIR_APP) && cd $(DIR_SRC) && tar axf $(DIR_DL)/$(DL_FILE)
-       cd $(DIR_APP) && patch -Np1 -i $(DIR_SRC)/src/patches/dnsmasq/001-include_0_0_0_0_8_in_DNS_rebind_checks.patch
-       cd $(DIR_APP) && patch -Np1 -i $(DIR_SRC)/src/patches/dnsmasq/002-enhance_add_subnet_to_allow_arbitary_subnet_addresses.patch
-       cd $(DIR_APP) && patch -Np1 -i $(DIR_SRC)/src/patches/dnsmasq/003-dont_answer_non_auth_queries_for_auth_zones_locally_when_localise_queries_set.patch
-       cd $(DIR_APP) && patch -Np1 -i $(DIR_SRC)/src/patches/dnsmasq/004-fix_behaviour_of_empty_dhcp-option.patch
-       cd $(DIR_APP) && patch -Np1 -i $(DIR_SRC)/src/patches/dnsmasq/005-suggest_solution_to_ENOMEM_error_with_IPv6_multicast.patch
-       cd $(DIR_APP) && patch -Np1 -i $(DIR_SRC)/src/patches/dnsmasq/006-clarify_man_page_on_RDNSS_set_in_router_advertisement.patch
-       cd $(DIR_APP) && patch -Np1 -i $(DIR_SRC)/src/patches/dnsmasq/007-handle_signed_dangling_CNAME_replies_to_DS_queries.patch
-       cd $(DIR_APP) && patch -Np1 -i $(DIR_SRC)/src/patches/dnsmasq/008-DHCPv6_option_56_does_not_hold_an_address_list.patch
-       cd $(DIR_APP) && patch -Np1 -i $(DIR_SRC)/src/patches/dnsmasq/009-Respect_the_--no_resolv_flag_in_inotify_code.patch
-       cd $(DIR_APP) && patch -Np1 -i $(DIR_SRC)/src/patches/dnsmasq/010-Rationalise_5e3e464ac4022ee0b3794513abe510817e2cf3ca.patch
-       cd $(DIR_APP) && patch -Np1 -i $(DIR_SRC)/src/patches/dnsmasq/011-Catch_errors_from_sendmsg_in_DHCP_code.patch
-       cd $(DIR_APP) && patch -Np1 -i $(DIR_SRC)/src/patches/dnsmasq/012-Update_list_of_subnet_for_--bogus-priv.patch
-       cd $(DIR_APP) && patch -Np1 -i $(DIR_SRC)/src/patches/dnsmasq/013-Fix_crash_when_empty_address_from_DNS_overlays_A_record_from.patch
-       cd $(DIR_APP) && patch -Np1 -i $(DIR_SRC)/src/patches/dnsmasq/014-Handle_unknown_DS_hash_algos_correctly.patch
-       cd $(DIR_APP) && patch -Np1 -i $(DIR_SRC)/src/patches/dnsmasq/015-Fix_crash_at_start_up_with_conf-dir.patch
-       cd $(DIR_APP) && patch -Np1 -i $(DIR_SRC)/src/patches/dnsmasq/016-Major_rationalisation_of_DNSSEC_validation.patch
-       cd $(DIR_APP) && patch -Np1 -i $(DIR_SRC)/src/patches/dnsmasq/017-Abandon_caching_RRSIGs_and_returning_them_from_cache.patch
-       cd $(DIR_APP) && patch -Np1 -i $(DIR_SRC)/src/patches/dnsmasq/018-Move_code_which_caches_DS_records_to_a_more_logical_place.patch
-       cd $(DIR_APP) && patch -Np1 -i $(DIR_SRC)/src/patches/dnsmasq/019-Generalise_RR-filtering_code_for_use_with_EDNS0.patch
-       cd $(DIR_APP) && patch -Np1 -i $(DIR_SRC)/src/patches/dnsmasq/020-DNSSEC_validation_tweak.patch
-       cd $(DIR_APP) && patch -Np1 -i $(DIR_SRC)/src/patches/dnsmasq/021-Tweaks_to_EDNS0_handling_in_DNS_replies.patch
-       cd $(DIR_APP) && patch -Np1 -i $(DIR_SRC)/src/patches/dnsmasq/022-Tidy_up_DNSSEC_non-existence_code_Check_zone_status_is_NSEC_proof_bad.patch
-       cd $(DIR_APP) && patch -Np1 -i $(DIR_SRC)/src/patches/dnsmasq/023-Fix_brace_botch_in_dnssec_validate_ds.patch
-       cd $(DIR_APP) && patch -Np1 -i $(DIR_SRC)/src/patches/dnsmasq/024-Do_a_better_job_of_determining_which_DNSSEC_sig_algos_are_supported.patch
+       cd $(DIR_APP) && patch -Np1 -i $(DIR_SRC)/src/patches/dnsmasq/001-Add_TTL_parameter_to_--host-record_and_--cname.patch
+       cd $(DIR_APP) && patch -Np1 -i $(DIR_SRC)/src/patches/dnsmasq/002-Add_--dhcp-ttl_option.patch
+       cd $(DIR_APP) && patch -Np1 -i $(DIR_SRC)/src/patches/dnsmasq/003-Update_CHANGELOG.patch
+       cd $(DIR_APP) && patch -Np1 -i $(DIR_SRC)/src/patches/dnsmasq/004-Add_--tftp-mtu_option.patch
+       cd $(DIR_APP) && patch -Np1 -i $(DIR_SRC)/src/patches/dnsmasq/005-Apply_ceiling_of_lease_length_to_TTL_when_--dhcp-ttl_in_use.patch
        cd $(DIR_APP) && patch -Np1 -i $(DIR_SRC)/src/patches/dnsmasq-Add-support-to-read-ISC-DHCP-lease-file.patch
 
        cd $(DIR_APP) && sed -i src/config.h \
index 530bf339b80b95ae2e86bec54ed7a0d91cd212f7..0d57a2a8d673c7f60384a5d0ae602f2049a8da0f 100644 (file)
@@ -1,7 +1,7 @@
 ###############################################################################
 #                                                                             #
 # IPFire.org - A linux based firewall                                         #
-# Copyright (C) 2007-2014  IPFire Team  <info@ipfire.org>                     #
+# Copyright (C) 2007-2016  IPFire Team  <info@ipfire.org>                     #
 #                                                                             #
 # 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        #
@@ -182,15 +182,19 @@ endif
        mkdir -pv $(MNThdd)/boot/grub
        chroot $(MNThdd) grub-mkconfig -o /boot/grub/grub.cfg
 
-       # Insert the UUID because grub-mkconfig fails to detect that correctly
+       # Insert the UUID because grub-mkconfig often fails to
+       # detect that correctly
        sed -i $(MNThdd)/boot/grub/grub.cfg \
-               -e "s/root=[a-z0-9\/]*/root=UUID=$$(blkid -o value -s UUID $(PART_ROOT))/g"
+               -e "s/root=[A-Za-z0-9\/=-]*/root=UUID=$$(blkid -o value -s UUID $(PART_ROOT))/g"
 
        # Install GRUB
        grub-install --force --recheck --no-floppy \
                --root-directory=$(MNThdd) $(DEVICE)
 endif
 
+       # Set ramdisk mode to automatic
+       echo RAMDISK_MODE=2 > $(MNThdd)/etc/sysconfig/ramdisk
+
        # Automatically resize the root partition to its maximum size at first boot
        touch $(MNThdd)/.partresize
 
diff --git a/lfs/gcc b/lfs/gcc
index ff8723a1e85dfe40d4b4715727bc0b172eb2fbe9..52d1daefcfa28746cefae8b17ee275d9c5e47940 100644 (file)
--- a/lfs/gcc
+++ b/lfs/gcc
@@ -1,7 +1,7 @@
 ###############################################################################
 #                                                                             #
 # IPFire.org - A linux based firewall                                         #
-# Copyright (C) 2007-2011  IPFire Team  <info@ipfire.org>                     #
+# Copyright (C) 2007-2016  IPFire Team  <info@ipfire.org>                     #
 #                                                                             #
 # 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        #
 
 include Config
 
-VER        = 4.4.7
+VER        = 4.9.3
 
 GMP_VER    = 5.0.5
 MPFR_VER   = 2.4.2
+MPC_VER    = 1.0.3
 
 THISAPP    = gcc-$(VER)
-DL_FILE    = $(THISAPP).tar.bz2
+DL_FILE    = $(THISAPP).tar.gz
 DL_FROM    = $(URL_IPFIRE)
 DIR_APP    = $(DIR_SRC)/$(THISAPP)
 
 CFLAGS    := $(patsubst -march=%,,$(CFLAGS))
 CFLAGS    := $(patsubst -mtune=%,,$(CFLAGS))
 CFLAGS    := $(patsubst -mfloat-abi=%,,$(CFLAGS))
-
-# https://bugzilla.redhat.com/show_bug.cgi?id=476370
-CFLAGS += -fgnu89-inline
+CFLAGS    := $(filter-out -fexceptions,$(CFLAGS))
+CXXFLAGS  := $(CFLAGS)
 
 # Normal build or /tools build.
 #
@@ -59,29 +59,40 @@ ifeq "$(ROOT)" ""
   EXTRA_INSTALL =
 else
 ifeq "$(PASS)" "1"
+  CFLAGS    := $(patsubst -fstack-protector-strong,-fstack-protector-all,$(CFLAGS))
+  CXXFLAGS  := $(patsubst -fstack-protector-strong,-fstack-protector-all,$(CXXFLAGS))
   TARGET = $(DIR_INFO)/$(THISAPP)-tools1
   EXTRA_CONFIG = \
        --target=$(CROSSTARGET) \
        --prefix=/tools \
+       --with-sysroot=$(ROOT) \
        --disable-nls \
        --disable-shared \
        --disable-decimal-float \
        --disable-threads \
+       --disable-libatomic \
        --disable-libmudflap \
        --disable-libssp \
        --disable-libgomp \
        --disable-libquadmath \
+       --disable-libstdc++-v3 \
+       --disable-libvtv \
+       --disable-libcilkrts \
+       --disable-libitm \
+       --disable-libsanitizer \
        --with-newlib \
        --without-headers \
        --without-ppl \
        --without-cloog \
-       --enable-languages=c
+       --enable-languages=c,c++
   EXTRA_MAKE = 
   EXTRA_INSTALL = 
 else
+ifeq "$(PASS)" "2"
   TARGET = $(DIR_INFO)/$(THISAPP)-tools2
   EXTRA_ENV = \
        CC="$(CROSSTARGET)-gcc -B/tools/lib/" \
+       CXX="$(CROSSTARGET)-g++" \
        AR="$(CROSSTARGET)-ar" \
        RANLIB="$(CROSSTARGET)-ranlib"
   EXTRA_CONFIG = \
@@ -90,15 +101,35 @@ else
        --target=$(BUILDTARGET) \
        --prefix=/tools \
        --with-local-prefix=/tools \
+       --with-native-system-header-dir=/tools/include \
        --enable-clocale=gnu \
        --enable-shared \
        --enable-threads=posix \
        --enable-__cxa_atexit \
        --enable-languages=c,c++ \
        --disable-libstdcxx-pch \
-       --disable-bootstrap
+       --enable-bootstrap
+  EXTRA_MAKE = 
+  EXTRA_INSTALL = 
+else
+  # PASS=L # libstdc++-v3
+  TARGET = $(DIR_INFO)/$(THISAPP)-libstdc++
+  EXTRA_ENV = \
+       CC="$(CROSSTARGET)-gcc -B/tools/lib/" \
+       AR="$(CROSSTARGET)-ar" \
+       RANLIB="$(CROSSTARGET)-ranlib"
+  EXTRA_CONFIG = \
+       --host=$(CROSSTARGET) \
+       --prefix=/tools \
+       --with-sysroot=$(ROOT) \
+       --disable-shared \
+       --disable-nls \
+       --disable-libstdcxx-threads \
+       --disable-libstdcxx-pch \
+       --with-gxx-include-dir=/tools/$(CROSSTARGET)/include/c++/$(VER)
   EXTRA_MAKE = 
   EXTRA_INSTALL = 
+endif
 endif
 
   # Disable stack protection in toolchain.
@@ -136,15 +167,18 @@ export TCFLAGS = $(CFLAGS)
 
 objects = $(DL_FILE) \
        gmp-$(GMP_VER).tar.bz2 \
-       mpfr-$(MPFR_VER).tar.bz2
+       mpfr-$(MPFR_VER).tar.bz2 \
+       mpc-$(MPC_VER).tar.gz
 
 $(DL_FILE) = $(DL_FROM)/$(DL_FILE)
 gmp-$(GMP_VER).tar.bz2 = $(DL_FROM)/gmp-$(GMP_VER).tar.bz2
 mpfr-$(MPFR_VER).tar.bz2 = $(DL_FROM)/mpfr-$(MPFR_VER).tar.bz2
+mpc-$(MPC_VER).tar.gz = $(DL_FROM)/mpc-$(MPC_VER).tar.gz
 
-$(DL_FILE)_MD5                 = 295709feb4441b04e87dea3f1bab4281
+$(DL_FILE)_MD5                 = 648bfba342bb41a4b5350fb685f85bc5
 gmp-$(GMP_VER).tar.bz2_MD5     = 041487d25e9c230b0c42b106361055fe
 mpfr-$(MPFR_VER).tar.bz2_MD5   = 89e59fe665e2b3ad44a6789f40b059a0
+mpc-$(MPC_VER).tar.gz_MD5      = d6a1d5f8ddea3abd2cc3e98f58352d26
 
 install : $(TARGET)
 
@@ -173,23 +207,16 @@ $(subst %,%_MD5,$(objects)) :
 
 $(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects))
        @$(PREBUILD)
-       @rm -rf $(DIR_APP) $(DIR_SRC)/gcc-build && cd $(DIR_SRC) && tar jxf $(DIR_DL)/$(DL_FILE)
+       @rm -rf $(DIR_APP) $(DIR_SRC)/gcc-build && cd $(DIR_SRC) && tar axf $(DIR_DL)/$(DL_FILE)
        @mkdir $(DIR_SRC)/gcc-build
 
        # Apply patches.
-       cd $(DIR_APP) && patch -Np0 < $(DIR_SRC)/src/patches/gcc/gcc44-build-id.patch
-       cd $(DIR_APP) && patch -Np0 < $(DIR_SRC)/src/patches/gcc/gcc44-c++-builtin-redecl.patch
-       cd $(DIR_APP) && patch -Np0 < $(DIR_SRC)/src/patches/gcc/gcc44-i386-libgomp.patch
-       cd $(DIR_APP) && patch -Np0 < $(DIR_SRC)/src/patches/gcc/gcc44-libtool-no-rpath.patch
-       cd $(DIR_APP) && patch -Np0 < $(DIR_SRC)/src/patches/gcc/gcc44-no-add-needed.patch
-       cd $(DIR_APP) && patch -Np0 < $(DIR_SRC)/src/patches/gcc/gcc44-pr33763.patch
-       cd $(DIR_APP) && patch -Np0 < $(DIR_SRC)/src/patches/gcc/gcc44-rh330771.patch
-       cd $(DIR_APP) && patch -Np0 < $(DIR_SRC)/src/patches/gcc/gcc44-rh533181.patch
-       cd $(DIR_APP) && patch -Np0 < $(DIR_SRC)/src/patches/gcc/gcc44-rh610785.patch
-       cd $(DIR_APP) && patch -Np0 < $(DIR_SRC)/src/patches/gcc/gcc44-unwind-debug-hook.patch
-
-       # texinfo 5 syntax-fixes
-       cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/gcc-4.4.7-texinfo-5.patch
+       cd $(DIR_APP) && patch -Np0 < $(DIR_SRC)/src/patches/gcc/gcc49-i386-libgomp.patch
+       cd $(DIR_APP) && patch -Np0 < $(DIR_SRC)/src/patches/gcc/gcc49-libtool-no-rpath.patch
+       cd $(DIR_APP) && patch -Np0 < $(DIR_SRC)/src/patches/gcc/gcc49-no-add-needed.patch
+       cd $(DIR_APP) && patch -Np0 < $(DIR_SRC)/src/patches/gcc/gcc49-pr38757.patch
+       cd $(DIR_APP) && patch -Np0 < $(DIR_SRC)/src/patches/gcc/gcc49-pr64336.patch
+       cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/gcc/gcc-fix-inlining-issues.patch
 
 ifneq "$(ROOT)" ""
        # Build gmp and mpfr internally in toolchain.
@@ -197,25 +224,39 @@ ifneq "$(ROOT)" ""
        cd $(DIR_APP) && mv -v gmp-$(GMP_VER) gmp
        cd $(DIR_APP) && tar xfa $(DIR_DL)/mpfr-$(MPFR_VER).tar.bz2
        cd $(DIR_APP) && mv -v mpfr-$(MPFR_VER) mpfr
+       cd $(DIR_APP) && tar xfa $(DIR_DL)/mpc-$(MPC_VER).tar.gz
+       cd $(DIR_APP) && mv -v mpc-$(MPC_VER) mpc
 
 ifeq    "$(PASS)" "1"
        # GCC does not detect stack protection correctly, which causes problems
        # for the build of libresolv_pic.a.
        cd $(DIR_APP) && sed -i '/k prot/agcc_cv_libc_provides_ssp=yes' gcc/configure
+
+       for file in $$(find $(DIR_APP)/gcc/config -name linux64.h -o -name linux.h \
+                       -o -name sysv4.h -o -name linux-eabi.h -o -name linux-elf.h); do \
+               echo "Processing $${file}..."; \
+               sed -i $${file} \
+                       -e 's@/lib\(64\)\?\(32\)\?/ld@/tools&@g' \
+                       -e 's@/usr@/tools@g'; \
+               echo '#undef STANDARD_STARTFILE_PREFIX_1' >> $${file}; \
+               echo '#undef STANDARD_STARTFILE_PREFIX_2' >> $${file}; \
+               echo '#define STANDARD_STARTFILE_PREFIX_1 "/tools/lib/"' >> $${file}; \
+               echo '#define STANDARD_STARTFILE_PREFIX_2 ""' >> $${file}; \
+       done
 endif
 
 ifeq    "$(PASS)" "2"
-       cd $(DIR_APP) && patch -Np1 -i $(DIR_SRC)/src/patches/gcc-4.4.3-startfiles_fix-1.patch
-
+       cd $(DIR_APP) && cat gcc/limitx.h gcc/glimits.h gcc/limity.h > \
+                       `dirname $$(/tools/bin/$(CROSSTARGET)-gcc -print-libgcc-file-name)`/include-fixed/limits.h
        for file in $$(find $(DIR_APP)/gcc/config -name linux64.h -o -name linux.h \
                        -o -name sysv4.h -o -name linux-eabi.h -o -name linux-elf.h); do \
                echo "Processing $${file}..."; \
                sed -i $${file} \
                        -e 's@/lib\(64\)\?\(32\)\?/ld@/tools&@g' \
                        -e 's@/usr@/tools@g'; \
-               echo '#undef STANDARD_INCLUDE_DIR' >> $${file}; \
-               echo '#define STANDARD_INCLUDE_DIR 0' >> $${file}; \
-               echo '#define STANDARD_STARTFILE_PREFIX_1 ""' >> $${file}; \
+               echo '#undef STANDARD_STARTFILE_PREFIX_1' >> $${file}; \
+               echo '#undef STANDARD_STARTFILE_PREFIX_2' >> $${file}; \
+               echo '#define STANDARD_STARTFILE_PREFIX_1 "/tools/lib/"' >> $${file}; \
                echo '#define STANDARD_STARTFILE_PREFIX_2 ""' >> $${file}; \
        done
 endif
@@ -226,6 +267,15 @@ endif
                -e 's@\./fixinc\.sh@-c true@' \
                -e 's/^T_CFLAGS =$$/& -fomit-frame-pointer/'
 
+ifeq    "$(PASS)" "L"
+       # libstdc++ pass
+       cd $(DIR_SRC)/gcc-build && \
+               $(EXTRA_ENV) \
+               $(DIR_APP)/libstdc++-v3/configure \
+                       $(EXTRA_CONFIG)
+       cd $(DIR_SRC)/gcc-build && make $(MAKETUNING) $(EXTRA_MAKE)
+       cd $(DIR_SRC)/gcc-build && make $(EXTRA_INSTALL) install
+else
        # The actual build.
        cd $(DIR_SRC)/gcc-build && \
                $(EXTRA_ENV) \
@@ -233,15 +283,20 @@ endif
                        $(EXTRA_CONFIG)
        cd $(DIR_SRC)/gcc-build && make $(MAKETUNING) $(EXTRA_MAKE)
        cd $(DIR_SRC)/gcc-build && make $(EXTRA_INSTALL) install
+endif
 
 ifeq "$(ROOT)" ""
        ln -svf ../usr/bin/cpp /lib
        ln -svf gcc /usr/bin/cc
+       # remove gdb python files from libdir
+       rm -rf /usr/lib/*-gdb.py
 else
 ifeq    "$(PASS)" "1"
        ln -svf libgcc.a $$(/tools/bin/$(CROSSTARGET)-gcc -print-libgcc-file-name | sed 's/libgcc/&_eh/')
 else
        ln -svf gcc /tools/bin/cc
+       # remove gdb python files from libdir
+       rm -rf /tools/lib/*-gdb.py
 endif
 endif
        @rm -rf $(DIR_APP) $(DIR_SRC)/gcc-build
index 7c8ed5e9a1e37589d67b21396919024691002f64..c0af6fc06cfd7c5b09121208ec21a4dbc7ea1aaf 100644 (file)
--- a/lfs/glibc
+++ b/lfs/glibc
@@ -51,7 +51,8 @@ else
        --with-headers=/tools/include \
        libc_cv_forced_unwind=yes \
        libc_cv_ctors_header=yes \
-       libc_cv_c_cleanup=yes
+       libc_cv_c_cleanup=yes \
+       CC=/tools/bin/$(CROSSTARGET)-gcc
   EXTRA_MAKE =
   EXTRA_INSTALL =
 endif
@@ -358,6 +359,7 @@ endif
 
        cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/glibc-test-installation.pl-libgcc_s.patch
        cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/glibc-2.12-accept-make-versions-4.0-and-greater.patch
+       cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/glibc/glibc-mq_open.patch
 
        # Fixes:
        #   Makefile:235: *** mixed implicit and normal rules.  Stop.
index ac201613d684520f699cf5f24c8ddad67d20ba73..d22b359a57fcb0d9276e557930c7f73bd078a638 100644 (file)
--- a/lfs/grep
+++ b/lfs/grep
@@ -1,7 +1,7 @@
 ###############################################################################
 #                                                                             #
 # IPFire.org - A linux based firewall                                         #
-# Copyright (C) 2007  Michael Tremer & Christian Schmidt                      #
+# Copyright (C) 2016  Michael Tremer & Christian Schmidt                      #
 #                                                                             #
 # 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        #
@@ -24,7 +24,7 @@
 
 include Config
 
-VER        = 2.21
+VER        = 2.22
 
 THISAPP    = grep-$(VER)
 DL_FILE    = $(THISAPP).tar.xz
@@ -54,7 +54,7 @@ objects = $(DL_FILE)
 
 $(DL_FILE) = $(DL_FROM)/$(DL_FILE)
 
-$(DL_FILE)_MD5 = 43c48064d6409862b8a850db83c8038a
+$(DL_FILE)_MD5 = e1015e951a49a82b02e38891026ef5df
 
 install : $(TARGET)
 
index 3e613a824f66a586993714977b8b34e7d389b6ae..ba744087cf6b2ebb96b335f5aab5ca2b08a93f85 100644 (file)
--- a/lfs/grub
+++ b/lfs/grub
@@ -101,6 +101,7 @@ $(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects))
 
        # Disable hardening.
        paxctl -mpes /usr/sbin/grub-bios-setup /usr/sbin/grub-probe
+       paxctl -mpexs /usr/bin/grub-script-check
 
        # We don't need to install unifont just to generate a grub2 compatible
        # font archive for the graphical boot menu. The following command only
diff --git a/lfs/libmpc b/lfs/libmpc
new file mode 100644 (file)
index 0000000..5aa43d9
--- /dev/null
@@ -0,0 +1,77 @@
+###############################################################################
+#                                                                             #
+# IPFire.org - A linux based firewall                                         #
+# Copyright (C) 2007  Michael Tremer & Christian Schmidt                      #
+#                                                                             #
+# 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 3 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, see <http://www.gnu.org/licenses/>.       #
+#                                                                             #
+###############################################################################
+
+###############################################################################
+# Definitions
+###############################################################################
+
+include Config
+
+VER        = 1.0.3
+
+THISAPP    = mpc-$(VER)
+DL_FILE    = $(THISAPP).tar.gz
+DL_FROM    = $(URL_IPFIRE)
+DIR_APP    = $(DIR_SRC)/$(THISAPP)
+TARGET     = $(DIR_INFO)/$(THISAPP)
+
+###############################################################################
+# Top-level Rules
+###############################################################################
+
+objects = $(DL_FILE)
+
+$(DL_FILE) = $(DL_FROM)/$(DL_FILE)
+
+$(DL_FILE)_MD5 = d6a1d5f8ddea3abd2cc3e98f58352d26
+
+install : $(TARGET)
+
+check : $(patsubst %,$(DIR_CHK)/%,$(objects))
+
+download :$(patsubst %,$(DIR_DL)/%,$(objects))
+
+md5 : $(subst %,%_MD5,$(objects))
+
+###############################################################################
+# Downloading, checking, md5sum
+###############################################################################
+
+$(patsubst %,$(DIR_CHK)/%,$(objects)) :
+       @$(CHECK)
+
+$(patsubst %,$(DIR_DL)/%,$(objects)) :
+       @$(LOAD)
+
+$(subst %,%_MD5,$(objects)) :
+       @$(MD5)
+
+###############################################################################
+# Installation Details
+###############################################################################
+
+$(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects))
+       @$(PREBUILD)
+       @rm -rf $(DIR_APP) && cd $(DIR_SRC) && tar axf $(DIR_DL)/$(DL_FILE)
+       cd $(DIR_APP) && ./configure --prefix=/usr
+       cd $(DIR_APP) && make $(MAKETUNING)
+       cd $(DIR_APP) && make install
+       @rm -rf $(DIR_APP)
+       @$(POSTBUILD)
index 829b21e3e4d1d0e83a2cd1914c4fb8a778ca7033..262e591772dfaf3f5c57322175e81924ac85b07d 100644 (file)
--- a/lfs/linux
+++ b/lfs/linux
@@ -1,7 +1,7 @@
 ###############################################################################
 #                                                                             #
 # IPFire.org - A linux based firewall                                         #
-# Copyright (C) 2007-2015  IPFire Team <info@ipfire.org>                      #
+# Copyright (C) 2007-2016  IPFire Team <info@ipfire.org>                      #
 #                                                                             #
 # 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        #
 
 include Config
 
-VER         = 3.14.57
-RPI_PATCHES = 3.14.57-grsec-ipfire1
-A7M_PATCHES = 3.14.57-grsec-ipfire1
-GRS_PATCHES = grsecurity-3.1ipfire-3.14.57-v1.patch.xz
+VER         = 3.14.62
+RPI_PATCHES = 3.14.62-grsec-ipfire1
+A7M_PATCHES = 3.14.62-grsec-ipfire1
+GRS_PATCHES = grsecurity-3.1ipfire-3.14.62-v1.patch.xz
 
 
 THISAPP    = linux-$(VER)
@@ -37,7 +37,7 @@ DIR_APP    = $(DIR_SRC)/$(THISAPP)
 CFLAGS     =
 CXXFLAGS   =
 
-PAK_VER    = 64
+PAK_VER    = 65
 DEPS      = ""
 
 KERNEL_ARCH = $(MACHINE)
@@ -83,10 +83,10 @@ rpi-patches-$(RPI_PATCHES).patch.xz         = $(URL_IPFIRE)/rpi-patches-$(RPI_PATCHES).
 arm7-multi-patches-$(A7M_PATCHES).patch.xz     = $(URL_IPFIRE)/arm7-multi-patches-$(A7M_PATCHES).patch.xz
 $(GRS_PATCHES)                                 = $(URL_IPFIRE)/$(GRS_PATCHES)
 
-$(DL_FILE)_MD5                                 = b7e254c83a0324852c8ccc4ed1b5377d
-rpi-patches-$(RPI_PATCHES).patch.xz_MD5                = 4ab53e184441c895adf318a1c2874d43
-arm7-multi-patches-$(A7M_PATCHES).patch.xz_MD5 = f29bd5c156384b0a4bb7c6e2c973ea06
-$(GRS_PATCHES)_MD5                             = de603c5cb2e38ee308f1647ad3bd24cf
+$(DL_FILE)_MD5                                 = 84dd675bb2024beb18ade2fe55e7b47d
+rpi-patches-$(RPI_PATCHES).patch.xz_MD5                = 6f84442e9c00aab43e8118db199107c4
+arm7-multi-patches-$(A7M_PATCHES).patch.xz_MD5 = 4ed04c218c0a84a6a1954d220ad601b6
+$(GRS_PATCHES)_MD5                             = 9a77776b2740084dc80846e707bca0e3
 
 install : $(TARGET)
 
@@ -170,8 +170,32 @@ endif
        # update the queued trim blacklist from kernel 4.2rc1
        cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/linux-3.14.43_new_qtrim_blacklist.patch
 
-       # HyperV 2008 patch
-       cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/linux-3.14.x-hyperv-2008-fix.patch
+       # Hyper-V patches
+       cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/linux/0001-Drivers-net-hyperv-Get-rid-of-the-rndis_filter_packe.patch
+       cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/linux/0002-Drivers-net-hyperv-Cleanup-the-receive-path.patch
+       cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/linux/0003-Drivers-net-hyperv-Cleanup-the-netvsc-receive-callba.patch
+       cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/linux/0004-hyperv-Add-latest-NetVSP-versions-to-auto-negotiatio.patch
+       cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/linux/0005-Drivers-net-hyperv-Enable-scatter-gather-I-O.patch
+       cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/linux/0006-Drivers-net-hyperv-Cleanup-the-send-path.patch
+       cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/linux/0007-Drivers-net-hyperv-Enable-offloads-on-the-host.patch
+       cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/linux/0008-Drivers-net-hyperv-Enable-receive-side-IP-checksum-o.patch
+       cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/linux/0009-Drivers-net-hyperv-Enable-send-side-checksum-offload.patch
+       cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/linux/0010-Drivers-net-hyperv-Enable-large-send-offload.patch
+       cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/linux/0011-hyperv-Change-the-receive-buffer-size-for-legacy-hos.patch
+       cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/linux/0012-Drivers-net-hyperv-Allocate-memory-for-all-possible-.patch
+       cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/linux/0013-Drivers-net-hyperv-Negotiate-suitable-ndis-version-f.patch
+       cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/linux/0014-Drivers-net-hyperv-Address-UDP-checksum-issues.patch
+       cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/linux/0015-hyperv-Properly-handle-checksum-offload.patch
+       cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/linux/0016-hyperv-Add-support-for-virtual-Receive-Side-Scaling-.patch
+       cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/linux/0017-hyperv-Remove-recv_pkt_list-and-lock.patch
+       cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/linux/0018-hyperv-Simplify-the-send_completion-variables.patch
+       cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/linux/0019-hyperv-Enable-sendbuf-mechanism-on-the-send-path.patch
+       cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/linux/0020-Add-support-for-netvsc-build-without-CONFIG_SYSFS-fl.patch
+       cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/linux/0021-hyperv-Add-hash-value-into-RNDIS-Per-packet-info.patch
+       cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/linux/0022-hyperv-fix-apparent-cut-n-paste-error-in-send-path-t.patch
+       cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/linux/0023-hyperv-Fix-error-return-code-in-netvsc_init_buf.patch
+       cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/linux/0024-hyperv-Fix-a-bug-in-netvsc_send.patch
+       cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/linux/0025-Drivers-hv-vmbus-Support-per-channel-driver-state.patch
 
        # fix empty symbol crc's
        cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/linux-genksyms_fix_typeof_handling.patch
@@ -186,6 +210,7 @@ ifeq "$(KCFG)" "-multi"
 
        # Apply Arm7-multiarch kernel patches.
        cd $(DIR_APP) && xzcat $(DIR_DL)/arm7-multi-patches-$(A7M_PATCHES).patch.xz | patch -Np1
+       cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/arm-multi-grsec-compile-fixes.patch
 
        # Install switch api userspace header
        cd $(DIR_APP) && install -v -m644 include/uapi/linux/switch.h /usr/include/linux/
diff --git a/lfs/lua b/lfs/lua
new file mode 100644 (file)
index 0000000..6a6a959
--- /dev/null
+++ b/lfs/lua
@@ -0,0 +1,80 @@
+###############################################################################
+#                                                                             #
+# IPFire.org - A linux based firewall                                         #
+# Copyright (C) 2007  Michael Tremer & Christian Schmidt                      #
+#                                                                             #
+# 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 3 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, see <http://www.gnu.org/licenses/>.       #
+#                                                                             #
+###############################################################################
+
+###############################################################################
+# Definitions
+###############################################################################
+
+include Config
+
+VER        = 5.3.0
+
+THISAPP    = lua-$(VER)
+DL_FILE    = $(THISAPP).tar.gz
+DL_FROM    = $(URL_IPFIRE)
+DIR_APP    = $(DIR_SRC)/$(THISAPP)
+TARGET     = $(DIR_INFO)/$(THISAPP)
+
+###############################################################################
+# Top-level Rules
+###############################################################################
+
+objects = $(DL_FILE)
+
+$(DL_FILE) = $(DL_FROM)/$(DL_FILE)
+
+$(DL_FILE)_MD5 = a1b0a7e92d0c85bbff7a8d27bf29f8af
+
+install : $(TARGET)
+
+check : $(patsubst %,$(DIR_CHK)/%,$(objects))
+
+download :$(patsubst %,$(DIR_DL)/%,$(objects))
+
+md5 : $(subst %,%_MD5,$(objects))
+
+###############################################################################
+# Downloading, checking, md5sum
+###############################################################################
+
+$(patsubst %,$(DIR_CHK)/%,$(objects)) :
+       @$(CHECK)
+
+$(patsubst %,$(DIR_DL)/%,$(objects)) :
+       @$(LOAD)
+
+$(subst %,%_MD5,$(objects)) :
+       @$(MD5)
+
+###############################################################################
+# Installation Details
+###############################################################################
+
+$(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects))
+       @$(PREBUILD)
+       @rm -rf $(DIR_APP) && cd $(DIR_SRC) && tar axf $(DIR_DL)/$(DL_FILE)
+       cd $(DIR_APP) && cp -v src/luaconf.h src/luaconf.h.template.in
+       cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/lua-5.3.0-autotoolize.patch
+       cd $(DIR_APP) && autoreconf -vfi
+       cd $(DIR_APP) && ./configure --prefix=/usr
+       cd $(DIR_APP) && make $(MAKETUNING)
+       cd $(DIR_APP) && make install
+       @rm -rf $(DIR_APP)
+       @$(POSTBUILD)
diff --git a/lfs/m4 b/lfs/m4
index 462022195999eb83e21ca4ff961b588a751eaf61..932cb6d519e7f46e0ac7d7013fa7fd0bc3cd066d 100644 (file)
--- a/lfs/m4
+++ b/lfs/m4
 
 include Config
 
-VER        = 1.4.16
+VER        = 1.4.17
 
 THISAPP    = m4-$(VER)
-DL_FILE    = $(THISAPP).tar.bz2
+DL_FILE    = $(THISAPP).tar.xz
 DL_FROM    = $(URL_IPFIRE)
 DIR_APP    = $(DIR_SRC)/$(THISAPP)
 
@@ -37,12 +37,10 @@ ifeq "$(ROOT)" ""
   TARGET = $(DIR_INFO)/$(THISAPP)
   EXTRA_CONFIG = --prefix=/usr --disable-nls
   EXTRA_MAKE =
-  EXTRA_INSTALL =
 else
   TARGET = $(DIR_INFO)/$(THISAPP)-tools
   EXTRA_CONFIG = --prefix=/tools --disable-nls
   EXTRA_MAKE = 
-  EXTRA_INSTALL = 
 endif
 
 ###############################################################################
@@ -53,7 +51,7 @@ objects = $(DL_FILE)
 
 $(DL_FILE) = $(DL_FROM)/$(DL_FILE)
 
-$(DL_FILE)_MD5 = 8a7cef47fecab6272eb86a6be6363b2f
+$(DL_FILE)_MD5 = 12a3c829301a4fd6586a57d3fcf196dc
 
 install : $(TARGET)
 
@@ -82,9 +80,9 @@ $(subst %,%_MD5,$(objects)) :
 
 $(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects))
        @$(PREBUILD)
-       @rm -rf $(DIR_APP) && cd $(DIR_SRC) && tar jxf $(DIR_DL)/$(DL_FILE)
+       @rm -rf $(DIR_APP) && cd $(DIR_SRC) && tar axf $(DIR_DL)/$(DL_FILE)
        cd $(DIR_APP) && ./configure $(EXTRA_CONFIG)
        cd $(DIR_APP) && make $(MAKETUNING) $(EXTRA_MAKE)
-       cd $(DIR_APP) && make $(EXTRA_INSTALL) install
+       cd $(DIR_APP) && make install
        @rm -rf $(DIR_APP)
        @$(POSTBUILD)
index c08ec883cc4b0610e1f8cd96872af8674fa726de..0d92c6be5eb1e113d499f40de3fd45217952b9ed 100644 (file)
--- a/lfs/nano
+++ b/lfs/nano
@@ -1,7 +1,7 @@
 ###############################################################################
 #                                                                             #
 # IPFire.org - A linux based firewall                                         #
-# Copyright (C) 2015  Michael Tremer & Christian Schmidt                      #
+# Copyright (C) 2016  Michael Tremer & Christian Schmidt                      #
 #                                                                             #
 # 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        #
@@ -24,7 +24,7 @@
 
 include Config
 
-VER        = 2.5.0
+VER        = 2.5.1
 
 THISAPP    = nano-$(VER)
 DL_FILE    = $(THISAPP).tar.gz
@@ -32,7 +32,7 @@ DL_FROM    = $(URL_IPFIRE)
 DIR_APP    = $(DIR_SRC)/$(THISAPP)
 TARGET     = $(DIR_INFO)/$(THISAPP)
 PROG       = nano
-PAK_VER    = 7
+PAK_VER    = 8
 
 DEPS       = ""
 
@@ -44,7 +44,7 @@ objects = $(DL_FILE)
 
 $(DL_FILE) = $(DL_FROM)/$(DL_FILE)
 
-$(DL_FILE)_MD5 = 751ed96457017572bab15be18cb873ba
+$(DL_FILE)_MD5 = f25c7da9813ae5f1df7e5dd1072de4ce
 
 install : $(TARGET)
 
diff --git a/lfs/ntp b/lfs/ntp
index 2d04b17ba02dab9ad6e3f6a4e13459071c79b5fd..3393f9059f1155d8a03684a9485898a95156fa0a 100644 (file)
--- a/lfs/ntp
+++ b/lfs/ntp
@@ -1,7 +1,7 @@
 ###############################################################################
 #                                                                             #
 # IPFire.org - A linux based firewall                                         #
-# Copyright (C) 2015  Michael Tremer & Christian Schmidt                      #
+# Copyright (C) 2016  Michael Tremer & Christian Schmidt                      #
 #                                                                             #
 # 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        #
@@ -24,7 +24,7 @@
 
 include Config
 
-VER        = 4.2.8p4
+VER        = 4.2.8p5
 
 THISAPP    = ntp-$(VER)
 DL_FILE    = $(THISAPP).tar.gz
@@ -40,7 +40,7 @@ objects = $(DL_FILE)
 
 $(DL_FILE) = $(DL_FROM)/$(DL_FILE)
 
-$(DL_FILE)_MD5 = 6af96862b09324a8ef965ca76b759c8b
+$(DL_FILE)_MD5 = 9f02b2a0acc1617ce2716d529a58d2d8
 
 install : $(TARGET)
 
@@ -70,7 +70,6 @@ $(subst %,%_MD5,$(objects)) :
 $(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects))
        @$(PREBUILD)
        @rm -rf $(DIR_APP) && cd $(DIR_SRC) && tar zxf $(DIR_DL)/$(DL_FILE)
-       cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/ntp-fix-sycing-with-local-clock.patch
        cd $(DIR_APP) && \
                ./configure \
                        --prefix=/usr \
index a19ac1ff15d2834eaa0f909e47ac8c261514af07..96e37f7d479b21cf94800594e15604bd85d54ca9 100644 (file)
@@ -1,7 +1,7 @@
 ###############################################################################
 #                                                                             #
 # IPFire.org - A linux based firewall                                         #
-# Copyright (C) 2007-2014  IPFire Team  <info@ipfire.org>                     #
+# Copyright (C) 2015  IPFire Team  <info@ipfire.org>                          #
 #                                                                             #
 # 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        #
@@ -24,7 +24,7 @@
 
 include Config
 
-VER        = 2.3.6
+VER        = 2.3.7
 
 THISAPP    = openvpn-$(VER)
 DL_FILE    = $(THISAPP).tar.xz
@@ -40,7 +40,7 @@ objects = $(DL_FILE)
 
 $(DL_FILE) = $(DL_FROM)/$(DL_FILE)
 
-$(DL_FILE)_MD5 = bcc30c296566df14feebdd8aa0e408ca
+$(DL_FILE)_MD5 = 5b819f7cd0b875f55f20a947224967aa
 
 install : $(TARGET)
 
index 88c5f4590fd41bbcd86ddace3e2e18191625b698..e021a4c63aed6b7b379be66dd52bf5d8d75e1e6f 100644 (file)
@@ -24,7 +24,7 @@
 
 include Config
 
-VER        = 7.0.3
+VER        = 7.0.11
 
 THISAPP    = owncloud-$(VER)
 DL_FILE    = $(THISAPP).tar.bz2
@@ -32,7 +32,7 @@ DL_FROM    = $(URL_IPFIRE)
 DIR_APP    = $(DIR_SRC)/$(THISAPP)
 TARGET     = $(DIR_INFO)/$(THISAPP)
 PROG       = owncloud
-PAK_VER           = 4
+PAK_VER           = 6
 
 DEPS       = ""
 
@@ -44,7 +44,7 @@ objects = $(DL_FILE)
 
 $(DL_FILE) = $(DL_FROM)/$(DL_FILE)
 
-$(DL_FILE)_MD5 = d5d2ad068046e6ddb322cf001a9bb3d5
+$(DL_FILE)_MD5 = 1f4839e43bc910a9acd8700fb9923b3a
 
 install : $(TARGET)
 
index 8899ec0ed47783d7437749687625b19d66b80d74..ce8c65258aa4d350a6b36a75f92f544103feb00f 100644 (file)
--- a/lfs/rsync
+++ b/lfs/rsync
@@ -1,7 +1,7 @@
 ###############################################################################
 #                                                                             #
 # IPFire.org - A linux based firewall                                         #
-# Copyright (C) 2007-2013  IPFire Team  <info@ipfire.org>                     #
+# Copyright (C) 2007-2016  IPFire Team  <info@ipfire.org>                     #
 #                                                                             #
 # 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        #
@@ -24,7 +24,7 @@
 
 include Config
 
-VER        = 3.1.1
+VER        = 3.1.2
 
 THISAPP    = rsync-$(VER)
 DL_FILE    = $(THISAPP).tar.gz
@@ -32,7 +32,7 @@ DL_FROM    = $(URL_IPFIRE)
 DIR_APP    = $(DIR_SRC)/$(THISAPP)
 TARGET     = $(DIR_INFO)/$(THISAPP)
 PROG       = rsync
-PAK_VER    = 9
+PAK_VER    = 10
 
 DEPS       = ""
 
@@ -44,7 +44,7 @@ objects = $(DL_FILE)
 
 $(DL_FILE) = $(DL_FROM)/$(DL_FILE)
 
-$(DL_FILE)_MD5 = 43bd6676f0b404326eee2d63be3cdcfe
+$(DL_FILE)_MD5 = 0f758d7e000c0f7f7d3792610fad70cb
 
 install : $(TARGET)
 
diff --git a/lfs/sed b/lfs/sed
index 8904fd42906aa2837ddb2a210894cbe2f2d0b152..77eba0bc63441b90418fc95674fd1e0141082231 100644 (file)
--- a/lfs/sed
+++ b/lfs/sed
@@ -1,7 +1,7 @@
 ###############################################################################
 #                                                                             #
 # IPFire.org - A linux based firewall                                         #
-# Copyright (C) 2007  Michael Tremer & Christian Schmidt                      #
+# Copyright (C) 2016  Michael Tremer & Christian Schmidt                      #
 #                                                                             #
 # 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        #
@@ -24,7 +24,7 @@
 
 include Config
 
-VER        = 4.2.1
+VER        = 4.2.2
 
 THISAPP    = sed-$(VER)
 DL_FILE    = $(THISAPP).tar.gz
@@ -53,7 +53,7 @@ objects = $(DL_FILE)
 
 $(DL_FILE) = $(DL_FROM)/$(DL_FILE)
 
-$(DL_FILE)_MD5 = f0fd4d7da574d4707e442285fd2d3b86
+$(DL_FILE)_MD5 = 4111de4faa3b9848a0686b2f260c5056
 
 install : $(TARGET)
 
index de6c87d46e0aa45394e99d2c09a566ef472984f0..997c660bb01af888cbe1f19d1b223c21cc893533 100644 (file)
--- a/lfs/squid
+++ b/lfs/squid
@@ -71,6 +71,11 @@ $(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects))
        @$(PREBUILD)
        @rm -rf $(DIR_APP) && cd $(DIR_SRC) && tar xaf $(DIR_DL)/$(DL_FILE)
        cd $(DIR_APP) && patch -Np0 -i $(DIR_SRC)/src/patches/squid-3.4-13228.patch
+       cd $(DIR_APP) && patch -Np0 -i $(DIR_SRC)/src/patches/squid-3.4.14-fix-max-file-descriptors.patch
+       cd $(DIR_APP) && patch -Np0 -i $(DIR_SRC)/src/patches/squid-3.4-13230.patch
+       cd $(DIR_APP) && autoreconf -vfi
+       cd $(DIR_APP)/libltdl && autoreconf -vfi
+
        cd $(DIR_APP) && ./configure \
                --prefix=/usr \
                --sysconfdir=/etc/squid \
index dfb54e6639bacf62319473599ffbf83127d67989..5cc3fc8b4eb8d8b113eb9a3074d6862f124bf15a 100644 (file)
@@ -1,7 +1,7 @@
 ###############################################################################
 #                                                                             #
 # IPFire.org - A linux based firewall                                         #
-# Copyright (C) 2007-2011  IPFire Team  <info@ipfire.org>                     #
+# Copyright (C) 2007-2016  IPFire Team  <info@ipfire.org>                     #
 #                                                                             #
 # 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        #
@@ -24,7 +24,7 @@
 
 include Config
 
-VER        = 2015d
+VER        = 2016a
 TZDATA_VER = $(VER)
 TZCODE_VER = $(VER)
 
@@ -45,8 +45,8 @@ objects = tzdata$(TZDATA_VER).tar.gz tzcode$(TZCODE_VER).tar.gz
 tzdata$(TZDATA_VER).tar.gz = $(DL_FROM)/tzdata$(TZDATA_VER).tar.gz
 tzcode$(TZCODE_VER).tar.gz = $(DL_FROM)/tzcode$(TZCODE_VER).tar.gz
 
-tzdata$(TZDATA_VER).tar.gz_MD5 = b595bdc4474b8fc1a15cffc67c66025b
-tzcode$(TZCODE_VER).tar.gz_MD5 = 4008a3abc025a398697b2587c48258b9
+tzdata$(TZDATA_VER).tar.gz_MD5 = 0d3123eb1b453ec0620822bd65be4c42
+tzcode$(TZCODE_VER).tar.gz_MD5 = f5e0299925631da7cf82d8ce1205111d
 
 install : $(TARGET)
 
diff --git a/lfs/xz b/lfs/xz
index c1d3ef789082f374950b9dbf84e777cc07f29ec8..c09cb34486f3d0fd38c7d1b22d3c027fcd582d74 100644 (file)
--- a/lfs/xz
+++ b/lfs/xz
@@ -24,7 +24,7 @@
 
 include Config
 
-VER        = 5.2.1
+VER        = 5.2.2
 
 THISAPP    = xz-$(VER)
 DL_FILE    = $(THISAPP).tar.xz
@@ -47,7 +47,7 @@ objects = $(DL_FILE)
 
 $(DL_FILE) = $(DL_FROM)/$(DL_FILE)
 
-$(DL_FILE)_MD5 = b5e2dd95dc8498cea5354377ed89aa65
+$(DL_FILE)_MD5 = e26772b69940085c0632589ab1d52e64
 
 install : $(TARGET)
 
@@ -77,6 +77,7 @@ $(subst %,%_MD5,$(objects)) :
 $(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects))
        @$(PREBUILD)
        @rm -rf $(DIR_APP) && cd $(DIR_SRC) && tar axf $(DIR_DL)/$(DL_FILE)
+       cd $(DIR_APP) && sed -e '/mf\.buffer = NULL/a next->coder->mf.size = 0;' -i src/liblzma/lz/lz_encoder.c
        cd $(DIR_APP) && ./configure --prefix=$(PREFIX)
        cd $(DIR_APP) && make $(MAKETUNING)
        cd $(DIR_APP) && make install
diff --git a/make.sh b/make.sh
index 08178b40b9f3f937aecc6b776ea3794dd66347a2..8392e30333e417833f45b22713768712c0ff9b56 100755 (executable)
--- a/make.sh
+++ b/make.sh
@@ -25,7 +25,7 @@
 NAME="IPFire"                                                  # Software name
 SNAME="ipfire"                                                 # Short name
 VERSION="2.17"                                                 # Version number
-CORE="99"                                                      # Core Level (Filename)
+CORE="100"                                                     # Core Level (Filename)
 PAKFIRE_CORE="99"                                              # Core Level (PAKFIRE)
 GIT_BRANCH=`git rev-parse --abbrev-ref HEAD`                   # Git Branch
 SLOGAN="www.ipfire.org"                                                # Software slogan
@@ -36,7 +36,7 @@ BUILD_IMAGES=1                                                        # Flash and Xen Downloader
 KVER=`grep --max-count=1 VER lfs/linux | awk '{ print $3 }'`
 GIT_TAG=$(git tag | tail -1)                                   # Git Tag
 GIT_LASTCOMMIT=$(git log | head -n1 | cut -d" " -f2 |head -c8) # Last commit
-TOOLCHAINVER=10
+TOOLCHAINVER=11
 
 # New architecture variables
 BUILD_ARCH="$(uname -m)"
@@ -221,7 +221,7 @@ prepareenv() {
     # Run LFS static binary creation scripts one by one
     export CCACHE_DIR=$BASEDIR/ccache
     export CCACHE_COMPRESS=1
-    export CCACHE_COMPILERCHECK="string:toolchain-${TOOLCHAINVER}:${TARGET_ARCH}"
+    export CCACHE_COMPILERCHECK="string:toolchain-${TOOLCHAINVER} ${TARGET_ARCH}"
 
     # Remove pre-install list of installed files in case user erase some files before rebuild
     rm -f $BASEDIR/build/usr/src/lsalr 2>/dev/null
@@ -287,6 +287,7 @@ buildtoolchain() {
     lfsmake1 linux                     TOOLS=1 KCFG="-headers"
     lfsmake1 glibc
     lfsmake1 cleanup-toolchain         PASS=1
+    lfsmake1 gcc                       PASS=L
     lfsmake1 binutils                  PASS=2
     lfsmake1 gcc                       PASS=2
     lfsmake1 ccache                    PASS=2
@@ -330,6 +331,7 @@ buildbase() {
     lfsmake2 gmp
     lfsmake2 gmp-compat
     lfsmake2 mpfr
+    lfsmake2 libmpc
     lfsmake2 file
     lfsmake2 gcc
     lfsmake2 sed
@@ -746,7 +748,7 @@ buildipfire() {
   ipfiremake streamripper
   ipfiremake sshfs
   ipfiremake taglib
-  ipfiremake mediatomb
+  #ipfiremake mediatomb
   ipfiremake sslh
   ipfiremake perl-gettext
   ipfiremake perl-Sort-Naturally
@@ -844,6 +846,8 @@ buildipfire() {
   ipfiremake swconfig
   ipfiremake haproxy
   ipfiremake ipset
+  ipfiremake lua
+  ipfiremake dnsdist
 }
 
 buildinstaller() {
diff --git a/src/initscripts/init.d/dnsdist b/src/initscripts/init.d/dnsdist
new file mode 100644 (file)
index 0000000..03e6ab8
--- /dev/null
@@ -0,0 +1,46 @@
+#!/bin/sh
+########################################################################
+# Begin $rc_base/init.d/dnsdist
+#
+# Description : dnsdist - A DNS load-balancer and more
+#
+########################################################################
+
+. /etc/sysconfig/rc
+. ${rc_functions}
+
+[ -r "/etc/sysconfig/dnsdist" ] && . /etc/sysconfig/dnsdist
+
+case "${1}" in
+       start)
+               boot_mesg "Starting dnsdist..."
+               loadproc /usr/bin/dnsdist -d ${ARGS}
+               ;;
+
+       stop)
+               boot_mesg "Stopping dnsdist..."
+               killproc /usr/bin/dnsdist
+               ;;
+
+       reload)
+               boot_mesg "Reloading dnsdist..."
+               reloadproc /usr/bin/dnsdist
+               ;;
+
+       restart)
+               ${0} stop
+               sleep 1
+               ${0} start
+               ;;
+
+       status)
+               statusproc /usr/bin/dnsdist
+               ;;
+
+       *)
+               echo "Usage: ${0} {start|stop|reload|restart|status}"
+               exit 1
+               ;;
+esac
+
+# End $rc_base/init.d/dnsdist
index 66220715306171a167cc6b65121ce73bc1f6fb05..cb52670d6a5e42c5dbf7fd809fd1350d66a8a00d 100644 (file)
@@ -21,9 +21,11 @@ iptables_init() {
        iptables -F
        iptables -t nat -F
        iptables -t mangle -F
+       iptables -t raw -F
        iptables -X
        iptables -t nat -X
        iptables -t mangle -X
+       iptables -t raw -X
 
        # Set up policies
        iptables -P INPUT DROP
@@ -84,10 +86,71 @@ iptables_init() {
        iptables -A INPUT   -p tcp -j BADTCP
        iptables -A FORWARD -p tcp -j BADTCP
 
-       # Connection tracking chain
+       # Connection tracking chains
        iptables -N CONNTRACK
-       iptables -A CONNTRACK -m conntrack --ctstate ESTABLISHED,RELATED -j ACCEPT
+       iptables -A CONNTRACK -m conntrack --ctstate ESTABLISHED -j ACCEPT
        iptables -A CONNTRACK -m conntrack --ctstate INVALID -j DROP
+       iptables -A CONNTRACK -p icmp -m conntrack --ctstate RELATED -j ACCEPT
+       iptables -t raw -N CONNTRACK
+       iptables -t raw -A PREROUTING -j CONNTRACK
+
+       # Conntrack helpers (https://home.regit.org/netfilter-en/secure-use-of-helpers/)
+
+       # SIP
+       if [ "${CONNTRACK_SIP}" = "on" ]; then
+               iptables -A CONNTRACK -m conntrack --ctstate RELATED \
+                       -m helper --helper sip -j ACCEPT
+               for proto in udp tcp; do
+                       iptables -t raw -A CONNTRACK -p "${proto}" --dport 5060 -j CT --helper sip
+               done
+       fi
+
+       # H.323
+       if [ "${CONNTRACK_H323}" = "on" ]; then
+               iptables -A CONNTRACK -m conntrack --ctstate RELATED \
+                       -m helper --helper h323 -j ACCEPT
+
+               # Gatekeeper RAS
+               iptables -t raw -A CONNTRACK -p udp --dport 1719 -j CT --helper RAS
+
+               # Q.931
+               iptables -t raw -A CONNTRACK -p tcp --dport 1720 -j CT --helper Q.931
+       fi
+
+       # FTP
+       if [ "${CONNTRACK_FTP}" = "on" ]; then
+               iptables -A CONNTRACK -m conntrack --ctstate RELATED \
+                       -m helper --helper ftp -p tcp --dport 1024: -j ACCEPT
+               iptables -t raw -A CONNTRACK -p tcp --dport 21 -j CT --helper ftp
+       fi
+
+       # PPTP
+       if [ "${CONNTRACK_PPTP}" = "on" ]; then
+               iptables -A CONNTRACK -m conntrack --ctstate RELATED \
+                       -m helper --helper pptp -j ACCEPT
+               iptables -t raw -A CONNTRACK -p udp --dport 1723 -j CT --helper pptp
+       fi
+
+       # TFTP
+       if [ "${CONNTRACK_TFTP}" = "on" ]; then
+               iptables -A CONNTRACK -m conntrack --ctstate RELATED \
+                       -m helper --helper tftp -j ACCEPT
+               iptables -t raw -A CONNTRACK -p udp --dport 69 -j CT --helper tftp
+       fi
+
+       # IRC
+       if [ "${CONNTRACK_IRC}" = "on" ]; then
+               iptables -A CONNTRACK -m conntrack --ctstate RELATED \
+                       -m helper --helper irc -j ACCEPT
+               iptables -t raw -A CONNTRACK -p tcp --dport 6667 -j CT --helper irc
+       fi
+
+       # Amanda
+       if [ "${CONNTRACK_AMANDA}" = "on" ]; then
+               iptables -A CONNTRACK -m conntrack --ctstate RELATED \
+                       -m helper --helper amanda -j ACCEPT
+               iptables -t raw -A CONNTRACK -p tcp -j CT --helper amanda
+       fi
 
        # Fix for braindead ISP's
        iptables -A FORWARD -p tcp --tcp-flags SYN,RST SYN -j TCPMSS --clamp-mss-to-pmtu
@@ -400,24 +463,6 @@ iptables_red_down() {
 # See how we were called.
 case "$1" in
   start)
-       boot_mesg "Loading firewall modules into the kernel"
-       modprobe iptable_nat || failed=1
-       for i in $(find /lib/modules/$(uname -r) -name nf_conntrack*); do
-               modprobe $(basename $i | cut -d. -f1) || failed=1
-       done
-       for i in $(find /lib/modules/$(uname -r) -name nf_nat*); do
-               modprobe $(basename $i | cut -d. -f1) || failed=1
-       done
-       (exit ${failed})
-       evaluate_retval
-
-       if [ -e /var/ipfire/main/disable_nf_sip ]; then
-               rmmod nf_nat_sip
-               rmmod nf_conntrack_sip
-               rmmod nf_nat_h323
-               rmmod nf_conntrack_h323
-       fi
-
        boot_mesg "Setting up firewall"
        iptables_init
        evaluate_retval
index 0d9b013ea0522a239394cbfb9dc0d3124cc65b00..c00f65922c97450e74aae3cc3f0c28f9c36f2251 100644 (file)
@@ -728,7 +728,7 @@ use_ramdisk() {
                2)
                        local mem_avail="$(mem_amount)"
 
-                       if [ ${mem_avail} -ge 490 ]; then
+                       if [ ${mem_avail} -ge 400 ]; then
                                return 0
                        else
                                return 1
index a7bad47b5037c0af2ef4af5551940ef21a51b6f0..a2cdc66d257404c57cdad5013cda247bbfcbe751 100644 (file)
@@ -31,13 +31,6 @@ dhcpcd_up()
        # Only if RED_TYPE=DHCP update /var/ipfire/red
        if [ "$RED_TYPE" == "DHCP" ]; then
 
-               #Force MTU option for KabelDeutschland because this ISP
-               #set the MTU to 576 instead of the supportet 1500
-               if [ $RED_DHCP_FORCE_MTU -ge 576 ]; then
-                       logger -p local0.info -t dhcpcd.exe[$$] "Force mtu to $RED_DHCP_FORCE_MTU"
-                       ip link set $interface mtu $RED_DHCP_FORCE_MTU
-               fi
-
                #Check if we have to restart the services at update
                [ ! -e "/var/ipfire/red/active" ] && update=1;
                if [ "$old_domain_name_service" != "$new_domain_name_service" ]; then
index 5e1420b9d28f06cc224811e4210327db949b3acd..c00dbcf7ceac5f82c52ee71f1fd0f7dc3fc748ed 100644 (file)
 #include <sys/types.h>
 #include <fcntl.h>
 #include "setuid.h"
+#include "libsmooth.h"
 
-int main(int argc, char *argv[]) {
+#define QOS_SH "/var/ipfire/qos/bin/qos.sh"
 
+int main(int argc, char *argv[]) {
+       struct keyvalue* kv = NULL;
         int fd = -1;
+       int r = 0;
 
         if (!(initsetuid()))
                 exit(1);
@@ -26,30 +30,48 @@ int main(int argc, char *argv[]) {
         }
 
         if (strcmp(argv[1], "generate") == 0) {
-                safe_system("/usr/bin/perl /var/ipfire/qos/bin/makeqosscripts.pl > /var/ipfire/qos/bin/qos.sh");
+               kv = initkeyvalues();
+               if (!readkeyvalues(kv, CONFIG_ROOT "/qos/settings")) {
+                       fprintf(stderr, "Cannot read QoS settings\n");
+                       r = 1;
+                       goto END;
+               }
+
+               char enabled[STRING_SIZE];
+               if (!findkey(kv, "ENABLED", enabled))
+                       strcpy(enabled, "off");
+
+               if (strcmp(enabled, "on") == 0)
+                       safe_system("/usr/bin/perl /var/ipfire/qos/bin/makeqosscripts.pl > " QOS_SH);
+               else
+                       unlink(QOS_SH);
         }
 
-        if ((fd = open("/var/ipfire/qos/bin/qos.sh", O_RDONLY)) != -1) {
+        if ((fd = open(QOS_SH, O_RDONLY)) != -1) {
                 close(fd);
         } else {
                 // If there is no qos.sh do nothing.
-                exit(0);
+                goto END;
         }
 
-        safe_system("chmod 755 /var/ipfire/qos/bin/qos.sh &>/dev/null");
+        safe_system("chmod 755 " QOS_SH " &>/dev/null");
         if (strcmp(argv[1], "start") == 0) {
-                safe_system("/var/ipfire/qos/bin/qos.sh start");
+                safe_system(QOS_SH " start");
         } else if (strcmp(argv[1], "stop") == 0) {
-                safe_system("/var/ipfire/qos/bin/qos.sh clear");
+                safe_system(QOS_SH " clear");
         } else if (strcmp(argv[1], "status") == 0) {
-                safe_system("/var/ipfire/qos/bin/qos.sh status");
+                safe_system(QOS_SH " status");
         } else if (strcmp(argv[1], "restart") == 0) {
-                safe_system("/var/ipfire/qos/bin/qos.sh restart");
+                safe_system(QOS_SH " restart");
         } else {
                 if (strcmp(argv[1], "generate") == 0) {exit(0);}
                 fprintf(stderr, "\nBad argument given.\n\nqosctrl (start|stop|restart|status|generate)\n\n");
                 exit(1);
         }
 
-        return 0;
+END:
+       if (kv)
+               freekeyvalues(kv);
+
+        return r;
 }
index 48b0978d78a927e0a6b9e1a434e3e6d42667d7c2..109d267a4fe833f63794f49472d5309a0c0a10f7 100644 (file)
@@ -35,7 +35,7 @@ int main(int argc, char *argv[]) {
                safe_system("ln -fs ../init.d/ntp /etc/rc.d/rc6.d/K46ntpd >/dev/null 2>&1");
                safe_system("/etc/rc.d/init.d/ntp start");
        } else if (strcmp(argv[1], "disable") == 0) {
-               safe_system("/etc/rc.d/init.d/ntpd stop");
+               safe_system("/etc/rc.d/init.d/ntp stop");
                safe_system("rm -f /etc/rc.d/rc*.d/*ntpd >/dev/null 2>&1");
        } else {
                fprintf(stderr, "\nBad argument given.\n\ntimectrl (start|stop|restart)\n\n");
index 4a2e6dc862d371f6cb9647766de2a9fd809df11b..1e166eb3da160f0467641d82f49cd5e2a41d3373 100644 (file)
@@ -39,7 +39,6 @@ void exithandler(void) {
 }
 
 int main(void) {
-       char green_dev[STRING_SIZE] = "";
        char buffer[STRING_SIZE];
        char *index, *ipaddress, *macaddress, *enabled;
        struct keyvalue *kv = NULL;
@@ -68,14 +67,6 @@ int main(void) {
                exit(1);
        }
 
-       /* Get the GREEN interface details */
-       if (findkey(kv, "GREEN_DEV", green_dev) > 0) {
-               if (!VALID_DEVICE(green_dev)) {
-                       fprintf(stderr, "Bad GREEN_DEV: %s\n", green_dev);
-                       exit(1);
-               }
-       }
-
        /* Get the BLUE interface details */
        if (findkey(kv, "BLUE_DEV", blue_dev) > 0) {
                if ((strlen(blue_dev) > 0) && !VALID_DEVICE(blue_dev)) {
@@ -135,21 +126,21 @@ int main(void) {
                if (strcmp(enabled, "on") == 0) {
                        /* both specified, added security */
                        if ((strlen(macaddress) == 17) && (VALID_IP_AND_MASK(ipaddress))) {
-                               snprintf(command, STRING_SIZE-1, "/sbin/iptables --wait -A WIRELESSINPUT -m mac --mac-source %s -s %s -i %s -j ACCEPT", macaddress, ipaddress, blue_dev);
+                               snprintf(command, STRING_SIZE-1, "/sbin/iptables --wait -A WIRELESSINPUT -m mac --mac-source %s -s %s -i %s -j RETURN", macaddress, ipaddress, blue_dev);
                                safe_system(command);
                                snprintf(command, STRING_SIZE-1, "/sbin/iptables --wait -A WIRELESSFORWARD -m mac --mac-source %s -s %s -i %s -j RETURN", macaddress, ipaddress, blue_dev);
                                safe_system(command);
                        } else {
                                /* correctly formed mac address is 17 chars */
                                if (strlen(macaddress) == 17) {
-                                       snprintf(command, STRING_SIZE-1, "/sbin/iptables --wait -A WIRELESSINPUT -m mac --mac-source %s -i %s -j ACCEPT", macaddress, blue_dev);
+                                       snprintf(command, STRING_SIZE-1, "/sbin/iptables --wait -A WIRELESSINPUT -m mac --mac-source %s -i %s -j RETURN", macaddress, blue_dev);
                                        safe_system(command);
                                        snprintf(command, STRING_SIZE-1, "/sbin/iptables --wait -A WIRELESSFORWARD -m mac --mac-source %s -i %s -j RETURN", macaddress, blue_dev);
                                        safe_system(command);
                                }
 
                                if (VALID_IP_AND_MASK(ipaddress)) {
-                                       snprintf(command, STRING_SIZE-1, "/sbin/iptables --wait -A WIRELESSINPUT -s %s -i %s -j ACCEPT", ipaddress, blue_dev);
+                                       snprintf(command, STRING_SIZE-1, "/sbin/iptables --wait -A WIRELESSINPUT -s %s -i %s -j RETURN", ipaddress, blue_dev);
                                        safe_system(command);
                                        snprintf(command, STRING_SIZE-1, "/sbin/iptables --wait -A WIRELESSFORWARD -s %s -i %s -j RETURN", ipaddress, blue_dev);
                                        safe_system(command);
diff --git a/src/patches/arm-multi-grsec-compile-fixes.patch b/src/patches/arm-multi-grsec-compile-fixes.patch
new file mode 100644 (file)
index 0000000..530d69e
--- /dev/null
@@ -0,0 +1,11 @@
+--- a/arch/arm/mach-omap2/cclock3xxx_data.c~   2015-12-12 11:00:10.474423373 +0000
++++ b/arch/arm/mach-omap2/cclock3xxx_data.c    2015-12-12 11:30:31.198452547 +0000
+@@ -250,7 +250,7 @@
+ static struct clk dpll1_ck;
+-static struct clk_ops dpll1_ck_ops;
++static clk_ops_no_const dpll1_ck_ops;
+ static struct clk_ops dpll1_ck_ops_34xx __initdata = {
+       .init           = &omap2_init_clk_clkdm,
similarity index 93%
rename from src/patches/backports-3.18.1-1-add_usbnet_modules.patch
rename to src/patches/backports-4.2.6-1-add_usbnet_modules.patch
index 11b9638aec2afd9b7c469ddca0ea78ee22227895..660ef8cc5c160ed276de95e40a3937831fc46490 100644 (file)
@@ -1,7 +1,7 @@
-diff -Naur backports-3.18.1-1.org/drivers/net/usb/asix_common.c backports-3.18.1-1/drivers/net/usb/asix_common.c
---- backports-3.18.1-1.org/drivers/net/usb/asix_common.c       1970-01-01 01:00:00.000000000 +0100
-+++ backports-3.18.1-1/drivers/net/usb/asix_common.c   2014-12-16 18:39:45.000000000 +0100
-@@ -0,0 +1,582 @@
+diff -Naur backports-4.2.6-1.org/drivers/net/usb/asix_common.c backports-4.2.6-1/drivers/net/usb/asix_common.c
+--- backports-4.2.6-1.org/drivers/net/usb/asix_common.c        1970-01-01 01:00:00.000000000 +0100
++++ backports-4.2.6-1/drivers/net/usb/asix_common.c    2015-11-09 23:37:56.000000000 +0100
+@@ -0,0 +1,584 @@
 +/*
 + * ASIX AX8817X based USB 2.0 Ethernet Devices
 + * Copyright (C) 2003-2006 David Hollis <dhollis@davehollis.com>
@@ -192,6 +192,8 @@ diff -Naur backports-3.18.1-1.org/drivers/net/usb/asix_common.c backports-3.18.1
 +              memcpy(skb_tail_pointer(skb), &padbytes, sizeof(padbytes));
 +              skb_put(skb, sizeof(padbytes));
 +      }
++
++      usbnet_set_skb_tx_stats(skb, 1, 0);
 +      return skb;
 +}
 +
@@ -584,10 +586,10 @@ diff -Naur backports-3.18.1-1.org/drivers/net/usb/asix_common.c backports-3.18.1
 +
 +      return 0;
 +}
-diff -Naur backports-3.18.1-1.org/drivers/net/usb/asix_devices.c backports-3.18.1-1/drivers/net/usb/asix_devices.c
---- backports-3.18.1-1.org/drivers/net/usb/asix_devices.c      1970-01-01 01:00:00.000000000 +0100
-+++ backports-3.18.1-1/drivers/net/usb/asix_devices.c  2014-12-16 18:39:45.000000000 +0100
-@@ -0,0 +1,1104 @@
+diff -Naur backports-4.2.6-1.org/drivers/net/usb/asix_devices.c backports-4.2.6-1/drivers/net/usb/asix_devices.c
+--- backports-4.2.6-1.org/drivers/net/usb/asix_devices.c       1970-01-01 01:00:00.000000000 +0100
++++ backports-4.2.6-1/drivers/net/usb/asix_devices.c   2015-11-09 23:37:56.000000000 +0100
+@@ -0,0 +1,1107 @@
 +/*
 + * ASIX AX8817X based USB 2.0 Ethernet Devices
 + * Copyright (C) 2003-2006 David Hollis <dhollis@davehollis.com>
@@ -1077,8 +1079,7 @@ diff -Naur backports-3.18.1-1.org/drivers/net/usb/asix_devices.c backports-3.18.
 +
 +static void ax88772_unbind(struct usbnet *dev, struct usb_interface *intf)
 +{
-+      if (dev->driver_priv)
-+              kfree(dev->driver_priv);
++      kfree(dev->driver_priv);
 +}
 +
 +static const struct ethtool_ops ax88178_ethtool_ops = {
@@ -1570,6 +1571,10 @@ diff -Naur backports-3.18.1-1.org/drivers/net/usb/asix_devices.c backports-3.18.
 +      USB_DEVICE (0x0df6, 0x0056),
 +      .driver_info =  (unsigned long) &ax88178_info,
 +}, {
++      // Sitecom LN-028 "USB 2.0 10/100/1000 Ethernet adapter"
++      USB_DEVICE (0x0df6, 0x061c),
++      .driver_info =  (unsigned long) &ax88178_info,
++}, {
 +      // corega FEther USB2-TX
 +      USB_DEVICE (0x07aa, 0x0017),
 +      .driver_info =  (unsigned long) &ax8817x_info,
@@ -1692,9 +1697,9 @@ diff -Naur backports-3.18.1-1.org/drivers/net/usb/asix_devices.c backports-3.18.
 +MODULE_DESCRIPTION("ASIX AX8817X based USB 2.0 Ethernet Devices");
 +MODULE_LICENSE("GPL");
 +
-diff -Naur backports-3.18.1-1.org/drivers/net/usb/asix.h backports-3.18.1-1/drivers/net/usb/asix.h
---- backports-3.18.1-1.org/drivers/net/usb/asix.h      1970-01-01 01:00:00.000000000 +0100
-+++ backports-3.18.1-1/drivers/net/usb/asix.h  2014-12-16 18:39:45.000000000 +0100
+diff -Naur backports-4.2.6-1.org/drivers/net/usb/asix.h backports-4.2.6-1/drivers/net/usb/asix.h
+--- backports-4.2.6-1.org/drivers/net/usb/asix.h       1970-01-01 01:00:00.000000000 +0100
++++ backports-4.2.6-1/drivers/net/usb/asix.h   2015-11-09 23:37:56.000000000 +0100
 @@ -0,0 +1,234 @@
 +/*
 + * ASIX AX8817X based USB 2.0 Ethernet Devices
@@ -1930,9 +1935,9 @@ diff -Naur backports-3.18.1-1.org/drivers/net/usb/asix.h backports-3.18.1-1/driv
 +int asix_set_mac_address(struct net_device *net, void *p);
 +
 +#endif /* _ASIX_H */
-diff -Naur backports-3.18.1-1.org/drivers/net/usb/ax88172a.c backports-3.18.1-1/drivers/net/usb/ax88172a.c
---- backports-3.18.1-1.org/drivers/net/usb/ax88172a.c  1970-01-01 01:00:00.000000000 +0100
-+++ backports-3.18.1-1/drivers/net/usb/ax88172a.c      2014-12-16 18:39:45.000000000 +0100
+diff -Naur backports-4.2.6-1.org/drivers/net/usb/ax88172a.c backports-4.2.6-1/drivers/net/usb/ax88172a.c
+--- backports-4.2.6-1.org/drivers/net/usb/ax88172a.c   1970-01-01 01:00:00.000000000 +0100
++++ backports-4.2.6-1/drivers/net/usb/ax88172a.c       2015-11-09 23:37:56.000000000 +0100
 @@ -0,0 +1,422 @@
 +/*
 + * ASIX AX88172A based USB 2.0 Ethernet Devices
@@ -2356,9 +2361,9 @@ diff -Naur backports-3.18.1-1.org/drivers/net/usb/ax88172a.c backports-3.18.1-1/
 +      .rx_fixup = ax88172a_rx_fixup,
 +      .tx_fixup = asix_tx_fixup,
 +};
-diff -Naur backports-3.18.1-1.org/drivers/net/usb/ax88179_178a.c backports-3.18.1-1/drivers/net/usb/ax88179_178a.c
---- backports-3.18.1-1.org/drivers/net/usb/ax88179_178a.c      1970-01-01 01:00:00.000000000 +0100
-+++ backports-3.18.1-1/drivers/net/usb/ax88179_178a.c  2014-12-16 18:39:45.000000000 +0100
+diff -Naur backports-4.2.6-1.org/drivers/net/usb/ax88179_178a.c backports-4.2.6-1/drivers/net/usb/ax88179_178a.c
+--- backports-4.2.6-1.org/drivers/net/usb/ax88179_178a.c       1970-01-01 01:00:00.000000000 +0100
++++ backports-4.2.6-1/drivers/net/usb/ax88179_178a.c   2015-11-09 23:37:56.000000000 +0100
 @@ -0,0 +1,1756 @@
 +/*
 + * ASIX AX88179/178A USB 3.0/2.0 to Gigabit Ethernet Devices
@@ -4116,9 +4121,9 @@ diff -Naur backports-3.18.1-1.org/drivers/net/usb/ax88179_178a.c backports-3.18.
 +
 +MODULE_DESCRIPTION("ASIX AX88179/178A based USB 3.0/2.0 Gigabit Ethernet Devices");
 +MODULE_LICENSE("GPL");
-diff -Naur backports-3.18.1-1.org/drivers/net/usb/catc.c backports-3.18.1-1/drivers/net/usb/catc.c
---- backports-3.18.1-1.org/drivers/net/usb/catc.c      1970-01-01 01:00:00.000000000 +0100
-+++ backports-3.18.1-1/drivers/net/usb/catc.c  2014-12-16 18:39:45.000000000 +0100
+diff -Naur backports-4.2.6-1.org/drivers/net/usb/catc.c backports-4.2.6-1/drivers/net/usb/catc.c
+--- backports-4.2.6-1.org/drivers/net/usb/catc.c       1970-01-01 01:00:00.000000000 +0100
++++ backports-4.2.6-1/drivers/net/usb/catc.c   2015-11-09 23:37:56.000000000 +0100
 @@ -0,0 +1,965 @@
 +/*
 + *  Copyright (c) 2001 Vojtech Pavlik
@@ -4763,7 +4768,7 @@ diff -Naur backports-3.18.1-1.org/drivers/net/usb/catc.c backports-3.18.1-1/driv
 +      u8 broadcast[ETH_ALEN];
 +      u8 rx = RxEnable | RxPolarity | RxMultiCast;
 +
-+      memset(broadcast, 0xff, ETH_ALEN);
++      eth_broadcast_addr(broadcast);
 +      memset(catc->multicast, 0, 64);
 +
 +      catc_multicast(broadcast, catc->multicast);
@@ -5002,7 +5007,7 @@ diff -Naur backports-3.18.1-1.org/drivers/net/usb/catc.c backports-3.18.1-1/driv
 +              
 +              dev_dbg(dev, "Filling the multicast list.\n");
 +        
-+              memset(broadcast, 0xff, ETH_ALEN);
++              eth_broadcast_addr(broadcast);
 +              catc_multicast(broadcast, catc->multicast);
 +              catc_multicast(netdev->dev_addr, catc->multicast);
 +              catc_write_mem(catc, 0xfa80, catc->multicast, 64);
@@ -5085,9 +5090,9 @@ diff -Naur backports-3.18.1-1.org/drivers/net/usb/catc.c backports-3.18.1-1/driv
 +};
 +
 +module_usb_driver(catc_driver);
-diff -Naur backports-3.18.1-1.org/drivers/net/usb/cdc_eem.c backports-3.18.1-1/drivers/net/usb/cdc_eem.c
---- backports-3.18.1-1.org/drivers/net/usb/cdc_eem.c   1970-01-01 01:00:00.000000000 +0100
-+++ backports-3.18.1-1/drivers/net/usb/cdc_eem.c       2014-12-16 18:39:45.000000000 +0100
+diff -Naur backports-4.2.6-1.org/drivers/net/usb/cdc_eem.c backports-4.2.6-1/drivers/net/usb/cdc_eem.c
+--- backports-4.2.6-1.org/drivers/net/usb/cdc_eem.c    1970-01-01 01:00:00.000000000 +0100
++++ backports-4.2.6-1/drivers/net/usb/cdc_eem.c        2015-11-09 23:37:56.000000000 +0100
 @@ -0,0 +1,381 @@
 +/*
 + * USB CDC EEM network interface driver
@@ -5470,9 +5475,9 @@ diff -Naur backports-3.18.1-1.org/drivers/net/usb/cdc_eem.c backports-3.18.1-1/d
 +MODULE_AUTHOR("Omar Laazimani <omar.oberthur@gmail.com>");
 +MODULE_DESCRIPTION("USB CDC EEM");
 +MODULE_LICENSE("GPL");
-diff -Naur backports-3.18.1-1.org/drivers/net/usb/cdc-phonet.c backports-3.18.1-1/drivers/net/usb/cdc-phonet.c
---- backports-3.18.1-1.org/drivers/net/usb/cdc-phonet.c        1970-01-01 01:00:00.000000000 +0100
-+++ backports-3.18.1-1/drivers/net/usb/cdc-phonet.c    2014-12-16 18:39:45.000000000 +0100
+diff -Naur backports-4.2.6-1.org/drivers/net/usb/cdc-phonet.c backports-4.2.6-1/drivers/net/usb/cdc-phonet.c
+--- backports-4.2.6-1.org/drivers/net/usb/cdc-phonet.c 1970-01-01 01:00:00.000000000 +0100
++++ backports-4.2.6-1/drivers/net/usb/cdc-phonet.c     2015-11-09 23:37:56.000000000 +0100
 @@ -0,0 +1,466 @@
 +/*
 + * phonet.c -- USB CDC Phonet host driver
@@ -5606,7 +5611,7 @@ diff -Naur backports-3.18.1-1.org/drivers/net/usb/cdc-phonet.c backports-3.18.1-
 +      struct page *page;
 +      int err;
 +
-+      page = __skb_alloc_page(gfp_flags | __GFP_NOMEMALLOC, NULL);
++      page = __dev_alloc_page(gfp_flags | __GFP_NOMEMALLOC);
 +      if (!page)
 +              return -ENOMEM;
 +
@@ -5688,7 +5693,7 @@ diff -Naur backports-3.18.1-1.org/drivers/net/usb/cdc-phonet.c backports-3.18.1-
 +      if (page)
 +              put_page(page);
 +      if (req)
-+              rx_submit(pnd, req, GFP_ATOMIC | __GFP_COLD);
++              rx_submit(pnd, req, GFP_ATOMIC);
 +}
 +
 +static int usbpn_close(struct net_device *dev);
@@ -5707,7 +5712,7 @@ diff -Naur backports-3.18.1-1.org/drivers/net/usb/cdc-phonet.c backports-3.18.1-
 +      for (i = 0; i < rxq_size; i++) {
 +              struct urb *req = usb_alloc_urb(0, GFP_KERNEL);
 +
-+              if (!req || rx_submit(pnd, req, GFP_KERNEL | __GFP_COLD)) {
++              if (!req || rx_submit(pnd, req, GFP_KERNEL)) {
 +                      usb_free_urb(req);
 +                      usbpn_close(dev);
 +                      return -ENOMEM;
@@ -5940,9 +5945,9 @@ diff -Naur backports-3.18.1-1.org/drivers/net/usb/cdc-phonet.c backports-3.18.1-
 +MODULE_AUTHOR("Remi Denis-Courmont");
 +MODULE_DESCRIPTION("USB CDC Phonet host interface");
 +MODULE_LICENSE("GPL");
-diff -Naur backports-3.18.1-1.org/drivers/net/usb/cdc_subset.c backports-3.18.1-1/drivers/net/usb/cdc_subset.c
---- backports-3.18.1-1.org/drivers/net/usb/cdc_subset.c        1970-01-01 01:00:00.000000000 +0100
-+++ backports-3.18.1-1/drivers/net/usb/cdc_subset.c    2014-12-16 18:39:45.000000000 +0100
+diff -Naur backports-4.2.6-1.org/drivers/net/usb/cdc_subset.c backports-4.2.6-1/drivers/net/usb/cdc_subset.c
+--- backports-4.2.6-1.org/drivers/net/usb/cdc_subset.c 1970-01-01 01:00:00.000000000 +0100
++++ backports-4.2.6-1/drivers/net/usb/cdc_subset.c     2015-11-09 23:37:56.000000000 +0100
 @@ -0,0 +1,369 @@
 +/*
 + * Simple "CDC Subset" USB Networking Links
@@ -6313,10 +6318,10 @@ diff -Naur backports-3.18.1-1.org/drivers/net/usb/cdc_subset.c backports-3.18.1-
 +MODULE_AUTHOR("David Brownell");
 +MODULE_DESCRIPTION("Simple 'CDC Subset' USB networking links");
 +MODULE_LICENSE("GPL");
-diff -Naur backports-3.18.1-1.org/drivers/net/usb/cx82310_eth.c backports-3.18.1-1/drivers/net/usb/cx82310_eth.c
---- backports-3.18.1-1.org/drivers/net/usb/cx82310_eth.c       1970-01-01 01:00:00.000000000 +0100
-+++ backports-3.18.1-1/drivers/net/usb/cx82310_eth.c   2014-12-16 18:39:45.000000000 +0100
-@@ -0,0 +1,326 @@
+diff -Naur backports-4.2.6-1.org/drivers/net/usb/cx82310_eth.c backports-4.2.6-1/drivers/net/usb/cx82310_eth.c
+--- backports-4.2.6-1.org/drivers/net/usb/cx82310_eth.c        1970-01-01 01:00:00.000000000 +0100
++++ backports-4.2.6-1/drivers/net/usb/cx82310_eth.c    2015-11-09 23:37:56.000000000 +0100
+@@ -0,0 +1,353 @@
 +/*
 + * Driver for USB ethernet port of Conexant CX82310-based ADSL routers
 + * Copyright (C) 2010 by Ondrej Zary
@@ -6365,8 +6370,7 @@ diff -Naur backports-3.18.1-1.org/drivers/net/usb/cx82310_eth.c backports-3.18.1
 +};
 +
 +#define CMD_PACKET_SIZE       64
-+/* first command after power on can take around 8 seconds */
-+#define CMD_TIMEOUT   15000
++#define CMD_TIMEOUT   100
 +#define CMD_REPLY_RETRY 5
 +
 +#define CX82310_MTU   1514
@@ -6397,8 +6401,9 @@ diff -Naur backports-3.18.1-1.org/drivers/net/usb/cx82310_eth.c backports-3.18.1
 +      ret = usb_bulk_msg(udev, usb_sndbulkpipe(udev, CMD_EP), buf,
 +                         CMD_PACKET_SIZE, &actual_len, CMD_TIMEOUT);
 +      if (ret < 0) {
-+              dev_err(&dev->udev->dev, "send command %#x: error %d\n",
-+                      cmd, ret);
++              if (cmd != CMD_GET_LINK_STATUS)
++                      dev_err(&dev->udev->dev, "send command %#x: error %d\n",
++                              cmd, ret);
 +              goto end;
 +      }
 +
@@ -6409,8 +6414,10 @@ diff -Naur backports-3.18.1-1.org/drivers/net/usb/cx82310_eth.c backports-3.18.1
 +                                         buf, CMD_PACKET_SIZE, &actual_len,
 +                                         CMD_TIMEOUT);
 +                      if (ret < 0) {
-+                              dev_err(&dev->udev->dev,
-+                                      "reply receive error %d\n", ret);
++                              if (cmd != CMD_GET_LINK_STATUS)
++                                      dev_err(&dev->udev->dev,
++                                              "reply receive error %d\n",
++                                              ret);
 +                              goto end;
 +                      }
 +                      if (actual_len > 0)
@@ -6453,6 +6460,8 @@ diff -Naur backports-3.18.1-1.org/drivers/net/usb/cx82310_eth.c backports-3.18.1
 +      int ret;
 +      char buf[15];
 +      struct usb_device *udev = dev->udev;
++      u8 link[3];
++      int timeout = 50;
 +
 +      /* avoid ADSL modems - continue only if iProduct is "USB NET CARD" */
 +      if (usb_string(udev, udev->descriptor.iProduct, buf, sizeof(buf)) > 0
@@ -6479,6 +6488,20 @@ diff -Naur backports-3.18.1-1.org/drivers/net/usb/cx82310_eth.c backports-3.18.1
 +      if (!dev->partial_data)
 +              return -ENOMEM;
 +
++      /* wait for firmware to become ready (indicated by the link being up) */
++      while (--timeout) {
++              ret = cx82310_cmd(dev, CMD_GET_LINK_STATUS, true, NULL, 0,
++                                link, sizeof(link));
++              /* the command can time out during boot - it's not an error */
++              if (!ret && link[0] == 1 && link[2] == 1)
++                      break;
++              msleep(500);
++      }
++      if (!timeout) {
++              dev_err(&udev->dev, "firmware not ready in time\n");
++              return -ETIMEDOUT;
++      }
++
 +      /* enable ethernet mode (?) */
 +      ret = cx82310_cmd(dev, CMD_ETHERNET_MODE, true, "\x01", 1, NULL, 0);
 +      if (ret) {
@@ -6619,9 +6642,18 @@ diff -Naur backports-3.18.1-1.org/drivers/net/usb/cx82310_eth.c backports-3.18.1
 +      .tx_fixup       = cx82310_tx_fixup,
 +};
 +
++#define USB_DEVICE_CLASS(vend, prod, cl, sc, pr) \
++      .match_flags = USB_DEVICE_ID_MATCH_DEVICE | \
++                     USB_DEVICE_ID_MATCH_DEV_INFO, \
++      .idVendor = (vend), \
++      .idProduct = (prod), \
++      .bDeviceClass = (cl), \
++      .bDeviceSubClass = (sc), \
++      .bDeviceProtocol = (pr)
++
 +static const struct usb_device_id products[] = {
 +      {
-+              USB_DEVICE_AND_INTERFACE_INFO(0x0572, 0xcb01, 0xff, 0, 0),
++              USB_DEVICE_CLASS(0x0572, 0xcb01, 0xff, 0, 0),
 +              .driver_info = (unsigned long) &cx82310_info
 +      },
 +      { },
@@ -6643,9 +6675,9 @@ diff -Naur backports-3.18.1-1.org/drivers/net/usb/cx82310_eth.c backports-3.18.1
 +MODULE_AUTHOR("Ondrej Zary");
 +MODULE_DESCRIPTION("Conexant CX82310-based ADSL router USB ethernet driver");
 +MODULE_LICENSE("GPL");
-diff -Naur backports-3.18.1-1.org/drivers/net/usb/dm9601.c backports-3.18.1-1/drivers/net/usb/dm9601.c
---- backports-3.18.1-1.org/drivers/net/usb/dm9601.c    1970-01-01 01:00:00.000000000 +0100
-+++ backports-3.18.1-1/drivers/net/usb/dm9601.c        2014-12-16 18:39:45.000000000 +0100
+diff -Naur backports-4.2.6-1.org/drivers/net/usb/dm9601.c backports-4.2.6-1/drivers/net/usb/dm9601.c
+--- backports-4.2.6-1.org/drivers/net/usb/dm9601.c     1970-01-01 01:00:00.000000000 +0100
++++ backports-4.2.6-1/drivers/net/usb/dm9601.c 2015-11-09 23:37:56.000000000 +0100
 @@ -0,0 +1,647 @@
 +/*
 + * Davicom DM96xx USB 10/100Mbps ethernet devices
@@ -7294,9 +7326,9 @@ diff -Naur backports-3.18.1-1.org/drivers/net/usb/dm9601.c backports-3.18.1-1/dr
 +MODULE_AUTHOR("Peter Korsgaard <jacmet@sunsite.dk>");
 +MODULE_DESCRIPTION("Davicom DM96xx USB 10/100 ethernet devices");
 +MODULE_LICENSE("GPL");
-diff -Naur backports-3.18.1-1.org/drivers/net/usb/gl620a.c backports-3.18.1-1/drivers/net/usb/gl620a.c
---- backports-3.18.1-1.org/drivers/net/usb/gl620a.c    1970-01-01 01:00:00.000000000 +0100
-+++ backports-3.18.1-1/drivers/net/usb/gl620a.c        2014-12-16 18:39:45.000000000 +0100
+diff -Naur backports-4.2.6-1.org/drivers/net/usb/gl620a.c backports-4.2.6-1/drivers/net/usb/gl620a.c
+--- backports-4.2.6-1.org/drivers/net/usb/gl620a.c     1970-01-01 01:00:00.000000000 +0100
++++ backports-4.2.6-1/drivers/net/usb/gl620a.c 2015-11-09 23:37:56.000000000 +0100
 @@ -0,0 +1,242 @@
 +/*
 + * GeneSys GL620USB-A based links
@@ -7540,10 +7572,10 @@ diff -Naur backports-3.18.1-1.org/drivers/net/usb/gl620a.c backports-3.18.1-1/dr
 +MODULE_DESCRIPTION("GL620-USB-A Host-to-Host Link cables");
 +MODULE_LICENSE("GPL");
 +
-diff -Naur backports-3.18.1-1.org/drivers/net/usb/hso.c backports-3.18.1-1/drivers/net/usb/hso.c
---- backports-3.18.1-1.org/drivers/net/usb/hso.c       1970-01-01 01:00:00.000000000 +0100
-+++ backports-3.18.1-1/drivers/net/usb/hso.c   2015-01-03 13:42:25.000000000 +0100
-@@ -0,0 +1,3326 @@
+diff -Naur backports-4.2.6-1.org/drivers/net/usb/hso.c backports-4.2.6-1/drivers/net/usb/hso.c
+--- backports-4.2.6-1.org/drivers/net/usb/hso.c        1970-01-01 01:00:00.000000000 +0100
++++ backports-4.2.6-1/drivers/net/usb/hso.c    2016-01-27 15:03:25.000000000 +0100
+@@ -0,0 +1,3322 @@
 +/******************************************************************************
 + *
 + * Driver for Option High Speed Mobile Devices.
@@ -7604,7 +7636,6 @@ diff -Naur backports-3.18.1-1.org/drivers/net/usb/hso.c backports-3.18.1-1/drive
 +#include <linux/module.h>
 +#include <linux/ethtool.h>
 +#include <linux/usb.h>
-+#include <linux/timer.h>
 +#include <linux/tty.h>
 +#include <linux/tty_driver.h>
 +#include <linux/tty_flip.h>
@@ -7700,6 +7731,7 @@ diff -Naur backports-3.18.1-1.org/drivers/net/usb/hso.c backports-3.18.1-1/drive
 +      struct hso_device *parent;
 +      struct net_device *net;
 +      struct rfkill *rfkill;
++      char name[24];
 +
 +      struct usb_endpoint_descriptor *in_endp;
 +      struct usb_endpoint_descriptor *out_endp;
@@ -7820,7 +7852,6 @@ diff -Naur backports-3.18.1-1.org/drivers/net/usb/hso.c backports-3.18.1-1/drive
 +      u8 usb_gone;
 +      struct work_struct async_get_intf;
 +      struct work_struct async_put_intf;
-+      struct work_struct reset_device;
 +
 +      struct usb_device *usb;
 +      struct usb_interface *interface;
@@ -7886,7 +7917,6 @@ diff -Naur backports-3.18.1-1.org/drivers/net/usb/hso.c backports-3.18.1-1/drive
 +static int hso_put_activity(struct hso_device *hso_dev);
 +static int hso_get_activity(struct hso_device *hso_dev);
 +static void tiocmget_intr_callback(struct urb *urb);
-+static void reset_device(struct work_struct *data);
 +/*****************************************************************************/
 +/* Helping functions                                                         */
 +/*****************************************************************************/
@@ -8079,6 +8109,13 @@ diff -Naur backports-3.18.1-1.org/drivers/net/usb/hso.c backports-3.18.1-1/drive
 +}
 +static DEVICE_ATTR(hsotype, S_IRUGO, hso_sysfs_show_porttype, NULL);
 +
++static struct attribute *hso_serial_dev_attrs[] = {
++      &dev_attr_hsotype.attr,
++      NULL
++};
++
++ATTRIBUTE_GROUPS(hso_serial_dev);
++
 +static int hso_urb_to_index(struct hso_serial *serial, struct urb *urb)
 +{
 +      int idx;
@@ -8242,7 +8279,7 @@ diff -Naur backports-3.18.1-1.org/drivers/net/usb/hso.c backports-3.18.1-1/drive
 +      case -ETIMEDOUT:
 +              explanation = "protocol error";
 +              if (hso_dev)
-+                      schedule_work(&hso_dev->reset_device);
++                      usb_queue_reset_device(hso_dev->interface);
 +              break;
 +      default:
 +              explanation = "unknown status";
@@ -8455,7 +8492,7 @@ diff -Naur backports-3.18.1-1.org/drivers/net/usb/hso.c backports-3.18.1-1/drive
 +                                      /* We got no receive buffer. */
 +                                      D1("could not allocate memory");
 +                                      odev->rx_parse_state = WAIT_SYNC;
-+                                      return;
++                                      continue;
 +                              }
 +
 +                              /* Copy what we got so far. make room for iphdr
@@ -8817,7 +8854,6 @@ diff -Naur backports-3.18.1-1.org/drivers/net/usb/hso.c backports-3.18.1-1/drive
 +              goto err_out;
 +
 +      D1("Opening %d", serial->minor);
-+      kref_get(&serial->parent->ref);
 +
 +      /* setup */
 +      tty->driver_data = serial;
@@ -8835,7 +8871,8 @@ diff -Naur backports-3.18.1-1.org/drivers/net/usb/hso.c backports-3.18.1-1/drive
 +              if (result) {
 +                      hso_stop_serial_device(serial->parent);
 +                      atomic_dec(&serial->port.count);
-+                      kref_put(&serial->parent->ref, hso_serial_ref_free);
++              } else {
++                      kref_get(&serial->parent->ref);
 +              }
 +      } else {
 +              D1("Port was already open");
@@ -8885,8 +8922,6 @@ diff -Naur backports-3.18.1-1.org/drivers/net/usb/hso.c backports-3.18.1-1/drive
 +              usb_autopm_put_interface(serial->parent->interface);
 +
 +      mutex_unlock(&serial->parent->mutex);
-+
-+      kref_put(&serial->parent->ref, hso_serial_ref_free);
 +}
 +
 +/* close the requested serial port */
@@ -8937,6 +8972,16 @@ diff -Naur backports-3.18.1-1.org/drivers/net/usb/hso.c backports-3.18.1-1/drive
 +      return room;
 +}
 +
++static void hso_serial_cleanup(struct tty_struct *tty)
++{
++      struct hso_serial *serial = tty->driver_data;
++
++      if (!serial)
++              return;
++
++      kref_put(&serial->parent->ref, hso_serial_ref_free);
++}
++
 +/* setup the term */
 +static void hso_serial_set_termios(struct tty_struct *tty, struct ktermios *old)
 +{
@@ -9009,6 +9054,7 @@ diff -Naur backports-3.18.1-1.org/drivers/net/usb/hso.c backports-3.18.1-1/drive
 +      struct uart_icount *icount;
 +      struct hso_serial_state_notification *serial_state_notification;
 +      struct usb_device *usb;
++      struct usb_interface *interface;
 +      int if_num;
 +
 +      /* Sanity checks */
@@ -9026,7 +9072,9 @@ diff -Naur backports-3.18.1-1.org/drivers/net/usb/hso.c backports-3.18.1-1/drive
 +      BUG_ON((serial->parent->port_spec & HSO_PORT_MASK) != HSO_PORT_MODEM);
 +
 +      usb = serial->parent->usb;
-+      if_num = serial->parent->interface->altsetting->desc.bInterfaceNumber;
++      interface = serial->parent->interface;
++
++      if_num = interface->cur_altsetting->desc.bInterfaceNumber;
 +
 +      /* wIndex should be the USB interface number of the port to which the
 +       * notification applies, which should always be the Modem port.
@@ -9126,7 +9174,7 @@ diff -Naur backports-3.18.1-1.org/drivers/net/usb/hso.c backports-3.18.1-1/drive
 +              }
 +              cprev = cnow;
 +      }
-+      current->state = TASK_RUNNING;
++      __set_current_state(TASK_RUNNING);
 +      remove_wait_queue(&tiocmget->waitq, &wait);
 +
 +      return ret;
@@ -9207,6 +9255,7 @@ diff -Naur backports-3.18.1-1.org/drivers/net/usb/hso.c backports-3.18.1-1/drive
 +      unsigned long flags;
 +      int if_num;
 +      struct hso_serial *serial = tty->driver_data;
++      struct usb_interface *interface;
 +
 +      /* sanity check */
 +      if (!serial) {
@@ -9217,7 +9266,8 @@ diff -Naur backports-3.18.1-1.org/drivers/net/usb/hso.c backports-3.18.1-1/drive
 +      if ((serial->parent->port_spec & HSO_PORT_MASK) != HSO_PORT_MODEM)
 +              return -EINVAL;
 +
-+      if_num = serial->parent->interface->altsetting->desc.bInterfaceNumber;
++      interface = serial->parent->interface;
++      if_num = interface->cur_altsetting->desc.bInterfaceNumber;
 +
 +      spin_lock_irqsave(&serial->serial_lock, flags);
 +      if (set & TIOCM_RTS)
@@ -9743,8 +9793,8 @@ diff -Naur backports-3.18.1-1.org/drivers/net/usb/hso.c backports-3.18.1-1/drive
 +
 +      for (i = 0; i < serial->num_rx_urbs; i++) {
 +              if (serial->rx_urb[i]) {
-+                              usb_kill_urb(serial->rx_urb[i]);
-+                              serial->rx_urb_filled[i] = 0;
++                      usb_kill_urb(serial->rx_urb[i]);
++                      serial->rx_urb_filled[i] = 0;
 +              }
 +      }
 +      serial->curr_rx_urb_idx = 0;
@@ -9773,15 +9823,15 @@ diff -Naur backports-3.18.1-1.org/drivers/net/usb/hso.c backports-3.18.1-1/drive
 +      return 0;
 +}
 +
++static void hso_serial_tty_unregister(struct hso_serial *serial)
++{
++      tty_unregister_device(tty_drv, serial->minor);
++}
++
 +static void hso_serial_common_free(struct hso_serial *serial)
 +{
 +      int i;
 +
-+      if (serial->parent->dev)
-+              device_remove_file(serial->parent->dev, &dev_attr_hsotype);
-+
-+      tty_unregister_device(tty_drv, serial->minor);
-+
 +      for (i = 0; i < serial->num_rx_urbs; i++) {
 +              /* unlink and free RX URB */
 +              usb_free_urb(serial->rx_urb[i]);
@@ -9791,6 +9841,7 @@ diff -Naur backports-3.18.1-1.org/drivers/net/usb/hso.c backports-3.18.1-1/drive
 +
 +      /* unlink and free TX URB */
 +      usb_free_urb(serial->tx_urb);
++      kfree(serial->tx_buffer);
 +      kfree(serial->tx_data);
 +      tty_port_destroy(&serial->port);
 +}
@@ -9809,11 +9860,10 @@ diff -Naur backports-3.18.1-1.org/drivers/net/usb/hso.c backports-3.18.1-1/drive
 +              goto exit;
 +
 +      /* register our minor number */
-+      serial->parent->dev = tty_port_register_device(&serial->port, tty_drv,
-+                      minor, &serial->parent->interface->dev);
++      serial->parent->dev = tty_port_register_device_attr(&serial->port,
++                      tty_drv, minor, &serial->parent->interface->dev,
++                      serial->parent, hso_serial_dev_groups);
 +      dev = serial->parent->dev;
-+      dev_set_drvdata(dev, serial->parent);
-+      i = device_create_file(dev, &dev_attr_hsotype);
 +
 +      /* fill in specific data for later use */
 +      serial->minor = minor;
@@ -9861,6 +9911,7 @@ diff -Naur backports-3.18.1-1.org/drivers/net/usb/hso.c backports-3.18.1-1/drive
 +
 +      return 0;
 +exit:
++      hso_serial_tty_unregister(serial);
 +      hso_serial_common_free(serial);
 +      return -1;
 +}
@@ -9883,7 +9934,6 @@ diff -Naur backports-3.18.1-1.org/drivers/net/usb/hso.c backports-3.18.1-1/drive
 +
 +      INIT_WORK(&hso_dev->async_get_intf, async_get_intf);
 +      INIT_WORK(&hso_dev->async_put_intf, async_put_intf);
-+      INIT_WORK(&hso_dev->reset_device, reset_device);
 +
 +      return hso_dev;
 +}
@@ -10004,27 +10054,21 @@ diff -Naur backports-3.18.1-1.org/drivers/net/usb/hso.c backports-3.18.1-1/drive
 +{
 +      struct hso_net *hso_net = dev2net(hso_dev);
 +      struct device *dev = &hso_net->net->dev;
-+      char *rfkn;
++      static u32 rfkill_counter;
 +
-+      rfkn = kzalloc(20, GFP_KERNEL);
-+      if (!rfkn)
-+              dev_err(dev, "%s - Out of memory\n", __func__);
-+
-+      snprintf(rfkn, 20, "hso-%d",
-+               interface->altsetting->desc.bInterfaceNumber);
++      snprintf(hso_net->name, sizeof(hso_net->name), "hso-%d",
++               rfkill_counter++);
 +
-+      hso_net->rfkill = rfkill_alloc(rfkn,
++      hso_net->rfkill = rfkill_alloc(hso_net->name,
 +                                     &interface_to_usbdev(interface)->dev,
 +                                     RFKILL_TYPE_WWAN,
 +                                     &hso_rfkill_ops, hso_dev);
 +      if (!hso_net->rfkill) {
 +              dev_err(dev, "%s - Out of memory\n", __func__);
-+              kfree(rfkn);
 +              return;
 +      }
 +      if (rfkill_register(hso_net->rfkill) < 0) {
 +              rfkill_destroy(hso_net->rfkill);
-+              kfree(rfkn);
 +              hso_net->rfkill = NULL;
 +              dev_err(dev, "%s - Failed to register rfkill\n", __func__);
 +              return;
@@ -10139,7 +10183,6 @@ diff -Naur backports-3.18.1-1.org/drivers/net/usb/hso.c backports-3.18.1-1/drive
 +
 +      if (!serial)
 +              return;
-+      set_serial_by_index(serial->minor, NULL);
 +
 +      hso_serial_common_free(serial);
 +
@@ -10229,6 +10272,7 @@ diff -Naur backports-3.18.1-1.org/drivers/net/usb/hso.c backports-3.18.1-1/drive
 +      return hso_dev;
 +
 +exit2:
++      hso_serial_tty_unregister(serial);
 +      hso_serial_common_free(serial);
 +exit:
 +      hso_free_tiomget(serial);
@@ -10291,8 +10335,7 @@ diff -Naur backports-3.18.1-1.org/drivers/net/usb/hso.c backports-3.18.1-1/drive
 +              tty_unregister_device(tty_drv, serial->minor);
 +              kfree(serial);
 +      }
-+      if (hso_dev)
-+              kfree(hso_dev);
++      kfree(hso_dev);
 +      return NULL;
 +
 +}
@@ -10347,7 +10390,7 @@ diff -Naur backports-3.18.1-1.org/drivers/net/usb/hso.c backports-3.18.1-1/drive
 +{
 +      struct usb_device *usbdev = interface_to_usbdev(interface);
 +      u8 *config_data = kmalloc(17, GFP_KERNEL);
-+      u32 if_num = interface->altsetting->desc.bInterfaceNumber;
++      u32 if_num = interface->cur_altsetting->desc.bInterfaceNumber;
 +      s32 result;
 +
 +      if (!config_data)
@@ -10425,7 +10468,7 @@ diff -Naur backports-3.18.1-1.org/drivers/net/usb/hso.c backports-3.18.1-1/drive
 +              return -ENODEV;
 +      }
 +
-+      if_num = interface->altsetting->desc.bInterfaceNumber;
++      if_num = interface->cur_altsetting->desc.bInterfaceNumber;
 +
 +      /* Get the interface/port specification from either driver_info or from
 +       * the device itself */
@@ -10629,26 +10672,6 @@ diff -Naur backports-3.18.1-1.org/drivers/net/usb/hso.c backports-3.18.1-1/drive
 +      return result;
 +}
 +
-+static void reset_device(struct work_struct *data)
-+{
-+      struct hso_device *hso_dev =
-+          container_of(data, struct hso_device, reset_device);
-+      struct usb_device *usb = hso_dev->usb;
-+      int result;
-+
-+      if (hso_dev->usb_gone) {
-+              D1("No reset during disconnect\n");
-+      } else {
-+              result = usb_lock_device_for_reset(usb, hso_dev->interface);
-+              if (result < 0)
-+                      D1("unable to lock device for reset: %d\n", result);
-+              else {
-+                      usb_reset_device(usb);
-+                      usb_unlock_device(usb);
-+              }
-+      }
-+}
-+
 +static void hso_serial_ref_free(struct kref *ref)
 +{
 +      struct hso_device *hso_dev = container_of(ref, struct hso_device, ref);
@@ -10658,18 +10681,22 @@ diff -Naur backports-3.18.1-1.org/drivers/net/usb/hso.c backports-3.18.1-1/drive
 +
 +static void hso_free_interface(struct usb_interface *interface)
 +{
-+      struct hso_serial *hso_dev;
++      struct hso_serial *serial;
 +      int i;
 +
 +      for (i = 0; i < HSO_SERIAL_TTY_MINORS; i++) {
 +              if (serial_table[i] &&
 +                  (serial_table[i]->interface == interface)) {
-+                      hso_dev = dev2ser(serial_table[i]);
-+                      tty_port_tty_hangup(&hso_dev->port, false);
-+                      mutex_lock(&hso_dev->parent->mutex);
-+                      hso_dev->parent->usb_gone = 1;
-+                      mutex_unlock(&hso_dev->parent->mutex);
++                      serial = dev2ser(serial_table[i]);
++                      tty_port_tty_hangup(&serial->port, false);
++                      mutex_lock(&serial->parent->mutex);
++                      serial->parent->usb_gone = 1;
++                      mutex_unlock(&serial->parent->mutex);
++                      cancel_work_sync(&serial_table[i]->async_put_intf);
++                      cancel_work_sync(&serial_table[i]->async_get_intf);
++                      hso_serial_tty_unregister(serial);
 +                      kref_put(&serial_table[i]->ref, hso_serial_ref_free);
++                      set_serial_by_index(i, NULL);
 +              }
 +      }
 +
@@ -10761,6 +10788,7 @@ diff -Naur backports-3.18.1-1.org/drivers/net/usb/hso.c backports-3.18.1-1/drive
 +      .close = hso_serial_close,
 +      .write = hso_serial_write,
 +      .write_room = hso_serial_write_room,
++      .cleanup = hso_serial_cleanup,
 +      .ioctl = hso_serial_ioctl,
 +      .set_termios = hso_serial_set_termios,
 +      .chars_in_buffer = hso_serial_chars_in_buffer,
@@ -10870,10 +10898,10 @@ diff -Naur backports-3.18.1-1.org/drivers/net/usb/hso.c backports-3.18.1-1/drive
 +/* disable network interface (eg: insmod hso.ko disable_net=1) */
 +MODULE_PARM_DESC(disable_net, "Disable the network interface");
 +module_param(disable_net, int, S_IRUGO | S_IWUSR);
-diff -Naur backports-3.18.1-1.org/drivers/net/usb/huawei_cdc_ncm.c backports-3.18.1-1/drivers/net/usb/huawei_cdc_ncm.c
---- backports-3.18.1-1.org/drivers/net/usb/huawei_cdc_ncm.c    1970-01-01 01:00:00.000000000 +0100
-+++ backports-3.18.1-1/drivers/net/usb/huawei_cdc_ncm.c        2014-12-16 18:39:45.000000000 +0100
-@@ -0,0 +1,221 @@
+diff -Naur backports-4.2.6-1.org/drivers/net/usb/huawei_cdc_ncm.c backports-4.2.6-1/drivers/net/usb/huawei_cdc_ncm.c
+--- backports-4.2.6-1.org/drivers/net/usb/huawei_cdc_ncm.c     1970-01-01 01:00:00.000000000 +0100
++++ backports-4.2.6-1/drivers/net/usb/huawei_cdc_ncm.c 2015-11-09 23:37:56.000000000 +0100
+@@ -0,0 +1,224 @@
 +/* huawei_cdc_ncm.c - handles Huawei devices using the CDC NCM protocol as
 + * transport layer.
 + * Copyright (C) 2013  Enrico Mioso <mrkiko.rs@gmail.com>
@@ -10949,11 +10977,14 @@ diff -Naur backports-3.18.1-1.org/drivers/net/usb/huawei_cdc_ncm.c backports-3.1
 +      struct usb_driver *subdriver = ERR_PTR(-ENODEV);
 +      int ret = -ENODEV;
 +      struct huawei_cdc_ncm_state *drvstate = (void *)&usbnet_dev->data;
++      int drvflags = 0;
 +
 +      /* altsetting should always be 1 for NCM devices - so we hard-coded
-+       * it here
++       * it here. Some huawei devices will need the NDP part of the NCM package to
++       * be at the end of the frame.
 +       */
-+      ret = cdc_ncm_bind_common(usbnet_dev, intf, 1);
++      drvflags |= CDC_NCM_FLAG_NDP_TO_END;
++      ret = cdc_ncm_bind_common(usbnet_dev, intf, 1, drvflags);
 +      if (ret)
 +              goto err;
 +
@@ -11095,9 +11126,9 @@ diff -Naur backports-3.18.1-1.org/drivers/net/usb/huawei_cdc_ncm.c backports-3.1
 +MODULE_AUTHOR("Enrico Mioso <mrkiko.rs@gmail.com>");
 +MODULE_DESCRIPTION("USB CDC NCM host driver with encapsulated protocol support");
 +MODULE_LICENSE("GPL");
-diff -Naur backports-3.18.1-1.org/drivers/net/usb/int51x1.c backports-3.18.1-1/drivers/net/usb/int51x1.c
---- backports-3.18.1-1.org/drivers/net/usb/int51x1.c   1970-01-01 01:00:00.000000000 +0100
-+++ backports-3.18.1-1/drivers/net/usb/int51x1.c       2014-12-16 18:39:45.000000000 +0100
+diff -Naur backports-4.2.6-1.org/drivers/net/usb/int51x1.c backports-4.2.6-1/drivers/net/usb/int51x1.c
+--- backports-4.2.6-1.org/drivers/net/usb/int51x1.c    1970-01-01 01:00:00.000000000 +0100
++++ backports-4.2.6-1/drivers/net/usb/int51x1.c        2015-11-09 23:37:56.000000000 +0100
 @@ -0,0 +1,199 @@
 +/*
 + * Copyright (c) 2009 Peter Holik
@@ -11298,9 +11329,9 @@ diff -Naur backports-3.18.1-1.org/drivers/net/usb/int51x1.c backports-3.18.1-1/d
 +MODULE_AUTHOR("Peter Holik");
 +MODULE_DESCRIPTION("Intellon usb powerline adapter");
 +MODULE_LICENSE("GPL");
-diff -Naur backports-3.18.1-1.org/drivers/net/usb/ipheth.c backports-3.18.1-1/drivers/net/usb/ipheth.c
---- backports-3.18.1-1.org/drivers/net/usb/ipheth.c    1970-01-01 01:00:00.000000000 +0100
-+++ backports-3.18.1-1/drivers/net/usb/ipheth.c        2014-12-16 18:39:45.000000000 +0100
+diff -Naur backports-4.2.6-1.org/drivers/net/usb/ipheth.c backports-4.2.6-1/drivers/net/usb/ipheth.c
+--- backports-4.2.6-1.org/drivers/net/usb/ipheth.c     1970-01-01 01:00:00.000000000 +0100
++++ backports-4.2.6-1/drivers/net/usb/ipheth.c 2015-11-09 23:37:56.000000000 +0100
 @@ -0,0 +1,588 @@
 +/*
 + * ipheth.c - Apple iPhone USB Ethernet driver
@@ -11890,9 +11921,9 @@ diff -Naur backports-3.18.1-1.org/drivers/net/usb/ipheth.c backports-3.18.1-1/dr
 +MODULE_AUTHOR("Diego Giagio <diego@giagio.com>");
 +MODULE_DESCRIPTION("Apple iPhone USB Ethernet driver");
 +MODULE_LICENSE("Dual BSD/GPL");
-diff -Naur backports-3.18.1-1.org/drivers/net/usb/kalmia.c backports-3.18.1-1/drivers/net/usb/kalmia.c
---- backports-3.18.1-1.org/drivers/net/usb/kalmia.c    1970-01-01 01:00:00.000000000 +0100
-+++ backports-3.18.1-1/drivers/net/usb/kalmia.c        2014-12-16 18:39:45.000000000 +0100
+diff -Naur backports-4.2.6-1.org/drivers/net/usb/kalmia.c backports-4.2.6-1/drivers/net/usb/kalmia.c
+--- backports-4.2.6-1.org/drivers/net/usb/kalmia.c     1970-01-01 01:00:00.000000000 +0100
++++ backports-4.2.6-1/drivers/net/usb/kalmia.c 2015-11-09 23:37:56.000000000 +0100
 @@ -0,0 +1,366 @@
 +/*
 + * USB network interface driver for Samsung Kalmia based LTE USB modem like the
@@ -12260,9 +12291,9 @@ diff -Naur backports-3.18.1-1.org/drivers/net/usb/kalmia.c backports-3.18.1-1/dr
 +MODULE_AUTHOR("Marius Bjoernstad Kotsbak <marius@kotsbak.com>");
 +MODULE_DESCRIPTION("Samsung Kalmia USB network driver");
 +MODULE_LICENSE("GPL");
-diff -Naur backports-3.18.1-1.org/drivers/net/usb/kaweth.c backports-3.18.1-1/drivers/net/usb/kaweth.c
---- backports-3.18.1-1.org/drivers/net/usb/kaweth.c    1970-01-01 01:00:00.000000000 +0100
-+++ backports-3.18.1-1/drivers/net/usb/kaweth.c        2014-12-16 18:39:45.000000000 +0100
+diff -Naur backports-4.2.6-1.org/drivers/net/usb/kaweth.c backports-4.2.6-1/drivers/net/usb/kaweth.c
+--- backports-4.2.6-1.org/drivers/net/usb/kaweth.c     1970-01-01 01:00:00.000000000 +0100
++++ backports-4.2.6-1/drivers/net/usb/kaweth.c 2015-11-09 23:37:56.000000000 +0100
 @@ -0,0 +1,1331 @@
 +/****************************************************************
 + *
@@ -13542,7 +13573,7 @@ diff -Naur backports-3.18.1-1.org/drivers/net/usb/kaweth.c backports-3.18.1-1/dr
 +        awd.done = 0;
 +
 +        urb->context = &awd;
-+        status = usb_submit_urb(urb, GFP_NOIO);
++        status = usb_submit_urb(urb, GFP_ATOMIC);
 +        if (status) {
 +                // something went wrong
 +                usb_free_urb(urb);
@@ -13595,9 +13626,9 @@ diff -Naur backports-3.18.1-1.org/drivers/net/usb/kaweth.c backports-3.18.1-1/dr
 +}
 +
 +module_usb_driver(kaweth_driver);
-diff -Naur backports-3.18.1-1.org/drivers/net/usb/Kconfig backports-3.18.1-1/drivers/net/usb/Kconfig
---- backports-3.18.1-1.org/drivers/net/usb/Kconfig     2014-12-21 22:37:15.000000000 +0100
-+++ backports-3.18.1-1/drivers/net/usb/Kconfig 2015-01-03 15:19:02.310281530 +0100
+diff -Naur backports-4.2.6-1.org/drivers/net/usb/Kconfig backports-4.2.6-1/drivers/net/usb/Kconfig
+--- backports-4.2.6-1.org/drivers/net/usb/Kconfig      2015-11-15 22:19:40.000000000 +0100
++++ backports-4.2.6-1/drivers/net/usb/Kconfig  2016-01-27 15:58:23.159192032 +0100
 @@ -13,7 +13,6 @@
  if USB_NET_DRIVERS
  
@@ -13621,7 +13652,7 @@ diff -Naur backports-3.18.1-1.org/drivers/net/usb/Kconfig backports-3.18.1-1/dri
 -      depends on n
        tristate "USB Pegasus/Pegasus-II based ethernet device support"
        depends on m
-       select BACKPORT_MII
+       select BPAUTO_MII
 @@ -92,7 +89,6 @@
          module will be called pegasus.
  
@@ -13629,7 +13660,7 @@ diff -Naur backports-3.18.1-1.org/drivers/net/usb/Kconfig backports-3.18.1-1/dri
 -      depends on n
        tristate "USB RTL8150 based ethernet device support"
        depends on m
-       select BACKPORT_MII
+       select BPAUTO_MII
 @@ -105,7 +101,6 @@
          module will be called rtl8150.
  
@@ -13637,7 +13668,7 @@ diff -Naur backports-3.18.1-1.org/drivers/net/usb/Kconfig backports-3.18.1-1/dri
 -      depends on n
        tristate "Realtek RTL8152/RTL8153 Based USB Ethernet Adapters"
        depends on m
-       select BACKPORT_MII
+       select BPAUTO_MII
 @@ -153,7 +148,6 @@
          module will be called usbnet.
  
@@ -13646,7 +13677,7 @@ diff -Naur backports-3.18.1-1.org/drivers/net/usb/Kconfig backports-3.18.1-1/dri
        tristate "ASIX AX88xxx Based USB 2.0 Ethernet Adapters"
        depends on m
        depends on USB_USBNET
-@@ -183,7 +177,6 @@
+@@ -184,7 +178,6 @@
          what other networking devices you have in use.
  
  config USB_NET_AX88179_178A
@@ -13654,7 +13685,7 @@ diff -Naur backports-3.18.1-1.org/drivers/net/usb/Kconfig backports-3.18.1-1/dri
        tristate "ASIX AX88179/178A USB 3.0/2.0 to Gigabit Ethernet"
        depends on m
        depends on USB_USBNET
-@@ -232,7 +225,6 @@
+@@ -233,7 +226,6 @@
          name is used instead.
  
  config USB_NET_CDC_EEM
@@ -13662,7 +13693,7 @@ diff -Naur backports-3.18.1-1.org/drivers/net/usb/Kconfig backports-3.18.1-1/dri
        tristate "CDC EEM support"
        depends on m
        depends on USB_USBNET
-@@ -268,7 +260,6 @@
+@@ -269,7 +261,6 @@
            * Ericsson F5521gw Mobile Broadband Module
  
  config USB_NET_HUAWEI_CDC_NCM
@@ -13670,7 +13701,7 @@ diff -Naur backports-3.18.1-1.org/drivers/net/usb/Kconfig backports-3.18.1-1/dri
        tristate "Huawei NCM embedded AT channel support"
        depends on m
        depends on USB_USBNET
-@@ -304,7 +295,6 @@
+@@ -305,7 +296,6 @@
          module will be called cdc_mbim.
  
  config USB_NET_DM9601
@@ -13678,7 +13709,7 @@ diff -Naur backports-3.18.1-1.org/drivers/net/usb/Kconfig backports-3.18.1-1/dri
        tristate "Davicom DM96xx based USB 10/100 ethernet devices"
        depends on m
        depends on USB_USBNET
-@@ -314,7 +304,6 @@
+@@ -315,7 +305,6 @@
          based USB 10/100 Ethernet adapters.
  
  config USB_NET_SR9700
@@ -13686,7 +13717,7 @@ diff -Naur backports-3.18.1-1.org/drivers/net/usb/Kconfig backports-3.18.1-1/dri
        tristate "CoreChip-sz SR9700 based USB 1.1 10/100 ethernet devices"
        depends on m
        depends on USB_USBNET
-@@ -324,7 +313,6 @@
+@@ -325,7 +314,6 @@
          10/100 Ethernet adapters.
  
  config USB_NET_SR9800
@@ -13694,7 +13725,7 @@ diff -Naur backports-3.18.1-1.org/drivers/net/usb/Kconfig backports-3.18.1-1/dri
        tristate "CoreChip-sz SR9800 based USB 2.0 10/100 ethernet devices"
        depends on m
        depends on USB_USBNET
-@@ -341,7 +329,6 @@
+@@ -342,7 +330,6 @@
          module will be called sr9800.
  
  config USB_NET_SMSC75XX
@@ -13702,7 +13733,7 @@ diff -Naur backports-3.18.1-1.org/drivers/net/usb/Kconfig backports-3.18.1-1/dri
        tristate "SMSC LAN75XX based USB 2.0 gigabit ethernet devices"
        depends on m
        depends on USB_USBNET
-@@ -353,7 +340,6 @@
+@@ -354,7 +341,6 @@
          Gigabit Ethernet adapters.
  
  config USB_NET_SMSC95XX
@@ -13710,7 +13741,7 @@ diff -Naur backports-3.18.1-1.org/drivers/net/usb/Kconfig backports-3.18.1-1/dri
        tristate "SMSC LAN95XX based USB 2.0 10/100 ethernet devices"
        depends on m
        depends on USB_USBNET
-@@ -365,7 +351,6 @@
+@@ -366,7 +352,6 @@
          10/100 Ethernet adapters.
  
  config USB_NET_GL620A
@@ -13718,7 +13749,7 @@ diff -Naur backports-3.18.1-1.org/drivers/net/usb/Kconfig backports-3.18.1-1/dri
        tristate "GeneSys GL620USB-A based cables"
        depends on m
        depends on USB_USBNET
-@@ -376,7 +361,6 @@
+@@ -377,7 +362,6 @@
          Note that the half-duplex "GL620USB" is not supported.
  
  config USB_NET_NET1080
@@ -13726,7 +13757,7 @@ diff -Naur backports-3.18.1-1.org/drivers/net/usb/Kconfig backports-3.18.1-1/dri
        tristate "NetChip 1080 based cables (Laplink, ...)"
        depends on m
        default y
-@@ -387,7 +371,6 @@
+@@ -388,7 +372,6 @@
          optionally with LEDs that indicate traffic
  
  config USB_NET_PLUSB
@@ -13734,7 +13765,7 @@ diff -Naur backports-3.18.1-1.org/drivers/net/usb/Kconfig backports-3.18.1-1/dri
        tristate "Prolific PL-2301/2302/25A1 based cables"
        depends on m
        # if the handshake/init/reset problems, from original 'plusb',
-@@ -398,7 +381,6 @@
+@@ -399,7 +382,6 @@
          with one of these chips.
  
  config USB_NET_MCS7830
@@ -13742,7 +13773,7 @@ diff -Naur backports-3.18.1-1.org/drivers/net/usb/Kconfig backports-3.18.1-1/dri
        tristate "MosChip MCS7830 based Ethernet adapters"
        depends on m
        depends on USB_USBNET
-@@ -424,7 +406,6 @@
+@@ -425,7 +407,6 @@
          (and for) Microsoft; it isn't an "Open" ecosystem or market.
  
  config USB_NET_CDC_SUBSET
@@ -13750,7 +13781,7 @@ diff -Naur backports-3.18.1-1.org/drivers/net/usb/Kconfig backports-3.18.1-1/dri
        tristate "Simple USB Network Links (CDC Ethernet subset)"
        depends on m
        depends on USB_USBNET
-@@ -496,7 +477,6 @@
+@@ -497,7 +478,6 @@
          with one of these chips.
  
  config USB_NET_ZAURUS
@@ -13758,7 +13789,7 @@ diff -Naur backports-3.18.1-1.org/drivers/net/usb/Kconfig backports-3.18.1-1/dri
        tristate "Sharp Zaurus (stock ROMs) and compatible"
        depends on m
        depends on USB_USBNET
-@@ -516,7 +496,6 @@
+@@ -517,7 +497,6 @@
          some cases CDC MDLM) protocol, not "g_ether".
  
  config USB_NET_CX82310_ETH
@@ -13766,7 +13797,7 @@ diff -Naur backports-3.18.1-1.org/drivers/net/usb/Kconfig backports-3.18.1-1/dri
        tristate "Conexant CX82310 USB ethernet port"
        depends on m
        depends on USB_USBNET
-@@ -526,7 +505,6 @@
+@@ -527,7 +506,6 @@
          it will not work with ADSL modems (use cxacru driver instead).
  
  config USB_NET_KALMIA
@@ -13774,7 +13805,7 @@ diff -Naur backports-3.18.1-1.org/drivers/net/usb/Kconfig backports-3.18.1-1/dri
        tristate "Samsung Kalmia based LTE USB modem"
        depends on m
        depends on USB_USBNET
-@@ -561,7 +539,6 @@
+@@ -562,7 +540,6 @@
          module will be called qmi_wwan.
  
  config USB_HSO
@@ -13782,7 +13813,7 @@ diff -Naur backports-3.18.1-1.org/drivers/net/usb/Kconfig backports-3.18.1-1/dri
        tristate "Option USB High Speed Mobile Devices"
        depends on m
        depends on USB && RFKILL && TTY
-@@ -574,7 +551,6 @@
+@@ -575,7 +552,6 @@
          module will be called hso.
  
  config USB_NET_INT51X1
@@ -13790,7 +13821,7 @@ diff -Naur backports-3.18.1-1.org/drivers/net/usb/Kconfig backports-3.18.1-1/dri
        tristate "Intellon PLC based usb adapter"
        depends on m
        depends on USB_USBNET
-@@ -584,7 +560,6 @@
+@@ -585,7 +561,6 @@
          INT51x1/INT5200 chip, like the "devolo dLan duo".
  
  config USB_CDC_PHONET
@@ -13798,7 +13829,7 @@ diff -Naur backports-3.18.1-1.org/drivers/net/usb/Kconfig backports-3.18.1-1/dri
        tristate "CDC Phonet support"
        depends on m
        depends on PHONET
-@@ -594,7 +569,6 @@
+@@ -595,7 +570,6 @@
          "PC suite" USB profile.
  
  config USB_IPHETH
@@ -13806,7 +13837,7 @@ diff -Naur backports-3.18.1-1.org/drivers/net/usb/Kconfig backports-3.18.1-1/dri
        tristate "Apple iPhone USB Ethernet driver"
        depends on m
        default n
-@@ -618,11 +592,10 @@
+@@ -619,11 +593,10 @@
          module will be called sierra_net.
  
  config USB_VL600
@@ -13819,9 +13850,651 @@ diff -Naur backports-3.18.1-1.org/drivers/net/usb/Kconfig backports-3.18.1-1/dri
        help
          Select this if you want to use an LG Electronics 4G/LTE usb modem
          called VL600.  This driver only handles the ethernet
-diff -Naur backports-3.18.1-1.org/drivers/net/usb/lg-vl600.c backports-3.18.1-1/drivers/net/usb/lg-vl600.c
---- backports-3.18.1-1.org/drivers/net/usb/lg-vl600.c  1970-01-01 01:00:00.000000000 +0100
-+++ backports-3.18.1-1/drivers/net/usb/lg-vl600.c      2014-12-16 18:39:45.000000000 +0100
+diff -Naur backports-4.2.6-1.org/drivers/net/usb/Kconfig.orig backports-4.2.6-1/drivers/net/usb/Kconfig.orig
+--- backports-4.2.6-1.org/drivers/net/usb/Kconfig.orig 1970-01-01 01:00:00.000000000 +0100
++++ backports-4.2.6-1/drivers/net/usb/Kconfig.orig     2015-11-15 22:19:40.000000000 +0100
+@@ -0,0 +1,638 @@
++#
++# USB Network devices configuration
++#
++comment "Host-side USB support is needed for USB Network Adapter support"
++      depends on !USB && NET
++
++menuconfig USB_NET_DRIVERS
++      tristate "USB Network Adapters"
++      depends on m
++      default USB if USB
++      depends on USB && NET
++
++if USB_NET_DRIVERS
++
++config USB_CATC
++      depends on n
++      tristate "USB CATC NetMate-based Ethernet device support"
++      depends on m
++      depends on CRC32
++      ---help---
++        Say Y if you want to use one of the following 10Mbps USB Ethernet
++        device based on the EL1210A chip. Supported devices are:
++        Belkin F5U011
++        Belkin F5U111
++        CATC NetMate
++        CATC NetMate II
++        smartBridges smartNIC
++
++        This driver makes the adapter appear as a normal Ethernet interface,
++        typically on eth0, if it is the only ethernet device, or perhaps on
++        eth1, if you have a PCI or ISA ethernet card installed.
++
++        To compile this driver as a module, choose M here: the
++        module will be called catc.
++
++config USB_KAWETH
++      depends on n
++      tristate "USB KLSI KL5USB101-based ethernet device support"
++      depends on m
++      ---help---
++        Say Y here if you want to use one of the following 10Mbps only
++        USB Ethernet adapters based on the KLSI KL5KUSB101B chipset:
++        3Com 3C19250
++        ADS USB-10BT
++        ATEN USB Ethernet
++        ASANTE USB To Ethernet Adapter
++        AOX Endpoints USB Ethernet
++        Correga K.K.
++        D-Link DSB-650C and DU-E10
++        Entrega / Portgear E45
++        I-O DATA USB-ET/T
++        Jaton USB Ethernet Device Adapter
++        Kingston Technology USB Ethernet Adapter
++        Linksys USB10T
++        Mobility USB-Ethernet Adapter
++        NetGear EA-101
++        Peracom Enet and Enet2
++        Portsmith Express Ethernet Adapter
++        Shark Pocket Adapter
++        SMC 2202USB
++        Sony Vaio port extender
++
++        This driver is likely to work with most 10Mbps only USB Ethernet
++        adapters, including some "no brand" devices. It does NOT work on
++        SmartBridges smartNIC or on Belkin F5U111 devices - you should use
++        the CATC NetMate driver for those. If you are not sure which one
++        you need, select both, and the correct one should be selected for
++        you.
++
++        This driver makes the adapter appear as a normal Ethernet interface,
++        typically on eth0, if it is the only ethernet device, or perhaps on
++        eth1, if you have a PCI or ISA ethernet card installed.
++
++        To compile this driver as a module, choose M here: the
++        module will be called kaweth.
++
++config USB_PEGASUS
++      depends on n
++      tristate "USB Pegasus/Pegasus-II based ethernet device support"
++      depends on m
++      select BPAUTO_MII
++      ---help---
++        Say Y here if you know you have Pegasus or Pegasus-II based adapter.
++        If in doubt then look at <file:drivers/net/usb/pegasus.h> for the
++        complete list of supported devices.
++
++        If your particular adapter is not in the list and you are _sure_ it
++        is Pegasus or Pegasus II based then send me
++        <petkan@users.sourceforge.net> vendor and device IDs.
++
++        To compile this driver as a module, choose M here: the
++        module will be called pegasus.
++
++config USB_RTL8150
++      depends on n
++      tristate "USB RTL8150 based ethernet device support"
++      depends on m
++      select BPAUTO_MII
++      help
++        Say Y here if you have RTL8150 based usb-ethernet adapter.
++        Send me <petkan@users.sourceforge.net> any comments you may have.
++        You can also check for updates at <http://pegasus2.sourceforge.net/>.
++
++        To compile this driver as a module, choose M here: the
++        module will be called rtl8150.
++
++config USB_RTL8152
++      depends on n
++      tristate "Realtek RTL8152/RTL8153 Based USB Ethernet Adapters"
++      depends on m
++      select BPAUTO_MII
++      help
++        This option adds support for Realtek RTL8152 based USB 2.0
++        10/100 Ethernet adapters and RTL8153 based USB 3.0 10/100/1000
++        Ethernet adapters.
++
++        To compile this driver as a module, choose M here: the
++        module will be called r8152.
++
++config USB_USBNET
++      tristate "Multi-purpose USB Networking Framework"
++      depends on m
++      select BPAUTO_MII
++      ---help---
++        This driver supports several kinds of network links over USB,
++        with "minidrivers" built around a common network driver core
++        that supports deep queues for efficient transfers.  (This gives
++        better performance with small packets and at high speeds).
++
++        The USB host runs "usbnet", and the other end of the link might be:
++
++        - Another USB host, when using USB "network" or "data transfer"
++          cables.  These are often used to network laptops to PCs, like
++          "Laplink" parallel cables or some motherboards.  These rely
++          on specialized chips from many suppliers.
++
++        - An intelligent USB gadget, perhaps embedding a Linux system.
++          These include PDAs running Linux (iPaq, Yopy, Zaurus, and
++          others), and devices that interoperate using the standard
++          CDC-Ethernet specification (including many cable modems).
++
++        - Network adapter hardware (like those for 10/100 Ethernet) which
++          uses this driver framework.
++
++        The link will appear with a name like "usb0", when the link is
++        a two-node link, or "eth0" for most CDC-Ethernet devices.  Those
++        two-node links are most easily managed with Ethernet Bridging
++        (CONFIG_BRIDGE) instead of routing.
++
++        For more information see <http://www.linux-usb.org/usbnet/>.
++
++        To compile this driver as a module, choose M here: the
++        module will be called usbnet.
++
++config USB_NET_AX8817X
++      depends on n
++      tristate "ASIX AX88xxx Based USB 2.0 Ethernet Adapters"
++      depends on m
++      depends on USB_USBNET
++      depends on CRC32
++      depends on PHYLIB
++      default y
++      help
++        This option adds support for ASIX AX88xxx based USB 2.0
++        10/100 Ethernet adapters.
++
++        This driver should work with at least the following devices:
++          * Aten UC210T
++          * ASIX AX88172
++          * Billionton Systems, USB2AR
++          * Buffalo LUA-U2-KTX
++          * Corega FEther USB2-TX
++          * D-Link DUB-E100
++          * Hawking UF200
++          * Linksys USB200M
++          * Netgear FA120
++          * Sitecom LN-029
++          * Sitecom LN-028
++          * Intellinet USB 2.0 Ethernet
++          * ST Lab USB 2.0 Ethernet
++          * TrendNet TU2-ET100
++
++        This driver creates an interface named "ethX", where X depends on
++        what other networking devices you have in use.
++
++config USB_NET_AX88179_178A
++      depends on n
++      tristate "ASIX AX88179/178A USB 3.0/2.0 to Gigabit Ethernet"
++      depends on m
++      depends on USB_USBNET
++      depends on CRC32
++      depends on PHYLIB
++      default y
++      help
++        This option adds support for ASIX AX88179 based USB 3.0/2.0
++        to Gigabit Ethernet adapters.
++
++        This driver should work with at least the following devices:
++          * ASIX AX88179
++          * ASIX AX88178A
++          * Sitcomm LN-032
++
++        This driver creates an interface named "ethX", where X depends on
++        what other networking devices you have in use.
++
++config USB_NET_CDCETHER
++      tristate "CDC Ethernet support (smart devices such as cable modems)"
++      depends on m
++      depends on USB_USBNET
++      default y
++      help
++        This option supports devices conforming to the Communication Device
++        Class (CDC) Ethernet Control Model, a specification that's easy to
++        implement in device firmware.  The CDC specifications are available
++        from <http://www.usb.org/>.
++
++        CDC Ethernet is an implementation option for DOCSIS cable modems
++        that support USB connectivity, used for non-Microsoft USB hosts.
++        The Linux-USB CDC Ethernet Gadget driver is an open implementation.
++        This driver should work with at least the following devices:
++
++          * Dell Wireless 5530 HSPA
++          * Ericsson PipeRider (all variants)
++          * Ericsson Mobile Broadband Module (all variants)
++          * Motorola (DM100 and SB4100)
++          * Broadcom Cable Modem (reference design)
++          * Toshiba (PCX1100U and F3507g/F3607gw)
++          * ...
++
++        This driver creates an interface named "ethX", where X depends on
++        what other networking devices you have in use.  However, if the
++        IEEE 802 "local assignment" bit is set in the address, a "usbX"
++        name is used instead.
++
++config USB_NET_CDC_EEM
++      depends on n
++      tristate "CDC EEM support"
++      depends on m
++      depends on USB_USBNET
++      help
++        This option supports devices conforming to the Communication Device
++        Class (CDC) Ethernet Emulation Model, a specification that's easy to
++        implement in device firmware.  The CDC EEM specifications are available
++        from <http://www.usb.org/>.
++
++        This driver creates an interface named "ethX", where X depends on
++        what other networking devices you have in use.  However, if the
++        IEEE 802 "local assignment" bit is set in the address, a "usbX"
++        name is used instead.
++
++config USB_NET_CDC_NCM
++      tristate "CDC NCM support"
++      depends on m
++      depends on USB_USBNET
++      default y
++      help
++        This driver provides support for CDC NCM (Network Control Model
++        Device USB Class Specification). The CDC NCM specification is
++        available from <http://www.usb.org/>.
++
++        Say "y" to link the driver statically, or "m" to build a
++        dynamically linked module.
++
++        This driver should work with at least the following devices:
++          * ST-Ericsson M700 LTE FDD/TDD Mobile Broadband Modem (ref. design)
++          * ST-Ericsson M5730 HSPA+ Mobile Broadband Modem (reference design)
++          * ST-Ericsson M570 HSPA+ Mobile Broadband Modem (reference design)
++          * ST-Ericsson M343 HSPA Mobile Broadband Modem (reference design)
++          * Ericsson F5521gw Mobile Broadband Module
++
++config USB_NET_HUAWEI_CDC_NCM
++      depends on n
++      tristate "Huawei NCM embedded AT channel support"
++      depends on m
++      depends on USB_USBNET
++      select USB_WDM
++      select USB_NET_CDC_NCM
++      help
++              This driver supports huawei-style NCM devices, that use NCM as a
++              transport for other protocols, usually an embedded AT channel.
++              Good examples are:
++              * Huawei E3131
++              * Huawei E3251
++
++              To compile this driver as a module, choose M here: the module will be
++              called huawei_cdc_ncm.ko.
++
++config USB_NET_CDC_MBIM
++      tristate "CDC MBIM support"
++      depends on m
++      depends on USB_USBNET
++      select USB_WDM
++      select USB_NET_CDC_NCM
++      help
++        This driver provides support for CDC MBIM (Mobile Broadband
++        Interface Model) devices. The CDC MBIM specification is
++        available from <http://www.usb.org/>.
++
++        MBIM devices require configuration using the management
++        protocol defined by the MBIM specification.  This driver
++        provides unfiltered access to the MBIM control channel
++        through the associated /dev/cdc-wdmx character device.
++
++        To compile this driver as a module, choose M here: the
++        module will be called cdc_mbim.
++
++config USB_NET_DM9601
++      depends on n
++      tristate "Davicom DM96xx based USB 10/100 ethernet devices"
++      depends on m
++      depends on USB_USBNET
++      depends on CRC32
++      help
++        This option adds support for Davicom DM9601/DM9620/DM9621A
++        based USB 10/100 Ethernet adapters.
++
++config USB_NET_SR9700
++      depends on n
++      tristate "CoreChip-sz SR9700 based USB 1.1 10/100 ethernet devices"
++      depends on m
++      depends on USB_USBNET
++      depends on CRC32
++      help
++        This option adds support for CoreChip-sz SR9700 based USB 1.1
++        10/100 Ethernet adapters.
++
++config USB_NET_SR9800
++      depends on n
++      tristate "CoreChip-sz SR9800 based USB 2.0 10/100 ethernet devices"
++      depends on m
++      depends on USB_USBNET
++      depends on CRC32
++      ---help---
++        Say Y if you want to use one of the following 100Mbps USB Ethernet
++        device based on the CoreChip-sz SR9800 chip.
++
++        This driver makes the adapter appear as a normal Ethernet interface,
++        typically on eth0, if it is the only ethernet device, or perhaps on
++        eth1, if you have a PCI or ISA ethernet card installed.
++
++        To compile this driver as a module, choose M here: the
++        module will be called sr9800.
++
++config USB_NET_SMSC75XX
++      depends on n
++      tristate "SMSC LAN75XX based USB 2.0 gigabit ethernet devices"
++      depends on m
++      depends on USB_USBNET
++      depends on BITREVERSE
++      depends on CRC16
++      depends on CRC32
++      help
++        This option adds support for SMSC LAN75XX based USB 2.0
++        Gigabit Ethernet adapters.
++
++config USB_NET_SMSC95XX
++      depends on n
++      tristate "SMSC LAN95XX based USB 2.0 10/100 ethernet devices"
++      depends on m
++      depends on USB_USBNET
++      depends on BITREVERSE
++      depends on CRC16
++      depends on CRC32
++      help
++        This option adds support for SMSC LAN95XX based USB 2.0
++        10/100 Ethernet adapters.
++
++config USB_NET_GL620A
++      depends on n
++      tristate "GeneSys GL620USB-A based cables"
++      depends on m
++      depends on USB_USBNET
++      help
++        Choose this option if you're using a host-to-host cable,
++        or PC2PC motherboard, with this chip.
++
++        Note that the half-duplex "GL620USB" is not supported.
++
++config USB_NET_NET1080
++      depends on n
++      tristate "NetChip 1080 based cables (Laplink, ...)"
++      depends on m
++      default y
++      depends on USB_USBNET
++      help
++        Choose this option if you're using a host-to-host cable based
++        on this design:  one NetChip 1080 chip and supporting logic,
++        optionally with LEDs that indicate traffic
++
++config USB_NET_PLUSB
++      depends on n
++      tristate "Prolific PL-2301/2302/25A1 based cables"
++      depends on m
++      # if the handshake/init/reset problems, from original 'plusb',
++      # are ever resolved ... then remove "experimental"
++      depends on USB_USBNET
++      help
++        Choose this option if you're using a host-to-host cable
++        with one of these chips.
++
++config USB_NET_MCS7830
++      depends on n
++      tristate "MosChip MCS7830 based Ethernet adapters"
++      depends on m
++      depends on USB_USBNET
++      help
++        Choose this option if you're using a 10/100 Ethernet USB2
++        adapter based on the MosChip 7830 controller. This includes
++        adapters marketed under the DeLOCK brand.
++
++config USB_NET_RNDIS_HOST
++      tristate "Host for RNDIS and ActiveSync devices"
++      depends on m
++      depends on USB_USBNET
++      select USB_NET_CDCETHER
++      help
++        This option enables hosting "Remote NDIS" USB networking links,
++        as encouraged by Microsoft (instead of CDC Ethernet!) for use in
++        various devices that may only support this protocol.  A variant
++        of this protocol (with even less public documentation) seems to
++        be at the root of Microsoft's "ActiveSync" too.
++
++        Avoid using this protocol unless you have no better options.
++        The protocol specification is incomplete, and is controlled by
++        (and for) Microsoft; it isn't an "Open" ecosystem or market.
++
++config USB_NET_CDC_SUBSET
++      depends on n
++      tristate "Simple USB Network Links (CDC Ethernet subset)"
++      depends on m
++      depends on USB_USBNET
++      default y
++      help
++        This driver module supports USB network devices that can work
++        without any device-specific information.  Select it if you have
++        one of these drivers.
++
++        Note that while many USB host-to-host cables can work in this mode,
++        that may mean not being able to talk to Win32 systems or more
++        commonly not being able to handle certain events (like replugging
++        the host on the other end) very well.  Also, these devices will
++        not generally have permanently assigned Ethernet addresses.
++
++config USB_ALI_M5632
++      bool "ALi M5632 based 'USB 2.0 Data Link' cables"
++      depends on USB_NET_CDC_SUBSET
++      help
++        Choose this option if you're using a host-to-host cable
++        based on this design, which supports USB 2.0 high speed.
++
++config USB_AN2720
++      bool "AnchorChips 2720 based cables (Xircom PGUNET, ...)"
++      depends on USB_NET_CDC_SUBSET
++      help
++        Choose this option if you're using a host-to-host cable
++        based on this design.  Note that AnchorChips is now a
++        Cypress brand.
++
++config USB_BELKIN
++      bool "eTEK based host-to-host cables (Advance, Belkin, ...)"
++      depends on USB_NET_CDC_SUBSET
++      default y
++      help
++        Choose this option if you're using a host-to-host cable
++        based on this design:  two NetChip 2890 chips and an Atmel
++        microcontroller, with LEDs that indicate traffic.
++
++config USB_ARMLINUX
++      bool "Embedded ARM Linux links (iPaq, ...)"
++      depends on USB_NET_CDC_SUBSET
++      default y
++      help
++        Choose this option to support the "usb-eth" networking driver
++        used by most of the ARM Linux community with device controllers
++        such as the SA-11x0 and PXA-25x UDCs, or the tftp capabilities
++        in some PXA versions of the "blob" boot loader.
++
++        Linux-based "Gumstix" PXA-25x based systems use this protocol
++        to talk with other Linux systems.
++
++        Although the ROMs shipped with Sharp Zaurus products use a
++        different link level framing protocol, you can have them use
++        this simpler protocol by installing a different kernel.
++
++config USB_EPSON2888
++      bool "Epson 2888 based firmware (DEVELOPMENT)"
++      depends on USB_NET_CDC_SUBSET
++      help
++        Choose this option to support the usb networking links used
++        by some sample firmware from Epson.
++
++config USB_KC2190
++      bool "KT Technology KC2190 based cables (InstaNet)"
++      depends on USB_NET_CDC_SUBSET
++      help
++        Choose this option if you're using a host-to-host cable
++        with one of these chips.
++
++config USB_NET_ZAURUS
++      depends on n
++      tristate "Sharp Zaurus (stock ROMs) and compatible"
++      depends on m
++      depends on USB_USBNET
++      select USB_NET_CDCETHER
++      depends on CRC32
++      default y
++      help
++        Choose this option to support the usb networking links used by
++        Zaurus models like the SL-5000D, SL-5500, SL-5600, A-300, B-500.
++        This also supports some related device firmware, as used in some
++        PDAs from Olympus and some cell phones from Motorola.
++
++        If you install an alternate image, such as the Linux 2.6 based
++        versions of OpenZaurus, you should no longer need to support this
++        protocol.  Only the "eth-fd" or "net_fd" drivers in these devices
++        really need this non-conformant variant of CDC Ethernet (or in
++        some cases CDC MDLM) protocol, not "g_ether".
++
++config USB_NET_CX82310_ETH
++      depends on n
++      tristate "Conexant CX82310 USB ethernet port"
++      depends on m
++      depends on USB_USBNET
++      help
++        Choose this option if you're using a Conexant CX82310-based ADSL
++        router with USB ethernet port. This driver is for routers only,
++        it will not work with ADSL modems (use cxacru driver instead).
++
++config USB_NET_KALMIA
++      depends on n
++      tristate "Samsung Kalmia based LTE USB modem"
++      depends on m
++      depends on USB_USBNET
++      help
++        Choose this option if you have a Samsung Kalmia based USB modem
++        as Samsung GT-B3730.
++
++        To compile this driver as a module, choose M here: the
++        module will be called kalmia.
++
++config USB_NET_QMI_WWAN
++      tristate "QMI WWAN driver for Qualcomm MSM based 3G and LTE modems"
++      depends on m
++      depends on USB_USBNET
++      select USB_WDM
++      help
++        Support WWAN LTE/3G devices based on Qualcomm Mobile Data Modem
++        (MDM) chipsets.  Examples of such devices are
++          * Huawei E392/E398
++
++        This driver will only drive the ethernet part of the chips.
++        The devices require additional configuration to be usable.
++        Multiple management interfaces with linux drivers are
++        available:
++
++          * option: AT commands on /dev/ttyUSBx
++          * cdc-wdm: Qualcomm MSM Interface (QMI) protocol on /dev/cdc-wdmx
++
++        A modem manager with support for QMI is recommended.
++
++        To compile this driver as a module, choose M here: the
++        module will be called qmi_wwan.
++
++config USB_HSO
++      depends on n
++      tristate "Option USB High Speed Mobile Devices"
++      depends on m
++      depends on USB && RFKILL && TTY
++      default n
++      help
++        Choose this option if you have an Option HSDPA/HSUPA card.
++        These cards support downlink speeds of 7.2Mbps or greater.
++
++        To compile this driver as a module, choose M here: the
++        module will be called hso.
++
++config USB_NET_INT51X1
++      depends on n
++      tristate "Intellon PLC based usb adapter"
++      depends on m
++      depends on USB_USBNET
++      help
++        Choose this option if you're using a 14Mb USB-based PLC
++        (Powerline Communications) solution with an Intellon
++        INT51x1/INT5200 chip, like the "devolo dLan duo".
++
++config USB_CDC_PHONET
++      depends on n
++      tristate "CDC Phonet support"
++      depends on m
++      depends on PHONET
++      help
++        Choose this option to support the Phonet interface to a Nokia
++        cellular modem, as found on most Nokia handsets with the
++        "PC suite" USB profile.
++
++config USB_IPHETH
++      depends on n
++      tristate "Apple iPhone USB Ethernet driver"
++      depends on m
++      default n
++      ---help---
++        Module used to share Internet connection (tethering) from your
++        iPhone (Original, 3G and 3GS) to your system.
++        Note that you need userspace libraries and programs that are needed
++        to pair your device with your system and that understand the iPhone
++        protocol.
++
++        For more information: http://giagio.com/wiki/moin.cgi/iPhoneEthernetDriver
++
++config USB_SIERRA_NET
++      tristate "USB-to-WWAN Driver for Sierra Wireless modems"
++      depends on m
++      depends on USB_USBNET
++      help
++        Choose this option if you have a Sierra Wireless USB-to-WWAN device.
++
++        To compile this driver as a module, choose M here: the
++        module will be called sierra_net.
++
++config USB_VL600
++      depends on n
++      tristate "LG VL600 modem dongle"
++      depends on m
++      depends on USB_NET_CDCETHER && TTY
++      select USB_ACM
++      help
++        Select this if you want to use an LG Electronics 4G/LTE usb modem
++        called VL600.  This driver only handles the ethernet
++        interface exposed by the modem firmware.  To establish a connection
++        you will first need a userspace program that sends the right
++        command to the modem through its CDC ACM port, and most
++        likely also a DHCP client.  See this thread about using the
++        4G modem from Verizon:
++
++        http://ubuntuforums.org/showpost.php?p=10589647&postcount=17
++
++endif # USB_NET_DRIVERS
+diff -Naur backports-4.2.6-1.org/drivers/net/usb/lg-vl600.c backports-4.2.6-1/drivers/net/usb/lg-vl600.c
+--- backports-4.2.6-1.org/drivers/net/usb/lg-vl600.c   1970-01-01 01:00:00.000000000 +0100
++++ backports-4.2.6-1/drivers/net/usb/lg-vl600.c       2015-11-09 23:37:56.000000000 +0100
 @@ -0,0 +1,353 @@
 +/*
 + * Ethernet interface part of the LG VL600 LTE modem (4G dongle)
@@ -14026,7 +14699,7 @@ diff -Naur backports-3.18.1-1.org/drivers/net/usb/lg-vl600.c backports-3.18.1-1/
 +                                      &buf->data[sizeof(*ethhdr) + 0x12],
 +                                      ETH_ALEN);
 +              } else {
-+                      memset(ethhdr->h_source, 0, ETH_ALEN);
++                      eth_zero_addr(ethhdr->h_source);
 +                      memcpy(ethhdr->h_dest, dev->net->dev_addr, ETH_ALEN);
 +
 +                      /* Inbound IPv6 packets have an IPv4 ethertype (0x800)
@@ -14176,13 +14849,13 @@ diff -Naur backports-3.18.1-1.org/drivers/net/usb/lg-vl600.c backports-3.18.1-1/
 +MODULE_AUTHOR("Anrzej Zaborowski");
 +MODULE_DESCRIPTION("LG-VL600 modem's ethernet link");
 +MODULE_LICENSE("GPL");
-diff -Naur backports-3.18.1-1.org/drivers/net/usb/Makefile backports-3.18.1-1/drivers/net/usb/Makefile
---- backports-3.18.1-1.org/drivers/net/usb/Makefile    2014-12-21 22:37:15.000000000 +0100
-+++ backports-3.18.1-1/drivers/net/usb/Makefile        2015-01-03 13:49:51.269970813 +0100
-@@ -1,39 +1,35 @@
--#
--# Makefile for USB Network drivers
--#
+diff -Naur backports-4.2.6-1.org/drivers/net/usb/Makefile backports-4.2.6-1/drivers/net/usb/Makefile
+--- backports-4.2.6-1.org/drivers/net/usb/Makefile     2015-11-15 22:19:40.000000000 +0100
++++ backports-4.2.6-1/drivers/net/usb/Makefile 2016-01-27 15:53:50.000000000 +0100
+@@ -1,39 +1,40 @@
+ #
+ # Makefile for USB Network drivers
+ #
 -#
 -#obj-$(CPTCFG_USB_CATC)               += catc.o
 -#obj-$(CPTCFG_USB_KAWETH)     += kaweth.o
@@ -14192,6 +14865,7 @@ diff -Naur backports-3.18.1-1.org/drivers/net/usb/Makefile backports-3.18.1-1/dr
 -#obj-$(CPTCFG_USB_HSO)                += hso.o
 -#obj-$(CPTCFG_USB_NET_AX8817X)        += asix.o
 -#obj-$(CPTCFG_USB_NET_AX88179_178A)      += ax88179_178a.o
++
 +obj-$(CPTCFG_USB_CATC)                += catc.o
 +obj-$(CPTCFG_USB_KAWETH)      += kaweth.o
 +obj-$(CPTCFG_USB_PEGASUS)     += pegasus.o
@@ -14246,10 +14920,10 @@ diff -Naur backports-3.18.1-1.org/drivers/net/usb/Makefile backports-3.18.1-1/dr
 +obj-$(CPTCFG_USB_VL600)               += lg-vl600.o
  obj-$(CPTCFG_USB_NET_QMI_WWAN)        += qmi_wwan.o
  obj-$(CPTCFG_USB_NET_CDC_MBIM)        += cdc_mbim.o
--
-diff -Naur backports-3.18.1-1.org/drivers/net/usb/mcs7830.c backports-3.18.1-1/drivers/net/usb/mcs7830.c
---- backports-3.18.1-1.org/drivers/net/usb/mcs7830.c   1970-01-01 01:00:00.000000000 +0100
-+++ backports-3.18.1-1/drivers/net/usb/mcs7830.c       2014-12-16 18:39:45.000000000 +0100
+diff -Naur backports-4.2.6-1.org/drivers/net/usb/mcs7830.c backports-4.2.6-1/drivers/net/usb/mcs7830.c
+--- backports-4.2.6-1.org/drivers/net/usb/mcs7830.c    1970-01-01 01:00:00.000000000 +0100
++++ backports-4.2.6-1/drivers/net/usb/mcs7830.c        2015-11-09 23:37:56.000000000 +0100
 @@ -0,0 +1,643 @@
 +/*
 + * MOSCHIP MCS7830 based (7730/7830/7832) USB 2.0 Ethernet Devices
@@ -14894,9 +15568,9 @@ diff -Naur backports-3.18.1-1.org/drivers/net/usb/mcs7830.c backports-3.18.1-1/d
 +
 +MODULE_DESCRIPTION("USB to network adapter MCS7830)");
 +MODULE_LICENSE("GPL");
-diff -Naur backports-3.18.1-1.org/drivers/net/usb/net1080.c backports-3.18.1-1/drivers/net/usb/net1080.c
---- backports-3.18.1-1.org/drivers/net/usb/net1080.c   1970-01-01 01:00:00.000000000 +0100
-+++ backports-3.18.1-1/drivers/net/usb/net1080.c       2014-12-16 18:39:45.000000000 +0100
+diff -Naur backports-4.2.6-1.org/drivers/net/usb/net1080.c backports-4.2.6-1/drivers/net/usb/net1080.c
+--- backports-4.2.6-1.org/drivers/net/usb/net1080.c    1970-01-01 01:00:00.000000000 +0100
++++ backports-4.2.6-1/drivers/net/usb/net1080.c        2015-11-09 23:37:56.000000000 +0100
 @@ -0,0 +1,544 @@
 +/*
 + * Net1080 based USB host-to-host cables
@@ -15442,9 +16116,9 @@ diff -Naur backports-3.18.1-1.org/drivers/net/usb/net1080.c backports-3.18.1-1/d
 +MODULE_AUTHOR("David Brownell");
 +MODULE_DESCRIPTION("NetChip 1080 based USB Host-to-Host Links");
 +MODULE_LICENSE("GPL");
-diff -Naur backports-3.18.1-1.org/drivers/net/usb/pegasus.c backports-3.18.1-1/drivers/net/usb/pegasus.c
---- backports-3.18.1-1.org/drivers/net/usb/pegasus.c   1970-01-01 01:00:00.000000000 +0100
-+++ backports-3.18.1-1/drivers/net/usb/pegasus.c       2014-12-16 18:39:45.000000000 +0100
+diff -Naur backports-4.2.6-1.org/drivers/net/usb/pegasus.c backports-4.2.6-1/drivers/net/usb/pegasus.c
+--- backports-4.2.6-1.org/drivers/net/usb/pegasus.c    1970-01-01 01:00:00.000000000 +0100
++++ backports-4.2.6-1/drivers/net/usb/pegasus.c        2015-11-09 23:37:56.000000000 +0100
 @@ -0,0 +1,1335 @@
 +/*
 + *  Copyright (c) 1999-2013 Petko Manolov (petkan@nucleusys.com)
@@ -16781,9 +17455,9 @@ diff -Naur backports-3.18.1-1.org/drivers/net/usb/pegasus.c backports-3.18.1-1/d
 +
 +module_init(pegasus_init);
 +module_exit(pegasus_exit);
-diff -Naur backports-3.18.1-1.org/drivers/net/usb/pegasus.h backports-3.18.1-1/drivers/net/usb/pegasus.h
---- backports-3.18.1-1.org/drivers/net/usb/pegasus.h   1970-01-01 01:00:00.000000000 +0100
-+++ backports-3.18.1-1/drivers/net/usb/pegasus.h       2014-12-16 18:39:45.000000000 +0100
+diff -Naur backports-4.2.6-1.org/drivers/net/usb/pegasus.h backports-4.2.6-1/drivers/net/usb/pegasus.h
+--- backports-4.2.6-1.org/drivers/net/usb/pegasus.h    1970-01-01 01:00:00.000000000 +0100
++++ backports-4.2.6-1/drivers/net/usb/pegasus.h        2015-11-09 23:37:56.000000000 +0100
 @@ -0,0 +1,308 @@
 +/*
 + * Copyright (c) 1999-2013 Petko Manolov (petkan@nucleusys.com)
@@ -17093,10 +17767,10 @@ diff -Naur backports-3.18.1-1.org/drivers/net/usb/pegasus.h backports-3.18.1-1/d
 +
 +
 +#endif        /* PEGASUS_DEV */
-diff -Naur backports-3.18.1-1.org/drivers/net/usb/plusb.c backports-3.18.1-1/drivers/net/usb/plusb.c
---- backports-3.18.1-1.org/drivers/net/usb/plusb.c     1970-01-01 01:00:00.000000000 +0100
-+++ backports-3.18.1-1/drivers/net/usb/plusb.c 2014-12-16 18:39:45.000000000 +0100
-@@ -0,0 +1,157 @@
+diff -Naur backports-4.2.6-1.org/drivers/net/usb/plusb.c backports-4.2.6-1/drivers/net/usb/plusb.c
+--- backports-4.2.6-1.org/drivers/net/usb/plusb.c      1970-01-01 01:00:00.000000000 +0100
++++ backports-4.2.6-1/drivers/net/usb/plusb.c  2015-11-09 23:37:56.000000000 +0100
+@@ -0,0 +1,162 @@
 +/*
 + * PL-2301/2302 USB host-to-host link cables
 + * Copyright (C) 2000-2005 by David Brownell
@@ -17233,6 +17907,11 @@ diff -Naur backports-3.18.1-1.org/drivers/net/usb/plusb.c backports-3.18.1-1/dri
 +}, {
 +      USB_DEVICE(0x050d, 0x258a),     /* Belkin F5U258/F5U279 (PL-25A1) */
 +      .driver_info =  (unsigned long) &prolific_info,
++}, {
++      USB_DEVICE(0x3923, 0x7825),     /* National Instruments USB
++                                       * Host-to-Host Cable
++                                       */
++      .driver_info =  (unsigned long) &prolific_info,
 +},
 +
 +      { },            // END
@@ -17254,10 +17933,10 @@ diff -Naur backports-3.18.1-1.org/drivers/net/usb/plusb.c backports-3.18.1-1/dri
 +MODULE_AUTHOR("David Brownell");
 +MODULE_DESCRIPTION("Prolific PL-2301/2302/25A1 USB Host to Host Link Driver");
 +MODULE_LICENSE("GPL");
-diff -Naur backports-3.18.1-1.org/drivers/net/usb/r8152.c backports-3.18.1-1/drivers/net/usb/r8152.c
---- backports-3.18.1-1.org/drivers/net/usb/r8152.c     1970-01-01 01:00:00.000000000 +0100
-+++ backports-3.18.1-1/drivers/net/usb/r8152.c 2015-01-03 13:42:25.000000000 +0100
-@@ -0,0 +1,3913 @@
+diff -Naur backports-4.2.6-1.org/drivers/net/usb/r8152.c backports-4.2.6-1/drivers/net/usb/r8152.c
+--- backports-4.2.6-1.org/drivers/net/usb/r8152.c      1970-01-01 01:00:00.000000000 +0100
++++ backports-4.2.6-1/drivers/net/usb/r8152.c  2016-01-27 12:43:25.000000000 +0100
+@@ -0,0 +1,2847 @@
 +/*
 + *  Copyright (c) 2014 Realtek Semiconductor Corp. All rights reserved.
 + *
@@ -17281,12 +17960,9 @@ diff -Naur backports-3.18.1-1.org/drivers/net/usb/r8152.c backports-3.18.1-1/dri
 +#include <linux/list.h>
 +#include <linux/ip.h>
 +#include <linux/ipv6.h>
-+#include <net/ip6_checksum.h>
-+#include <uapi/linux/mdio.h>
-+#include <linux/mdio.h>
 +
 +/* Version Information */
-+#define DRIVER_VERSION "v1.07.0 (2014/10/09)"
++#define DRIVER_VERSION "v1.04.0 (2014/01/15)"
 +#define DRIVER_AUTHOR "Realtek linux nic maintainers <nic_swsd@realtek.com>"
 +#define DRIVER_DESC "Realtek RTL8152/RTL8153 Based USB Ethernet Adapters"
 +#define MODULENAME "r8152"
@@ -17321,13 +17997,10 @@ diff -Naur backports-3.18.1-1.org/drivers/net/usb/r8152.c backports-3.18.1-1/dri
 +#define PLA_WDT6_CTRL         0xe428
 +#define PLA_TCR0              0xe610
 +#define PLA_TCR1              0xe612
-+#define PLA_MTPS              0xe615
 +#define PLA_TXFIFO_CTRL               0xe618
-+#define PLA_RSTTALLY          0xe800
++#define PLA_RSTTELLY          0xe800
 +#define PLA_CR                        0xe813
 +#define PLA_CRWECR            0xe81c
-+#define PLA_CONFIG12          0xe81e  /* CONFIG1, CONFIG2 */
-+#define PLA_CONFIG34          0xe820  /* CONFIG3, CONFIG4 */
 +#define PLA_CONFIG5           0xe822
 +#define PLA_PHY_PWR           0xe84c
 +#define PLA_OOB_CTRL          0xe84f
@@ -17335,7 +18008,7 @@ diff -Naur backports-3.18.1-1.org/drivers/net/usb/r8152.c backports-3.18.1-1/dri
 +#define PLA_MISC_0            0xe858
 +#define PLA_MISC_1            0xe85a
 +#define PLA_OCP_GPHY_BASE     0xe86c
-+#define PLA_TALLYCNT          0xe890
++#define PLA_TELLYCNT          0xe890
 +#define PLA_SFF_STS_7         0xe8de
 +#define PLA_PHYSTATUS         0xe908
 +#define PLA_BP_BA             0xfc26
@@ -17391,9 +18064,7 @@ diff -Naur backports-3.18.1-1.org/drivers/net/usb/r8152.c backports-3.18.1-1/dri
 +#define OCP_SRAM_ADDR         0xa436
 +#define OCP_SRAM_DATA         0xa438
 +#define OCP_DOWN_SPEED                0xa442
-+#define OCP_EEE_ABLE          0xa5c4
-+#define OCP_EEE_ADV           0xa5d0
-+#define OCP_EEE_LPABLE                0xa5d2
++#define OCP_EEE_CFG2          0xa5d0
 +#define OCP_ADC_CFG           0xbc06
 +
 +/* SRAM Register */
@@ -17445,13 +18116,6 @@ diff -Naur backports-3.18.1-1.org/drivers/net/usb/r8152.c backports-3.18.1-1/dri
 +/* PLA_TCR1 */
 +#define VERSION_MASK          0x7cf0
 +
-+/* PLA_MTPS */
-+#define MTPS_JUMBO            (12 * 1024 / 64)
-+#define MTPS_DEFAULT          (6 * 1024 / 64)
-+
-+/* PLA_RSTTALLY */
-+#define TALLY_RESET           0x0001
-+
 +/* PLA_CR */
 +#define CR_RST                        0x10
 +#define CR_RE                 0x08
@@ -17491,14 +18155,7 @@ diff -Naur backports-3.18.1-1.org/drivers/net/usb/r8152.c backports-3.18.1-1/dri
 +/* PAL_BDC_CR */
 +#define ALDPS_PROXY_MODE      0x0001
 +
-+/* PLA_CONFIG34 */
-+#define LINK_ON_WAKE_EN               0x0010
-+#define LINK_OFF_WAKE_EN      0x0008
-+
 +/* PLA_CONFIG5 */
-+#define BWF_EN                        0x0040
-+#define MWF_EN                        0x0020
-+#define UWF_EN                        0x0010
 +#define LAN_WAKE_EN           0x0002
 +
 +/* PLA_LED_FEATURE */
@@ -17551,7 +18208,7 @@ diff -Naur backports-3.18.1-1.org/drivers/net/usb/r8152.c backports-3.18.1-1/dri
 +/* USB_DEV_STAT */
 +#define STAT_SPEED_MASK               0x0006
 +#define STAT_SPEED_HIGH               0x0000
-+#define STAT_SPEED_FULL               0x0002
++#define STAT_SPEED_FULL               0x0001
 +
 +/* USB_TX_AGG */
 +#define TX_AGG_MAX_THRESHOLD  0x03
@@ -17625,8 +18282,7 @@ diff -Naur backports-3.18.1-1.org/drivers/net/usb/r8152.c backports-3.18.1-1/dri
 +#define EEE_NWAY_EN           0x1000
 +#define TX_QUIET_EN           0x0200
 +#define RX_QUIET_EN           0x0100
-+#define sd_rise_time_mask     0x0070
-+#define sd_rise_time(x)               (min(x, 7) << 4)        /* bit 4 ~ 6 */
++#define SDRISETIME            0x0010  /* bit 4 ~ 6 */
 +#define RG_RXLPI_MSK_HFDUP    0x0008
 +#define SDFALLTIME            0x0007  /* bit 0 ~ 2 */
 +
@@ -17638,8 +18294,7 @@ diff -Naur backports-3.18.1-1.org/drivers/net/usb/r8152.c backports-3.18.1-1/dri
 +#define RG_EEEPRG_EN          0x0010
 +
 +/* OCP_EEE_CONFIG3 */
-+#define fast_snr_mask         0xff80
-+#define fast_snr(x)           (min(x, 0x1ff) << 7)    /* bit 7 ~ 15 */
++#define FST_SNR_EYE_R         0x1500  /* bit 7 ~ 15 */
 +#define RG_LFS_SEL            0x0060  /* bit 6 ~ 5 */
 +#define MSK_PH                        0x0006  /* bit 0 ~ 3 */
 +
@@ -17648,6 +18303,11 @@ diff -Naur backports-3.18.1-1.org/drivers/net/usb/r8152.c backports-3.18.1-1/dri
 +#define FUN_ADDR              0x0000
 +#define FUN_DATA              0x4000
 +/* bit[4:0] device addr */
++#define DEVICE_ADDR           0x0007
++
++/* OCP_EEE_DATA */
++#define EEE_ADDR              0x003C
++#define EEE_DATA              0x0002
 +
 +/* OCP_EEE_CFG */
 +#define CTAP_SHORT_EN         0x0040
@@ -17656,6 +18316,10 @@ diff -Naur backports-3.18.1-1.org/drivers/net/usb/r8152.c backports-3.18.1-1/dri
 +/* OCP_DOWN_SPEED */
 +#define EN_10M_BGOFF          0x0080
 +
++/* OCP_EEE_CFG2 */
++#define MY1000_EEE            0x0004
++#define MY100_EEE             0x0002
++
 +/* OCP_ADC_CFG */
 +#define CKADSEL_L             0x0100
 +#define ADC_EN                        0x0080
@@ -17681,7 +18345,7 @@ diff -Naur backports-3.18.1-1.org/drivers/net/usb/r8152.c backports-3.18.1-1/dri
 +      FULL_DUP        = 0x01,
 +};
 +
-+#define RTL8152_MAX_TX                4
++#define RTL8152_MAX_TX                10
 +#define RTL8152_MAX_RX                10
 +#define INTBUFSIZE            2
 +#define CRC_SIZE              4
@@ -17702,11 +18366,8 @@ diff -Naur backports-3.18.1-1.org/drivers/net/usb/r8152.c backports-3.18.1-1/dri
 +#define BYTE_EN_START_MASK    0x0f
 +#define BYTE_EN_END_MASK      0xf0
 +
-+#define RTL8153_MAX_PACKET    9216 /* 9K */
-+#define RTL8153_MAX_MTU               (RTL8153_MAX_PACKET - VLAN_ETH_HLEN - VLAN_HLEN)
 +#define RTL8152_RMS           (VLAN_ETH_FRAME_LEN + VLAN_HLEN)
-+#define RTL8153_RMS           RTL8153_MAX_PACKET
-+#define RTL8152_TX_TIMEOUT    (5 * HZ)
++#define RTL8152_TX_TIMEOUT    (HZ)
 +
 +/* rtl8152 flags */
 +enum rtl8152_flags {
@@ -17714,9 +18375,6 @@ diff -Naur backports-3.18.1-1.org/drivers/net/usb/r8152.c backports-3.18.1-1/dri
 +      RTL8152_SET_RX_MODE,
 +      WORK_ENABLE,
 +      RTL8152_LINK_CHG,
-+      SELECTIVE_SUSPEND,
-+      PHY_RESET,
-+      SCHEDULE_TASKLET,
 +};
 +
 +/* Define these values to match your device */
@@ -17730,41 +18388,11 @@ diff -Naur backports-3.18.1-1.org/drivers/net/usb/r8152.c backports-3.18.1-1/dri
 +#define MCU_TYPE_PLA                  0x0100
 +#define MCU_TYPE_USB                  0x0000
 +
-+#define REALTEK_USB_DEVICE(vend, prod)        \
-+      USB_DEVICE_INTERFACE_CLASS(vend, prod, USB_CLASS_VENDOR_SPEC)
-+
-+struct tally_counter {
-+      __le64  tx_packets;
-+      __le64  rx_packets;
-+      __le64  tx_errors;
-+      __le32  rx_errors;
-+      __le16  rx_missed;
-+      __le16  align_errors;
-+      __le32  tx_one_collision;
-+      __le32  tx_multi_collision;
-+      __le64  rx_unicast;
-+      __le64  rx_broadcast;
-+      __le32  rx_multicast;
-+      __le16  tx_aborted;
-+      __le16  tx_underun;
-+};
-+
 +struct rx_desc {
 +      __le32 opts1;
 +#define RX_LEN_MASK                   0x7fff
-+
 +      __le32 opts2;
-+#define RD_UDP_CS                     (1 << 23)
-+#define RD_TCP_CS                     (1 << 22)
-+#define RD_IPV6_CS                    (1 << 20)
-+#define RD_IPV4_CS                    (1 << 19)
-+
 +      __le32 opts3;
-+#define IPF                           (1 << 23) /* IP checksum fail */
-+#define UDPF                          (1 << 22) /* UDP checksum fail */
-+#define TCPF                          (1 << 21) /* TCP checksum fail */
-+#define RX_VLAN_TAG                   (1 << 16)
-+
 +      __le32 opts4;
 +      __le32 opts5;
 +      __le32 opts6;
@@ -17774,22 +18402,13 @@ diff -Naur backports-3.18.1-1.org/drivers/net/usb/r8152.c backports-3.18.1-1/dri
 +      __le32 opts1;
 +#define TX_FS                 (1 << 31) /* First segment of a packet */
 +#define TX_LS                 (1 << 30) /* Final segment of a packet */
-+#define GTSENDV4              (1 << 28)
-+#define GTSENDV6              (1 << 27)
-+#define GTTCPHO_SHIFT         18
-+#define GTTCPHO_MAX           0x7fU
-+#define TX_LEN_MAX            0x3ffffU
++#define TX_LEN_MASK           0x3ffff
 +
 +      __le32 opts2;
 +#define UDP_CS                        (1 << 31) /* Calculate UDP/IP checksum */
 +#define TCP_CS                        (1 << 30) /* Calculate TCP/IP checksum */
 +#define IPV4_CS                       (1 << 29) /* Calculate IPv4 checksum */
 +#define IPV6_CS                       (1 << 28) /* Calculate IPv6 checksum */
-+#define MSS_SHIFT             17
-+#define MSS_MAX                       0x7ffU
-+#define TCPHO_SHIFT           17
-+#define TCPHO_MAX             0x7ffU
-+#define TX_VLAN_TAG                   (1 << 16)
 +};
 +
 +struct r8152;
@@ -17826,21 +18445,16 @@ diff -Naur backports-3.18.1-1.org/drivers/net/usb/r8152.c backports-3.18.1-1/dri
 +      spinlock_t rx_lock, tx_lock;
 +      struct delayed_work schedule;
 +      struct mii_if_info mii;
-+      struct mutex control;   /* use for hw setting */
 +
 +      struct rtl_ops {
 +              void (*init)(struct r8152 *);
 +              int (*enable)(struct r8152 *);
 +              void (*disable)(struct r8152 *);
-+              void (*up)(struct r8152 *);
 +              void (*down)(struct r8152 *);
 +              void (*unload)(struct r8152 *);
-+              int (*eee_get)(struct r8152 *, struct ethtool_eee *);
-+              int (*eee_set)(struct r8152 *, struct ethtool_eee *);
 +      } __no_const rtl_ops;
 +
 +      int intr_interval;
-+      u32 saved_wolopts;
 +      u32 msg_enable;
 +      u32 tx_qlen;
 +      u16 ocp_base;
@@ -17859,20 +18473,11 @@ diff -Naur backports-3.18.1-1.org/drivers/net/usb/r8152.c backports-3.18.1-1/dri
 +      RTL_VER_MAX
 +};
 +
-+enum tx_csum_stat {
-+      TX_CSUM_SUCCESS = 0,
-+      TX_CSUM_TSO,
-+      TX_CSUM_NONE
-+};
-+
 +/* Maximum number of multicast addresses to filter (vs. Rx-all-multicast).
 + * The RTL chips use a 64 element hash table based on the Ethernet CRC.
 + */
 +static const int multicast_filter_limit = 32;
-+static unsigned int agg_buf_sz = 16384;
-+
-+#define RTL_LIMITED_TSO_SIZE  (agg_buf_sz - sizeof(struct tx_desc) - \
-+                               VLAN_ETH_HLEN - VLAN_HLEN)
++static unsigned int rx_buf_sz = 16384;
 +
 +static
 +int get_registers(struct r8152 *tp, u16 value, u16 index, u16 size, void *data)
@@ -17885,8 +18490,8 @@ diff -Naur backports-3.18.1-1.org/drivers/net/usb/r8152.c backports-3.18.1-1/dri
 +              return -ENOMEM;
 +
 +      ret = usb_control_msg(tp->udev, usb_rcvctrlpipe(tp->udev, 0),
-+                            RTL8152_REQ_GET_REGS, RTL8152_REQT_READ,
-+                            value, index, tmp, size, 500);
++                             RTL8152_REQ_GET_REGS, RTL8152_REQT_READ,
++                             value, index, tmp, size, 500);
 +
 +      memcpy(data, tmp, size);
 +      kfree(tmp);
@@ -17900,21 +18505,22 @@ diff -Naur backports-3.18.1-1.org/drivers/net/usb/r8152.c backports-3.18.1-1/dri
 +      int ret;
 +      void *tmp;
 +
-+      tmp = kmemdup(data, size, GFP_KERNEL);
++      tmp = kmalloc(size, GFP_KERNEL);
 +      if (!tmp)
 +              return -ENOMEM;
 +
++      memcpy(tmp, data, size);
++
 +      ret = usb_control_msg(tp->udev, usb_sndctrlpipe(tp->udev, 0),
-+                            RTL8152_REQ_SET_REGS, RTL8152_REQT_WRITE,
-+                            value, index, tmp, size, 500);
++                             RTL8152_REQ_SET_REGS, RTL8152_REQT_WRITE,
++                             value, index, tmp, size, 500);
 +
 +      kfree(tmp);
-+
 +      return ret;
 +}
 +
 +static int generic_ocp_read(struct r8152 *tp, u16 index, u16 size,
-+                          void *data, u16 type)
++                              void *data, u16 type)
 +{
 +      u16 limit = 64;
 +      int ret = 0;
@@ -17954,7 +18560,7 @@ diff -Naur backports-3.18.1-1.org/drivers/net/usb/r8152.c backports-3.18.1-1/dri
 +}
 +
 +static int generic_ocp_write(struct r8152 *tp, u16 index, u16 byteen,
-+                           u16 size, void *data, u16 type)
++                              u16 size, void *data, u16 type)
 +{
 +      int ret;
 +      u16 byteen_start, byteen_end, byen;
@@ -17988,8 +18594,8 @@ diff -Naur backports-3.18.1-1.org/drivers/net/usb/r8152.c backports-3.18.1-1/dri
 +              while (size) {
 +                      if (size > limit) {
 +                              ret = set_registers(tp, index,
-+                                                  type | BYTE_EN_DWORD,
-+                                                  limit, data);
++                                      type | BYTE_EN_DWORD,
++                                      limit, data);
 +                              if (ret < 0)
 +                                      goto error1;
 +
@@ -17998,8 +18604,8 @@ diff -Naur backports-3.18.1-1.org/drivers/net/usb/r8152.c backports-3.18.1-1/dri
 +                              size -= limit;
 +                      } else {
 +                              ret = set_registers(tp, index,
-+                                                  type | BYTE_EN_DWORD,
-+                                                  size, data);
++                                      type | BYTE_EN_DWORD,
++                                      size, data);
 +                              if (ret < 0)
 +                                      goto error1;
 +
@@ -18195,17 +18801,11 @@ diff -Naur backports-3.18.1-1.org/drivers/net/usb/r8152.c backports-3.18.1-1/dri
 +static int read_mii_word(struct net_device *netdev, int phy_id, int reg)
 +{
 +      struct r8152 *tp = netdev_priv(netdev);
-+      int ret;
-+
-+      if (test_bit(RTL8152_UNPLUG, &tp->flags))
-+              return -ENODEV;
 +
 +      if (phy_id != R8152_PHY_ID)
 +              return -EINVAL;
 +
-+      ret = r8152_mdio_read(tp, reg);
-+
-+      return ret;
++      return r8152_mdio_read(tp, reg);
 +}
 +
 +static
@@ -18213,32 +18813,35 @@ diff -Naur backports-3.18.1-1.org/drivers/net/usb/r8152.c backports-3.18.1-1/dri
 +{
 +      struct r8152 *tp = netdev_priv(netdev);
 +
-+      if (test_bit(RTL8152_UNPLUG, &tp->flags))
-+              return;
-+
 +      if (phy_id != R8152_PHY_ID)
 +              return;
 +
 +      r8152_mdio_write(tp, reg, val);
 +}
 +
-+static int
-+r8152_submit_rx(struct r8152 *tp, struct rx_agg *agg, gfp_t mem_flags);
++static
++int r8152_submit_rx(struct r8152 *tp, struct rx_agg *agg, gfp_t mem_flags);
++
++static inline void set_ethernet_addr(struct r8152 *tp)
++{
++      struct net_device *dev = tp->netdev;
++      u8 node_id[8] = {0};
++
++      if (pla_ocp_read(tp, PLA_IDR, sizeof(node_id), node_id) < 0)
++              netif_notice(tp, probe, dev, "inet addr fail\n");
++      else {
++              memcpy(dev->dev_addr, node_id, dev->addr_len);
++              memcpy(dev->perm_addr, dev->dev_addr, dev->addr_len);
++      }
++}
 +
 +static int rtl8152_set_mac_address(struct net_device *netdev, void *p)
 +{
 +      struct r8152 *tp = netdev_priv(netdev);
 +      struct sockaddr *addr = p;
-+      int ret = -EADDRNOTAVAIL;
 +
 +      if (!is_valid_ether_addr(addr->sa_data))
-+              goto out1;
-+
-+      ret = usb_autopm_get_interface(tp->intf);
-+      if (ret < 0)
-+              goto out1;
-+
-+      mutex_lock(&tp->control);
++              return -EADDRNOTAVAIL;
 +
 +      memcpy(netdev->dev_addr, addr->sa_data, netdev->addr_len);
 +
@@ -18246,47 +18849,18 @@ diff -Naur backports-3.18.1-1.org/drivers/net/usb/r8152.c backports-3.18.1-1/dri
 +      pla_ocp_write(tp, PLA_IDR, BYTE_EN_SIX_BYTES, 8, addr->sa_data);
 +      ocp_write_byte(tp, MCU_TYPE_PLA, PLA_CRWECR, CRWECR_NORAML);
 +
-+      mutex_unlock(&tp->control);
-+
-+      usb_autopm_put_interface(tp->intf);
-+out1:
-+      return ret;
++      return 0;
 +}
 +
-+static int set_ethernet_addr(struct r8152 *tp)
++static struct net_device_stats *rtl8152_get_stats(struct net_device *dev)
 +{
-+      struct net_device *dev = tp->netdev;
-+      struct sockaddr sa;
-+      int ret;
-+
-+      if (tp->version == RTL_VER_01)
-+              ret = pla_ocp_read(tp, PLA_IDR, 8, sa.sa_data);
-+      else
-+              ret = pla_ocp_read(tp, PLA_BACKUP, 8, sa.sa_data);
-+
-+      if (ret < 0) {
-+              netif_err(tp, probe, dev, "Get ether addr fail\n");
-+      } else if (!is_valid_ether_addr(sa.sa_data)) {
-+              netif_err(tp, probe, dev, "Invalid ether addr %pM\n",
-+                        sa.sa_data);
-+              eth_hw_addr_random(dev);
-+              ether_addr_copy(sa.sa_data, dev->dev_addr);
-+              ret = rtl8152_set_mac_address(dev, &sa);
-+              netif_info(tp, probe, dev, "Random ether addr %pM\n",
-+                         sa.sa_data);
-+      } else {
-+              if (tp->version == RTL_VER_01)
-+                      ether_addr_copy(dev->dev_addr, sa.sa_data);
-+              else
-+                      ret = rtl8152_set_mac_address(dev, &sa);
-+      }
-+
-+      return ret;
++      return &dev->stats;
 +}
 +
 +static void read_bulk_callback(struct urb *urb)
 +{
 +      struct net_device *netdev;
++      unsigned long flags;
 +      int status = urb->status;
 +      struct rx_agg *agg;
 +      struct r8152 *tp;
@@ -18313,16 +18887,14 @@ diff -Naur backports-3.18.1-1.org/drivers/net/usb/r8152.c backports-3.18.1-1/dri
 +      if (!netif_carrier_ok(netdev))
 +              return;
 +
-+      usb_mark_last_busy(tp->udev);
-+
 +      switch (status) {
 +      case 0:
 +              if (urb->actual_length < ETH_ZLEN)
 +                      break;
 +
-+              spin_lock(&tp->rx_lock);
++              spin_lock_irqsave(&tp->rx_lock, flags);
 +              list_add_tail(&agg->list, &tp->rx_done);
-+              spin_unlock(&tp->rx_lock);
++              spin_unlock_irqrestore(&tp->rx_lock, flags);
 +              tasklet_schedule(&tp->tl);
 +              return;
 +      case -ESHUTDOWN:
@@ -18345,9 +18917,9 @@ diff -Naur backports-3.18.1-1.org/drivers/net/usb/r8152.c backports-3.18.1-1/dri
 +      if (result == -ENODEV) {
 +              netif_device_detach(tp->netdev);
 +      } else if (result) {
-+              spin_lock(&tp->rx_lock);
++              spin_lock_irqsave(&tp->rx_lock, flags);
 +              list_add_tail(&agg->list, &tp->rx_done);
-+              spin_unlock(&tp->rx_lock);
++              spin_unlock_irqrestore(&tp->rx_lock, flags);
 +              tasklet_schedule(&tp->tl);
 +      }
 +}
@@ -18355,7 +18927,7 @@ diff -Naur backports-3.18.1-1.org/drivers/net/usb/r8152.c backports-3.18.1-1/dri
 +static void write_bulk_callback(struct urb *urb)
 +{
 +      struct net_device_stats *stats;
-+      struct net_device *netdev;
++      unsigned long flags;
 +      struct tx_agg *agg;
 +      struct r8152 *tp;
 +      int status = urb->status;
@@ -18368,24 +18940,21 @@ diff -Naur backports-3.18.1-1.org/drivers/net/usb/r8152.c backports-3.18.1-1/dri
 +      if (!tp)
 +              return;
 +
-+      netdev = tp->netdev;
-+      stats = &netdev->stats;
++      stats = rtl8152_get_stats(tp->netdev);
 +      if (status) {
 +              if (net_ratelimit())
-+                      netdev_warn(netdev, "Tx status %d\n", status);
++                      netdev_warn(tp->netdev, "Tx status %d\n", status);
 +              stats->tx_errors += agg->skb_num;
 +      } else {
 +              stats->tx_packets += agg->skb_num;
 +              stats->tx_bytes += agg->skb_len;
 +      }
 +
-+      spin_lock(&tp->tx_lock);
++      spin_lock_irqsave(&tp->tx_lock, flags);
 +      list_add_tail(&agg->list, &tp->tx_free);
-+      spin_unlock(&tp->tx_lock);
-+
-+      usb_autopm_put_interface_async(tp->intf);
++      spin_unlock_irqrestore(&tp->tx_lock, flags);
 +
-+      if (!netif_carrier_ok(netdev))
++      if (!netif_carrier_ok(tp->netdev))
 +              return;
 +
 +      if (!test_bit(WORK_ENABLE, &tp->flags))
@@ -18422,9 +18991,6 @@ diff -Naur backports-3.18.1-1.org/drivers/net/usb/r8152.c backports-3.18.1-1/dri
 +      case -ESHUTDOWN:
 +              netif_device_detach(tp->netdev);
 +      case -ENOENT:
-+      case -EPROTO:
-+              netif_info(tp, intr, tp->netdev,
-+                         "Stop submitting intr, status %d\n", status);
 +              return;
 +      case -EOVERFLOW:
 +              netif_info(tp, intr, tp->netdev, "intr status -EOVERFLOW\n");
@@ -18515,13 +19081,13 @@ diff -Naur backports-3.18.1-1.org/drivers/net/usb/r8152.c backports-3.18.1-1/dri
 +      skb_queue_head_init(&tp->tx_queue);
 +
 +      for (i = 0; i < RTL8152_MAX_RX; i++) {
-+              buf = kmalloc_node(agg_buf_sz, GFP_KERNEL, node);
++              buf = kmalloc_node(rx_buf_sz, GFP_KERNEL, node);
 +              if (!buf)
 +                      goto err1;
 +
 +              if (buf != rx_agg_align(buf)) {
 +                      kfree(buf);
-+                      buf = kmalloc_node(agg_buf_sz + RX_ALIGN, GFP_KERNEL,
++                      buf = kmalloc_node(rx_buf_sz + RX_ALIGN, GFP_KERNEL,
 +                                         node);
 +                      if (!buf)
 +                              goto err1;
@@ -18541,13 +19107,13 @@ diff -Naur backports-3.18.1-1.org/drivers/net/usb/r8152.c backports-3.18.1-1/dri
 +      }
 +
 +      for (i = 0; i < RTL8152_MAX_TX; i++) {
-+              buf = kmalloc_node(agg_buf_sz, GFP_KERNEL, node);
++              buf = kmalloc_node(rx_buf_sz, GFP_KERNEL, node);
 +              if (!buf)
 +                      goto err1;
 +
 +              if (buf != tx_agg_align(buf)) {
 +                      kfree(buf);
-+                      buf = kmalloc_node(agg_buf_sz + TX_ALIGN, GFP_KERNEL,
++                      buf = kmalloc_node(rx_buf_sz + TX_ALIGN, GFP_KERNEL,
 +                                         node);
 +                      if (!buf)
 +                              goto err1;
@@ -18578,8 +19144,8 @@ diff -Naur backports-3.18.1-1.org/drivers/net/usb/r8152.c backports-3.18.1-1/dri
 +
 +      tp->intr_interval = (int)ep_intr->desc.bInterval;
 +      usb_fill_int_urb(tp->intr_urb, tp->udev, usb_rcvintpipe(tp->udev, 3),
-+                       tp->intr_buff, INTBUFSIZE, intr_callback,
-+                       tp, tp->intr_interval);
++                   tp->intr_buff, INTBUFSIZE, intr_callback,
++                   tp, tp->intr_interval);
 +
 +      return 0;
 +
@@ -18593,9 +19159,6 @@ diff -Naur backports-3.18.1-1.org/drivers/net/usb/r8152.c backports-3.18.1-1/dri
 +      struct tx_agg *agg = NULL;
 +      unsigned long flags;
 +
-+      if (list_empty(&tp->tx_free))
-+              return NULL;
-+
 +      spin_lock_irqsave(&tp->tx_lock, flags);
 +      if (!list_empty(&tp->tx_free)) {
 +              struct list_head *cursor;
@@ -18609,155 +19172,24 @@ diff -Naur backports-3.18.1-1.org/drivers/net/usb/r8152.c backports-3.18.1-1/dri
 +      return agg;
 +}
 +
-+static inline __be16 get_protocol(struct sk_buff *skb)
-+{
-+      __be16 protocol;
-+
-+      if (skb->protocol == htons(ETH_P_8021Q))
-+              protocol = vlan_eth_hdr(skb)->h_vlan_encapsulated_proto;
-+      else
-+              protocol = skb->protocol;
-+
-+      return protocol;
-+}
-+
-+/* r8152_csum_workaround()
-+ * The hw limites the value the transport offset. When the offset is out of the
-+ * range, calculate the checksum by sw.
-+ */
-+static void r8152_csum_workaround(struct r8152 *tp, struct sk_buff *skb,
-+                                struct sk_buff_head *list)
-+{
-+      if (skb_shinfo(skb)->gso_size) {
-+              netdev_features_t features = tp->netdev->features;
-+              struct sk_buff_head seg_list;
-+              struct sk_buff *segs, *nskb;
-+
-+              features &= ~(NETIF_F_SG | NETIF_F_IPV6_CSUM | NETIF_F_TSO6);
-+              segs = skb_gso_segment(skb, features);
-+              if (IS_ERR(segs) || !segs)
-+                      goto drop;
-+
-+              __skb_queue_head_init(&seg_list);
-+
-+              do {
-+                      nskb = segs;
-+                      segs = segs->next;
-+                      nskb->next = NULL;
-+                      __skb_queue_tail(&seg_list, nskb);
-+              } while (segs);
-+
-+              skb_queue_splice(&seg_list, list);
-+              dev_kfree_skb(skb);
-+      } else if (skb->ip_summed == CHECKSUM_PARTIAL) {
-+              if (skb_checksum_help(skb) < 0)
-+                      goto drop;
-+
-+              __skb_queue_head(list, skb);
-+      } else {
-+              struct net_device_stats *stats;
-+
-+drop:
-+              stats = &tp->netdev->stats;
-+              stats->tx_dropped++;
-+              dev_kfree_skb(skb);
-+      }
-+}
-+
-+/* msdn_giant_send_check()
-+ * According to the document of microsoft, the TCP Pseudo Header excludes the
-+ * packet length for IPv6 TCP large packets.
-+ */
-+static int msdn_giant_send_check(struct sk_buff *skb)
-+{
-+      const struct ipv6hdr *ipv6h;
-+      struct tcphdr *th;
-+      int ret;
-+
-+      ret = skb_cow_head(skb, 0);
-+      if (ret)
-+              return ret;
-+
-+      ipv6h = ipv6_hdr(skb);
-+      th = tcp_hdr(skb);
-+
-+      th->check = 0;
-+      th->check = ~tcp_v6_check(0, &ipv6h->saddr, &ipv6h->daddr, 0);
-+
-+      return ret;
-+}
-+
-+static inline void rtl_tx_vlan_tag(struct tx_desc *desc, struct sk_buff *skb)
-+{
-+      if (vlan_tx_tag_present(skb)) {
-+              u32 opts2;
-+
-+              opts2 = TX_VLAN_TAG | swab16(vlan_tx_tag_get(skb));
-+              desc->opts2 |= cpu_to_le32(opts2);
-+      }
-+}
-+
-+static inline void rtl_rx_vlan_tag(struct rx_desc *desc, struct sk_buff *skb)
-+{
-+      u32 opts2 = le32_to_cpu(desc->opts2);
-+
-+      if (opts2 & RX_VLAN_TAG)
-+              __vlan_hwaccel_put_tag(skb, htons(ETH_P_8021Q),
-+                                     swab16(opts2 & 0xffff));
-+}
-+
-+static int r8152_tx_csum(struct r8152 *tp, struct tx_desc *desc,
-+                       struct sk_buff *skb, u32 len, u32 transport_offset)
++static void
++r8152_tx_csum(struct r8152 *tp, struct tx_desc *desc, struct sk_buff *skb)
 +{
-+      u32 mss = skb_shinfo(skb)->gso_size;
-+      u32 opts1, opts2 = 0;
-+      int ret = TX_CSUM_SUCCESS;
-+
-+      WARN_ON_ONCE(len > TX_LEN_MAX);
-+
-+      opts1 = len | TX_FS | TX_LS;
-+
-+      if (mss) {
-+              if (transport_offset > GTTCPHO_MAX) {
-+                      netif_warn(tp, tx_err, tp->netdev,
-+                                 "Invalid transport offset 0x%x for TSO\n",
-+                                 transport_offset);
-+                      ret = TX_CSUM_TSO;
-+                      goto unavailable;
-+              }
-+
-+              switch (get_protocol(skb)) {
-+              case htons(ETH_P_IP):
-+                      opts1 |= GTSENDV4;
-+                      break;
-+
-+              case htons(ETH_P_IPV6):
-+                      if (msdn_giant_send_check(skb)) {
-+                              ret = TX_CSUM_TSO;
-+                              goto unavailable;
-+                      }
-+                      opts1 |= GTSENDV6;
-+                      break;
++      memset(desc, 0, sizeof(*desc));
 +
-+              default:
-+                      WARN_ON_ONCE(1);
-+                      break;
-+              }
++      desc->opts1 = cpu_to_le32((skb->len & TX_LEN_MASK) | TX_FS | TX_LS);
 +
-+              opts1 |= transport_offset << GTTCPHO_SHIFT;
-+              opts2 |= min(mss, MSS_MAX) << MSS_SHIFT;
-+      } else if (skb->ip_summed == CHECKSUM_PARTIAL) {
++      if (skb->ip_summed == CHECKSUM_PARTIAL) {
++              __be16 protocol;
 +              u8 ip_protocol;
++              u32 opts2 = 0;
 +
-+              if (transport_offset > TCPHO_MAX) {
-+                      netif_warn(tp, tx_err, tp->netdev,
-+                                 "Invalid transport offset 0x%x\n",
-+                                 transport_offset);
-+                      ret = TX_CSUM_NONE;
-+                      goto unavailable;
-+              }
++              if (skb->protocol == htons(ETH_P_8021Q))
++                      protocol = vlan_eth_hdr(skb)->h_vlan_encapsulated_proto;
++              else
++                      protocol = skb->protocol;
 +
-+              switch (get_protocol(skb)) {
++              switch (protocol) {
 +              case htons(ETH_P_IP):
 +                      opts2 |= IPV4_CS;
 +                      ip_protocol = ip_hdr(skb)->protocol;
@@ -18773,93 +19205,56 @@ diff -Naur backports-3.18.1-1.org/drivers/net/usb/r8152.c backports-3.18.1-1/dri
 +                      break;
 +              }
 +
-+              if (ip_protocol == IPPROTO_TCP)
++              if (ip_protocol == IPPROTO_TCP) {
 +                      opts2 |= TCP_CS;
-+              else if (ip_protocol == IPPROTO_UDP)
++                      opts2 |= (skb_transport_offset(skb) & 0x7fff) << 17;
++              } else if (ip_protocol == IPPROTO_UDP) {
 +                      opts2 |= UDP_CS;
-+              else
++              } else {
 +                      WARN_ON_ONCE(1);
++              }
 +
-+              opts2 |= transport_offset << TCPHO_SHIFT;
++              desc->opts2 = cpu_to_le32(opts2);
 +      }
-+
-+      desc->opts2 = cpu_to_le32(opts2);
-+      desc->opts1 = cpu_to_le32(opts1);
-+
-+unavailable:
-+      return ret;
 +}
 +
 +static int r8152_tx_agg_fill(struct r8152 *tp, struct tx_agg *agg)
 +{
-+      struct sk_buff_head skb_head, *tx_queue = &tp->tx_queue;
-+      int remain, ret;
++      int remain;
 +      u8 *tx_data;
 +
-+      __skb_queue_head_init(&skb_head);
-+      spin_lock(&tx_queue->lock);
-+      skb_queue_splice_init(tx_queue, &skb_head);
-+      spin_unlock(&tx_queue->lock);
-+
 +      tx_data = agg->head;
-+      agg->skb_num = 0;
-+      agg->skb_len = 0;
-+      remain = agg_buf_sz;
++      agg->skb_num = agg->skb_len = 0;
++      remain = rx_buf_sz;
 +
 +      while (remain >= ETH_ZLEN + sizeof(struct tx_desc)) {
 +              struct tx_desc *tx_desc;
 +              struct sk_buff *skb;
 +              unsigned int len;
-+              u32 offset;
 +
-+              skb = __skb_dequeue(&skb_head);
++              skb = skb_dequeue(&tp->tx_queue);
 +              if (!skb)
 +                      break;
 +
-+              len = skb->len + sizeof(*tx_desc);
-+
-+              if (len > remain) {
-+                      __skb_queue_head(&skb_head, skb);
++              remain -= sizeof(*tx_desc);
++              len = skb->len;
++              if (remain < len) {
++                      skb_queue_head(&tp->tx_queue, skb);
 +                      break;
 +              }
 +
 +              tx_data = tx_agg_align(tx_data);
 +              tx_desc = (struct tx_desc *)tx_data;
-+
-+              offset = (u32)skb_transport_offset(skb);
-+
-+              if (r8152_tx_csum(tp, tx_desc, skb, skb->len, offset)) {
-+                      r8152_csum_workaround(tp, skb, &skb_head);
-+                      continue;
-+              }
-+
-+              rtl_tx_vlan_tag(tx_desc, skb);
-+
 +              tx_data += sizeof(*tx_desc);
 +
-+              len = skb->len;
-+              if (skb_copy_bits(skb, 0, tx_data, len) < 0) {
-+                      struct net_device_stats *stats = &tp->netdev->stats;
-+
-+                      stats->tx_dropped++;
-+                      dev_kfree_skb_any(skb);
-+                      tx_data -= sizeof(*tx_desc);
-+                      continue;
-+              }
-+
-+              tx_data += len;
-+              agg->skb_len += len;
++              r8152_tx_csum(tp, tx_desc, skb);
++              memcpy(tx_data, skb->data, len);
 +              agg->skb_num++;
-+
++              agg->skb_len += len;
 +              dev_kfree_skb_any(skb);
 +
-+              remain = agg_buf_sz - (int)(tx_agg_align(tx_data) - agg->head);
-+      }
-+
-+      if (!skb_queue_empty(&skb_head)) {
-+              spin_lock(&tx_queue->lock);
-+              skb_queue_splice(&skb_head, tx_queue);
-+              spin_unlock(&tx_queue->lock);
++              tx_data += len;
++              remain = rx_buf_sz - (int)(tx_agg_align(tx_data) - agg->head);
 +      }
 +
 +      netif_tx_lock(tp->netdev);
@@ -18870,67 +19265,20 @@ diff -Naur backports-3.18.1-1.org/drivers/net/usb/r8152.c backports-3.18.1-1/dri
 +
 +      netif_tx_unlock(tp->netdev);
 +
-+      ret = usb_autopm_get_interface_async(tp->intf);
-+      if (ret < 0)
-+              goto out_tx_fill;
-+
 +      usb_fill_bulk_urb(agg->urb, tp->udev, usb_sndbulkpipe(tp->udev, 2),
 +                        agg->head, (int)(tx_data - (u8 *)agg->head),
 +                        (usb_complete_t)write_bulk_callback, agg);
 +
-+      ret = usb_submit_urb(agg->urb, GFP_ATOMIC);
-+      if (ret < 0)
-+              usb_autopm_put_interface_async(tp->intf);
-+
-+out_tx_fill:
-+      return ret;
-+}
-+
-+static u8 r8152_rx_csum(struct r8152 *tp, struct rx_desc *rx_desc)
-+{
-+      u8 checksum = CHECKSUM_NONE;
-+      u32 opts2, opts3;
-+
-+      if (tp->version == RTL_VER_01)
-+              goto return_result;
-+
-+      opts2 = le32_to_cpu(rx_desc->opts2);
-+      opts3 = le32_to_cpu(rx_desc->opts3);
-+
-+      if (opts2 & RD_IPV4_CS) {
-+              if (opts3 & IPF)
-+                      checksum = CHECKSUM_NONE;
-+              else if ((opts2 & RD_UDP_CS) && (opts3 & UDPF))
-+                      checksum = CHECKSUM_NONE;
-+              else if ((opts2 & RD_TCP_CS) && (opts3 & TCPF))
-+                      checksum = CHECKSUM_NONE;
-+              else
-+                      checksum = CHECKSUM_UNNECESSARY;
-+      } else if (RD_IPV6_CS) {
-+              if ((opts2 & RD_UDP_CS) && !(opts3 & UDPF))
-+                      checksum = CHECKSUM_UNNECESSARY;
-+              else if ((opts2 & RD_TCP_CS) && !(opts3 & TCPF))
-+                      checksum = CHECKSUM_UNNECESSARY;
-+      }
-+
-+return_result:
-+      return checksum;
++      return usb_submit_urb(agg->urb, GFP_ATOMIC);
 +}
 +
 +static void rx_bottom(struct r8152 *tp)
 +{
 +      unsigned long flags;
-+      struct list_head *cursor, *next, rx_queue;
-+
-+      if (list_empty(&tp->rx_done))
-+              return;
++      struct list_head *cursor, *next;
 +
-+      INIT_LIST_HEAD(&rx_queue);
 +      spin_lock_irqsave(&tp->rx_lock, flags);
-+      list_splice_init(&tp->rx_done, &rx_queue);
-+      spin_unlock_irqrestore(&tp->rx_lock, flags);
-+
-+      list_for_each_safe(cursor, next, &rx_queue) {
++      list_for_each_safe(cursor, next, &tp->rx_done) {
 +              struct rx_desc *rx_desc;
 +              struct rx_agg *agg;
 +              int len_used = 0;
@@ -18939,6 +19287,7 @@ diff -Naur backports-3.18.1-1.org/drivers/net/usb/r8152.c backports-3.18.1-1/dri
 +              int ret;
 +
 +              list_del_init(cursor);
++              spin_unlock_irqrestore(&tp->rx_lock, flags);
 +
 +              agg = list_entry(cursor, struct rx_agg, list);
 +              urb = agg->urb;
@@ -18951,7 +19300,7 @@ diff -Naur backports-3.18.1-1.org/drivers/net/usb/r8152.c backports-3.18.1-1/dri
 +
 +              while (urb->actual_length > len_used) {
 +                      struct net_device *netdev = tp->netdev;
-+                      struct net_device_stats *stats = &netdev->stats;
++                      struct net_device_stats *stats;
 +                      unsigned int pkt_len;
 +                      struct sk_buff *skb;
 +
@@ -18963,25 +19312,23 @@ diff -Naur backports-3.18.1-1.org/drivers/net/usb/r8152.c backports-3.18.1-1/dri
 +                      if (urb->actual_length < len_used)
 +                              break;
 +
++                      stats = rtl8152_get_stats(netdev);
++
 +                      pkt_len -= CRC_SIZE;
 +                      rx_data += sizeof(struct rx_desc);
 +
 +                      skb = netdev_alloc_skb_ip_align(netdev, pkt_len);
 +                      if (!skb) {
 +                              stats->rx_dropped++;
-+                              goto find_next_rx;
++                              break;
 +                      }
-+
-+                      skb->ip_summed = r8152_rx_csum(tp, rx_desc);
 +                      memcpy(skb->data, rx_data, pkt_len);
 +                      skb_put(skb, pkt_len);
 +                      skb->protocol = eth_type_trans(skb, netdev);
-+                      rtl_rx_vlan_tag(rx_desc, skb);
-+                      netif_receive_skb(skb);
++                      netif_rx(skb);
 +                      stats->rx_packets++;
 +                      stats->rx_bytes += pkt_len;
 +
-+find_next_rx:
 +                      rx_data = rx_agg_align(rx_data + pkt_len + CRC_SIZE);
 +                      rx_desc = (struct rx_desc *)rx_data;
 +                      len_used = (int)(rx_data - (u8 *)agg->head);
@@ -18990,13 +19337,13 @@ diff -Naur backports-3.18.1-1.org/drivers/net/usb/r8152.c backports-3.18.1-1/dri
 +
 +submit:
 +              ret = r8152_submit_rx(tp, agg, GFP_ATOMIC);
++              spin_lock_irqsave(&tp->rx_lock, flags);
 +              if (ret && ret != -ENODEV) {
-+                      spin_lock_irqsave(&tp->rx_lock, flags);
-+                      list_add_tail(&agg->list, &tp->rx_done);
-+                      spin_unlock_irqrestore(&tp->rx_lock, flags);
++                      list_add_tail(&agg->list, next);
 +                      tasklet_schedule(&tp->tl);
 +              }
 +      }
++      spin_unlock_irqrestore(&tp->rx_lock, flags);
 +}
 +
 +static void tx_bottom(struct r8152 *tp)
@@ -19015,18 +19362,19 @@ diff -Naur backports-3.18.1-1.org/drivers/net/usb/r8152.c backports-3.18.1-1/dri
 +
 +              res = r8152_tx_agg_fill(tp, agg);
 +              if (res) {
-+                      struct net_device *netdev = tp->netdev;
++                      struct net_device_stats *stats;
++                      struct net_device *netdev;
++                      unsigned long flags;
++
++                      netdev = tp->netdev;
++                      stats = rtl8152_get_stats(netdev);
 +
 +                      if (res == -ENODEV) {
 +                              netif_device_detach(netdev);
 +                      } else {
-+                              struct net_device_stats *stats = &netdev->stats;
-+                              unsigned long flags;
-+
 +                              netif_warn(tp, tx_err, netdev,
 +                                         "failed tx_urb %d\n", res);
 +                              stats->tx_dropped += agg->skb_num;
-+
 +                              spin_lock_irqsave(&tp->tx_lock, flags);
 +                              list_add_tail(&agg->list, &tp->tx_free);
 +                              spin_unlock_irqrestore(&tp->tx_lock, flags);
@@ -19060,32 +19408,12 @@ diff -Naur backports-3.18.1-1.org/drivers/net/usb/r8152.c backports-3.18.1-1/dri
 +int r8152_submit_rx(struct r8152 *tp, struct rx_agg *agg, gfp_t mem_flags)
 +{
 +      usb_fill_bulk_urb(agg->urb, tp->udev, usb_rcvbulkpipe(tp->udev, 1),
-+                        agg->head, agg_buf_sz,
-+                        (usb_complete_t)read_bulk_callback, agg);
++                    agg->head, rx_buf_sz,
++                    (usb_complete_t)read_bulk_callback, agg);
 +
 +      return usb_submit_urb(agg->urb, mem_flags);
 +}
 +
-+static void rtl_drop_queued_tx(struct r8152 *tp)
-+{
-+      struct net_device_stats *stats = &tp->netdev->stats;
-+      struct sk_buff_head skb_head, *tx_queue = &tp->tx_queue;
-+      struct sk_buff *skb;
-+
-+      if (skb_queue_empty(tx_queue))
-+              return;
-+
-+      __skb_queue_head_init(&skb_head);
-+      spin_lock_bh(&tx_queue->lock);
-+      skb_queue_splice_init(tx_queue, &skb_head);
-+      spin_unlock_bh(&tx_queue->lock);
-+
-+      while ((skb = __skb_dequeue(&skb_head))) {
-+              dev_kfree_skb(skb);
-+              stats->tx_dropped++;
-+      }
-+}
-+
 +static void rtl8152_tx_timeout(struct net_device *netdev)
 +{
 +      struct r8152 *tp = netdev_priv(netdev);
@@ -19123,22 +19451,18 @@ diff -Naur backports-3.18.1-1.org/drivers/net/usb/r8152.c backports-3.18.1-1/dri
 +              /* Unconditionally log net taps. */
 +              netif_notice(tp, link, netdev, "Promiscuous mode enabled\n");
 +              ocp_data |= RCR_AM | RCR_AAP;
-+              mc_filter[1] = 0xffffffff;
-+              mc_filter[0] = 0xffffffff;
++              mc_filter[1] = mc_filter[0] = 0xffffffff;
 +      } else if ((netdev_mc_count(netdev) > multicast_filter_limit) ||
 +                 (netdev->flags & IFF_ALLMULTI)) {
 +              /* Too many to filter perfectly -- accept all multicasts. */
 +              ocp_data |= RCR_AM;
-+              mc_filter[1] = 0xffffffff;
-+              mc_filter[0] = 0xffffffff;
++              mc_filter[1] = mc_filter[0] = 0xffffffff;
 +      } else {
 +              struct netdev_hw_addr *ha;
 +
-+              mc_filter[1] = 0;
-+              mc_filter[0] = 0;
++              mc_filter[1] = mc_filter[0] = 0;
 +              netdev_for_each_mc_addr(ha, netdev) {
 +                      int bit_nr = ether_crc(ETH_ALEN, ha->addr) >> 26;
-+
 +                      mc_filter[bit_nr >> 5] |= 1 << (bit_nr & 31);
 +                      ocp_data |= RCR_AM;
 +              }
@@ -19153,7 +19477,7 @@ diff -Naur backports-3.18.1-1.org/drivers/net/usb/r8152.c backports-3.18.1-1/dri
 +}
 +
 +static netdev_tx_t rtl8152_start_xmit(struct sk_buff *skb,
-+                                    struct net_device *netdev)
++                                          struct net_device *netdev)
 +{
 +      struct r8152 *tp = netdev_priv(netdev);
 +
@@ -19161,17 +19485,12 @@ diff -Naur backports-3.18.1-1.org/drivers/net/usb/r8152.c backports-3.18.1-1/dri
 +
 +      skb_queue_tail(&tp->tx_queue, skb);
 +
-+      if (!list_empty(&tp->tx_free)) {
-+              if (test_bit(SELECTIVE_SUSPEND, &tp->flags)) {
-+                      set_bit(SCHEDULE_TASKLET, &tp->flags);
-+                      schedule_delayed_work(&tp->schedule, 0);
-+              } else {
-+                      usb_mark_last_busy(tp->udev);
-+                      tasklet_schedule(&tp->tl);
-+              }
-+      } else if (skb_queue_len(&tp->tx_queue) > tp->tx_qlen) {
++      if (list_empty(&tp->tx_free) &&
++          skb_queue_len(&tp->tx_queue) > tp->tx_qlen)
 +              netif_stop_queue(netdev);
-+      }
++
++      if (!list_empty(&tp->tx_free))
++              tasklet_schedule(&tp->tl);
 +
 +      return NETDEV_TX_OK;
 +}
@@ -19196,7 +19515,7 @@ diff -Naur backports-3.18.1-1.org/drivers/net/usb/r8152.c backports-3.18.1-1/dri
 +      for (i = 0; i < 1000; i++) {
 +              if (!(ocp_read_byte(tp, MCU_TYPE_PLA, PLA_CR) & CR_RST))
 +                      break;
-+              usleep_range(100, 400);
++              udelay(100);
 +      }
 +}
 +
@@ -19204,8 +19523,8 @@ diff -Naur backports-3.18.1-1.org/drivers/net/usb/r8152.c backports-3.18.1-1/dri
 +{
 +      struct net_device *netdev = tp->netdev;
 +
-+      tp->tx_qlen = agg_buf_sz / (netdev->mtu + VLAN_ETH_HLEN + VLAN_HLEN +
-+                                  sizeof(struct tx_desc));
++      tp->tx_qlen = rx_buf_sz / (netdev->mtu + VLAN_ETH_HLEN + VLAN_HLEN +
++                                 sizeof(struct tx_desc));
 +}
 +
 +static inline u8 rtl8152_get_speed(struct r8152 *tp)
@@ -19230,63 +19549,33 @@ diff -Naur backports-3.18.1-1.org/drivers/net/usb/r8152.c backports-3.18.1-1/dri
 +      }
 +}
 +
-+static void rxdy_gated_en(struct r8152 *tp, bool enable)
++static int rtl_enable(struct r8152 *tp)
 +{
 +      u32 ocp_data;
++      int i, ret;
++
++      r8152b_reset_packet_filter(tp);
++
++      ocp_data = ocp_read_byte(tp, MCU_TYPE_PLA, PLA_CR);
++      ocp_data |= CR_RE | CR_TE;
++      ocp_write_byte(tp, MCU_TYPE_PLA, PLA_CR, ocp_data);
 +
 +      ocp_data = ocp_read_word(tp, MCU_TYPE_PLA, PLA_MISC_1);
-+      if (enable)
-+              ocp_data |= RXDY_GATED_EN;
-+      else
-+              ocp_data &= ~RXDY_GATED_EN;
++      ocp_data &= ~RXDY_GATED_EN;
 +      ocp_write_word(tp, MCU_TYPE_PLA, PLA_MISC_1, ocp_data);
-+}
-+
-+static int rtl_start_rx(struct r8152 *tp)
-+{
-+      int i, ret = 0;
 +
 +      INIT_LIST_HEAD(&tp->rx_done);
++      ret = 0;
 +      for (i = 0; i < RTL8152_MAX_RX; i++) {
 +              INIT_LIST_HEAD(&tp->rx_info[i].list);
-+              ret = r8152_submit_rx(tp, &tp->rx_info[i], GFP_KERNEL);
-+              if (ret)
-+                      break;
++              ret |= r8152_submit_rx(tp, &tp->rx_info[i], GFP_KERNEL);
 +      }
 +
 +      return ret;
 +}
 +
-+static int rtl_stop_rx(struct r8152 *tp)
-+{
-+      int i;
-+
-+      for (i = 0; i < RTL8152_MAX_RX; i++)
-+              usb_kill_urb(tp->rx_info[i].urb);
-+
-+      return 0;
-+}
-+
-+static int rtl_enable(struct r8152 *tp)
-+{
-+      u32 ocp_data;
-+
-+      r8152b_reset_packet_filter(tp);
-+
-+      ocp_data = ocp_read_byte(tp, MCU_TYPE_PLA, PLA_CR);
-+      ocp_data |= CR_RE | CR_TE;
-+      ocp_write_byte(tp, MCU_TYPE_PLA, PLA_CR, ocp_data);
-+
-+      rxdy_gated_en(tp, false);
-+
-+      return rtl_start_rx(tp);
-+}
-+
 +static int rtl8152_enable(struct r8152 *tp)
 +{
-+      if (test_bit(RTL8152_UNPLUG, &tp->flags))
-+              return -ENODEV;
-+
 +      set_tx_qlen(tp);
 +      rtl_set_eee_plus(tp);
 +
@@ -19319,9 +19608,6 @@ diff -Naur backports-3.18.1-1.org/drivers/net/usb/r8152.c backports-3.18.1-1/dri
 +
 +static int rtl8153_enable(struct r8152 *tp)
 +{
-+      if (test_bit(RTL8152_UNPLUG, &tp->flags))
-+              return -ENODEV;
-+
 +      set_tx_qlen(tp);
 +      rtl_set_eee_plus(tp);
 +      r8153_set_rx_agg(tp);
@@ -19329,268 +19615,60 @@ diff -Naur backports-3.18.1-1.org/drivers/net/usb/r8152.c backports-3.18.1-1/dri
 +      return rtl_enable(tp);
 +}
 +
-+static void rtl_disable(struct r8152 *tp)
++static void rtl8152_disable(struct r8152 *tp)
 +{
++      struct net_device_stats *stats = rtl8152_get_stats(tp->netdev);
++      struct sk_buff *skb;
 +      u32 ocp_data;
 +      int i;
 +
-+      if (test_bit(RTL8152_UNPLUG, &tp->flags)) {
-+              rtl_drop_queued_tx(tp);
-+              return;
-+      }
-+
 +      ocp_data = ocp_read_dword(tp, MCU_TYPE_PLA, PLA_RCR);
 +      ocp_data &= ~RCR_ACPT_ALL;
 +      ocp_write_dword(tp, MCU_TYPE_PLA, PLA_RCR, ocp_data);
 +
-+      rtl_drop_queued_tx(tp);
++      while ((skb = skb_dequeue(&tp->tx_queue))) {
++              dev_kfree_skb(skb);
++              stats->tx_dropped++;
++      }
 +
 +      for (i = 0; i < RTL8152_MAX_TX; i++)
 +              usb_kill_urb(tp->tx_info[i].urb);
 +
-+      rxdy_gated_en(tp, true);
++      ocp_data = ocp_read_word(tp, MCU_TYPE_PLA, PLA_MISC_1);
++      ocp_data |= RXDY_GATED_EN;
++      ocp_write_word(tp, MCU_TYPE_PLA, PLA_MISC_1, ocp_data);
 +
 +      for (i = 0; i < 1000; i++) {
 +              ocp_data = ocp_read_byte(tp, MCU_TYPE_PLA, PLA_OOB_CTRL);
 +              if ((ocp_data & FIFO_EMPTY) == FIFO_EMPTY)
 +                      break;
-+              usleep_range(1000, 2000);
++              mdelay(1);
 +      }
 +
 +      for (i = 0; i < 1000; i++) {
 +              if (ocp_read_word(tp, MCU_TYPE_PLA, PLA_TCR0) & TCR0_TX_EMPTY)
 +                      break;
-+              usleep_range(1000, 2000);
++              mdelay(1);
 +      }
 +
-+      rtl_stop_rx(tp);
++      for (i = 0; i < RTL8152_MAX_RX; i++)
++              usb_kill_urb(tp->rx_info[i].urb);
 +
 +      rtl8152_nic_reset(tp);
 +}
 +
-+static void r8152_power_cut_en(struct r8152 *tp, bool enable)
-+{
-+      u32 ocp_data;
-+
-+      ocp_data = ocp_read_word(tp, MCU_TYPE_USB, USB_UPS_CTRL);
-+      if (enable)
-+              ocp_data |= POWER_CUT;
-+      else
-+              ocp_data &= ~POWER_CUT;
-+      ocp_write_word(tp, MCU_TYPE_USB, USB_UPS_CTRL, ocp_data);
-+
-+      ocp_data = ocp_read_word(tp, MCU_TYPE_USB, USB_PM_CTRL_STATUS);
-+      ocp_data &= ~RESUME_INDICATE;
-+      ocp_write_word(tp, MCU_TYPE_USB, USB_PM_CTRL_STATUS, ocp_data);
-+}
-+
-+static void rtl_rx_vlan_en(struct r8152 *tp, bool enable)
-+{
-+      u32 ocp_data;
-+
-+      ocp_data = ocp_read_word(tp, MCU_TYPE_PLA, PLA_CPCR);
-+      if (enable)
-+              ocp_data |= CPCR_RX_VLAN;
-+      else
-+              ocp_data &= ~CPCR_RX_VLAN;
-+      ocp_write_word(tp, MCU_TYPE_PLA, PLA_CPCR, ocp_data);
-+}
-+
-+static int rtl8152_set_features(struct net_device *dev,
-+                              netdev_features_t features)
-+{
-+      netdev_features_t changed = features ^ dev->features;
-+      struct r8152 *tp = netdev_priv(dev);
-+      int ret;
-+
-+      ret = usb_autopm_get_interface(tp->intf);
-+      if (ret < 0)
-+              goto out;
-+
-+      mutex_lock(&tp->control);
-+
-+      if (changed & NETIF_F_HW_VLAN_CTAG_RX) {
-+              if (features & NETIF_F_HW_VLAN_CTAG_RX)
-+                      rtl_rx_vlan_en(tp, true);
-+              else
-+                      rtl_rx_vlan_en(tp, false);
-+      }
-+
-+      mutex_unlock(&tp->control);
-+
-+      usb_autopm_put_interface(tp->intf);
-+
-+out:
-+      return ret;
-+}
-+
-+#define WAKE_ANY (WAKE_PHY | WAKE_MAGIC | WAKE_UCAST | WAKE_BCAST | WAKE_MCAST)
-+
-+static u32 __rtl_get_wol(struct r8152 *tp)
-+{
-+      u32 ocp_data;
-+      u32 wolopts = 0;
-+
-+      ocp_data = ocp_read_byte(tp, MCU_TYPE_PLA, PLA_CONFIG5);
-+      if (!(ocp_data & LAN_WAKE_EN))
-+              return 0;
-+
-+      ocp_data = ocp_read_word(tp, MCU_TYPE_PLA, PLA_CONFIG34);
-+      if (ocp_data & LINK_ON_WAKE_EN)
-+              wolopts |= WAKE_PHY;
-+
-+      ocp_data = ocp_read_word(tp, MCU_TYPE_PLA, PLA_CONFIG5);
-+      if (ocp_data & UWF_EN)
-+              wolopts |= WAKE_UCAST;
-+      if (ocp_data & BWF_EN)
-+              wolopts |= WAKE_BCAST;
-+      if (ocp_data & MWF_EN)
-+              wolopts |= WAKE_MCAST;
-+
-+      ocp_data = ocp_read_word(tp, MCU_TYPE_PLA, PLA_CFG_WOL);
-+      if (ocp_data & MAGIC_EN)
-+              wolopts |= WAKE_MAGIC;
-+
-+      return wolopts;
-+}
-+
-+static void __rtl_set_wol(struct r8152 *tp, u32 wolopts)
-+{
-+      u32 ocp_data;
-+
-+      ocp_write_byte(tp, MCU_TYPE_PLA, PLA_CRWECR, CRWECR_CONFIG);
-+
-+      ocp_data = ocp_read_word(tp, MCU_TYPE_PLA, PLA_CONFIG34);
-+      ocp_data &= ~LINK_ON_WAKE_EN;
-+      if (wolopts & WAKE_PHY)
-+              ocp_data |= LINK_ON_WAKE_EN;
-+      ocp_write_word(tp, MCU_TYPE_PLA, PLA_CONFIG34, ocp_data);
-+
-+      ocp_data = ocp_read_word(tp, MCU_TYPE_PLA, PLA_CONFIG5);
-+      ocp_data &= ~(UWF_EN | BWF_EN | MWF_EN | LAN_WAKE_EN);
-+      if (wolopts & WAKE_UCAST)
-+              ocp_data |= UWF_EN;
-+      if (wolopts & WAKE_BCAST)
-+              ocp_data |= BWF_EN;
-+      if (wolopts & WAKE_MCAST)
-+              ocp_data |= MWF_EN;
-+      if (wolopts & WAKE_ANY)
-+              ocp_data |= LAN_WAKE_EN;
-+      ocp_write_word(tp, MCU_TYPE_PLA, PLA_CONFIG5, ocp_data);
-+
-+      ocp_write_byte(tp, MCU_TYPE_PLA, PLA_CRWECR, CRWECR_NORAML);
-+
-+      ocp_data = ocp_read_word(tp, MCU_TYPE_PLA, PLA_CFG_WOL);
-+      ocp_data &= ~MAGIC_EN;
-+      if (wolopts & WAKE_MAGIC)
-+              ocp_data |= MAGIC_EN;
-+      ocp_write_word(tp, MCU_TYPE_PLA, PLA_CFG_WOL, ocp_data);
-+
-+      if (wolopts & WAKE_ANY)
-+              device_set_wakeup_enable(&tp->udev->dev, true);
-+      else
-+              device_set_wakeup_enable(&tp->udev->dev, false);
-+}
-+
-+static void rtl_runtime_suspend_enable(struct r8152 *tp, bool enable)
-+{
-+      if (enable) {
-+              u32 ocp_data;
-+
-+              __rtl_set_wol(tp, WAKE_ANY);
-+
-+              ocp_write_byte(tp, MCU_TYPE_PLA, PLA_CRWECR, CRWECR_CONFIG);
-+
-+              ocp_data = ocp_read_word(tp, MCU_TYPE_PLA, PLA_CONFIG34);
-+              ocp_data |= LINK_OFF_WAKE_EN;
-+              ocp_write_word(tp, MCU_TYPE_PLA, PLA_CONFIG34, ocp_data);
-+
-+              ocp_write_byte(tp, MCU_TYPE_PLA, PLA_CRWECR, CRWECR_NORAML);
-+      } else {
-+              __rtl_set_wol(tp, tp->saved_wolopts);
-+      }
-+}
-+
-+static void rtl_phy_reset(struct r8152 *tp)
-+{
-+      u16 data;
-+      int i;
-+
-+      clear_bit(PHY_RESET, &tp->flags);
-+
-+      data = r8152_mdio_read(tp, MII_BMCR);
-+
-+      /* don't reset again before the previous one complete */
-+      if (data & BMCR_RESET)
-+              return;
-+
-+      data |= BMCR_RESET;
-+      r8152_mdio_write(tp, MII_BMCR, data);
-+
-+      for (i = 0; i < 50; i++) {
-+              msleep(20);
-+              if ((r8152_mdio_read(tp, MII_BMCR) & BMCR_RESET) == 0)
-+                      break;
-+      }
-+}
-+
-+static void r8153_teredo_off(struct r8152 *tp)
-+{
-+      u32 ocp_data;
-+
-+      ocp_data = ocp_read_word(tp, MCU_TYPE_PLA, PLA_TEREDO_CFG);
-+      ocp_data &= ~(TEREDO_SEL | TEREDO_RS_EVENT_MASK | OOB_TEREDO_EN);
-+      ocp_write_word(tp, MCU_TYPE_PLA, PLA_TEREDO_CFG, ocp_data);
-+
-+      ocp_write_word(tp, MCU_TYPE_PLA, PLA_WDT6_CTRL, WDT6_SET_MODE);
-+      ocp_write_word(tp, MCU_TYPE_PLA, PLA_REALWOW_TIMER, 0);
-+      ocp_write_dword(tp, MCU_TYPE_PLA, PLA_TEREDO_TIMER, 0);
-+}
-+
-+static void r8152b_disable_aldps(struct r8152 *tp)
-+{
-+      ocp_reg_write(tp, OCP_ALDPS_CONFIG, ENPDNPS | LINKENA | DIS_SDSAVE);
-+      msleep(20);
-+}
-+
-+static inline void r8152b_enable_aldps(struct r8152 *tp)
-+{
-+      ocp_reg_write(tp, OCP_ALDPS_CONFIG, ENPWRSAVE | ENPDNPS |
-+                                          LINKENA | DIS_SDSAVE);
-+}
-+
-+static void rtl8152_disable(struct r8152 *tp)
-+{
-+      r8152b_disable_aldps(tp);
-+      rtl_disable(tp);
-+      r8152b_enable_aldps(tp);
-+}
-+
-+static void r8152b_hw_phy_cfg(struct r8152 *tp)
-+{
-+      u16 data;
-+
-+      data = r8152_mdio_read(tp, MII_BMCR);
-+      if (data & BMCR_PDOWN) {
-+              data &= ~BMCR_PDOWN;
-+              r8152_mdio_write(tp, MII_BMCR, data);
-+      }
-+
-+      set_bit(PHY_RESET, &tp->flags);
-+}
-+
 +static void r8152b_exit_oob(struct r8152 *tp)
 +{
-+      u32 ocp_data;
-+      int i;
++      u32     ocp_data;
++      int     i;
 +
 +      ocp_data = ocp_read_dword(tp, MCU_TYPE_PLA, PLA_RCR);
 +      ocp_data &= ~RCR_ACPT_ALL;
 +      ocp_write_dword(tp, MCU_TYPE_PLA, PLA_RCR, ocp_data);
 +
-+      rxdy_gated_en(tp, true);
-+      r8153_teredo_off(tp);
-+      r8152b_hw_phy_cfg(tp);
++      ocp_data = ocp_read_word(tp, MCU_TYPE_PLA, PLA_MISC_1);
++      ocp_data |= RXDY_GATED_EN;
++      ocp_write_word(tp, MCU_TYPE_PLA, PLA_MISC_1, ocp_data);
 +
 +      ocp_write_byte(tp, MCU_TYPE_PLA, PLA_CRWECR, CRWECR_NORAML);
 +      ocp_write_byte(tp, MCU_TYPE_PLA, PLA_CR, 0x00);
@@ -19607,7 +19685,7 @@ diff -Naur backports-3.18.1-1.org/drivers/net/usb/r8152.c backports-3.18.1-1/dri
 +              ocp_data = ocp_read_byte(tp, MCU_TYPE_PLA, PLA_OOB_CTRL);
 +              if (ocp_data & LINK_LIST_READY)
 +                      break;
-+              usleep_range(1000, 2000);
++              mdelay(1);
 +      }
 +
 +      ocp_data = ocp_read_word(tp, MCU_TYPE_PLA, PLA_SFF_STS_7);
@@ -19618,7 +19696,7 @@ diff -Naur backports-3.18.1-1.org/drivers/net/usb/r8152.c backports-3.18.1-1/dri
 +              ocp_data = ocp_read_byte(tp, MCU_TYPE_PLA, PLA_OOB_CTRL);
 +              if (ocp_data & LINK_LIST_READY)
 +                      break;
-+              usleep_range(1000, 2000);
++              mdelay(1);
 +      }
 +
 +      rtl8152_nic_reset(tp);
@@ -19626,8 +19704,9 @@ diff -Naur backports-3.18.1-1.org/drivers/net/usb/r8152.c backports-3.18.1-1/dri
 +      /* rx share fifo credit full threshold */
 +      ocp_write_dword(tp, MCU_TYPE_PLA, PLA_RXFIFO_CTRL0, RXFIFO_THR1_NORMAL);
 +
-+      if (tp->udev->speed == USB_SPEED_FULL ||
-+          tp->udev->speed == USB_SPEED_LOW) {
++      ocp_data = ocp_read_word(tp, MCU_TYPE_USB, USB_DEV_STAT);
++      ocp_data &= STAT_SPEED_MASK;
++      if (ocp_data == STAT_SPEED_FULL) {
 +              /* rx share fifo credit near full threshold */
 +              ocp_write_dword(tp, MCU_TYPE_PLA, PLA_RXFIFO_CTRL1,
 +                              RXFIFO_THR2_FULL);
@@ -19649,7 +19728,9 @@ diff -Naur backports-3.18.1-1.org/drivers/net/usb/r8152.c backports-3.18.1-1/dri
 +      ocp_write_dword(tp, MCU_TYPE_USB, USB_TX_DMA,
 +                      TEST_MODE_DISABLE | TX_SIZE_ADJUST1);
 +
-+      rtl_rx_vlan_en(tp, tp->netdev->features & NETIF_F_HW_VLAN_CTAG_RX);
++      ocp_data = ocp_read_word(tp, MCU_TYPE_PLA, PLA_CPCR);
++      ocp_data &= ~CPCR_RX_VLAN;
++      ocp_write_word(tp, MCU_TYPE_PLA, PLA_CPCR, ocp_data);
 +
 +      ocp_write_word(tp, MCU_TYPE_PLA, PLA_RMS, RTL8152_RMS);
 +
@@ -19671,13 +19752,13 @@ diff -Naur backports-3.18.1-1.org/drivers/net/usb/r8152.c backports-3.18.1-1/dri
 +      ocp_write_dword(tp, MCU_TYPE_PLA, PLA_RXFIFO_CTRL1, RXFIFO_THR2_OOB);
 +      ocp_write_dword(tp, MCU_TYPE_PLA, PLA_RXFIFO_CTRL2, RXFIFO_THR3_OOB);
 +
-+      rtl_disable(tp);
++      rtl8152_disable(tp);
 +
 +      for (i = 0; i < 1000; i++) {
 +              ocp_data = ocp_read_byte(tp, MCU_TYPE_PLA, PLA_OOB_CTRL);
 +              if (ocp_data & LINK_LIST_READY)
 +                      break;
-+              usleep_range(1000, 2000);
++              mdelay(1);
 +      }
 +
 +      ocp_data = ocp_read_word(tp, MCU_TYPE_PLA, PLA_SFF_STS_7);
@@ -19688,12 +19769,18 @@ diff -Naur backports-3.18.1-1.org/drivers/net/usb/r8152.c backports-3.18.1-1/dri
 +              ocp_data = ocp_read_byte(tp, MCU_TYPE_PLA, PLA_OOB_CTRL);
 +              if (ocp_data & LINK_LIST_READY)
 +                      break;
-+              usleep_range(1000, 2000);
++              mdelay(1);
 +      }
 +
 +      ocp_write_word(tp, MCU_TYPE_PLA, PLA_RMS, RTL8152_RMS);
 +
-+      rtl_rx_vlan_en(tp, true);
++      ocp_data = ocp_read_word(tp, MCU_TYPE_PLA, PLA_CFG_WOL);
++      ocp_data |= MAGIC_EN;
++      ocp_write_word(tp, MCU_TYPE_PLA, PLA_CFG_WOL, ocp_data);
++
++      ocp_data = ocp_read_word(tp, MCU_TYPE_PLA, PLA_CPCR);
++      ocp_data |= CPCR_RX_VLAN;
++      ocp_write_word(tp, MCU_TYPE_PLA, PLA_CPCR, ocp_data);
 +
 +      ocp_data = ocp_read_word(tp, MCU_TYPE_PLA, PAL_BDC_CR);
 +      ocp_data |= ALDPS_PROXY_MODE;
@@ -19703,24 +19790,36 @@ diff -Naur backports-3.18.1-1.org/drivers/net/usb/r8152.c backports-3.18.1-1/dri
 +      ocp_data |= NOW_IS_OOB | DIS_MCU_CLROOB;
 +      ocp_write_byte(tp, MCU_TYPE_PLA, PLA_OOB_CTRL, ocp_data);
 +
-+      rxdy_gated_en(tp, false);
++      ocp_write_byte(tp, MCU_TYPE_PLA, PLA_CONFIG5, LAN_WAKE_EN);
++
++      ocp_data = ocp_read_word(tp, MCU_TYPE_PLA, PLA_MISC_1);
++      ocp_data &= ~RXDY_GATED_EN;
++      ocp_write_word(tp, MCU_TYPE_PLA, PLA_MISC_1, ocp_data);
 +
 +      ocp_data = ocp_read_dword(tp, MCU_TYPE_PLA, PLA_RCR);
 +      ocp_data |= RCR_APM | RCR_AM | RCR_AB;
 +      ocp_write_dword(tp, MCU_TYPE_PLA, PLA_RCR, ocp_data);
 +}
 +
++static void r8152b_disable_aldps(struct r8152 *tp)
++{
++      ocp_reg_write(tp, OCP_ALDPS_CONFIG, ENPDNPS | LINKENA | DIS_SDSAVE);
++      msleep(20);
++}
++
++static inline void r8152b_enable_aldps(struct r8152 *tp)
++{
++      ocp_reg_write(tp, OCP_ALDPS_CONFIG, ENPWRSAVE | ENPDNPS |
++                                          LINKENA | DIS_SDSAVE);
++}
++
 +static void r8153_hw_phy_cfg(struct r8152 *tp)
 +{
 +      u32 ocp_data;
 +      u16 data;
 +
 +      ocp_reg_write(tp, OCP_ADC_CFG, CKADSEL_L | ADC_EN | EN_EMI_L);
-+      data = r8152_mdio_read(tp, MII_BMCR);
-+      if (data & BMCR_PDOWN) {
-+              data &= ~BMCR_PDOWN;
-+              r8152_mdio_write(tp, MII_BMCR, data);
-+      }
++      r8152_mdio_write(tp, MII_BMCR, BMCR_ANENABLE);
 +
 +      if (tp->version == RTL_VER_03) {
 +              data = ocp_reg_read(tp, OCP_EEE_CFG);
@@ -19756,11 +19855,9 @@ diff -Naur backports-3.18.1-1.org/drivers/net/usb/r8152.c backports-3.18.1-1/dri
 +      data = sram_read(tp, SRAM_10M_AMP2);
 +      data |= AMP_DN;
 +      sram_write(tp, SRAM_10M_AMP2, data);
-+
-+      set_bit(PHY_RESET, &tp->flags);
 +}
 +
-+static void r8153_u1u2en(struct r8152 *tp, bool enable)
++static void r8153_u1u2en(struct r8152 *tp, int enable)
 +{
 +      u8 u1u2[8];
 +
@@ -19772,7 +19869,7 @@ diff -Naur backports-3.18.1-1.org/drivers/net/usb/r8152.c backports-3.18.1-1/dri
 +      usb_ocp_write(tp, USB_TOLERANCE, BYTE_EN_SIX_BYTES, sizeof(u1u2), u1u2);
 +}
 +
-+static void r8153_u2p3en(struct r8152 *tp, bool enable)
++static void r8153_u2p3en(struct r8152 *tp, int enable)
 +{
 +      u32 ocp_data;
 +
@@ -19784,7 +19881,7 @@ diff -Naur backports-3.18.1-1.org/drivers/net/usb/r8152.c backports-3.18.1-1/dri
 +      ocp_write_word(tp, MCU_TYPE_USB, USB_U2P3_CTRL, ocp_data);
 +}
 +
-+static void r8153_power_cut_en(struct r8152 *tp, bool enable)
++static void r8153_power_cut_en(struct r8152 *tp, int enable)
 +{
 +      u32 ocp_data;
 +
@@ -19800,12 +19897,28 @@ diff -Naur backports-3.18.1-1.org/drivers/net/usb/r8152.c backports-3.18.1-1/dri
 +      ocp_write_word(tp, MCU_TYPE_USB, USB_MISC_0, ocp_data);
 +}
 +
++static void r8153_teredo_off(struct r8152 *tp)
++{
++      u32 ocp_data;
++
++      ocp_data = ocp_read_word(tp, MCU_TYPE_PLA, PLA_TEREDO_CFG);
++      ocp_data &= ~(TEREDO_SEL | TEREDO_RS_EVENT_MASK | OOB_TEREDO_EN);
++      ocp_write_word(tp, MCU_TYPE_PLA, PLA_TEREDO_CFG, ocp_data);
++
++      ocp_write_word(tp, MCU_TYPE_PLA, PLA_WDT6_CTRL, WDT6_SET_MODE);
++      ocp_write_word(tp, MCU_TYPE_PLA, PLA_REALWOW_TIMER, 0);
++      ocp_write_dword(tp, MCU_TYPE_PLA, PLA_TEREDO_TIMER, 0);
++}
++
 +static void r8153_first_init(struct r8152 *tp)
 +{
 +      u32 ocp_data;
 +      int i;
 +
-+      rxdy_gated_en(tp, true);
++      ocp_data = ocp_read_word(tp, MCU_TYPE_PLA, PLA_MISC_1);
++      ocp_data |= RXDY_GATED_EN;
++      ocp_write_word(tp, MCU_TYPE_PLA, PLA_MISC_1, ocp_data);
++
 +      r8153_teredo_off(tp);
 +
 +      ocp_data = ocp_read_dword(tp, MCU_TYPE_PLA, PLA_RCR);
@@ -19828,7 +19941,7 @@ diff -Naur backports-3.18.1-1.org/drivers/net/usb/r8152.c backports-3.18.1-1/dri
 +              ocp_data = ocp_read_byte(tp, MCU_TYPE_PLA, PLA_OOB_CTRL);
 +              if (ocp_data & LINK_LIST_READY)
 +                      break;
-+              usleep_range(1000, 2000);
++              mdelay(1);
 +      }
 +
 +      ocp_data = ocp_read_word(tp, MCU_TYPE_PLA, PLA_SFF_STS_7);
@@ -19839,13 +19952,14 @@ diff -Naur backports-3.18.1-1.org/drivers/net/usb/r8152.c backports-3.18.1-1/dri
 +              ocp_data = ocp_read_byte(tp, MCU_TYPE_PLA, PLA_OOB_CTRL);
 +              if (ocp_data & LINK_LIST_READY)
 +                      break;
-+              usleep_range(1000, 2000);
++              mdelay(1);
 +      }
 +
-+      rtl_rx_vlan_en(tp, tp->netdev->features & NETIF_F_HW_VLAN_CTAG_RX);
++      ocp_data = ocp_read_word(tp, MCU_TYPE_PLA, PLA_CPCR);
++      ocp_data &= ~CPCR_RX_VLAN;
++      ocp_write_word(tp, MCU_TYPE_PLA, PLA_CPCR, ocp_data);
 +
-+      ocp_write_word(tp, MCU_TYPE_PLA, PLA_RMS, RTL8153_RMS);
-+      ocp_write_byte(tp, MCU_TYPE_PLA, PLA_MTPS, MTPS_JUMBO);
++      ocp_write_word(tp, MCU_TYPE_PLA, PLA_RMS, RTL8152_RMS);
 +
 +      ocp_data = ocp_read_word(tp, MCU_TYPE_PLA, PLA_TCR0);
 +      ocp_data |= TCR0_AUTO_FIFO;
@@ -19875,13 +19989,13 @@ diff -Naur backports-3.18.1-1.org/drivers/net/usb/r8152.c backports-3.18.1-1/dri
 +      ocp_data &= ~NOW_IS_OOB;
 +      ocp_write_byte(tp, MCU_TYPE_PLA, PLA_OOB_CTRL, ocp_data);
 +
-+      rtl_disable(tp);
++      rtl8152_disable(tp);
 +
 +      for (i = 0; i < 1000; i++) {
 +              ocp_data = ocp_read_byte(tp, MCU_TYPE_PLA, PLA_OOB_CTRL);
 +              if (ocp_data & LINK_LIST_READY)
 +                      break;
-+              usleep_range(1000, 2000);
++              mdelay(1);
 +      }
 +
 +      ocp_data = ocp_read_word(tp, MCU_TYPE_PLA, PLA_SFF_STS_7);
@@ -19892,16 +20006,22 @@ diff -Naur backports-3.18.1-1.org/drivers/net/usb/r8152.c backports-3.18.1-1/dri
 +              ocp_data = ocp_read_byte(tp, MCU_TYPE_PLA, PLA_OOB_CTRL);
 +              if (ocp_data & LINK_LIST_READY)
 +                      break;
-+              usleep_range(1000, 2000);
++              mdelay(1);
 +      }
 +
-+      ocp_write_word(tp, MCU_TYPE_PLA, PLA_RMS, RTL8153_RMS);
++      ocp_write_word(tp, MCU_TYPE_PLA, PLA_RMS, RTL8152_RMS);
++
++      ocp_data = ocp_read_word(tp, MCU_TYPE_PLA, PLA_CFG_WOL);
++      ocp_data |= MAGIC_EN;
++      ocp_write_word(tp, MCU_TYPE_PLA, PLA_CFG_WOL, ocp_data);
 +
 +      ocp_data = ocp_read_word(tp, MCU_TYPE_PLA, PLA_TEREDO_CFG);
 +      ocp_data &= ~TEREDO_WAKE_MASK;
 +      ocp_write_word(tp, MCU_TYPE_PLA, PLA_TEREDO_CFG, ocp_data);
 +
-+      rtl_rx_vlan_en(tp, true);
++      ocp_data = ocp_read_word(tp, MCU_TYPE_PLA, PLA_CPCR);
++      ocp_data |= CPCR_RX_VLAN;
++      ocp_write_word(tp, MCU_TYPE_PLA, PLA_CPCR, ocp_data);
 +
 +      ocp_data = ocp_read_word(tp, MCU_TYPE_PLA, PAL_BDC_CR);
 +      ocp_data |= ALDPS_PROXY_MODE;
@@ -19911,7 +20031,11 @@ diff -Naur backports-3.18.1-1.org/drivers/net/usb/r8152.c backports-3.18.1-1/dri
 +      ocp_data |= NOW_IS_OOB | DIS_MCU_CLROOB;
 +      ocp_write_byte(tp, MCU_TYPE_PLA, PLA_OOB_CTRL, ocp_data);
 +
-+      rxdy_gated_en(tp, false);
++      ocp_write_byte(tp, MCU_TYPE_PLA, PLA_CONFIG5, LAN_WAKE_EN);
++
++      ocp_data = ocp_read_word(tp, MCU_TYPE_PLA, PLA_MISC_1);
++      ocp_data &= ~RXDY_GATED_EN;
++      ocp_write_word(tp, MCU_TYPE_PLA, PLA_MISC_1, ocp_data);
 +
 +      ocp_data = ocp_read_dword(tp, MCU_TYPE_PLA, PLA_RCR);
 +      ocp_data |= RCR_APM | RCR_AM | RCR_AB;
@@ -19937,13 +20061,6 @@ diff -Naur backports-3.18.1-1.org/drivers/net/usb/r8152.c backports-3.18.1-1/dri
 +      ocp_reg_write(tp, OCP_POWER_CFG, data);
 +}
 +
-+static void rtl8153_disable(struct r8152 *tp)
-+{
-+      r8153_disable_aldps(tp);
-+      rtl_disable(tp);
-+      r8153_enable_aldps(tp);
-+}
-+
 +static int rtl8152_set_speed(struct r8152 *tp, u8 autoneg, u16 speed, u8 duplex)
 +{
 +      u16 bmcr, anar, gbcr;
@@ -20009,73 +20126,34 @@ diff -Naur backports-3.18.1-1.org/drivers/net/usb/r8152.c backports-3.18.1-1/dri
 +              bmcr = BMCR_ANENABLE | BMCR_ANRESTART;
 +      }
 +
-+      if (test_bit(PHY_RESET, &tp->flags))
-+              bmcr |= BMCR_RESET;
-+
 +      if (tp->mii.supports_gmii)
 +              r8152_mdio_write(tp, MII_CTRL1000, gbcr);
 +
 +      r8152_mdio_write(tp, MII_ADVERTISE, anar);
 +      r8152_mdio_write(tp, MII_BMCR, bmcr);
 +
-+      if (test_bit(PHY_RESET, &tp->flags)) {
-+              int i;
-+
-+              clear_bit(PHY_RESET, &tp->flags);
-+              for (i = 0; i < 50; i++) {
-+                      msleep(20);
-+                      if ((r8152_mdio_read(tp, MII_BMCR) & BMCR_RESET) == 0)
-+                              break;
-+              }
-+      }
-+
 +out:
 +
 +      return ret;
 +}
 +
-+static void rtl8152_up(struct r8152 *tp)
-+{
-+      if (test_bit(RTL8152_UNPLUG, &tp->flags))
-+              return;
-+
-+      r8152b_disable_aldps(tp);
-+      r8152b_exit_oob(tp);
-+      r8152b_enable_aldps(tp);
-+}
-+
 +static void rtl8152_down(struct r8152 *tp)
 +{
-+      if (test_bit(RTL8152_UNPLUG, &tp->flags)) {
-+              rtl_drop_queued_tx(tp);
-+              return;
-+      }
++      u32     ocp_data;
++
++      ocp_data = ocp_read_word(tp, MCU_TYPE_USB, USB_UPS_CTRL);
++      ocp_data &= ~POWER_CUT;
++      ocp_write_word(tp, MCU_TYPE_USB, USB_UPS_CTRL, ocp_data);
 +
-+      r8152_power_cut_en(tp, false);
 +      r8152b_disable_aldps(tp);
 +      r8152b_enter_oob(tp);
 +      r8152b_enable_aldps(tp);
 +}
 +
-+static void rtl8153_up(struct r8152 *tp)
-+{
-+      if (test_bit(RTL8152_UNPLUG, &tp->flags))
-+              return;
-+
-+      r8153_disable_aldps(tp);
-+      r8153_first_init(tp);
-+      r8153_enable_aldps(tp);
-+}
-+
 +static void rtl8153_down(struct r8152 *tp)
 +{
-+      if (test_bit(RTL8152_UNPLUG, &tp->flags)) {
-+              rtl_drop_queued_tx(tp);
-+              return;
-+      }
-+
-+      r8153_u1u2en(tp, false);
-+      r8153_power_cut_en(tp, false);
++      r8153_u1u2en(tp, 0);
++      r8153_power_cut_en(tp, 0);
 +      r8153_disable_aldps(tp);
 +      r8153_enter_oob(tp);
 +      r8153_enable_aldps(tp);
@@ -20110,39 +20188,20 @@ diff -Naur backports-3.18.1-1.org/drivers/net/usb/r8152.c backports-3.18.1-1/dri
 +{
 +      struct r8152 *tp = container_of(work, struct r8152, schedule.work);
 +
-+      if (usb_autopm_get_interface(tp->intf) < 0)
-+              return;
-+
 +      if (!test_bit(WORK_ENABLE, &tp->flags))
 +              goto out1;
 +
 +      if (test_bit(RTL8152_UNPLUG, &tp->flags))
 +              goto out1;
 +
-+      if (!mutex_trylock(&tp->control)) {
-+              schedule_delayed_work(&tp->schedule, 0);
-+              goto out1;
-+      }
-+
 +      if (test_bit(RTL8152_LINK_CHG, &tp->flags))
 +              set_carrier(tp);
 +
 +      if (test_bit(RTL8152_SET_RX_MODE, &tp->flags))
 +              _rtl8152_set_rx_mode(tp->netdev);
 +
-+      if (test_bit(SCHEDULE_TASKLET, &tp->flags) &&
-+          (tp->speed & LINK_STATUS)) {
-+              clear_bit(SCHEDULE_TASKLET, &tp->flags);
-+              tasklet_schedule(&tp->tl);
-+      }
-+
-+      if (test_bit(PHY_RESET, &tp->flags))
-+              rtl_phy_reset(tp);
-+
-+      mutex_unlock(&tp->control);
-+
 +out1:
-+      usb_autopm_put_interface(tp->intf);
++      return;
 +}
 +
 +static int rtl8152_open(struct net_device *netdev)
@@ -20150,34 +20209,6 @@ diff -Naur backports-3.18.1-1.org/drivers/net/usb/r8152.c backports-3.18.1-1/dri
 +      struct r8152 *tp = netdev_priv(netdev);
 +      int res = 0;
 +
-+      res = alloc_all_mem(tp);
-+      if (res)
-+              goto out;
-+
-+      /* set speed to 0 to avoid autoresume try to submit rx */
-+      tp->speed = 0;
-+
-+      res = usb_autopm_get_interface(tp->intf);
-+      if (res < 0) {
-+              free_all_mem(tp);
-+              goto out;
-+      }
-+
-+      mutex_lock(&tp->control);
-+
-+      /* The WORK_ENABLE may be set when autoresume occurs */
-+      if (test_bit(WORK_ENABLE, &tp->flags)) {
-+              clear_bit(WORK_ENABLE, &tp->flags);
-+              usb_kill_urb(tp->intr_urb);
-+              cancel_delayed_work_sync(&tp->schedule);
-+
-+              /* disable the tx/rx, if the workqueue has enabled them. */
-+              if (tp->speed & LINK_STATUS)
-+                      tp->rtl_ops.disable(tp);
-+      }
-+
-+      tp->rtl_ops.up(tp);
-+
 +      rtl8152_set_speed(tp, AUTONEG_ENABLE,
 +                        tp->mii.supports_gmii ? SPEED_1000 : SPEED_100,
 +                        DUPLEX_FULL);
@@ -20185,21 +20216,15 @@ diff -Naur backports-3.18.1-1.org/drivers/net/usb/r8152.c backports-3.18.1-1/dri
 +      netif_carrier_off(netdev);
 +      netif_start_queue(netdev);
 +      set_bit(WORK_ENABLE, &tp->flags);
-+
 +      res = usb_submit_urb(tp->intr_urb, GFP_KERNEL);
 +      if (res) {
 +              if (res == -ENODEV)
 +                      netif_device_detach(tp->netdev);
 +              netif_warn(tp, ifup, netdev, "intr_urb submit failed: %d\n",
 +                         res);
-+              free_all_mem(tp);
 +      }
 +
-+      mutex_unlock(&tp->control);
-+
-+      usb_autopm_put_interface(tp->intf);
 +
-+out:
 +      return res;
 +}
 +
@@ -20212,119 +20237,72 @@ diff -Naur backports-3.18.1-1.org/drivers/net/usb/r8152.c backports-3.18.1-1/dri
 +      usb_kill_urb(tp->intr_urb);
 +      cancel_delayed_work_sync(&tp->schedule);
 +      netif_stop_queue(netdev);
-+
-+      res = usb_autopm_get_interface(tp->intf);
-+      if (res < 0) {
-+              rtl_drop_queued_tx(tp);
-+      } else {
-+              mutex_lock(&tp->control);
-+
-+              /* The autosuspend may have been enabled and wouldn't
-+               * be disable when autoresume occurs, because the
-+               * netif_running() would be false.
-+               */
-+              rtl_runtime_suspend_enable(tp, false);
-+
-+              tasklet_disable(&tp->tl);
-+              tp->rtl_ops.down(tp);
-+              tasklet_enable(&tp->tl);
-+
-+              mutex_unlock(&tp->control);
-+
-+              usb_autopm_put_interface(tp->intf);
-+      }
-+
-+      free_all_mem(tp);
++      tasklet_disable(&tp->tl);
++      tp->rtl_ops.disable(tp);
++      tasklet_enable(&tp->tl);
 +
 +      return res;
 +}
 +
-+static inline void r8152_mmd_indirect(struct r8152 *tp, u16 dev, u16 reg)
-+{
-+      ocp_reg_write(tp, OCP_EEE_AR, FUN_ADDR | dev);
-+      ocp_reg_write(tp, OCP_EEE_DATA, reg);
-+      ocp_reg_write(tp, OCP_EEE_AR, FUN_DATA | dev);
-+}
-+
-+static u16 r8152_mmd_read(struct r8152 *tp, u16 dev, u16 reg)
++static void rtl_clear_bp(struct r8152 *tp)
 +{
-+      u16 data;
-+
-+      r8152_mmd_indirect(tp, dev, reg);
-+      data = ocp_reg_read(tp, OCP_EEE_DATA);
-+      ocp_reg_write(tp, OCP_EEE_AR, 0x0000);
-+
-+      return data;
++      ocp_write_dword(tp, MCU_TYPE_PLA, PLA_BP_0, 0);
++      ocp_write_dword(tp, MCU_TYPE_PLA, PLA_BP_2, 0);
++      ocp_write_dword(tp, MCU_TYPE_PLA, PLA_BP_4, 0);
++      ocp_write_dword(tp, MCU_TYPE_PLA, PLA_BP_6, 0);
++      ocp_write_dword(tp, MCU_TYPE_USB, USB_BP_0, 0);
++      ocp_write_dword(tp, MCU_TYPE_USB, USB_BP_2, 0);
++      ocp_write_dword(tp, MCU_TYPE_USB, USB_BP_4, 0);
++      ocp_write_dword(tp, MCU_TYPE_USB, USB_BP_6, 0);
++      mdelay(3);
++      ocp_write_word(tp, MCU_TYPE_PLA, PLA_BP_BA, 0);
++      ocp_write_word(tp, MCU_TYPE_USB, USB_BP_BA, 0);
 +}
 +
-+static void r8152_mmd_write(struct r8152 *tp, u16 dev, u16 reg, u16 data)
++static void r8153_clear_bp(struct r8152 *tp)
 +{
-+      r8152_mmd_indirect(tp, dev, reg);
-+      ocp_reg_write(tp, OCP_EEE_DATA, data);
-+      ocp_reg_write(tp, OCP_EEE_AR, 0x0000);
++      ocp_write_byte(tp, MCU_TYPE_PLA, PLA_BP_EN, 0);
++      ocp_write_byte(tp, MCU_TYPE_USB, USB_BP_EN, 0);
++      rtl_clear_bp(tp);
 +}
 +
-+static void r8152_eee_en(struct r8152 *tp, bool enable)
++static void r8152b_enable_eee(struct r8152 *tp)
 +{
-+      u16 config1, config2, config3;
 +      u32 ocp_data;
 +
 +      ocp_data = ocp_read_word(tp, MCU_TYPE_PLA, PLA_EEE_CR);
-+      config1 = ocp_reg_read(tp, OCP_EEE_CONFIG1) & ~sd_rise_time_mask;
-+      config2 = ocp_reg_read(tp, OCP_EEE_CONFIG2);
-+      config3 = ocp_reg_read(tp, OCP_EEE_CONFIG3) & ~fast_snr_mask;
-+
-+      if (enable) {
-+              ocp_data |= EEE_RX_EN | EEE_TX_EN;
-+              config1 |= EEE_10_CAP | EEE_NWAY_EN | TX_QUIET_EN | RX_QUIET_EN;
-+              config1 |= sd_rise_time(1);
-+              config2 |= RG_DACQUIET_EN | RG_LDVQUIET_EN;
-+              config3 |= fast_snr(42);
-+      } else {
-+              ocp_data &= ~(EEE_RX_EN | EEE_TX_EN);
-+              config1 &= ~(EEE_10_CAP | EEE_NWAY_EN | TX_QUIET_EN |
-+                           RX_QUIET_EN);
-+              config1 |= sd_rise_time(7);
-+              config2 &= ~(RG_DACQUIET_EN | RG_LDVQUIET_EN);
-+              config3 |= fast_snr(511);
-+      }
-+
++      ocp_data |= EEE_RX_EN | EEE_TX_EN;
 +      ocp_write_word(tp, MCU_TYPE_PLA, PLA_EEE_CR, ocp_data);
-+      ocp_reg_write(tp, OCP_EEE_CONFIG1, config1);
-+      ocp_reg_write(tp, OCP_EEE_CONFIG2, config2);
-+      ocp_reg_write(tp, OCP_EEE_CONFIG3, config3);
-+}
-+
-+static void r8152b_enable_eee(struct r8152 *tp)
-+{
-+      r8152_eee_en(tp, true);
-+      r8152_mmd_write(tp, MDIO_MMD_AN, MDIO_AN_EEE_ADV, MDIO_EEE_100TX);
++      ocp_reg_write(tp, OCP_EEE_CONFIG1, RG_TXLPI_MSK_HFDUP | RG_MATCLR_EN |
++                                         EEE_10_CAP | EEE_NWAY_EN |
++                                         TX_QUIET_EN | RX_QUIET_EN |
++                                         SDRISETIME | RG_RXLPI_MSK_HFDUP |
++                                         SDFALLTIME);
++      ocp_reg_write(tp, OCP_EEE_CONFIG2, RG_LPIHYS_NUM | RG_DACQUIET_EN |
++                                         RG_LDVQUIET_EN | RG_CKRSEL |
++                                         RG_EEEPRG_EN);
++      ocp_reg_write(tp, OCP_EEE_CONFIG3, FST_SNR_EYE_R | RG_LFS_SEL | MSK_PH);
++      ocp_reg_write(tp, OCP_EEE_AR, FUN_ADDR | DEVICE_ADDR);
++      ocp_reg_write(tp, OCP_EEE_DATA, EEE_ADDR);
++      ocp_reg_write(tp, OCP_EEE_AR, FUN_DATA | DEVICE_ADDR);
++      ocp_reg_write(tp, OCP_EEE_DATA, EEE_DATA);
++      ocp_reg_write(tp, OCP_EEE_AR, 0x0000);
 +}
 +
-+static void r8153_eee_en(struct r8152 *tp, bool enable)
++static void r8153_enable_eee(struct r8152 *tp)
 +{
 +      u32 ocp_data;
-+      u16 config;
++      u16 data;
 +
 +      ocp_data = ocp_read_word(tp, MCU_TYPE_PLA, PLA_EEE_CR);
-+      config = ocp_reg_read(tp, OCP_EEE_CFG);
-+
-+      if (enable) {
-+              ocp_data |= EEE_RX_EN | EEE_TX_EN;
-+              config |= EEE10_EN;
-+      } else {
-+              ocp_data &= ~(EEE_RX_EN | EEE_TX_EN);
-+              config &= ~EEE10_EN;
-+      }
-+
++      ocp_data |= EEE_RX_EN | EEE_TX_EN;
 +      ocp_write_word(tp, MCU_TYPE_PLA, PLA_EEE_CR, ocp_data);
-+      ocp_reg_write(tp, OCP_EEE_CFG, config);
-+}
-+
-+static void r8153_enable_eee(struct r8152 *tp)
-+{
-+      r8153_eee_en(tp, true);
-+      ocp_reg_write(tp, OCP_EEE_ADV, MDIO_EEE_1000T | MDIO_EEE_100TX);
++      data = ocp_reg_read(tp, OCP_EEE_CFG);
++      data |= EEE10_EN;
++      ocp_reg_write(tp, OCP_EEE_CFG, data);
++      data = ocp_reg_read(tp, OCP_EEE_CFG2);
++      data |= MY1000_EEE | MY100_EEE;
++      ocp_reg_write(tp, OCP_EEE_CFG2, data);
 +}
 +
 +static void r8152b_enable_fc(struct r8152 *tp)
@@ -20336,23 +20314,18 @@ diff -Naur backports-3.18.1-1.org/drivers/net/usb/r8152.c backports-3.18.1-1/dri
 +      r8152_mdio_write(tp, MII_ADVERTISE, anar);
 +}
 +
-+static void rtl_tally_reset(struct r8152 *tp)
++static void r8152b_hw_phy_cfg(struct r8152 *tp)
 +{
-+      u32 ocp_data;
-+
-+      ocp_data = ocp_read_word(tp, MCU_TYPE_PLA, PLA_RSTTALLY);
-+      ocp_data |= TALLY_RESET;
-+      ocp_write_word(tp, MCU_TYPE_PLA, PLA_RSTTALLY, ocp_data);
++      r8152_mdio_write(tp, MII_BMCR, BMCR_ANENABLE);
++      r8152b_disable_aldps(tp);
 +}
 +
 +static void r8152b_init(struct r8152 *tp)
 +{
 +      u32 ocp_data;
++      int i;
 +
-+      if (test_bit(RTL8152_UNPLUG, &tp->flags))
-+              return;
-+
-+      r8152b_disable_aldps(tp);
++      rtl_clear_bp(tp);
 +
 +      if (tp->version == RTL_VER_01) {
 +              ocp_data = ocp_read_word(tp, MCU_TYPE_PLA, PLA_LED_FEATURE);
@@ -20360,7 +20333,17 @@ diff -Naur backports-3.18.1-1.org/drivers/net/usb/r8152.c backports-3.18.1-1/dri
 +              ocp_write_word(tp, MCU_TYPE_PLA, PLA_LED_FEATURE, ocp_data);
 +      }
 +
-+      r8152_power_cut_en(tp, false);
++      r8152b_hw_phy_cfg(tp);
++
++      ocp_data = ocp_read_word(tp, MCU_TYPE_USB, USB_UPS_CTRL);
++      ocp_data &= ~POWER_CUT;
++      ocp_write_word(tp, MCU_TYPE_USB, USB_UPS_CTRL, ocp_data);
++
++      ocp_data = ocp_read_word(tp, MCU_TYPE_USB, USB_PM_CTRL_STATUS);
++      ocp_data &= ~RESUME_INDICATE;
++      ocp_write_word(tp, MCU_TYPE_USB, USB_PM_CTRL_STATUS, ocp_data);
++
++      r8152b_exit_oob(tp);
 +
 +      ocp_data = ocp_read_word(tp, MCU_TYPE_PLA, PLA_PHY_PWR);
 +      ocp_data |= TX_10M_IDLE_EN | PFM_PWM_SWITCH;
@@ -20376,7 +20359,14 @@ diff -Naur backports-3.18.1-1.org/drivers/net/usb/r8152.c backports-3.18.1-1/dri
 +      r8152b_enable_eee(tp);
 +      r8152b_enable_aldps(tp);
 +      r8152b_enable_fc(tp);
-+      rtl_tally_reset(tp);
++
++      r8152_mdio_write(tp, MII_BMCR, BMCR_RESET | BMCR_ANENABLE |
++                                     BMCR_ANRESTART);
++      for (i = 0; i < 100; i++) {
++              udelay(100);
++              if (!(r8152_mdio_read(tp, MII_BMCR) & BMCR_RESET))
++                      break;
++      }
 +
 +      /* enable rx aggregation */
 +      ocp_data = ocp_read_word(tp, MCU_TYPE_USB, USB_USB_CTRL);
@@ -20389,11 +20379,7 @@ diff -Naur backports-3.18.1-1.org/drivers/net/usb/r8152.c backports-3.18.1-1/dri
 +      u32 ocp_data;
 +      int i;
 +
-+      if (test_bit(RTL8152_UNPLUG, &tp->flags))
-+              return;
-+
-+      r8153_disable_aldps(tp);
-+      r8153_u1u2en(tp, false);
++      r8153_u1u2en(tp, 0);
 +
 +      for (i = 0; i < 500; i++) {
 +              if (ocp_read_word(tp, MCU_TYPE_PLA, PLA_BOOT_CTRL) &
@@ -20409,12 +20395,14 @@ diff -Naur backports-3.18.1-1.org/drivers/net/usb/r8152.c backports-3.18.1-1/dri
 +              msleep(20);
 +      }
 +
-+      r8153_u2p3en(tp, false);
++      r8153_u2p3en(tp, 0);
 +
 +      ocp_data = ocp_read_word(tp, MCU_TYPE_USB, USB_WDT11_CTRL);
 +      ocp_data &= ~TIMER11_EN;
 +      ocp_write_word(tp, MCU_TYPE_USB, USB_WDT11_CTRL, ocp_data);
 +
++      r8153_clear_bp(tp);
++
 +      ocp_data = ocp_read_word(tp, MCU_TYPE_PLA, PLA_LED_FEATURE);
 +      ocp_data &= ~LED_MODE_MASK;
 +      ocp_write_word(tp, MCU_TYPE_PLA, PLA_LED_FEATURE, ocp_data);
@@ -20432,8 +20420,10 @@ diff -Naur backports-3.18.1-1.org/drivers/net/usb/r8152.c backports-3.18.1-1/dri
 +      ocp_data |= SEN_VAL_NORMAL | SEL_RXIDLE;
 +      ocp_write_word(tp, MCU_TYPE_USB, USB_AFE_CTRL2, ocp_data);
 +
-+      r8153_power_cut_en(tp, false);
-+      r8153_u1u2en(tp, true);
++      r8153_power_cut_en(tp, 0);
++      r8153_u1u2en(tp, 1);
++
++      r8153_first_init(tp);
 +
 +      ocp_write_word(tp, MCU_TYPE_PLA, PLA_MAC_PWR_CTRL, ALDPS_SPDWN_RATIO);
 +      ocp_write_word(tp, MCU_TYPE_PLA, PLA_MAC_PWR_CTRL2, EEE_SPDWN_RATIO);
@@ -20448,145 +20438,56 @@ diff -Naur backports-3.18.1-1.org/drivers/net/usb/r8152.c backports-3.18.1-1/dri
 +      r8153_enable_eee(tp);
 +      r8153_enable_aldps(tp);
 +      r8152b_enable_fc(tp);
-+      rtl_tally_reset(tp);
++
++      r8152_mdio_write(tp, MII_BMCR, BMCR_RESET | BMCR_ANENABLE |
++                                     BMCR_ANRESTART);
 +}
 +
 +static int rtl8152_suspend(struct usb_interface *intf, pm_message_t message)
 +{
 +      struct r8152 *tp = usb_get_intfdata(intf);
-+      struct net_device *netdev = tp->netdev;
-+      int ret = 0;
-+
-+      mutex_lock(&tp->control);
-+
-+      if (PMSG_IS_AUTO(message)) {
-+              if (netif_running(netdev) && work_busy(&tp->schedule.work)) {
-+                      ret = -EBUSY;
-+                      goto out1;
-+              }
 +
-+              set_bit(SELECTIVE_SUSPEND, &tp->flags);
-+      } else {
-+              netif_device_detach(netdev);
-+      }
++      netif_device_detach(tp->netdev);
 +
-+      if (netif_running(netdev) && test_bit(WORK_ENABLE, &tp->flags)) {
++      if (netif_running(tp->netdev)) {
 +              clear_bit(WORK_ENABLE, &tp->flags);
 +              usb_kill_urb(tp->intr_urb);
++              cancel_delayed_work_sync(&tp->schedule);
 +              tasklet_disable(&tp->tl);
-+              if (test_bit(SELECTIVE_SUSPEND, &tp->flags)) {
-+                      rtl_stop_rx(tp);
-+                      rtl_runtime_suspend_enable(tp, true);
-+              } else {
-+                      cancel_delayed_work_sync(&tp->schedule);
-+                      tp->rtl_ops.down(tp);
-+              }
-+              tasklet_enable(&tp->tl);
 +      }
-+out1:
-+      mutex_unlock(&tp->control);
 +
-+      return ret;
++      tp->rtl_ops.down(tp);
++
++      return 0;
 +}
 +
 +static int rtl8152_resume(struct usb_interface *intf)
 +{
 +      struct r8152 *tp = usb_get_intfdata(intf);
 +
-+      mutex_lock(&tp->control);
-+
-+      if (!test_bit(SELECTIVE_SUSPEND, &tp->flags)) {
-+              tp->rtl_ops.init(tp);
-+              netif_device_attach(tp->netdev);
-+      }
-+
++      tp->rtl_ops.init(tp);
++      netif_device_attach(tp->netdev);
 +      if (netif_running(tp->netdev)) {
-+              if (test_bit(SELECTIVE_SUSPEND, &tp->flags)) {
-+                      rtl_runtime_suspend_enable(tp, false);
-+                      clear_bit(SELECTIVE_SUSPEND, &tp->flags);
-+                      set_bit(WORK_ENABLE, &tp->flags);
-+                      if (tp->speed & LINK_STATUS)
-+                              rtl_start_rx(tp);
-+              } else {
-+                      tp->rtl_ops.up(tp);
-+                      rtl8152_set_speed(tp, AUTONEG_ENABLE,
-+                                        tp->mii.supports_gmii ?
-+                                        SPEED_1000 : SPEED_100,
-+                                        DUPLEX_FULL);
-+                      tp->speed = 0;
-+                      netif_carrier_off(tp->netdev);
-+                      set_bit(WORK_ENABLE, &tp->flags);
-+              }
++              rtl8152_set_speed(tp, AUTONEG_ENABLE,
++                              tp->mii.supports_gmii ? SPEED_1000 : SPEED_100,
++                              DUPLEX_FULL);
++              tp->speed = 0;
++              netif_carrier_off(tp->netdev);
++              set_bit(WORK_ENABLE, &tp->flags);
 +              usb_submit_urb(tp->intr_urb, GFP_KERNEL);
-+      } else if (test_bit(SELECTIVE_SUSPEND, &tp->flags)) {
-+              clear_bit(SELECTIVE_SUSPEND, &tp->flags);
++              tasklet_enable(&tp->tl);
 +      }
 +
-+      mutex_unlock(&tp->control);
-+
 +      return 0;
 +}
 +
-+static void rtl8152_get_wol(struct net_device *dev, struct ethtool_wolinfo *wol)
-+{
-+      struct r8152 *tp = netdev_priv(dev);
-+
-+      if (usb_autopm_get_interface(tp->intf) < 0)
-+              return;
-+
-+      mutex_lock(&tp->control);
-+
-+      wol->supported = WAKE_ANY;
-+      wol->wolopts = __rtl_get_wol(tp);
-+
-+      mutex_unlock(&tp->control);
-+
-+      usb_autopm_put_interface(tp->intf);
-+}
-+
-+static int rtl8152_set_wol(struct net_device *dev, struct ethtool_wolinfo *wol)
-+{
-+      struct r8152 *tp = netdev_priv(dev);
-+      int ret;
-+
-+      ret = usb_autopm_get_interface(tp->intf);
-+      if (ret < 0)
-+              goto out_set_wol;
-+
-+      mutex_lock(&tp->control);
-+
-+      __rtl_set_wol(tp, wol->wolopts);
-+      tp->saved_wolopts = wol->wolopts & WAKE_ANY;
-+
-+      mutex_unlock(&tp->control);
-+
-+      usb_autopm_put_interface(tp->intf);
-+
-+out_set_wol:
-+      return ret;
-+}
-+
-+static u32 rtl8152_get_msglevel(struct net_device *dev)
-+{
-+      struct r8152 *tp = netdev_priv(dev);
-+
-+      return tp->msg_enable;
-+}
-+
-+static void rtl8152_set_msglevel(struct net_device *dev, u32 value)
-+{
-+      struct r8152 *tp = netdev_priv(dev);
-+
-+      tp->msg_enable = value;
-+}
-+
 +static void rtl8152_get_drvinfo(struct net_device *netdev,
 +                              struct ethtool_drvinfo *info)
 +{
 +      struct r8152 *tp = netdev_priv(netdev);
 +
-+      strlcpy(info->driver, MODULENAME, sizeof(info->driver));
-+      strlcpy(info->version, DRIVER_VERSION, sizeof(info->version));
++      strncpy(info->driver, MODULENAME, ETHTOOL_BUSINFO_LEN);
++      strncpy(info->version, DRIVER_VERSION, ETHTOOL_BUSINFO_LEN);
 +      usb_make_path(tp->udev, info->bus_info, sizeof(info->bus_info));
 +}
 +
@@ -20594,235 +20495,18 @@ diff -Naur backports-3.18.1-1.org/drivers/net/usb/r8152.c backports-3.18.1-1/dri
 +int rtl8152_get_settings(struct net_device *netdev, struct ethtool_cmd *cmd)
 +{
 +      struct r8152 *tp = netdev_priv(netdev);
-+      int ret;
 +
 +      if (!tp->mii.mdio_read)
 +              return -EOPNOTSUPP;
 +
-+      ret = usb_autopm_get_interface(tp->intf);
-+      if (ret < 0)
-+              goto out;
-+
-+      mutex_lock(&tp->control);
-+
-+      ret = mii_ethtool_gset(&tp->mii, cmd);
-+
-+      mutex_unlock(&tp->control);
-+
-+      usb_autopm_put_interface(tp->intf);
-+
-+out:
-+      return ret;
++      return mii_ethtool_gset(&tp->mii, cmd);
 +}
 +
 +static int rtl8152_set_settings(struct net_device *dev, struct ethtool_cmd *cmd)
 +{
 +      struct r8152 *tp = netdev_priv(dev);
-+      int ret;
-+
-+      ret = usb_autopm_get_interface(tp->intf);
-+      if (ret < 0)
-+              goto out;
-+
-+      mutex_lock(&tp->control);
-+
-+      ret = rtl8152_set_speed(tp, cmd->autoneg, cmd->speed, cmd->duplex);
-+
-+      mutex_unlock(&tp->control);
-+
-+      usb_autopm_put_interface(tp->intf);
-+
-+out:
-+      return ret;
-+}
-+
-+static const char rtl8152_gstrings[][ETH_GSTRING_LEN] = {
-+      "tx_packets",
-+      "rx_packets",
-+      "tx_errors",
-+      "rx_errors",
-+      "rx_missed",
-+      "align_errors",
-+      "tx_single_collisions",
-+      "tx_multi_collisions",
-+      "rx_unicast",
-+      "rx_broadcast",
-+      "rx_multicast",
-+      "tx_aborted",
-+      "tx_underrun",
-+};
-+
-+static int rtl8152_get_sset_count(struct net_device *dev, int sset)
-+{
-+      switch (sset) {
-+      case ETH_SS_STATS:
-+              return ARRAY_SIZE(rtl8152_gstrings);
-+      default:
-+              return -EOPNOTSUPP;
-+      }
-+}
-+
-+static void rtl8152_get_ethtool_stats(struct net_device *dev,
-+                                    struct ethtool_stats *stats, u64 *data)
-+{
-+      struct r8152 *tp = netdev_priv(dev);
-+      struct tally_counter tally;
-+
-+      if (usb_autopm_get_interface(tp->intf) < 0)
-+              return;
-+
-+      generic_ocp_read(tp, PLA_TALLYCNT, sizeof(tally), &tally, MCU_TYPE_PLA);
-+
-+      usb_autopm_put_interface(tp->intf);
-+
-+      data[0] = le64_to_cpu(tally.tx_packets);
-+      data[1] = le64_to_cpu(tally.rx_packets);
-+      data[2] = le64_to_cpu(tally.tx_errors);
-+      data[3] = le32_to_cpu(tally.rx_errors);
-+      data[4] = le16_to_cpu(tally.rx_missed);
-+      data[5] = le16_to_cpu(tally.align_errors);
-+      data[6] = le32_to_cpu(tally.tx_one_collision);
-+      data[7] = le32_to_cpu(tally.tx_multi_collision);
-+      data[8] = le64_to_cpu(tally.rx_unicast);
-+      data[9] = le64_to_cpu(tally.rx_broadcast);
-+      data[10] = le32_to_cpu(tally.rx_multicast);
-+      data[11] = le16_to_cpu(tally.tx_aborted);
-+      data[12] = le16_to_cpu(tally.tx_underun);
-+}
-+
-+static void rtl8152_get_strings(struct net_device *dev, u32 stringset, u8 *data)
-+{
-+      switch (stringset) {
-+      case ETH_SS_STATS:
-+              memcpy(data, *rtl8152_gstrings, sizeof(rtl8152_gstrings));
-+              break;
-+      }
-+}
-+
-+static int r8152_get_eee(struct r8152 *tp, struct ethtool_eee *eee)
-+{
-+      u32 ocp_data, lp, adv, supported = 0;
-+      u16 val;
-+
-+      val = r8152_mmd_read(tp, MDIO_MMD_PCS, MDIO_PCS_EEE_ABLE);
-+      supported = mmd_eee_cap_to_ethtool_sup_t(val);
-+
-+      val = r8152_mmd_read(tp, MDIO_MMD_AN, MDIO_AN_EEE_ADV);
-+      adv = mmd_eee_adv_to_ethtool_adv_t(val);
-+
-+      val = r8152_mmd_read(tp, MDIO_MMD_AN, MDIO_AN_EEE_LPABLE);
-+      lp = mmd_eee_adv_to_ethtool_adv_t(val);
-+
-+      ocp_data = ocp_read_word(tp, MCU_TYPE_PLA, PLA_EEE_CR);
-+      ocp_data &= EEE_RX_EN | EEE_TX_EN;
-+
-+      eee->eee_enabled = !!ocp_data;
-+      eee->eee_active = !!(supported & adv & lp);
-+      eee->supported = supported;
-+      eee->advertised = adv;
-+      eee->lp_advertised = lp;
-+
-+      return 0;
-+}
-+
-+static int r8152_set_eee(struct r8152 *tp, struct ethtool_eee *eee)
-+{
-+      u16 val = ethtool_adv_to_mmd_eee_adv_t(eee->advertised);
-+
-+      r8152_eee_en(tp, eee->eee_enabled);
-+
-+      if (!eee->eee_enabled)
-+              val = 0;
-+
-+      r8152_mmd_write(tp, MDIO_MMD_AN, MDIO_AN_EEE_ADV, val);
-+
-+      return 0;
-+}
-+
-+static int r8153_get_eee(struct r8152 *tp, struct ethtool_eee *eee)
-+{
-+      u32 ocp_data, lp, adv, supported = 0;
-+      u16 val;
-+
-+      val = ocp_reg_read(tp, OCP_EEE_ABLE);
-+      supported = mmd_eee_cap_to_ethtool_sup_t(val);
-+
-+      val = ocp_reg_read(tp, OCP_EEE_ADV);
-+      adv = mmd_eee_adv_to_ethtool_adv_t(val);
-+
-+      val = ocp_reg_read(tp, OCP_EEE_LPABLE);
-+      lp = mmd_eee_adv_to_ethtool_adv_t(val);
-+
-+      ocp_data = ocp_read_word(tp, MCU_TYPE_PLA, PLA_EEE_CR);
-+      ocp_data &= EEE_RX_EN | EEE_TX_EN;
-+
-+      eee->eee_enabled = !!ocp_data;
-+      eee->eee_active = !!(supported & adv & lp);
-+      eee->supported = supported;
-+      eee->advertised = adv;
-+      eee->lp_advertised = lp;
-+
-+      return 0;
-+}
-+
-+static int r8153_set_eee(struct r8152 *tp, struct ethtool_eee *eee)
-+{
-+      u16 val = ethtool_adv_to_mmd_eee_adv_t(eee->advertised);
-+
-+      r8153_eee_en(tp, eee->eee_enabled);
-+
-+      if (!eee->eee_enabled)
-+              val = 0;
-+
-+      ocp_reg_write(tp, OCP_EEE_ADV, val);
-+
-+      return 0;
-+}
-+
-+static int
-+rtl_ethtool_get_eee(struct net_device *net, struct ethtool_eee *edata)
-+{
-+      struct r8152 *tp = netdev_priv(net);
-+      int ret;
-+
-+      ret = usb_autopm_get_interface(tp->intf);
-+      if (ret < 0)
-+              goto out;
-+
-+      mutex_lock(&tp->control);
-+
-+      ret = tp->rtl_ops.eee_get(tp, edata);
-+
-+      mutex_unlock(&tp->control);
-+
-+      usb_autopm_put_interface(tp->intf);
-+
-+out:
-+      return ret;
-+}
-+
-+static int
-+rtl_ethtool_set_eee(struct net_device *net, struct ethtool_eee *edata)
-+{
-+      struct r8152 *tp = netdev_priv(net);
-+      int ret;
-+
-+      ret = usb_autopm_get_interface(tp->intf);
-+      if (ret < 0)
-+              goto out;
-+
-+      mutex_lock(&tp->control);
-+
-+      ret = tp->rtl_ops.eee_set(tp, edata);
-+      if (!ret)
-+              ret = mii_nway_restart(&tp->mii);
 +
-+      mutex_unlock(&tp->control);
-+
-+      usb_autopm_put_interface(tp->intf);
-+
-+out:
-+      return ret;
++      return rtl8152_set_speed(tp, cmd->autoneg, cmd->speed, cmd->duplex);
 +}
 +
 +static struct ethtool_ops ops = {
@@ -20830,29 +20514,13 @@ diff -Naur backports-3.18.1-1.org/drivers/net/usb/r8152.c backports-3.18.1-1/dri
 +      .get_settings = rtl8152_get_settings,
 +      .set_settings = rtl8152_set_settings,
 +      .get_link = ethtool_op_get_link,
-+      .get_msglevel = rtl8152_get_msglevel,
-+      .set_msglevel = rtl8152_set_msglevel,
-+      .get_wol = rtl8152_get_wol,
-+      .set_wol = rtl8152_set_wol,
-+      .get_strings = rtl8152_get_strings,
-+      .get_sset_count = rtl8152_get_sset_count,
-+      .get_ethtool_stats = rtl8152_get_ethtool_stats,
-+      .get_eee = rtl_ethtool_get_eee,
-+      .set_eee = rtl_ethtool_set_eee,
 +};
 +
 +static int rtl8152_ioctl(struct net_device *netdev, struct ifreq *rq, int cmd)
 +{
 +      struct r8152 *tp = netdev_priv(netdev);
 +      struct mii_ioctl_data *data = if_mii(rq);
-+      int res;
-+
-+      if (test_bit(RTL8152_UNPLUG, &tp->flags))
-+              return -ENODEV;
-+
-+      res = usb_autopm_get_interface(tp->intf);
-+      if (res < 0)
-+              goto out;
++      int res = 0;
 +
 +      switch (cmd) {
 +      case SIOCGMIIPHY:
@@ -20860,9 +20528,7 @@ diff -Naur backports-3.18.1-1.org/drivers/net/usb/r8152.c backports-3.18.1-1/dri
 +              break;
 +
 +      case SIOCGMIIREG:
-+              mutex_lock(&tp->control);
 +              data->val_out = r8152_mdio_read(tp, data->reg_num);
-+              mutex_unlock(&tp->control);
 +              break;
 +
 +      case SIOCSMIIREG:
@@ -20870,51 +20536,26 @@ diff -Naur backports-3.18.1-1.org/drivers/net/usb/r8152.c backports-3.18.1-1/dri
 +                      res = -EPERM;
 +                      break;
 +              }
-+              mutex_lock(&tp->control);
 +              r8152_mdio_write(tp, data->reg_num, data->val_in);
-+              mutex_unlock(&tp->control);
 +              break;
 +
 +      default:
 +              res = -EOPNOTSUPP;
 +      }
 +
-+      usb_autopm_put_interface(tp->intf);
-+
-+out:
 +      return res;
 +}
 +
-+static int rtl8152_change_mtu(struct net_device *dev, int new_mtu)
-+{
-+      struct r8152 *tp = netdev_priv(dev);
-+
-+      switch (tp->version) {
-+      case RTL_VER_01:
-+      case RTL_VER_02:
-+              return eth_change_mtu(dev, new_mtu);
-+      default:
-+              break;
-+      }
-+
-+      if (new_mtu < 68 || new_mtu > RTL8153_MAX_MTU)
-+              return -EINVAL;
-+
-+      dev->mtu = new_mtu;
-+
-+      return 0;
-+}
-+
 +static const struct net_device_ops rtl8152_netdev_ops = {
 +      .ndo_open               = rtl8152_open,
 +      .ndo_stop               = rtl8152_close,
 +      .ndo_do_ioctl           = rtl8152_ioctl,
 +      .ndo_start_xmit         = rtl8152_start_xmit,
 +      .ndo_tx_timeout         = rtl8152_tx_timeout,
-+      .ndo_set_features       = rtl8152_set_features,
 +      .ndo_set_rx_mode        = rtl8152_set_rx_mode,
 +      .ndo_set_mac_address    = rtl8152_set_mac_address,
-+      .ndo_change_mtu         = rtl8152_change_mtu,
++
++      .ndo_change_mtu         = eth_change_mtu,
 +      .ndo_validate_addr      = eth_validate_addr,
 +};
 +
@@ -20954,19 +20595,22 @@ diff -Naur backports-3.18.1-1.org/drivers/net/usb/r8152.c backports-3.18.1-1/dri
 +
 +static void rtl8152_unload(struct r8152 *tp)
 +{
-+      if (test_bit(RTL8152_UNPLUG, &tp->flags))
-+              return;
++      u32     ocp_data;
 +
-+      if (tp->version != RTL_VER_01)
-+              r8152_power_cut_en(tp, true);
++      if (tp->version != RTL_VER_01) {
++              ocp_data = ocp_read_word(tp, MCU_TYPE_USB, USB_UPS_CTRL);
++              ocp_data |= POWER_CUT;
++              ocp_write_word(tp, MCU_TYPE_USB, USB_UPS_CTRL, ocp_data);
++      }
++
++      ocp_data = ocp_read_word(tp, MCU_TYPE_USB, USB_PM_CTRL_STATUS);
++      ocp_data &= ~RESUME_INDICATE;
++      ocp_write_word(tp, MCU_TYPE_USB, USB_PM_CTRL_STATUS, ocp_data);
 +}
 +
 +static void rtl8153_unload(struct r8152 *tp)
 +{
-+      if (test_bit(RTL8152_UNPLUG, &tp->flags))
-+              return;
-+
-+      r8153_power_cut_en(tp, false);
++      r8153_power_cut_en(tp, 1);
 +}
 +
 +static int rtl_ops_init(struct r8152 *tp, const struct usb_device_id *id)
@@ -20981,22 +20625,16 @@ diff -Naur backports-3.18.1-1.org/drivers/net/usb/r8152.c backports-3.18.1-1/dri
 +                      ops->init               = r8152b_init;
 +                      ops->enable             = rtl8152_enable;
 +                      ops->disable            = rtl8152_disable;
-+                      ops->up                 = rtl8152_up;
 +                      ops->down               = rtl8152_down;
 +                      ops->unload             = rtl8152_unload;
-+                      ops->eee_get            = r8152_get_eee;
-+                      ops->eee_set            = r8152_set_eee;
 +                      ret = 0;
 +                      break;
 +              case PRODUCT_ID_RTL8153:
 +                      ops->init               = r8153_init;
 +                      ops->enable             = rtl8153_enable;
-+                      ops->disable            = rtl8153_disable;
-+                      ops->up                 = rtl8153_up;
++                      ops->disable            = rtl8152_disable;
 +                      ops->down               = rtl8153_down;
 +                      ops->unload             = rtl8153_unload;
-+                      ops->eee_get            = r8153_get_eee;
-+                      ops->eee_set            = r8153_set_eee;
 +                      ret = 0;
 +                      break;
 +              default:
@@ -21009,12 +20647,9 @@ diff -Naur backports-3.18.1-1.org/drivers/net/usb/r8152.c backports-3.18.1-1/dri
 +              case PRODUCT_ID_SAMSUNG:
 +                      ops->init               = r8153_init;
 +                      ops->enable             = rtl8153_enable;
-+                      ops->disable            = rtl8153_disable;
-+                      ops->up                 = rtl8153_up;
++                      ops->disable            = rtl8152_disable;
 +                      ops->down               = rtl8153_down;
 +                      ops->unload             = rtl8153_unload;
-+                      ops->eee_get            = r8153_get_eee;
-+                      ops->eee_set            = r8153_set_eee;
 +                      ret = 0;
 +                      break;
 +              default:
@@ -21065,27 +20700,14 @@ diff -Naur backports-3.18.1-1.org/drivers/net/usb/r8152.c backports-3.18.1-1/dri
 +              goto out;
 +
 +      tasklet_init(&tp->tl, bottom_half, (unsigned long)tp);
-+      mutex_init(&tp->control);
 +      INIT_DELAYED_WORK(&tp->schedule, rtl_work_func_t);
 +
 +      netdev->netdev_ops = &rtl8152_netdev_ops;
 +      netdev->watchdog_timeo = RTL8152_TX_TIMEOUT;
 +
-+      netdev->features |= NETIF_F_RXCSUM | NETIF_F_IP_CSUM | NETIF_F_SG |
-+                          NETIF_F_TSO | NETIF_F_FRAGLIST | NETIF_F_IPV6_CSUM |
-+                          NETIF_F_TSO6 | NETIF_F_HW_VLAN_CTAG_RX |
-+                          NETIF_F_HW_VLAN_CTAG_TX;
-+      netdev->hw_features = NETIF_F_RXCSUM | NETIF_F_IP_CSUM | NETIF_F_SG |
-+                            NETIF_F_TSO | NETIF_F_FRAGLIST |
-+                            NETIF_F_IPV6_CSUM | NETIF_F_TSO6 |
-+                            NETIF_F_HW_VLAN_CTAG_RX |
-+                            NETIF_F_HW_VLAN_CTAG_TX;
-+      netdev->vlan_features = NETIF_F_SG | NETIF_F_IP_CSUM | NETIF_F_TSO |
-+                              NETIF_F_HIGHDMA | NETIF_F_FRAGLIST |
-+                              NETIF_F_IPV6_CSUM | NETIF_F_TSO6;
-+
-+      netdev->ethtool_ops = &ops;
-+      netif_set_gso_max_size(netdev, RTL_LIMITED_TSO_SIZE);
++      netdev->features |= NETIF_F_IP_CSUM;
++      netdev->hw_features = NETIF_F_IP_CSUM;
++      SET_ETHTOOL_OPS(netdev, &ops);
 +
 +      tp->mii.dev = netdev;
 +      tp->mii.mdio_read = read_mii_word;
@@ -21095,12 +20717,14 @@ diff -Naur backports-3.18.1-1.org/drivers/net/usb/r8152.c backports-3.18.1-1/dri
 +      tp->mii.phy_id = R8152_PHY_ID;
 +      tp->mii.supports_gmii = 0;
 +
-+      intf->needs_remote_wakeup = 1;
-+
 +      r8152b_get_version(tp);
 +      tp->rtl_ops.init(tp);
 +      set_ethernet_addr(tp);
 +
++      ret = alloc_all_mem(tp);
++      if (ret)
++              goto out;
++
 +      usb_set_intfdata(intf, tp);
 +
 +      ret = register_netdev(netdev);
@@ -21109,12 +20733,6 @@ diff -Naur backports-3.18.1-1.org/drivers/net/usb/r8152.c backports-3.18.1-1/dri
 +              goto out1;
 +      }
 +
-+      tp->saved_wolopts = __rtl_get_wol(tp);
-+      if (tp->saved_wolopts)
-+              device_set_wakeup_enable(&udev->dev, true);
-+      else
-+              device_set_wakeup_enable(&udev->dev, false);
-+
 +      netif_info(tp, probe, netdev, "%s\n", DRIVER_VERSION);
 +
 +      return 0;
@@ -21132,14 +20750,11 @@ diff -Naur backports-3.18.1-1.org/drivers/net/usb/r8152.c backports-3.18.1-1/dri
 +
 +      usb_set_intfdata(intf, NULL);
 +      if (tp) {
-+              struct usb_device *udev = tp->udev;
-+
-+              if (udev->state == USB_STATE_NOTATTACHED)
-+                      set_bit(RTL8152_UNPLUG, &tp->flags);
-+
++              set_bit(RTL8152_UNPLUG, &tp->flags);
 +              tasklet_kill(&tp->tl);
 +              unregister_netdev(tp->netdev);
 +              tp->rtl_ops.unload(tp);
++              free_all_mem(tp);
 +              free_netdev(tp->netdev);
 +      }
 +}
@@ -21162,8 +20777,6 @@ diff -Naur backports-3.18.1-1.org/drivers/net/usb/r8152.c backports-3.18.1-1/dri
 +      .suspend =      rtl8152_suspend,
 +      .resume =       rtl8152_resume,
 +      .reset_resume = rtl8152_resume,
-+      .supports_autosuspend = 1,
-+      .disable_hub_initiated_lpm = 1,
 +};
 +
 +module_usb_driver(rtl8152_driver);
@@ -21171,10 +20784,10 @@ diff -Naur backports-3.18.1-1.org/drivers/net/usb/r8152.c backports-3.18.1-1/dri
 +MODULE_AUTHOR(DRIVER_AUTHOR);
 +MODULE_DESCRIPTION(DRIVER_DESC);
 +MODULE_LICENSE("GPL");
-diff -Naur backports-3.18.1-1.org/drivers/net/usb/rtl8150.c backports-3.18.1-1/drivers/net/usb/rtl8150.c
---- backports-3.18.1-1.org/drivers/net/usb/rtl8150.c   1970-01-01 01:00:00.000000000 +0100
-+++ backports-3.18.1-1/drivers/net/usb/rtl8150.c       2014-12-16 18:39:45.000000000 +0100
-@@ -0,0 +1,950 @@
+diff -Naur backports-4.2.6-1.org/drivers/net/usb/rtl8150.c backports-4.2.6-1/drivers/net/usb/rtl8150.c
+--- backports-4.2.6-1.org/drivers/net/usb/rtl8150.c    1970-01-01 01:00:00.000000000 +0100
++++ backports-4.2.6-1/drivers/net/usb/rtl8150.c        2015-11-09 23:37:56.000000000 +0100
+@@ -0,0 +1,949 @@
 +/*
 + *  Copyright (c) 2002 Petko Manolov (petkan@users.sourceforge.net)
 + *
@@ -21930,14 +21543,13 @@ diff -Naur backports-3.18.1-1.org/drivers/net/usb/rtl8150.c backports-3.18.1-1/d
 +static int rtl8150_close(struct net_device *netdev)
 +{
 +      rtl8150_t *dev = netdev_priv(netdev);
-+      int res = 0;
 +
 +      netif_stop_queue(netdev);
 +      if (!test_bit(RTL8150_UNPLUG, &dev->flags))
 +              disable_net_traffic(dev);
 +      unlink_all_urbs(dev);
 +
-+      return res;
++      return 0;
 +}
 +
 +static void rtl8150_get_drvinfo(struct net_device *netdev, struct ethtool_drvinfo *info)
@@ -22125,9 +21737,9 @@ diff -Naur backports-3.18.1-1.org/drivers/net/usb/rtl8150.c backports-3.18.1-1/d
 +MODULE_AUTHOR(DRIVER_AUTHOR);
 +MODULE_DESCRIPTION(DRIVER_DESC);
 +MODULE_LICENSE("GPL");
-diff -Naur backports-3.18.1-1.org/drivers/net/usb/smsc75xx.c backports-3.18.1-1/drivers/net/usb/smsc75xx.c
---- backports-3.18.1-1.org/drivers/net/usb/smsc75xx.c  1970-01-01 01:00:00.000000000 +0100
-+++ backports-3.18.1-1/drivers/net/usb/smsc75xx.c      2014-12-16 18:39:45.000000000 +0100
+diff -Naur backports-4.2.6-1.org/drivers/net/usb/smsc75xx.c backports-4.2.6-1/drivers/net/usb/smsc75xx.c
+--- backports-4.2.6-1.org/drivers/net/usb/smsc75xx.c   1970-01-01 01:00:00.000000000 +0100
++++ backports-4.2.6-1/drivers/net/usb/smsc75xx.c       2015-11-09 23:37:56.000000000 +0100
 @@ -0,0 +1,2286 @@
 + /***************************************************************************
 + *
@@ -24415,9 +24027,9 @@ diff -Naur backports-3.18.1-1.org/drivers/net/usb/smsc75xx.c backports-3.18.1-1/
 +MODULE_AUTHOR("Steve Glendinning <steve.glendinning@shawell.net>");
 +MODULE_DESCRIPTION("SMSC75XX USB 2.0 Gigabit Ethernet Devices");
 +MODULE_LICENSE("GPL");
-diff -Naur backports-3.18.1-1.org/drivers/net/usb/smsc75xx.h backports-3.18.1-1/drivers/net/usb/smsc75xx.h
---- backports-3.18.1-1.org/drivers/net/usb/smsc75xx.h  1970-01-01 01:00:00.000000000 +0100
-+++ backports-3.18.1-1/drivers/net/usb/smsc75xx.h      2014-12-16 18:39:45.000000000 +0100
+diff -Naur backports-4.2.6-1.org/drivers/net/usb/smsc75xx.h backports-4.2.6-1/drivers/net/usb/smsc75xx.h
+--- backports-4.2.6-1.org/drivers/net/usb/smsc75xx.h   1970-01-01 01:00:00.000000000 +0100
++++ backports-4.2.6-1/drivers/net/usb/smsc75xx.h       2015-11-09 23:37:56.000000000 +0100
 @@ -0,0 +1,421 @@
 + /***************************************************************************
 + *
@@ -24840,10 +24452,10 @@ diff -Naur backports-3.18.1-1.org/drivers/net/usb/smsc75xx.h backports-3.18.1-1/
 +#define INT_ENP_RX_FIFO_DATA_INT      ((u32)BIT(12))
 +
 +#endif /* _SMSC75XX_H */
-diff -Naur backports-3.18.1-1.org/drivers/net/usb/smsc95xx.c backports-3.18.1-1/drivers/net/usb/smsc95xx.c
---- backports-3.18.1-1.org/drivers/net/usb/smsc95xx.c  1970-01-01 01:00:00.000000000 +0100
-+++ backports-3.18.1-1/drivers/net/usb/smsc95xx.c      2014-12-16 18:39:45.000000000 +0100
-@@ -0,0 +1,2030 @@
+diff -Naur backports-4.2.6-1.org/drivers/net/usb/smsc95xx.c backports-4.2.6-1/drivers/net/usb/smsc95xx.c
+--- backports-4.2.6-1.org/drivers/net/usb/smsc95xx.c   1970-01-01 01:00:00.000000000 +0100
++++ backports-4.2.6-1/drivers/net/usb/smsc95xx.c       2015-11-09 23:37:56.000000000 +0100
+@@ -0,0 +1,2032 @@
 + /***************************************************************************
 + *
 + * Copyright (C) 2007-2008 SMSC
@@ -26516,12 +26128,14 @@ diff -Naur backports-3.18.1-1.org/drivers/net/usb/smsc95xx.c backports-3.18.1-1/
 +static int smsc95xx_resume(struct usb_interface *intf)
 +{
 +      struct usbnet *dev = usb_get_intfdata(intf);
-+      struct smsc95xx_priv *pdata = (struct smsc95xx_priv *)(dev->data[0]);
-+      u8 suspend_flags = pdata->suspend_flags;
++      struct smsc95xx_priv *pdata;
++      u8 suspend_flags;
 +      int ret;
 +      u32 val;
 +
 +      BUG_ON(!dev);
++      pdata = (struct smsc95xx_priv *)(dev->data[0]);
++      suspend_flags = pdata->suspend_flags;
 +
 +      netdev_dbg(dev->net, "resume suspend_flags=0x%02x\n", suspend_flags);
 +
@@ -26874,9 +26488,9 @@ diff -Naur backports-3.18.1-1.org/drivers/net/usb/smsc95xx.c backports-3.18.1-1/
 +MODULE_AUTHOR("Steve Glendinning <steve.glendinning@shawell.net>");
 +MODULE_DESCRIPTION("SMSC95XX USB 2.0 Ethernet Devices");
 +MODULE_LICENSE("GPL");
-diff -Naur backports-3.18.1-1.org/drivers/net/usb/smsc95xx.h backports-3.18.1-1/drivers/net/usb/smsc95xx.h
---- backports-3.18.1-1.org/drivers/net/usb/smsc95xx.h  1970-01-01 01:00:00.000000000 +0100
-+++ backports-3.18.1-1/drivers/net/usb/smsc95xx.h      2014-12-16 18:39:45.000000000 +0100
+diff -Naur backports-4.2.6-1.org/drivers/net/usb/smsc95xx.h backports-4.2.6-1/drivers/net/usb/smsc95xx.h
+--- backports-4.2.6-1.org/drivers/net/usb/smsc95xx.h   1970-01-01 01:00:00.000000000 +0100
++++ backports-4.2.6-1/drivers/net/usb/smsc95xx.h       2015-11-09 23:37:56.000000000 +0100
 @@ -0,0 +1,290 @@
 + /***************************************************************************
 + *
@@ -27168,9 +26782,9 @@ diff -Naur backports-3.18.1-1.org/drivers/net/usb/smsc95xx.h backports-3.18.1-1/
 +#define INT_ENP_RXDF_                 ((u32)BIT(11))
 +
 +#endif /* _SMSC95XX_H */
-diff -Naur backports-3.18.1-1.org/drivers/net/usb/sr9700.c backports-3.18.1-1/drivers/net/usb/sr9700.c
---- backports-3.18.1-1.org/drivers/net/usb/sr9700.c    1970-01-01 01:00:00.000000000 +0100
-+++ backports-3.18.1-1/drivers/net/usb/sr9700.c        2014-12-16 18:39:45.000000000 +0100
+diff -Naur backports-4.2.6-1.org/drivers/net/usb/sr9700.c backports-4.2.6-1/drivers/net/usb/sr9700.c
+--- backports-4.2.6-1.org/drivers/net/usb/sr9700.c     1970-01-01 01:00:00.000000000 +0100
++++ backports-4.2.6-1/drivers/net/usb/sr9700.c 2015-11-09 23:37:56.000000000 +0100
 @@ -0,0 +1,559 @@
 +/*
 + * CoreChip-sz SR9700 one chip USB 1.1 Ethernet Devices
@@ -27251,7 +26865,7 @@ diff -Naur backports-3.18.1-1.org/drivers/net/usb/sr9700.c backports-3.18.1-1/dr
 +              int ret;
 +
 +              udelay(1);
-+              ret = sr_read_reg(dev, EPCR, &tmp);
++              ret = sr_read_reg(dev, SR_EPCR, &tmp);
 +              if (ret < 0)
 +                      return ret;
 +
@@ -27272,15 +26886,15 @@ diff -Naur backports-3.18.1-1.org/drivers/net/usb/sr9700.c backports-3.18.1-1/dr
 +
 +      mutex_lock(&dev->phy_mutex);
 +
-+      sr_write_reg(dev, EPAR, phy ? (reg | EPAR_PHY_ADR) : reg);
-+      sr_write_reg(dev, EPCR, phy ? (EPCR_EPOS | EPCR_ERPRR) : EPCR_ERPRR);
++      sr_write_reg(dev, SR_EPAR, phy ? (reg | EPAR_PHY_ADR) : reg);
++      sr_write_reg(dev, SR_EPCR, phy ? (EPCR_EPOS | EPCR_ERPRR) : EPCR_ERPRR);
 +
 +      ret = wait_phy_eeprom_ready(dev, phy);
 +      if (ret < 0)
 +              goto out_unlock;
 +
-+      sr_write_reg(dev, EPCR, 0x0);
-+      ret = sr_read(dev, EPDR, 2, value);
++      sr_write_reg(dev, SR_EPCR, 0x0);
++      ret = sr_read(dev, SR_EPDR, 2, value);
 +
 +      netdev_dbg(dev->net, "read shared %d 0x%02x returned 0x%04x, %d\n",
 +                 phy, reg, *value, ret);
@@ -27297,19 +26911,19 @@ diff -Naur backports-3.18.1-1.org/drivers/net/usb/sr9700.c backports-3.18.1-1/dr
 +
 +      mutex_lock(&dev->phy_mutex);
 +
-+      ret = sr_write(dev, EPDR, 2, &value);
++      ret = sr_write(dev, SR_EPDR, 2, &value);
 +      if (ret < 0)
 +              goto out_unlock;
 +
-+      sr_write_reg(dev, EPAR, phy ? (reg | EPAR_PHY_ADR) : reg);
-+      sr_write_reg(dev, EPCR, phy ? (EPCR_WEP | EPCR_EPOS | EPCR_ERPRW) :
++      sr_write_reg(dev, SR_EPAR, phy ? (reg | EPAR_PHY_ADR) : reg);
++      sr_write_reg(dev, SR_EPCR, phy ? (EPCR_WEP | EPCR_EPOS | EPCR_ERPRW) :
 +                  (EPCR_WEP | EPCR_ERPRW));
 +
 +      ret = wait_phy_eeprom_ready(dev, phy);
 +      if (ret < 0)
 +              goto out_unlock;
 +
-+      sr_write_reg(dev, EPCR, 0x0);
++      sr_write_reg(dev, SR_EPCR, 0x0);
 +
 +out_unlock:
 +      mutex_unlock(&dev->phy_mutex);
@@ -27362,7 +26976,7 @@ diff -Naur backports-3.18.1-1.org/drivers/net/usb/sr9700.c backports-3.18.1-1/dr
 +      if (loc == MII_BMSR) {
 +              u8 value;
 +
-+              sr_read_reg(dev, NSR, &value);
++              sr_read_reg(dev, SR_NSR, &value);
 +              if (value & NSR_LINKST)
 +                      rc = 1;
 +      }
@@ -27402,7 +27016,7 @@ diff -Naur backports-3.18.1-1.org/drivers/net/usb/sr9700.c backports-3.18.1-1/dr
 +      int rc = 0;
 +
 +      /* Get the Link Status directly */
-+      sr_read_reg(dev, NSR, &value);
++      sr_read_reg(dev, SR_NSR, &value);
 +      if (value & NSR_LINKST)
 +              rc = 1;
 +
@@ -27455,8 +27069,8 @@ diff -Naur backports-3.18.1-1.org/drivers/net/usb/sr9700.c backports-3.18.1-1/dr
 +              }
 +      }
 +
-+      sr_write_async(dev, MAR, SR_MCAST_SIZE, hashes);
-+      sr_write_reg_async(dev, RCR, rx_ctl);
++      sr_write_async(dev, SR_MAR, SR_MCAST_SIZE, hashes);
++      sr_write_reg_async(dev, SR_RCR, rx_ctl);
 +}
 +
 +static int sr9700_set_mac_address(struct net_device *netdev, void *p)
@@ -27471,7 +27085,7 @@ diff -Naur backports-3.18.1-1.org/drivers/net/usb/sr9700.c backports-3.18.1-1/dr
 +      }
 +
 +      memcpy(netdev->dev_addr, addr->sa_data, netdev->addr_len);
-+      sr_write_async(dev, PAR, 6, netdev->dev_addr);
++      sr_write_async(dev, SR_PAR, 6, netdev->dev_addr);
 +
 +      return 0;
 +}
@@ -27514,7 +27128,7 @@ diff -Naur backports-3.18.1-1.org/drivers/net/usb/sr9700.c backports-3.18.1-1/dr
 +      mii->phy_id_mask = 0x1f;
 +      mii->reg_num_mask = 0x1f;
 +
-+      sr_write_reg(dev, NCR, NCR_RST);
++      sr_write_reg(dev, SR_NCR, NCR_RST);
 +      udelay(20);
 +
 +      /* read MAC
@@ -27522,17 +27136,17 @@ diff -Naur backports-3.18.1-1.org/drivers/net/usb/sr9700.c backports-3.18.1-1/dr
 +       * EEPROM automatically to PAR. In case there is no EEPROM externally,
 +       * a default MAC address is stored in PAR for making chip work properly.
 +       */
-+      if (sr_read(dev, PAR, ETH_ALEN, netdev->dev_addr) < 0) {
++      if (sr_read(dev, SR_PAR, ETH_ALEN, netdev->dev_addr) < 0) {
 +              netdev_err(netdev, "Error reading MAC address\n");
 +              ret = -ENODEV;
 +              goto out;
 +      }
 +
 +      /* power up and reset phy */
-+      sr_write_reg(dev, PRR, PRR_PHY_RST);
++      sr_write_reg(dev, SR_PRR, PRR_PHY_RST);
 +      /* at least 10ms, here 20ms for safe */
 +      mdelay(20);
-+      sr_write_reg(dev, PRR, 0);
++      sr_write_reg(dev, SR_PRR, 0);
 +      /* at least 1ms, here 2ms for reading right register */
 +      udelay(2 * 1000);
 +
@@ -27731,9 +27345,9 @@ diff -Naur backports-3.18.1-1.org/drivers/net/usb/sr9700.c backports-3.18.1-1/dr
 +MODULE_AUTHOR("liujl <liujunliang_ljl@163.com>");
 +MODULE_DESCRIPTION("SR9700 one chip USB 1.1 USB to Ethernet device from http://www.corechip-sz.com/");
 +MODULE_LICENSE("GPL");
-diff -Naur backports-3.18.1-1.org/drivers/net/usb/sr9700.h backports-3.18.1-1/drivers/net/usb/sr9700.h
---- backports-3.18.1-1.org/drivers/net/usb/sr9700.h    1970-01-01 01:00:00.000000000 +0100
-+++ backports-3.18.1-1/drivers/net/usb/sr9700.h        2014-12-16 18:39:45.000000000 +0100
+diff -Naur backports-4.2.6-1.org/drivers/net/usb/sr9700.h backports-4.2.6-1/drivers/net/usb/sr9700.h
+--- backports-4.2.6-1.org/drivers/net/usb/sr9700.h     1970-01-01 01:00:00.000000000 +0100
++++ backports-4.2.6-1/drivers/net/usb/sr9700.h 2015-11-09 23:37:56.000000000 +0100
 @@ -0,0 +1,173 @@
 +/*
 + * CoreChip-sz SR9700 one chip USB 1.1 Ethernet Devices
@@ -27751,13 +27365,13 @@ diff -Naur backports-3.18.1-1.org/drivers/net/usb/sr9700.h backports-3.18.1-1/dr
 +/* sr9700 spec. register table on Linux platform */
 +
 +/* Network Control Reg */
-+#define       NCR                     0x00
++#define       SR_NCR                  0x00
 +#define               NCR_RST                 (1 << 0)
 +#define               NCR_LBK                 (3 << 1)
 +#define               NCR_FDX                 (1 << 3)
 +#define               NCR_WAKEEN              (1 << 6)
 +/* Network Status Reg */
-+#define       NSR                     0x01
++#define       SR_NSR                  0x01
 +#define               NSR_RXRDY               (1 << 0)
 +#define               NSR_RXOV                (1 << 1)
 +#define               NSR_TX1END              (1 << 2)
@@ -27767,7 +27381,7 @@ diff -Naur backports-3.18.1-1.org/drivers/net/usb/sr9700.h backports-3.18.1-1/dr
 +#define               NSR_LINKST              (1 << 6)
 +#define               NSR_SPEED               (1 << 7)
 +/* Tx Control Reg */
-+#define       TCR                     0x02
++#define       SR_TCR                  0x02
 +#define               TCR_CRC_DIS             (1 << 1)
 +#define               TCR_PAD_DIS             (1 << 2)
 +#define               TCR_LC_CARE             (1 << 3)
@@ -27775,7 +27389,7 @@ diff -Naur backports-3.18.1-1.org/drivers/net/usb/sr9700.h backports-3.18.1-1/dr
 +#define               TCR_EXCECM              (1 << 5)
 +#define               TCR_LF_EN               (1 << 6)
 +/* Tx Status Reg for Packet Index 1 */
-+#define       TSR1            0x03
++#define       SR_TSR1         0x03
 +#define               TSR1_EC                 (1 << 2)
 +#define               TSR1_COL                (1 << 3)
 +#define               TSR1_LC                 (1 << 4)
@@ -27783,7 +27397,7 @@ diff -Naur backports-3.18.1-1.org/drivers/net/usb/sr9700.h backports-3.18.1-1/dr
 +#define               TSR1_LOC                (1 << 6)
 +#define               TSR1_TLF                (1 << 7)
 +/* Tx Status Reg for Packet Index 2 */
-+#define       TSR2            0x04
++#define       SR_TSR2         0x04
 +#define               TSR2_EC                 (1 << 2)
 +#define               TSR2_COL                (1 << 3)
 +#define               TSR2_LC                 (1 << 4)
@@ -27791,7 +27405,7 @@ diff -Naur backports-3.18.1-1.org/drivers/net/usb/sr9700.h backports-3.18.1-1/dr
 +#define               TSR2_LOC                (1 << 6)
 +#define               TSR2_TLF                (1 << 7)
 +/* Rx Control Reg*/
-+#define       RCR                     0x05
++#define       SR_RCR                  0x05
 +#define               RCR_RXEN                (1 << 0)
 +#define               RCR_PRMSC               (1 << 1)
 +#define               RCR_RUNT                (1 << 2)
@@ -27799,87 +27413,87 @@ diff -Naur backports-3.18.1-1.org/drivers/net/usb/sr9700.h backports-3.18.1-1/dr
 +#define               RCR_DIS_CRC             (1 << 4)
 +#define               RCR_DIS_LONG    (1 << 5)
 +/* Rx Status Reg */
-+#define       RSR                     0x06
++#define       SR_RSR                  0x06
 +#define               RSR_AE                  (1 << 2)
 +#define               RSR_MF                  (1 << 6)
 +#define               RSR_RF                  (1 << 7)
 +/* Rx Overflow Counter Reg */
-+#define       ROCR            0x07
++#define       SR_ROCR         0x07
 +#define               ROCR_ROC                (0x7F << 0)
 +#define               ROCR_RXFU               (1 << 7)
 +/* Back Pressure Threshold Reg */
-+#define       BPTR            0x08
++#define       SR_BPTR         0x08
 +#define               BPTR_JPT                (0x0F << 0)
 +#define               BPTR_BPHW               (0x0F << 4)
 +/* Flow Control Threshold Reg */
-+#define       FCTR            0x09
++#define       SR_FCTR         0x09
 +#define               FCTR_LWOT               (0x0F << 0)
 +#define               FCTR_HWOT               (0x0F << 4)
 +/* rx/tx Flow Control Reg */
-+#define       FCR                     0x0A
++#define       SR_FCR                  0x0A
 +#define               FCR_FLCE                (1 << 0)
 +#define               FCR_BKPA                (1 << 4)
 +#define               FCR_TXPEN               (1 << 5)
 +#define               FCR_TXPF                (1 << 6)
 +#define               FCR_TXP0                (1 << 7)
 +/* Eeprom & Phy Control Reg */
-+#define       EPCR            0x0B
++#define       SR_EPCR         0x0B
 +#define               EPCR_ERRE               (1 << 0)
 +#define               EPCR_ERPRW              (1 << 1)
 +#define               EPCR_ERPRR              (1 << 2)
 +#define               EPCR_EPOS               (1 << 3)
 +#define               EPCR_WEP                (1 << 4)
 +/* Eeprom & Phy Address Reg */
-+#define       EPAR            0x0C
++#define       SR_EPAR         0x0C
 +#define               EPAR_EROA               (0x3F << 0)
 +#define               EPAR_PHY_ADR_MASK       (0x03 << 6)
 +#define               EPAR_PHY_ADR            (0x01 << 6)
 +/* Eeprom &   Phy Data Reg */
-+#define       EPDR            0x0D    /* 0x0D ~ 0x0E for Data Reg Low & High */
++#define       SR_EPDR         0x0D    /* 0x0D ~ 0x0E for Data Reg Low & High */
 +/* Wakeup Control Reg */
-+#define       WCR                     0x0F
++#define       SR_WCR                  0x0F
 +#define               WCR_MAGICST             (1 << 0)
 +#define               WCR_LINKST              (1 << 2)
 +#define               WCR_MAGICEN             (1 << 3)
 +#define               WCR_LINKEN              (1 << 5)
 +/* Physical Address Reg */
-+#define       PAR                     0x10    /* 0x10 ~ 0x15 6 bytes for PAR */
++#define       SR_PAR                  0x10    /* 0x10 ~ 0x15 6 bytes for PAR */
 +/* Multicast Address Reg */
-+#define       MAR                     0x16    /* 0x16 ~ 0x1D 8 bytes for MAR */
++#define       SR_MAR                  0x16    /* 0x16 ~ 0x1D 8 bytes for MAR */
 +/* 0x1e unused */
 +/* Phy Reset Reg */
-+#define       PRR                     0x1F
++#define       SR_PRR                  0x1F
 +#define               PRR_PHY_RST             (1 << 0)
 +/* Tx sdram Write Pointer Address Low */
-+#define       TWPAL           0x20
++#define       SR_TWPAL                0x20
 +/* Tx sdram Write Pointer Address High */
-+#define       TWPAH           0x21
++#define       SR_TWPAH                0x21
 +/* Tx sdram Read Pointer Address Low */
-+#define       TRPAL           0x22
++#define       SR_TRPAL                0x22
 +/* Tx sdram Read Pointer Address High */
-+#define       TRPAH           0x23
++#define       SR_TRPAH                0x23
 +/* Rx sdram Write Pointer Address Low */
-+#define       RWPAL           0x24
++#define       SR_RWPAL                0x24
 +/* Rx sdram Write Pointer Address High */
-+#define       RWPAH           0x25
++#define       SR_RWPAH                0x25
 +/* Rx sdram Read Pointer Address Low */
-+#define       RRPAL           0x26
++#define       SR_RRPAL                0x26
 +/* Rx sdram Read Pointer Address High */
-+#define       RRPAH           0x27
++#define       SR_RRPAH                0x27
 +/* Vendor ID register */
-+#define       VID                     0x28    /* 0x28 ~ 0x29 2 bytes for VID */
++#define       SR_VID                  0x28    /* 0x28 ~ 0x29 2 bytes for VID */
 +/* Product ID register */
-+#define       PID                     0x2A    /* 0x2A ~ 0x2B 2 bytes for PID */
++#define       SR_PID                  0x2A    /* 0x2A ~ 0x2B 2 bytes for PID */
 +/* CHIP Revision register */
-+#define       CHIPR           0x2C
++#define       SR_CHIPR                0x2C
 +/* 0x2D --> 0xEF unused */
 +/* USB Device Address */
-+#define       USBDA           0xF0
++#define       SR_USBDA                0xF0
 +#define               USBDA_USBFA             (0x7F << 0)
 +/* RX packet Counter Reg */
-+#define       RXC                     0xF1
++#define       SR_RXC                  0xF1
 +/* Tx packet Counter & USB Status Reg */
-+#define       TXC_USBS        0xF2
++#define       SR_TXC_USBS             0xF2
 +#define               TXC_USBS_TXC0           (1 << 0)
 +#define               TXC_USBS_TXC1           (1 << 1)
 +#define               TXC_USBS_TXC2           (1 << 2)
@@ -27887,7 +27501,7 @@ diff -Naur backports-3.18.1-1.org/drivers/net/usb/sr9700.h backports-3.18.1-1/dr
 +#define               TXC_USBS_SUSFLAG        (1 << 6)
 +#define               TXC_USBS_RXFAULT        (1 << 7)
 +/* USB Control register */
-+#define       USBC            0xF4
++#define       SR_USBC                 0xF4
 +#define               USBC_EP3NAK             (1 << 4)
 +#define               USBC_EP3ACK             (1 << 5)
 +
@@ -27908,10 +27522,10 @@ diff -Naur backports-3.18.1-1.org/drivers/net/usb/sr9700.h backports-3.18.1-1/dr
 +#define       SR_RX_OVERHEAD          7       /* 3bytes header + 4crc tail */
 +
 +#endif        /* _SR9700_H */
-diff -Naur backports-3.18.1-1.org/drivers/net/usb/sr9800.c backports-3.18.1-1/drivers/net/usb/sr9800.c
---- backports-3.18.1-1.org/drivers/net/usb/sr9800.c    1970-01-01 01:00:00.000000000 +0100
-+++ backports-3.18.1-1/drivers/net/usb/sr9800.c        2014-12-16 18:39:45.000000000 +0100
-@@ -0,0 +1,874 @@
+diff -Naur backports-4.2.6-1.org/drivers/net/usb/sr9800.c backports-4.2.6-1/drivers/net/usb/sr9800.c
+--- backports-4.2.6-1.org/drivers/net/usb/sr9800.c     1970-01-01 01:00:00.000000000 +0100
++++ backports-4.2.6-1/drivers/net/usb/sr9800.c 2015-11-09 23:37:56.000000000 +0100
+@@ -0,0 +1,875 @@
 +/* CoreChip-sz SR9800 one chip USB 2.0 Ethernet Devices
 + *
 + * Author : Liu Junliang <liujunliang_ljl@163.com>
@@ -28058,6 +27672,7 @@ diff -Naur backports-3.18.1-1.org/drivers/net/usb/sr9800.c backports-3.18.1-1/dr
 +              skb_put(skb, sizeof(padbytes));
 +      }
 +
++      usbnet_set_skb_tx_stats(skb, 1, 0);
 +      return skb;
 +}
 +
@@ -28786,9 +28401,9 @@ diff -Naur backports-3.18.1-1.org/drivers/net/usb/sr9800.c backports-3.18.1-1/dr
 +MODULE_VERSION(DRIVER_VERSION);
 +MODULE_DESCRIPTION("SR9800 USB 2.0 USB2NET Dev : http://www.corechip-sz.com");
 +MODULE_LICENSE("GPL");
-diff -Naur backports-3.18.1-1.org/drivers/net/usb/sr9800.h backports-3.18.1-1/drivers/net/usb/sr9800.h
---- backports-3.18.1-1.org/drivers/net/usb/sr9800.h    1970-01-01 01:00:00.000000000 +0100
-+++ backports-3.18.1-1/drivers/net/usb/sr9800.h        2014-12-16 18:39:45.000000000 +0100
+diff -Naur backports-4.2.6-1.org/drivers/net/usb/sr9800.h backports-4.2.6-1/drivers/net/usb/sr9800.h
+--- backports-4.2.6-1.org/drivers/net/usb/sr9800.h     1970-01-01 01:00:00.000000000 +0100
++++ backports-4.2.6-1/drivers/net/usb/sr9800.h 2015-11-09 23:37:56.000000000 +0100
 @@ -0,0 +1,202 @@
 +/* CoreChip-sz SR9800 one chip USB 2.0 Ethernet Devices
 + *
@@ -28992,9 +28607,9 @@ diff -Naur backports-3.18.1-1.org/drivers/net/usb/sr9800.h backports-3.18.1-1/dr
 +} __packed;
 +
 +#endif        /* _SR9800_H */
-diff -Naur backports-3.18.1-1.org/drivers/net/usb/zaurus.c backports-3.18.1-1/drivers/net/usb/zaurus.c
---- backports-3.18.1-1.org/drivers/net/usb/zaurus.c    1970-01-01 01:00:00.000000000 +0100
-+++ backports-3.18.1-1/drivers/net/usb/zaurus.c        2014-12-16 18:39:45.000000000 +0100
+diff -Naur backports-4.2.6-1.org/drivers/net/usb/zaurus.c backports-4.2.6-1/drivers/net/usb/zaurus.c
+--- backports-4.2.6-1.org/drivers/net/usb/zaurus.c     1970-01-01 01:00:00.000000000 +0100
++++ backports-4.2.6-1/drivers/net/usb/zaurus.c 2015-11-09 23:37:56.000000000 +0100
 @@ -0,0 +1,385 @@
 +/*
 + * Copyright (C) 2002 Pavel Machek <pavel@ucw.cz>
similarity index 72%
rename from src/patches/backports-3.18.1-1-grsecurity.patch
rename to src/patches/backports-4.2.6-1-grsecurity.patch
index 711f2e3e8dfdab05e87f4341e6c88f763684af24..1a44409a426cd3bef3b0aeaf85db7f3d966832df 100644 (file)
@@ -1,6 +1,6 @@
-diff -Naur backports-3.18.1-1.org/drivers/bluetooth/btwilink.c backports-3.18.1-1/drivers/bluetooth/btwilink.c
---- backports-3.18.1-1.org/drivers/bluetooth/btwilink.c        2014-12-21 22:37:15.000000000 +0100
-+++ backports-3.18.1-1/drivers/bluetooth/btwilink.c    2014-12-28 14:10:09.480888533 +0100
+diff -Naur backports-4.2.6-1.org/drivers/bluetooth/btwilink.c backports-4.2.6-1/drivers/bluetooth/btwilink.c
+--- backports-4.2.6-1.org/drivers/bluetooth/btwilink.c 2015-11-15 22:19:40.000000000 +0100
++++ backports-4.2.6-1/drivers/bluetooth/btwilink.c     2016-01-27 12:26:16.319959957 +0100
 @@ -288,7 +288,7 @@
  
  static int bt_ti_probe(struct platform_device *pdev)
@@ -10,10 +10,10 @@ diff -Naur backports-3.18.1-1.org/drivers/bluetooth/btwilink.c backports-3.18.1-
        struct hci_dev *hdev;
        int err;
  
-diff -Naur backports-3.18.1-1.org/drivers/media/dvb-core/dvbdev.c backports-3.18.1-1/drivers/media/dvb-core/dvbdev.c
---- backports-3.18.1-1.org/drivers/media/dvb-core/dvbdev.c     2014-12-21 22:37:14.000000000 +0100
-+++ backports-3.18.1-1/drivers/media/dvb-core/dvbdev.c 2014-12-28 14:10:09.528888772 +0100
-@@ -185,7 +185,7 @@
+diff -Naur backports-4.2.6-1.org/drivers/media/dvb-core/dvbdev.c backports-4.2.6-1/drivers/media/dvb-core/dvbdev.c
+--- backports-4.2.6-1.org/drivers/media/dvb-core/dvbdev.c      2015-11-15 22:19:39.000000000 +0100
++++ backports-4.2.6-1/drivers/media/dvb-core/dvbdev.c  2016-01-27 12:26:21.266626324 +0100
+@@ -272,7 +272,7 @@
                        const struct dvb_device *template, void *priv, int type)
  {
        struct dvb_device *dvbdev;
@@ -22,9 +22,9 @@ diff -Naur backports-3.18.1-1.org/drivers/media/dvb-core/dvbdev.c backports-3.18
        struct device *clsdev;
        int minor;
        int id;
-diff -Naur backports-3.18.1-1.org/drivers/media/dvb-frontends/af9033.h backports-3.18.1-1/drivers/media/dvb-frontends/af9033.h
---- backports-3.18.1-1.org/drivers/media/dvb-frontends/af9033.h        2014-12-21 22:37:14.000000000 +0100
-+++ backports-3.18.1-1/drivers/media/dvb-frontends/af9033.h    2014-12-28 14:10:09.528888772 +0100
+diff -Naur backports-4.2.6-1.org/drivers/media/dvb-frontends/af9033.h backports-4.2.6-1/drivers/media/dvb-frontends/af9033.h
+--- backports-4.2.6-1.org/drivers/media/dvb-frontends/af9033.h 2015-11-15 22:19:38.000000000 +0100
++++ backports-4.2.6-1/drivers/media/dvb-frontends/af9033.h     2016-01-27 12:26:21.266626324 +0100
 @@ -96,6 +96,6 @@
        int (*pid_filter_ctrl)(struct dvb_frontend *fe, int onoff);
        int (*pid_filter)(struct dvb_frontend *fe, int index, u16 pid,
@@ -33,9 +33,9 @@ diff -Naur backports-3.18.1-1.org/drivers/media/dvb-frontends/af9033.h backports
 +} __no_const;
  
  #endif /* AF9033_H */
-diff -Naur backports-3.18.1-1.org/drivers/media/dvb-frontends/dib3000.h backports-3.18.1-1/drivers/media/dvb-frontends/dib3000.h
---- backports-3.18.1-1.org/drivers/media/dvb-frontends/dib3000.h       2014-12-21 22:37:14.000000000 +0100
-+++ backports-3.18.1-1/drivers/media/dvb-frontends/dib3000.h   2014-12-28 14:10:09.528888772 +0100
+diff -Naur backports-4.2.6-1.org/drivers/media/dvb-frontends/dib3000.h backports-4.2.6-1/drivers/media/dvb-frontends/dib3000.h
+--- backports-4.2.6-1.org/drivers/media/dvb-frontends/dib3000.h        2015-11-15 22:19:38.000000000 +0100
++++ backports-4.2.6-1/drivers/media/dvb-frontends/dib3000.h    2016-01-27 12:26:21.266626324 +0100
 @@ -39,7 +39,7 @@
        int (*fifo_ctrl)(struct dvb_frontend *fe, int onoff);
        int (*pid_ctrl)(struct dvb_frontend *fe, int index, int pid, int onoff);
@@ -43,11 +43,11 @@ diff -Naur backports-3.18.1-1.org/drivers/media/dvb-frontends/dib3000.h backport
 -};
 +} __no_const;
  
- #if IS_ENABLED(CPTCFG_DVB_DIB3000MB)
+ #if IS_REACHABLE(CPTCFG_DVB_DIB3000MB)
  extern struct dvb_frontend* dib3000mb_attach(const struct dib3000_config* config,
-diff -Naur backports-3.18.1-1.org/drivers/media/dvb-frontends/dib7000p.h backports-3.18.1-1/drivers/media/dvb-frontends/dib7000p.h
---- backports-3.18.1-1.org/drivers/media/dvb-frontends/dib7000p.h      2014-12-21 22:37:14.000000000 +0100
-+++ backports-3.18.1-1/drivers/media/dvb-frontends/dib7000p.h  2014-12-28 14:10:09.528888772 +0100
+diff -Naur backports-4.2.6-1.org/drivers/media/dvb-frontends/dib7000p.h backports-4.2.6-1/drivers/media/dvb-frontends/dib7000p.h
+--- backports-4.2.6-1.org/drivers/media/dvb-frontends/dib7000p.h       2015-11-15 22:19:38.000000000 +0100
++++ backports-4.2.6-1/drivers/media/dvb-frontends/dib7000p.h   2016-01-27 12:26:21.266626324 +0100
 @@ -64,7 +64,7 @@
        int (*get_adc_power)(struct dvb_frontend *fe);
        int (*slave_reset)(struct dvb_frontend *fe);
@@ -55,11 +55,11 @@ diff -Naur backports-3.18.1-1.org/drivers/media/dvb-frontends/dib7000p.h backpor
 -};
 +} __no_const;
  
- #if IS_ENABLED(CPTCFG_DVB_DIB7000P)
+ #if IS_REACHABLE(CPTCFG_DVB_DIB7000P)
  void *dib7000p_attach(struct dib7000p_ops *ops);
-diff -Naur backports-3.18.1-1.org/drivers/media/dvb-frontends/dib8000.h backports-3.18.1-1/drivers/media/dvb-frontends/dib8000.h
---- backports-3.18.1-1.org/drivers/media/dvb-frontends/dib8000.h       2014-12-21 22:37:14.000000000 +0100
-+++ backports-3.18.1-1/drivers/media/dvb-frontends/dib8000.h   2014-12-28 14:10:09.528888772 +0100
+diff -Naur backports-4.2.6-1.org/drivers/media/dvb-frontends/dib8000.h backports-4.2.6-1/drivers/media/dvb-frontends/dib8000.h
+--- backports-4.2.6-1.org/drivers/media/dvb-frontends/dib8000.h        2015-11-15 22:19:38.000000000 +0100
++++ backports-4.2.6-1/drivers/media/dvb-frontends/dib8000.h    2016-01-27 12:26:21.266626324 +0100
 @@ -61,7 +61,7 @@
        int (*pid_filter_ctrl)(struct dvb_frontend *fe, u8 onoff);
        int (*pid_filter)(struct dvb_frontend *fe, u8 id, u16 pid, u8 onoff);
@@ -67,11 +67,11 @@ diff -Naur backports-3.18.1-1.org/drivers/media/dvb-frontends/dib8000.h backport
 -};
 +} __no_const;
  
- #if IS_ENABLED(CPTCFG_DVB_DIB8000)
+ #if IS_REACHABLE(CPTCFG_DVB_DIB8000)
  void *dib8000_attach(struct dib8000_ops *ops);
-diff -Naur backports-3.18.1-1.org/drivers/media/pci/cx88/cx88-video.c backports-3.18.1-1/drivers/media/pci/cx88/cx88-video.c
---- backports-3.18.1-1.org/drivers/media/pci/cx88/cx88-video.c 2014-12-21 22:37:13.000000000 +0100
-+++ backports-3.18.1-1/drivers/media/pci/cx88/cx88-video.c     2014-12-28 14:10:09.528888772 +0100
+diff -Naur backports-4.2.6-1.org/drivers/media/pci/cx88/cx88-video.c backports-4.2.6-1/drivers/media/pci/cx88/cx88-video.c
+--- backports-4.2.6-1.org/drivers/media/pci/cx88/cx88-video.c  2015-11-15 22:19:38.000000000 +0100
++++ backports-4.2.6-1/drivers/media/pci/cx88/cx88-video.c      2016-01-27 12:26:21.266626324 +0100
 @@ -50,9 +50,9 @@
  
  /* ------------------------------------------------------------------ */
@@ -85,9 +85,9 @@ diff -Naur backports-3.18.1-1.org/drivers/media/pci/cx88/cx88-video.c backports-
  
  module_param_array(video_nr, int, NULL, 0444);
  module_param_array(vbi_nr,   int, NULL, 0444);
-diff -Naur backports-3.18.1-1.org/drivers/media/pci/ivtv/ivtv-driver.c backports-3.18.1-1/drivers/media/pci/ivtv/ivtv-driver.c
---- backports-3.18.1-1.org/drivers/media/pci/ivtv/ivtv-driver.c        2014-12-21 22:37:13.000000000 +0100
-+++ backports-3.18.1-1/drivers/media/pci/ivtv/ivtv-driver.c    2014-12-28 14:10:09.528888772 +0100
+diff -Naur backports-4.2.6-1.org/drivers/media/pci/ivtv/ivtv-driver.c backports-4.2.6-1/drivers/media/pci/ivtv/ivtv-driver.c
+--- backports-4.2.6-1.org/drivers/media/pci/ivtv/ivtv-driver.c 2015-11-15 22:19:38.000000000 +0100
++++ backports-4.2.6-1/drivers/media/pci/ivtv/ivtv-driver.c     2016-01-27 12:26:21.266626324 +0100
 @@ -83,7 +83,7 @@
  MODULE_DEVICE_TABLE(pci,ivtv_pci_tbl);
  
@@ -97,9 +97,9 @@ diff -Naur backports-3.18.1-1.org/drivers/media/pci/ivtv/ivtv-driver.c backports
  
  /* Parameter declarations */
  static int cardtype[IVTV_MAX_CARDS];
-diff -Naur backports-3.18.1-1.org/drivers/media/pci/solo6x10/solo6x10-core.c backports-3.18.1-1/drivers/media/pci/solo6x10/solo6x10-core.c
---- backports-3.18.1-1.org/drivers/media/pci/solo6x10/solo6x10-core.c  2014-12-21 22:37:13.000000000 +0100
-+++ backports-3.18.1-1/drivers/media/pci/solo6x10/solo6x10-core.c      2014-12-28 14:10:09.528888772 +0100
+diff -Naur backports-4.2.6-1.org/drivers/media/pci/solo6x10/solo6x10-core.c backports-4.2.6-1/drivers/media/pci/solo6x10/solo6x10-core.c
+--- backports-4.2.6-1.org/drivers/media/pci/solo6x10/solo6x10-core.c   2015-11-15 22:19:38.000000000 +0100
++++ backports-4.2.6-1/drivers/media/pci/solo6x10/solo6x10-core.c       2016-01-27 12:26:21.266626324 +0100
 @@ -424,7 +424,7 @@
  
  static int solo_sysfs_init(struct solo_dev *solo_dev)
@@ -109,9 +109,9 @@ diff -Naur backports-3.18.1-1.org/drivers/media/pci/solo6x10/solo6x10-core.c bac
        struct device *dev = &solo_dev->dev;
        const char *driver;
        int i;
-diff -Naur backports-3.18.1-1.org/drivers/media/pci/solo6x10/solo6x10-g723.c backports-3.18.1-1/drivers/media/pci/solo6x10/solo6x10-g723.c
---- backports-3.18.1-1.org/drivers/media/pci/solo6x10/solo6x10-g723.c  2014-12-21 22:37:13.000000000 +0100
-+++ backports-3.18.1-1/drivers/media/pci/solo6x10/solo6x10-g723.c      2014-12-28 14:10:09.528888772 +0100
+diff -Naur backports-4.2.6-1.org/drivers/media/pci/solo6x10/solo6x10-g723.c backports-4.2.6-1/drivers/media/pci/solo6x10/solo6x10-g723.c
+--- backports-4.2.6-1.org/drivers/media/pci/solo6x10/solo6x10-g723.c   2015-11-15 22:19:38.000000000 +0100
++++ backports-4.2.6-1/drivers/media/pci/solo6x10/solo6x10-g723.c       2016-01-27 12:26:21.266626324 +0100
 @@ -351,7 +351,7 @@
  
  int solo_g723_init(struct solo_dev *solo_dev)
@@ -121,10 +121,10 @@ diff -Naur backports-3.18.1-1.org/drivers/media/pci/solo6x10/solo6x10-g723.c bac
        struct snd_card *card;
        struct snd_kcontrol_new kctl;
        char name[32];
-diff -Naur backports-3.18.1-1.org/drivers/media/pci/solo6x10/solo6x10.h backports-3.18.1-1/drivers/media/pci/solo6x10/solo6x10.h
---- backports-3.18.1-1.org/drivers/media/pci/solo6x10/solo6x10.h       2014-12-21 22:37:13.000000000 +0100
-+++ backports-3.18.1-1/drivers/media/pci/solo6x10/solo6x10.h   2014-12-28 14:10:09.532888798 +0100
-@@ -219,7 +219,7 @@
+diff -Naur backports-4.2.6-1.org/drivers/media/pci/solo6x10/solo6x10.h backports-4.2.6-1/drivers/media/pci/solo6x10/solo6x10.h
+--- backports-4.2.6-1.org/drivers/media/pci/solo6x10/solo6x10.h        2015-11-15 22:19:38.000000000 +0100
++++ backports-4.2.6-1/drivers/media/pci/solo6x10/solo6x10.h    2016-01-27 12:26:21.266626324 +0100
+@@ -218,7 +218,7 @@
  
        /* P2M DMA Engine */
        struct solo_p2m_dev     p2m_dev[SOLO_NR_P2M];
@@ -133,9 +133,9 @@ diff -Naur backports-3.18.1-1.org/drivers/media/pci/solo6x10/solo6x10.h backport
        int                     p2m_jiffies;
        unsigned int            p2m_timeouts;
  
-diff -Naur backports-3.18.1-1.org/drivers/media/pci/solo6x10/solo6x10-p2m.c backports-3.18.1-1/drivers/media/pci/solo6x10/solo6x10-p2m.c
---- backports-3.18.1-1.org/drivers/media/pci/solo6x10/solo6x10-p2m.c   2014-12-21 22:37:13.000000000 +0100
-+++ backports-3.18.1-1/drivers/media/pci/solo6x10/solo6x10-p2m.c       2014-12-28 14:10:09.532888798 +0100
+diff -Naur backports-4.2.6-1.org/drivers/media/pci/solo6x10/solo6x10-p2m.c backports-4.2.6-1/drivers/media/pci/solo6x10/solo6x10-p2m.c
+--- backports-4.2.6-1.org/drivers/media/pci/solo6x10/solo6x10-p2m.c    2015-11-15 22:19:38.000000000 +0100
++++ backports-4.2.6-1/drivers/media/pci/solo6x10/solo6x10-p2m.c        2016-01-27 12:26:21.266626324 +0100
 @@ -73,7 +73,7 @@
  
        /* Get next ID. According to Softlogic, 6110 has problems on !=0 P2M */
@@ -145,9 +145,21 @@ diff -Naur backports-3.18.1-1.org/drivers/media/pci/solo6x10/solo6x10-p2m.c back
                if (p2m_id < 0)
                        p2m_id = -p2m_id;
        }
-diff -Naur backports-3.18.1-1.org/drivers/media/platform/omap/omap_vout.c backports-3.18.1-1/drivers/media/platform/omap/omap_vout.c
---- backports-3.18.1-1.org/drivers/media/platform/omap/omap_vout.c     2014-12-21 22:37:13.000000000 +0100
-+++ backports-3.18.1-1/drivers/media/platform/omap/omap_vout.c 2014-12-28 14:10:09.532888798 +0100
+diff -Naur backports-4.2.6-1.org/drivers/media/pci/tw68/tw68-core.c backports-4.2.6-1/drivers/media/pci/tw68/tw68-core.c
+--- backports-4.2.6-1.org/drivers/media/pci/tw68/tw68-core.c   2015-11-15 22:19:38.000000000 +0100
++++ backports-4.2.6-1/drivers/media/pci/tw68/tw68-core.c       2016-01-27 12:26:21.266626324 +0100
+@@ -60,7 +60,7 @@
+ module_param_array(card, int, NULL, 0444);
+ MODULE_PARM_DESC(card, "card type");
+-static atomic_t tw68_instance = ATOMIC_INIT(0);
++static atomic_unchecked_t tw68_instance = ATOMIC_INIT(0);
+ /* ------------------------------------------------------------------ */
+diff -Naur backports-4.2.6-1.org/drivers/media/platform/omap/omap_vout.c backports-4.2.6-1/drivers/media/platform/omap/omap_vout.c
+--- backports-4.2.6-1.org/drivers/media/platform/omap/omap_vout.c      2015-11-15 22:19:38.000000000 +0100
++++ backports-4.2.6-1/drivers/media/platform/omap/omap_vout.c  2016-01-27 12:26:21.266626324 +0100
 @@ -63,7 +63,6 @@
        OMAP_VIDEO2,
  };
@@ -156,7 +168,7 @@ diff -Naur backports-3.18.1-1.org/drivers/media/platform/omap/omap_vout.c backpo
  /* Variables configurable through module params*/
  static u32 video1_numbuffers = 3;
  static u32 video2_numbuffers = 3;
-@@ -1012,6 +1011,12 @@
+@@ -1008,6 +1007,12 @@
  {
        struct videobuf_queue *q;
        struct omap_vout_device *vout = NULL;
@@ -169,7 +181,7 @@ diff -Naur backports-3.18.1-1.org/drivers/media/platform/omap/omap_vout.c backpo
  
        vout = video_drvdata(file);
        v4l2_dbg(1, debug, &vout->vid_dev->v4l2_dev, "Entering %s\n", __func__);
-@@ -1029,10 +1034,6 @@
+@@ -1025,10 +1030,6 @@
        vout->type = V4L2_BUF_TYPE_VIDEO_OUTPUT;
  
        q = &vout->vbq;
@@ -180,9 +192,9 @@ diff -Naur backports-3.18.1-1.org/drivers/media/platform/omap/omap_vout.c backpo
        spin_lock_init(&vout->vbq_lock);
  
        videobuf_queue_dma_contig_init(q, &video_vbq_ops, q->dev,
-diff -Naur backports-3.18.1-1.org/drivers/media/platform/s5p-tv/mixer_grp_layer.c backports-3.18.1-1/drivers/media/platform/s5p-tv/mixer_grp_layer.c
---- backports-3.18.1-1.org/drivers/media/platform/s5p-tv/mixer_grp_layer.c     2014-12-21 22:37:13.000000000 +0100
-+++ backports-3.18.1-1/drivers/media/platform/s5p-tv/mixer_grp_layer.c 2014-12-28 14:10:09.532888798 +0100
+diff -Naur backports-4.2.6-1.org/drivers/media/platform/s5p-tv/mixer_grp_layer.c backports-4.2.6-1/drivers/media/platform/s5p-tv/mixer_grp_layer.c
+--- backports-4.2.6-1.org/drivers/media/platform/s5p-tv/mixer_grp_layer.c      2015-11-15 22:19:38.000000000 +0100
++++ backports-4.2.6-1/drivers/media/platform/s5p-tv/mixer_grp_layer.c  2016-01-27 12:26:21.266626324 +0100
 @@ -235,7 +235,7 @@
  {
        struct mxr_layer *layer;
@@ -192,9 +204,9 @@ diff -Naur backports-3.18.1-1.org/drivers/media/platform/s5p-tv/mixer_grp_layer.
                .release = mxr_graph_layer_release,
                .buffer_set = mxr_graph_buffer_set,
                .stream_set = mxr_graph_stream_set,
-diff -Naur backports-3.18.1-1.org/drivers/media/platform/s5p-tv/mixer.h backports-3.18.1-1/drivers/media/platform/s5p-tv/mixer.h
---- backports-3.18.1-1.org/drivers/media/platform/s5p-tv/mixer.h       2014-12-21 22:37:13.000000000 +0100
-+++ backports-3.18.1-1/drivers/media/platform/s5p-tv/mixer.h   2014-12-28 14:10:09.532888798 +0100
+diff -Naur backports-4.2.6-1.org/drivers/media/platform/s5p-tv/mixer.h backports-4.2.6-1/drivers/media/platform/s5p-tv/mixer.h
+--- backports-4.2.6-1.org/drivers/media/platform/s5p-tv/mixer.h        2015-11-15 22:19:38.000000000 +0100
++++ backports-4.2.6-1/drivers/media/platform/s5p-tv/mixer.h    2016-01-27 12:26:21.266626324 +0100
 @@ -156,7 +156,7 @@
        /** layer index (unique identifier) */
        int idx;
@@ -204,9 +216,9 @@ diff -Naur backports-3.18.1-1.org/drivers/media/platform/s5p-tv/mixer.h backport
        /** format array */
        const struct mxr_format **fmt_array;
        /** size of format array */
-diff -Naur backports-3.18.1-1.org/drivers/media/platform/s5p-tv/mixer_reg.c backports-3.18.1-1/drivers/media/platform/s5p-tv/mixer_reg.c
---- backports-3.18.1-1.org/drivers/media/platform/s5p-tv/mixer_reg.c   2014-12-21 22:37:13.000000000 +0100
-+++ backports-3.18.1-1/drivers/media/platform/s5p-tv/mixer_reg.c       2014-12-28 14:10:09.532888798 +0100
+diff -Naur backports-4.2.6-1.org/drivers/media/platform/s5p-tv/mixer_reg.c backports-4.2.6-1/drivers/media/platform/s5p-tv/mixer_reg.c
+--- backports-4.2.6-1.org/drivers/media/platform/s5p-tv/mixer_reg.c    2015-11-15 22:19:38.000000000 +0100
++++ backports-4.2.6-1/drivers/media/platform/s5p-tv/mixer_reg.c        2016-01-27 12:26:21.266626324 +0100
 @@ -276,7 +276,7 @@
                layer->update_buf = next;
        }
@@ -216,9 +228,9 @@ diff -Naur backports-3.18.1-1.org/drivers/media/platform/s5p-tv/mixer_reg.c back
  
        if (done && done != layer->shadow_buf)
                vb2_buffer_done(&done->vb, VB2_BUF_STATE_DONE);
-diff -Naur backports-3.18.1-1.org/drivers/media/platform/s5p-tv/mixer_video.c backports-3.18.1-1/drivers/media/platform/s5p-tv/mixer_video.c
---- backports-3.18.1-1.org/drivers/media/platform/s5p-tv/mixer_video.c 2014-12-21 22:37:13.000000000 +0100
-+++ backports-3.18.1-1/drivers/media/platform/s5p-tv/mixer_video.c     2014-12-28 14:10:09.532888798 +0100
+diff -Naur backports-4.2.6-1.org/drivers/media/platform/s5p-tv/mixer_video.c backports-4.2.6-1/drivers/media/platform/s5p-tv/mixer_video.c
+--- backports-4.2.6-1.org/drivers/media/platform/s5p-tv/mixer_video.c  2015-11-15 22:19:38.000000000 +0100
++++ backports-4.2.6-1/drivers/media/platform/s5p-tv/mixer_video.c      2016-01-27 12:26:21.266626324 +0100
 @@ -210,7 +210,7 @@
        layer->geo.src.height = layer->geo.src.full_height;
  
@@ -270,7 +282,7 @@ diff -Naur backports-3.18.1-1.org/drivers/media/platform/s5p-tv/mixer_video.c ba
  
                /* retrieve update selection rectangle */
                res.left = target->x_offset;
-@@ -954,13 +954,13 @@
+@@ -938,13 +938,13 @@
        mxr_output_get(mdev);
  
        mxr_layer_update_output(layer);
@@ -286,7 +298,7 @@ diff -Naur backports-3.18.1-1.org/drivers/media/platform/s5p-tv/mixer_video.c ba
        mxr_streamer_get(mdev);
  
        return 0;
-@@ -1030,7 +1030,7 @@
+@@ -1014,7 +1014,7 @@
        spin_unlock_irqrestore(&layer->enq_slock, flags);
  
        /* disabling layer in hardware */
@@ -295,7 +307,7 @@ diff -Naur backports-3.18.1-1.org/drivers/media/platform/s5p-tv/mixer_video.c ba
        /* remove one streamer */
        mxr_streamer_put(mdev);
        /* allow changes in output configuration */
-@@ -1068,8 +1068,8 @@
+@@ -1052,8 +1052,8 @@
  
  void mxr_layer_release(struct mxr_layer *layer)
  {
@@ -306,7 +318,7 @@ diff -Naur backports-3.18.1-1.org/drivers/media/platform/s5p-tv/mixer_video.c ba
  }
  
  void mxr_base_layer_release(struct mxr_layer *layer)
-@@ -1095,7 +1095,7 @@
+@@ -1079,7 +1079,7 @@
  
        layer->mdev = mdev;
        layer->idx = idx;
@@ -315,9 +327,9 @@ diff -Naur backports-3.18.1-1.org/drivers/media/platform/s5p-tv/mixer_video.c ba
  
        spin_lock_init(&layer->enq_slock);
        INIT_LIST_HEAD(&layer->enq_list);
-diff -Naur backports-3.18.1-1.org/drivers/media/platform/s5p-tv/mixer_vp_layer.c backports-3.18.1-1/drivers/media/platform/s5p-tv/mixer_vp_layer.c
---- backports-3.18.1-1.org/drivers/media/platform/s5p-tv/mixer_vp_layer.c      2014-12-21 22:37:13.000000000 +0100
-+++ backports-3.18.1-1/drivers/media/platform/s5p-tv/mixer_vp_layer.c  2014-12-28 14:10:09.532888798 +0100
+diff -Naur backports-4.2.6-1.org/drivers/media/platform/s5p-tv/mixer_vp_layer.c backports-4.2.6-1/drivers/media/platform/s5p-tv/mixer_vp_layer.c
+--- backports-4.2.6-1.org/drivers/media/platform/s5p-tv/mixer_vp_layer.c       2015-11-15 22:19:38.000000000 +0100
++++ backports-4.2.6-1/drivers/media/platform/s5p-tv/mixer_vp_layer.c   2016-01-27 12:26:21.266626324 +0100
 @@ -206,7 +206,7 @@
  {
        struct mxr_layer *layer;
@@ -327,9 +339,20 @@ diff -Naur backports-3.18.1-1.org/drivers/media/platform/s5p-tv/mixer_vp_layer.c
                .release = mxr_vp_layer_release,
                .buffer_set = mxr_vp_buffer_set,
                .stream_set = mxr_vp_stream_set,
-diff -Naur backports-3.18.1-1.org/drivers/media/radio/radio-cadet.c backports-3.18.1-1/drivers/media/radio/radio-cadet.c
---- backports-3.18.1-1.org/drivers/media/radio/radio-cadet.c   2014-12-21 22:37:13.000000000 +0100
-+++ backports-3.18.1-1/drivers/media/radio/radio-cadet.c       2014-12-28 14:10:09.532888798 +0100
+diff -Naur backports-4.2.6-1.org/drivers/media/platform/vivid/vivid-osd.c backports-4.2.6-1/drivers/media/platform/vivid/vivid-osd.c
+--- backports-4.2.6-1.org/drivers/media/platform/vivid/vivid-osd.c     2015-11-15 22:19:38.000000000 +0100
++++ backports-4.2.6-1/drivers/media/platform/vivid/vivid-osd.c 2016-01-27 12:26:21.269959657 +0100
+@@ -85,6 +85,7 @@
+       case FBIOGET_VBLANK: {
+               struct fb_vblank vblank;
++              memset(&vblank, 0, sizeof(vblank));
+               vblank.flags = FB_VBLANK_HAVE_COUNT | FB_VBLANK_HAVE_VCOUNT |
+                       FB_VBLANK_HAVE_VSYNC;
+               vblank.count = 0;
+diff -Naur backports-4.2.6-1.org/drivers/media/radio/radio-cadet.c backports-4.2.6-1/drivers/media/radio/radio-cadet.c
+--- backports-4.2.6-1.org/drivers/media/radio/radio-cadet.c    2015-11-15 22:19:38.000000000 +0100
++++ backports-4.2.6-1/drivers/media/radio/radio-cadet.c        2016-01-27 12:26:21.269959657 +0100
 @@ -333,6 +333,8 @@
        unsigned char readbuf[RDS_BUFFER];
        int i = 0;
@@ -351,9 +374,9 @@ diff -Naur backports-3.18.1-1.org/drivers/media/radio/radio-cadet.c backports-3.
        return i;
  }
  
-diff -Naur backports-3.18.1-1.org/drivers/media/radio/radio-maxiradio.c backports-3.18.1-1/drivers/media/radio/radio-maxiradio.c
---- backports-3.18.1-1.org/drivers/media/radio/radio-maxiradio.c       2014-12-21 22:37:13.000000000 +0100
-+++ backports-3.18.1-1/drivers/media/radio/radio-maxiradio.c   2014-12-28 14:10:09.532888798 +0100
+diff -Naur backports-4.2.6-1.org/drivers/media/radio/radio-maxiradio.c backports-4.2.6-1/drivers/media/radio/radio-maxiradio.c
+--- backports-4.2.6-1.org/drivers/media/radio/radio-maxiradio.c        2015-11-15 22:19:38.000000000 +0100
++++ backports-4.2.6-1/drivers/media/radio/radio-maxiradio.c    2016-01-27 12:26:21.269959657 +0100
 @@ -61,7 +61,7 @@
  /* TEA5757 pin mappings */
  static const int clk = 1, data = 2, wren = 4, mo_st = 8, power = 16;
@@ -363,9 +386,9 @@ diff -Naur backports-3.18.1-1.org/drivers/media/radio/radio-maxiradio.c backport
  
  #define PCI_VENDOR_ID_GUILLEMOT 0x5046
  #define PCI_DEVICE_ID_GUILLEMOT_MAXIRADIO 0x1001
-diff -Naur backports-3.18.1-1.org/drivers/media/radio/radio-shark2.c backports-3.18.1-1/drivers/media/radio/radio-shark2.c
---- backports-3.18.1-1.org/drivers/media/radio/radio-shark2.c  2014-12-21 22:37:13.000000000 +0100
-+++ backports-3.18.1-1/drivers/media/radio/radio-shark2.c      2014-12-28 14:10:09.532888798 +0100
+diff -Naur backports-4.2.6-1.org/drivers/media/radio/radio-shark2.c backports-4.2.6-1/drivers/media/radio/radio-shark2.c
+--- backports-4.2.6-1.org/drivers/media/radio/radio-shark2.c   2015-11-15 22:19:38.000000000 +0100
++++ backports-4.2.6-1/drivers/media/radio/radio-shark2.c       2016-01-27 12:26:21.269959657 +0100
 @@ -74,7 +74,7 @@
        u8 *transfer_buffer;
  };
@@ -375,9 +398,9 @@ diff -Naur backports-3.18.1-1.org/drivers/media/radio/radio-shark2.c backports-3
  
  static int shark_write_reg(struct radio_tea5777 *tea, u64 reg)
  {
-diff -Naur backports-3.18.1-1.org/drivers/media/radio/radio-shark.c backports-3.18.1-1/drivers/media/radio/radio-shark.c
---- backports-3.18.1-1.org/drivers/media/radio/radio-shark.c   2014-12-21 22:37:13.000000000 +0100
-+++ backports-3.18.1-1/drivers/media/radio/radio-shark.c       2014-12-28 14:10:09.532888798 +0100
+diff -Naur backports-4.2.6-1.org/drivers/media/radio/radio-shark.c backports-4.2.6-1/drivers/media/radio/radio-shark.c
+--- backports-4.2.6-1.org/drivers/media/radio/radio-shark.c    2015-11-15 22:19:38.000000000 +0100
++++ backports-4.2.6-1/drivers/media/radio/radio-shark.c        2016-01-27 12:26:21.269959657 +0100
 @@ -79,7 +79,7 @@
        u32 last_val;
  };
@@ -387,9 +410,9 @@ diff -Naur backports-3.18.1-1.org/drivers/media/radio/radio-shark.c backports-3.
  
  static void shark_write_val(struct snd_tea575x *tea, u32 val)
  {
-diff -Naur backports-3.18.1-1.org/drivers/media/radio/radio-si476x.c backports-3.18.1-1/drivers/media/radio/radio-si476x.c
---- backports-3.18.1-1.org/drivers/media/radio/radio-si476x.c  2014-12-21 22:37:13.000000000 +0100
-+++ backports-3.18.1-1/drivers/media/radio/radio-si476x.c      2014-12-28 14:10:09.532888798 +0100
+diff -Naur backports-4.2.6-1.org/drivers/media/radio/radio-si476x.c backports-4.2.6-1/drivers/media/radio/radio-si476x.c
+--- backports-4.2.6-1.org/drivers/media/radio/radio-si476x.c   2015-11-15 22:19:38.000000000 +0100
++++ backports-4.2.6-1/drivers/media/radio/radio-si476x.c       2016-01-27 12:26:21.269959657 +0100
 @@ -1445,7 +1445,7 @@
        struct si476x_radio *radio;
        struct v4l2_ctrl *ctrl;
@@ -399,9 +422,21 @@ diff -Naur backports-3.18.1-1.org/drivers/media/radio/radio-si476x.c backports-3
  
        radio = devm_kzalloc(&pdev->dev, sizeof(*radio), GFP_KERNEL);
        if (!radio)
-diff -Naur backports-3.18.1-1.org/drivers/media/usb/dvb-usb/cinergyT2-core.c backports-3.18.1-1/drivers/media/usb/dvb-usb/cinergyT2-core.c
---- backports-3.18.1-1.org/drivers/media/usb/dvb-usb/cinergyT2-core.c  2014-12-21 22:37:14.000000000 +0100
-+++ backports-3.18.1-1/drivers/media/usb/dvb-usb/cinergyT2-core.c      2014-12-28 14:10:09.532888798 +0100
+diff -Naur backports-4.2.6-1.org/drivers/media/radio/wl128x/fmdrv_common.c backports-4.2.6-1/drivers/media/radio/wl128x/fmdrv_common.c
+--- backports-4.2.6-1.org/drivers/media/radio/wl128x/fmdrv_common.c    2015-11-15 22:19:38.000000000 +0100
++++ backports-4.2.6-1/drivers/media/radio/wl128x/fmdrv_common.c        2016-01-27 12:26:21.269959657 +0100
+@@ -71,7 +71,7 @@
+ MODULE_PARM_DESC(rds_buf, "RDS buffer entries");
+ /* Radio Nr */
+-static u32 radio_nr = -1;
++static int radio_nr = -1;
+ module_param(radio_nr, int, 0444);
+ MODULE_PARM_DESC(radio_nr, "Radio Nr");
+diff -Naur backports-4.2.6-1.org/drivers/media/usb/dvb-usb/cinergyT2-core.c backports-4.2.6-1/drivers/media/usb/dvb-usb/cinergyT2-core.c
+--- backports-4.2.6-1.org/drivers/media/usb/dvb-usb/cinergyT2-core.c   2015-11-15 22:19:39.000000000 +0100
++++ backports-4.2.6-1/drivers/media/usb/dvb-usb/cinergyT2-core.c       2016-01-27 12:26:21.269959657 +0100
 @@ -50,29 +50,73 @@
  
  static int cinergyt2_streaming_ctrl(struct dvb_usb_adapter *adap, int enable)
@@ -548,11 +583,11 @@ diff -Naur backports-3.18.1-1.org/drivers/media/usb/dvb-usb/cinergyT2-core.c bac
        return 0;
  }
  
-diff -Naur backports-3.18.1-1.org/drivers/media/usb/dvb-usb/cinergyT2-fe.c backports-3.18.1-1/drivers/media/usb/dvb-usb/cinergyT2-fe.c
---- backports-3.18.1-1.org/drivers/media/usb/dvb-usb/cinergyT2-fe.c    2014-12-21 22:37:14.000000000 +0100
-+++ backports-3.18.1-1/drivers/media/usb/dvb-usb/cinergyT2-fe.c        2014-12-28 14:10:09.532888798 +0100
+diff -Naur backports-4.2.6-1.org/drivers/media/usb/dvb-usb/cinergyT2-fe.c backports-4.2.6-1/drivers/media/usb/dvb-usb/cinergyT2-fe.c
+--- backports-4.2.6-1.org/drivers/media/usb/dvb-usb/cinergyT2-fe.c     2015-11-15 22:19:39.000000000 +0100
++++ backports-4.2.6-1/drivers/media/usb/dvb-usb/cinergyT2-fe.c 2016-01-27 12:26:21.269959657 +0100
 @@ -145,103 +145,176 @@
-                                       fe_status_t *status)
+                                   enum fe_status *status)
  {
        struct cinergyt2_fe_state *state = fe->demodulator_priv;
 -      struct dvbt_get_status_msg result;
@@ -824,9 +859,9 @@ diff -Naur backports-3.18.1-1.org/drivers/media/usb/dvb-usb/cinergyT2-fe.c backp
  }
  
  static void cinergyt2_fe_release(struct dvb_frontend *fe)
-diff -Naur backports-3.18.1-1.org/drivers/media/usb/dvb-usb/dvb-usb-firmware.c backports-3.18.1-1/drivers/media/usb/dvb-usb/dvb-usb-firmware.c
---- backports-3.18.1-1.org/drivers/media/usb/dvb-usb/dvb-usb-firmware.c        2014-12-21 22:37:14.000000000 +0100
-+++ backports-3.18.1-1/drivers/media/usb/dvb-usb/dvb-usb-firmware.c    2014-12-28 14:10:09.532888798 +0100
+diff -Naur backports-4.2.6-1.org/drivers/media/usb/dvb-usb/dvb-usb-firmware.c backports-4.2.6-1/drivers/media/usb/dvb-usb/dvb-usb-firmware.c
+--- backports-4.2.6-1.org/drivers/media/usb/dvb-usb/dvb-usb-firmware.c 2015-11-15 22:19:39.000000000 +0100
++++ backports-4.2.6-1/drivers/media/usb/dvb-usb/dvb-usb-firmware.c     2016-01-27 12:26:21.269959657 +0100
 @@ -35,42 +35,57 @@
  
  int usb_cypress_load_firmware(struct usb_device *udev, const struct firmware *fw, int type)
@@ -896,21 +931,9 @@ diff -Naur backports-3.18.1-1.org/drivers/media/usb/dvb-usb/dvb-usb-firmware.c b
        return ret;
  }
  EXPORT_SYMBOL(usb_cypress_load_firmware);
-diff -Naur backports-3.18.1-1.org/drivers/media/usb/dvb-usb/dw2102.c backports-3.18.1-1/drivers/media/usb/dvb-usb/dw2102.c
---- backports-3.18.1-1.org/drivers/media/usb/dvb-usb/dw2102.c  2014-12-21 22:37:14.000000000 +0100
-+++ backports-3.18.1-1/drivers/media/usb/dvb-usb/dw2102.c      2014-12-28 14:10:09.536888811 +0100
-@@ -118,7 +118,7 @@
- struct s6x0_state {
-       int (*old_set_voltage)(struct dvb_frontend *f, fe_sec_voltage_t v);
--};
-+} __no_const;
- /* debug */
- static int dvb_usb_dw2102_debug;
-diff -Naur backports-3.18.1-1.org/drivers/media/usb/dvb-usb/technisat-usb2.c backports-3.18.1-1/drivers/media/usb/dvb-usb/technisat-usb2.c
---- backports-3.18.1-1.org/drivers/media/usb/dvb-usb/technisat-usb2.c  2014-12-21 22:37:14.000000000 +0100
-+++ backports-3.18.1-1/drivers/media/usb/dvb-usb/technisat-usb2.c      2014-12-28 14:10:09.536888811 +0100
+diff -Naur backports-4.2.6-1.org/drivers/media/usb/dvb-usb/technisat-usb2.c backports-4.2.6-1/drivers/media/usb/dvb-usb/technisat-usb2.c
+--- backports-4.2.6-1.org/drivers/media/usb/dvb-usb/technisat-usb2.c   2015-11-15 22:19:39.000000000 +0100
++++ backports-4.2.6-1/drivers/media/usb/dvb-usb/technisat-usb2.c       2016-01-27 12:26:21.269959657 +0100
 @@ -87,8 +87,11 @@
  static int technisat_usb2_i2c_access(struct usb_device *udev,
                u8 device_addr, u8 *tx, u8 txlen, u8 *rx, u8 rxlen)
@@ -1063,7 +1086,7 @@ diff -Naur backports-3.18.1-1.org/drivers/media/usb/dvb-usb/technisat-usb2.c bac
        return 0;
  }
  
-@@ -591,10 +615,15 @@
+@@ -594,10 +618,15 @@
  
  static int technisat_usb2_get_ir(struct dvb_usb_device *d)
  {
@@ -1080,7 +1103,7 @@ diff -Naur backports-3.18.1-1.org/drivers/media/usb/dvb-usb/technisat-usb2.c bac
        buf[0] = GET_IR_DATA_VENDOR_REQUEST;
        buf[1] = 0x08;
        buf[2] = 0x8f;
-@@ -617,16 +646,20 @@
+@@ -620,16 +649,20 @@
                        GET_IR_DATA_VENDOR_REQUEST,
                        USB_TYPE_VENDOR | USB_DIR_IN,
                        0x8080, 0,
@@ -1104,7 +1127,7 @@ diff -Naur backports-3.18.1-1.org/drivers/media/usb/dvb-usb/technisat-usb2.c bac
  
        /* decoding */
        b = buf+1;
-@@ -653,6 +686,8 @@
+@@ -656,6 +689,8 @@
  
        ir_raw_event_handle(d->rc_dev);
  
@@ -1113,10 +1136,67 @@ diff -Naur backports-3.18.1-1.org/drivers/media/usb/dvb-usb/technisat-usb2.c bac
        return 1;
  }
  
-diff -Naur backports-3.18.1-1.org/drivers/media/v4l2-core/v4l2-device.c backports-3.18.1-1/drivers/media/v4l2-core/v4l2-device.c
---- backports-3.18.1-1.org/drivers/media/v4l2-core/v4l2-device.c       2014-12-21 22:37:14.000000000 +0100
-+++ backports-3.18.1-1/drivers/media/v4l2-core/v4l2-device.c   2014-12-28 14:10:09.536888811 +0100
-@@ -75,9 +75,9 @@
+diff -Naur backports-4.2.6-1.org/drivers/media/v4l2-core/v4l2-compat-ioctl32.c backports-4.2.6-1/drivers/media/v4l2-core/v4l2-compat-ioctl32.c
+--- backports-4.2.6-1.org/drivers/media/v4l2-core/v4l2-compat-ioctl32.c        2015-11-15 22:19:38.000000000 +0100
++++ backports-4.2.6-1/drivers/media/v4l2-core/v4l2-compat-ioctl32.c    2016-01-27 12:26:21.269959657 +0100
+@@ -429,7 +429,7 @@
+                * by passing a very big num_planes value */
+               uplane = compat_alloc_user_space(num_planes *
+                                               sizeof(struct v4l2_plane));
+-              kp->m.planes = (__force struct v4l2_plane *)uplane;
++              kp->m.planes = (__force_kernel struct v4l2_plane *)uplane;
+               while (--num_planes >= 0) {
+                       ret = get_v4l2_plane32(uplane, uplane32, kp->memory);
+@@ -500,7 +500,7 @@
+               if (num_planes == 0)
+                       return 0;
+-              uplane = (__force struct v4l2_plane __user *)kp->m.planes;
++              uplane = (struct v4l2_plane __force_user *)kp->m.planes;
+               if (get_user(p, &up->m.planes))
+                       return -EFAULT;
+               uplane32 = compat_ptr(p);
+@@ -564,7 +564,7 @@
+               get_user(kp->flags, &up->flags) ||
+               copy_from_user(&kp->fmt, &up->fmt, sizeof(up->fmt)))
+                       return -EFAULT;
+-      kp->base = (__force void *)compat_ptr(tmp);
++      kp->base = (__force_kernel void *)compat_ptr(tmp);
+       return 0;
+ }
+@@ -669,7 +669,7 @@
+                       n * sizeof(struct v4l2_ext_control32)))
+               return -EFAULT;
+       kcontrols = compat_alloc_user_space(n * sizeof(struct v4l2_ext_control));
+-      kp->controls = (__force struct v4l2_ext_control *)kcontrols;
++      kp->controls = (__force_kernel struct v4l2_ext_control *)kcontrols;
+       while (--n >= 0) {
+               u32 id;
+@@ -696,7 +696,7 @@
+ {
+       struct v4l2_ext_control32 __user *ucontrols;
+       struct v4l2_ext_control __user *kcontrols =
+-              (__force struct v4l2_ext_control __user *)kp->controls;
++              (struct v4l2_ext_control __force_user *)kp->controls;
+       int n = kp->count;
+       compat_caddr_t p;
+@@ -780,7 +780,7 @@
+               get_user(tmp, &up->edid) ||
+               copy_from_user(kp->reserved, up->reserved, sizeof(kp->reserved)))
+                       return -EFAULT;
+-      kp->edid = (__force u8 *)compat_ptr(tmp);
++      kp->edid = (__force_kernel u8 *)compat_ptr(tmp);
+       return 0;
+ }
+diff -Naur backports-4.2.6-1.org/drivers/media/v4l2-core/v4l2-device.c backports-4.2.6-1/drivers/media/v4l2-core/v4l2-device.c
+--- backports-4.2.6-1.org/drivers/media/v4l2-core/v4l2-device.c        2015-11-15 22:19:38.000000000 +0100
++++ backports-4.2.6-1/drivers/media/v4l2-core/v4l2-device.c    2016-01-27 12:26:21.269959657 +0100
+@@ -74,9 +74,9 @@
  EXPORT_SYMBOL_GPL(v4l2_device_put);
  
  int v4l2_device_set_name(struct v4l2_device *v4l2_dev, const char *basename,
@@ -1128,10 +1208,10 @@ diff -Naur backports-3.18.1-1.org/drivers/media/v4l2-core/v4l2-device.c backport
        int len = strlen(basename);
  
        if (basename[len - 1] >= '0' && basename[len - 1] <= '9')
-diff -Naur backports-3.18.1-1.org/drivers/media/v4l2-core/v4l2-ioctl.c backports-3.18.1-1/drivers/media/v4l2-core/v4l2-ioctl.c
---- backports-3.18.1-1.org/drivers/media/v4l2-core/v4l2-ioctl.c        2014-12-21 22:37:14.000000000 +0100
-+++ backports-3.18.1-1/drivers/media/v4l2-core/v4l2-ioctl.c    2014-12-28 14:10:09.536888811 +0100
-@@ -2142,7 +2142,8 @@
+diff -Naur backports-4.2.6-1.org/drivers/media/v4l2-core/v4l2-ioctl.c backports-4.2.6-1/drivers/media/v4l2-core/v4l2-ioctl.c
+--- backports-4.2.6-1.org/drivers/media/v4l2-core/v4l2-ioctl.c 2015-11-15 22:19:38.000000000 +0100
++++ backports-4.2.6-1/drivers/media/v4l2-core/v4l2-ioctl.c     2016-01-27 12:26:21.269959657 +0100
+@@ -2341,7 +2341,8 @@
                                struct file *file, void *fh, void *p);
        } u;
        void (*debug)(const void *arg, bool write_only);
@@ -1141,7 +1221,7 @@ diff -Naur backports-3.18.1-1.org/drivers/media/v4l2-core/v4l2-ioctl.c backports
  
  /* This control needs a priority check */
  #define INFO_FL_PRIO  (1 << 0)
-@@ -2326,7 +2327,7 @@
+@@ -2525,7 +2526,7 @@
        struct video_device *vfd = video_devdata(file);
        const struct v4l2_ioctl_ops *ops = vfd->ioctl_ops;
        bool write_only = false;
@@ -1150,7 +1230,7 @@ diff -Naur backports-3.18.1-1.org/drivers/media/v4l2-core/v4l2-ioctl.c backports
        const struct v4l2_ioctl_info *info;
        void *fh = file->private_data;
        struct v4l2_fh *vfh = NULL;
-@@ -2413,7 +2414,7 @@
+@@ -2616,7 +2617,7 @@
                                ret = -EINVAL;
                                break;
                        }
@@ -1159,7 +1239,7 @@ diff -Naur backports-3.18.1-1.org/drivers/media/v4l2-core/v4l2-ioctl.c backports
                        *kernel_ptr = (void **)&buf->m.planes;
                        *array_size = sizeof(struct v4l2_plane) * buf->length;
                        ret = 1;
-@@ -2430,7 +2431,7 @@
+@@ -2633,7 +2634,7 @@
                                ret = -EINVAL;
                                break;
                        }
@@ -1168,7 +1248,7 @@ diff -Naur backports-3.18.1-1.org/drivers/media/v4l2-core/v4l2-ioctl.c backports
                        *kernel_ptr = (void **)&edid->edid;
                        *array_size = edid->blocks * 128;
                        ret = 1;
-@@ -2448,7 +2449,7 @@
+@@ -2651,7 +2652,7 @@
                                ret = -EINVAL;
                                break;
                        }
@@ -1177,7 +1257,7 @@ diff -Naur backports-3.18.1-1.org/drivers/media/v4l2-core/v4l2-ioctl.c backports
                        *kernel_ptr = (void **)&ctrls->controls;
                        *array_size = sizeof(struct v4l2_ext_control)
                                    * ctrls->count;
-@@ -2549,7 +2550,7 @@
+@@ -2752,7 +2753,7 @@
        }
  
        if (has_array_args) {
@@ -1186,21 +1266,9 @@ diff -Naur backports-3.18.1-1.org/drivers/media/v4l2-core/v4l2-ioctl.c backports
                if (copy_to_user(user_ptr, mbuf, array_size))
                        err = -EFAULT;
                goto out_array_args;
-diff -Naur backports-3.18.1-1.org/drivers/net/ieee802154/fakehard.c backports-3.18.1-1/drivers/net/ieee802154/fakehard.c
---- backports-3.18.1-1.org/drivers/net/ieee802154/fakehard.c   2014-12-21 22:37:14.000000000 +0100
-+++ backports-3.18.1-1/drivers/net/ieee802154/fakehard.c       2014-12-28 14:10:09.556888909 +0100
-@@ -365,7 +365,7 @@
-       phy->transmit_power = 0xbf;
-       dev->netdev_ops = &fake_ops;
--      dev->ml_priv = &fake_mlme;
-+      dev->ml_priv = (void *)&fake_mlme;
-       priv = netdev_priv(dev);
-       priv->phy = phy;
-diff -Naur backports-3.18.1-1.org/drivers/net/usb/sierra_net.c backports-3.18.1-1/drivers/net/usb/sierra_net.c
---- backports-3.18.1-1.org/drivers/net/usb/sierra_net.c        2014-12-21 22:37:14.000000000 +0100
-+++ backports-3.18.1-1/drivers/net/usb/sierra_net.c    2014-12-28 14:10:09.560888936 +0100
+diff -Naur backports-4.2.6-1.org/drivers/net/usb/sierra_net.c backports-4.2.6-1/drivers/net/usb/sierra_net.c
+--- backports-4.2.6-1.org/drivers/net/usb/sierra_net.c 2015-11-15 22:19:39.000000000 +0100
++++ backports-4.2.6-1/drivers/net/usb/sierra_net.c     2016-01-27 12:26:21.283292990 +0100
 @@ -51,7 +51,7 @@
  /* atomic counter partially included in MAC address to make sure 2 devices
   * do not end up with the same MAC - concept breaks in case of > 255 ifaces
@@ -1219,9 +1287,21 @@ diff -Naur backports-3.18.1-1.org/drivers/net/usb/sierra_net.c backports-3.18.1-
        dev->net->dev_addr[ETH_ALEN-1] = ifacenum;
  
        /* we will have to manufacture ethernet headers, prepare template */
-diff -Naur backports-3.18.1-1.org/drivers/net/wireless/at76c50x-usb.c backports-3.18.1-1/drivers/net/wireless/at76c50x-usb.c
---- backports-3.18.1-1.org/drivers/net/wireless/at76c50x-usb.c 2014-12-21 22:37:14.000000000 +0100
-+++ backports-3.18.1-1/drivers/net/wireless/at76c50x-usb.c     2014-12-28 14:10:09.560888936 +0100
+diff -Naur backports-4.2.6-1.org/drivers/net/wireless/airo.c backports-4.2.6-1/drivers/net/wireless/airo.c
+--- backports-4.2.6-1.org/drivers/net/wireless/airo.c  2015-11-15 22:19:39.000000000 +0100
++++ backports-4.2.6-1/drivers/net/wireless/airo.c      2016-01-27 12:26:21.286626323 +0100
+@@ -7846,7 +7846,7 @@
+       struct airo_info *ai = dev->ml_priv;
+       int  ridcode;
+         int  enabled;
+-      static int (* writer)(struct airo_info *, u16 rid, const void *, int, int);
++      int (* writer)(struct airo_info *, u16 rid, const void *, int, int);
+       unsigned char *iobuf;
+       /* Only super-user can write RIDs */
+diff -Naur backports-4.2.6-1.org/drivers/net/wireless/at76c50x-usb.c backports-4.2.6-1/drivers/net/wireless/at76c50x-usb.c
+--- backports-4.2.6-1.org/drivers/net/wireless/at76c50x-usb.c  2015-11-15 22:19:39.000000000 +0100
++++ backports-4.2.6-1/drivers/net/wireless/at76c50x-usb.c      2016-01-27 12:26:21.286626323 +0100
 @@ -353,7 +353,7 @@
  }
  
@@ -1231,10 +1311,37 @@ diff -Naur backports-3.18.1-1.org/drivers/net/wireless/at76c50x-usb.c backports-
  {
        return msecs_to_jiffies((s->poll_timeout[2] << 16)
                                | (s->poll_timeout[1] << 8)
-diff -Naur backports-3.18.1-1.org/drivers/net/wireless/ath/ath10k/htc.c backports-3.18.1-1/drivers/net/wireless/ath/ath10k/htc.c
---- backports-3.18.1-1.org/drivers/net/wireless/ath/ath10k/htc.c       2014-12-21 22:37:14.000000000 +0100
-+++ backports-3.18.1-1/drivers/net/wireless/ath/ath10k/htc.c   2014-12-28 14:10:09.560888936 +0100
-@@ -848,7 +848,10 @@
+diff -Naur backports-4.2.6-1.org/drivers/net/wireless/ath/ath10k/ce.c backports-4.2.6-1/drivers/net/wireless/ath/ath10k/ce.c
+--- backports-4.2.6-1.org/drivers/net/wireless/ath/ath10k/ce.c 2015-11-15 22:19:40.000000000 +0100
++++ backports-4.2.6-1/drivers/net/wireless/ath/ath10k/ce.c     2016-01-27 12:26:21.286626323 +0100
+@@ -896,12 +896,12 @@
+       return 0;
+ }
+-static struct ath10k_ce_ring *
++static struct ath10k_ce_ring * __intentional_overflow(-1)
+ ath10k_ce_alloc_src_ring(struct ath10k *ar, unsigned int ce_id,
+                        const struct ce_attr *attr)
+ {
+       struct ath10k_ce_ring *src_ring;
+-      u32 nentries = attr->src_nentries;
++      unsigned long nentries = attr->src_nentries;
+       dma_addr_t base_addr;
+       nentries = roundup_pow_of_two(nentries);
+@@ -968,7 +968,7 @@
+                         const struct ce_attr *attr)
+ {
+       struct ath10k_ce_ring *dest_ring;
+-      u32 nentries;
++      unsigned long nentries;
+       dma_addr_t base_addr;
+       nentries = roundup_pow_of_two(attr->dest_nentries);
+diff -Naur backports-4.2.6-1.org/drivers/net/wireless/ath/ath10k/htc.c backports-4.2.6-1/drivers/net/wireless/ath/ath10k/htc.c
+--- backports-4.2.6-1.org/drivers/net/wireless/ath/ath10k/htc.c        2015-11-15 22:19:40.000000000 +0100
++++ backports-4.2.6-1/drivers/net/wireless/ath/ath10k/htc.c    2016-01-27 12:26:21.286626323 +0100
+@@ -841,7 +841,10 @@
  /* registered target arrival callback from the HIF layer */
  int ath10k_htc_init(struct ath10k *ar)
  {
@@ -1246,7 +1353,7 @@ diff -Naur backports-3.18.1-1.org/drivers/net/wireless/ath/ath10k/htc.c backport
        struct ath10k_htc_ep *ep = NULL;
        struct ath10k_htc *htc = &ar->htc;
  
-@@ -857,8 +860,6 @@
+@@ -850,8 +853,6 @@
        ath10k_htc_reset_endpoint_states(htc);
  
        /* setup HIF layer callbacks */
@@ -1255,9 +1362,9 @@ diff -Naur backports-3.18.1-1.org/drivers/net/wireless/ath/ath10k/htc.c backport
        htc->ar = ar;
  
        /* Get HIF default pipe for HTC message exchange */
-diff -Naur backports-3.18.1-1.org/drivers/net/wireless/ath/ath10k/htc.h backports-3.18.1-1/drivers/net/wireless/ath/ath10k/htc.h
---- backports-3.18.1-1.org/drivers/net/wireless/ath/ath10k/htc.h       2014-12-21 22:37:14.000000000 +0100
-+++ backports-3.18.1-1/drivers/net/wireless/ath/ath10k/htc.h   2014-12-28 14:10:09.560888936 +0100
+diff -Naur backports-4.2.6-1.org/drivers/net/wireless/ath/ath10k/htc.h backports-4.2.6-1/drivers/net/wireless/ath/ath10k/htc.h
+--- backports-4.2.6-1.org/drivers/net/wireless/ath/ath10k/htc.h        2015-11-15 22:19:40.000000000 +0100
++++ backports-4.2.6-1/drivers/net/wireless/ath/ath10k/htc.h    2016-01-27 12:26:21.286626323 +0100
 @@ -270,13 +270,13 @@
  
  struct ath10k_htc_ops {
@@ -1274,9 +1381,9 @@ diff -Naur backports-3.18.1-1.org/drivers/net/wireless/ath/ath10k/htc.h backport
  
  /* service connection information */
  struct ath10k_htc_svc_conn_req {
-diff -Naur backports-3.18.1-1.org/drivers/net/wireless/ath/ath9k/ar9002_mac.c backports-3.18.1-1/drivers/net/wireless/ath/ath9k/ar9002_mac.c
---- backports-3.18.1-1.org/drivers/net/wireless/ath/ath9k/ar9002_mac.c 2014-12-21 22:37:14.000000000 +0100
-+++ backports-3.18.1-1/drivers/net/wireless/ath/ath9k/ar9002_mac.c     2014-12-28 14:10:09.560888936 +0100
+diff -Naur backports-4.2.6-1.org/drivers/net/wireless/ath/ath9k/ar9002_mac.c backports-4.2.6-1/drivers/net/wireless/ath/ath9k/ar9002_mac.c
+--- backports-4.2.6-1.org/drivers/net/wireless/ath/ath9k/ar9002_mac.c  2015-11-15 22:19:39.000000000 +0100
++++ backports-4.2.6-1/drivers/net/wireless/ath/ath9k/ar9002_mac.c      2016-01-27 12:26:21.286626323 +0100
 @@ -220,8 +220,8 @@
        ads->ds_txstatus6 = ads->ds_txstatus7 = 0;
        ads->ds_txstatus8 = ads->ds_txstatus9 = 0;
@@ -1329,7 +1436,7 @@ diff -Naur backports-3.18.1-1.org/drivers/net/wireless/ath/ath9k/ar9002_mac.c ba
 -      ACCESS_ONCE(ads->ds_ctl0) = (i->pkt_len & AR_FrameLen)
 +      ACCESS_ONCE_RW(ads->ds_ctl0) = (i->pkt_len & AR_FrameLen)
                | (i->flags & ATH9K_TXDESC_VMF ? AR_VirtMoreFrag : 0)
-               | SM(i->txpower, AR_XmitPower0)
+               | SM(i->txpower[0], AR_XmitPower0)
                | (i->flags & ATH9K_TXDESC_VEOL ? AR_VEOL : 0)
 @@ -289,27 +289,27 @@
                | (i->flags & ATH9K_TXDESC_RTSENA ? AR_RTSEnable :
@@ -1358,18 +1465,18 @@ diff -Naur backports-3.18.1-1.org/drivers/net/wireless/ath/ath9k/ar9002_mac.c ba
                | set11nRateFlags(i->rates, 3)
                | SM(i->rtscts_rate, AR_RTSCTSRate);
  
--      ACCESS_ONCE(ads->ds_ctl9) = SM(i->txpower, AR_XmitPower1);
--      ACCESS_ONCE(ads->ds_ctl10) = SM(i->txpower, AR_XmitPower2);
--      ACCESS_ONCE(ads->ds_ctl11) = SM(i->txpower, AR_XmitPower3);
-+      ACCESS_ONCE_RW(ads->ds_ctl9) = SM(i->txpower, AR_XmitPower1);
-+      ACCESS_ONCE_RW(ads->ds_ctl10) = SM(i->txpower, AR_XmitPower2);
-+      ACCESS_ONCE_RW(ads->ds_ctl11) = SM(i->txpower, AR_XmitPower3);
+-      ACCESS_ONCE(ads->ds_ctl9) = SM(i->txpower[1], AR_XmitPower1);
+-      ACCESS_ONCE(ads->ds_ctl10) = SM(i->txpower[2], AR_XmitPower2);
+-      ACCESS_ONCE(ads->ds_ctl11) = SM(i->txpower[3], AR_XmitPower3);
++      ACCESS_ONCE_RW(ads->ds_ctl9) = SM(i->txpower[1], AR_XmitPower1);
++      ACCESS_ONCE_RW(ads->ds_ctl10) = SM(i->txpower[2], AR_XmitPower2);
++      ACCESS_ONCE_RW(ads->ds_ctl11) = SM(i->txpower[3], AR_XmitPower3);
  }
  
  static int ar9002_hw_proc_txdesc(struct ath_hw *ah, void *ds,
-diff -Naur backports-3.18.1-1.org/drivers/net/wireless/ath/ath9k/ar9003_mac.c backports-3.18.1-1/drivers/net/wireless/ath/ath9k/ar9003_mac.c
---- backports-3.18.1-1.org/drivers/net/wireless/ath/ath9k/ar9003_mac.c 2014-12-21 22:37:14.000000000 +0100
-+++ backports-3.18.1-1/drivers/net/wireless/ath/ath9k/ar9003_mac.c     2014-12-28 14:10:09.560888936 +0100
+diff -Naur backports-4.2.6-1.org/drivers/net/wireless/ath/ath9k/ar9003_mac.c backports-4.2.6-1/drivers/net/wireless/ath/ath9k/ar9003_mac.c
+--- backports-4.2.6-1.org/drivers/net/wireless/ath/ath9k/ar9003_mac.c  2015-11-15 22:19:39.000000000 +0100
++++ backports-4.2.6-1/drivers/net/wireless/ath/ath9k/ar9003_mac.c      2016-01-27 12:26:21.286626323 +0100
 @@ -39,47 +39,47 @@
              (i->qcu << AR_TxQcuNum_S) | desc_len;
  
@@ -1457,7 +1564,7 @@ diff -Naur backports-3.18.1-1.org/drivers/net/wireless/ath/ath9k/ar9003_mac.c ba
 -      ACCESS_ONCE(ads->ctl11) = (i->pkt_len & AR_FrameLen)
 +      ACCESS_ONCE_RW(ads->ctl11) = (i->pkt_len & AR_FrameLen)
                | (i->flags & ATH9K_TXDESC_VMF ? AR_VirtMoreFrag : 0)
-               | SM(i->txpower, AR_XmitPower0)
+               | SM(i->txpower[0], AR_XmitPower0)
                | (i->flags & ATH9K_TXDESC_VEOL ? AR_VEOL : 0)
 @@ -135,26 +135,26 @@
        val = (i->flags & ATH9K_TXDESC_PAPRD) >> ATH9K_TXDESC_PAPRD_S;
@@ -1486,28 +1593,28 @@ diff -Naur backports-3.18.1-1.org/drivers/net/wireless/ath/ath9k/ar9003_mac.c ba
 -      ACCESS_ONCE(ads->ctl19) = AR_Not_Sounding;
 +      ACCESS_ONCE_RW(ads->ctl19) = AR_Not_Sounding;
  
--      ACCESS_ONCE(ads->ctl20) = SM(i->txpower, AR_XmitPower1);
--      ACCESS_ONCE(ads->ctl21) = SM(i->txpower, AR_XmitPower2);
--      ACCESS_ONCE(ads->ctl22) = SM(i->txpower, AR_XmitPower3);
-+      ACCESS_ONCE_RW(ads->ctl20) = SM(i->txpower, AR_XmitPower1);
-+      ACCESS_ONCE_RW(ads->ctl21) = SM(i->txpower, AR_XmitPower2);
-+      ACCESS_ONCE_RW(ads->ctl22) = SM(i->txpower, AR_XmitPower3);
+-      ACCESS_ONCE(ads->ctl20) = SM(i->txpower[1], AR_XmitPower1);
+-      ACCESS_ONCE(ads->ctl21) = SM(i->txpower[2], AR_XmitPower2);
+-      ACCESS_ONCE(ads->ctl22) = SM(i->txpower[3], AR_XmitPower3);
++      ACCESS_ONCE_RW(ads->ctl20) = SM(i->txpower[1], AR_XmitPower1);
++      ACCESS_ONCE_RW(ads->ctl21) = SM(i->txpower[2], AR_XmitPower2);
++      ACCESS_ONCE_RW(ads->ctl22) = SM(i->txpower[3], AR_XmitPower3);
  }
  
  static u16 ar9003_calc_ptr_chksum(struct ar9003_txc *ads)
-diff -Naur backports-3.18.1-1.org/drivers/net/wireless/ath/ath9k/hw.h backports-3.18.1-1/drivers/net/wireless/ath/ath9k/hw.h
---- backports-3.18.1-1.org/drivers/net/wireless/ath/ath9k/hw.h 2014-12-21 22:37:14.000000000 +0100
-+++ backports-3.18.1-1/drivers/net/wireless/ath/ath9k/hw.h     2014-12-28 14:10:09.564888946 +0100
-@@ -630,7 +630,7 @@
-       /* ANI */
-       void (*ani_cache_ini_regs)(struct ath_hw *ah);
+diff -Naur backports-4.2.6-1.org/drivers/net/wireless/ath/ath9k/hw.h backports-4.2.6-1/drivers/net/wireless/ath/ath9k/hw.h
+--- backports-4.2.6-1.org/drivers/net/wireless/ath/ath9k/hw.h  2015-11-15 22:19:39.000000000 +0100
++++ backports-4.2.6-1/drivers/net/wireless/ath/ath9k/hw.h      2016-01-27 12:33:44.649931973 +0100
+@@ -671,7 +671,7 @@
+ #ifdef CPTCFG_ATH9K_BTCOEX_SUPPORT
+       bool (*is_aic_enabled)(struct ath_hw *ah);
+ #endif /* CPTCFG_ATH9K_BTCOEX_SUPPORT */
 -};
 +} __no_const;
  
  /**
   * struct ath_spec_scan - parameters for Atheros spectral scan
-@@ -708,7 +708,7 @@
+@@ -747,7 +747,7 @@
  #ifdef CPTCFG_ATH9K_BTCOEX_SUPPORT
        void (*set_bt_ant_diversity)(struct ath_hw *hw, bool enable);
  #endif
@@ -1516,10 +1623,21 @@ diff -Naur backports-3.18.1-1.org/drivers/net/wireless/ath/ath9k/hw.h backports-
  
  struct ath_nf_limits {
        s16 max;
-diff -Naur backports-3.18.1-1.org/drivers/net/wireless/ath/ath9k/main.c backports-3.18.1-1/drivers/net/wireless/ath/ath9k/main.c
---- backports-3.18.1-1.org/drivers/net/wireless/ath/ath9k/main.c       2014-12-21 22:37:14.000000000 +0100
-+++ backports-3.18.1-1/drivers/net/wireless/ath/ath9k/main.c   2014-12-28 14:24:49.169250593 +0100
-@@ -2454,16 +2454,18 @@
+diff -Naur backports-4.2.6-1.org/drivers/net/wireless/ath/ath9k/Kconfig backports-4.2.6-1/drivers/net/wireless/ath/ath9k/Kconfig
+--- backports-4.2.6-1.org/drivers/net/wireless/ath/ath9k/Kconfig       2015-11-15 22:19:40.000000000 +0100
++++ backports-4.2.6-1/drivers/net/wireless/ath/ath9k/Kconfig   2016-01-27 12:34:48.923262299 +0100
+@@ -5,7 +5,6 @@
+       tristate
+       depends on m
+       select ATH_COMMON
+-      depends on DEBUG_FS
+       depends on RELAY
+ config ATH9K_DFS_DEBUGFS
+       def_bool y
+diff -Naur backports-4.2.6-1.org/drivers/net/wireless/ath/ath9k/main.c backports-4.2.6-1/drivers/net/wireless/ath/ath9k/main.c
+--- backports-4.2.6-1.org/drivers/net/wireless/ath/ath9k/main.c        2015-11-15 22:19:39.000000000 +0100
++++ backports-4.2.6-1/drivers/net/wireless/ath/ath9k/main.c    2016-01-27 12:26:21.289959656 +0100
+@@ -2574,16 +2574,18 @@
        if (!ath9k_is_chanctx_enabled())
                return;
  
@@ -1548,9 +1666,9 @@ diff -Naur backports-3.18.1-1.org/drivers/net/wireless/ath/ath9k/main.c backport
  }
  
  #endif
-diff -Naur backports-3.18.1-1.org/drivers/net/wireless/b43/phy_lp.c backports-3.18.1-1/drivers/net/wireless/b43/phy_lp.c
---- backports-3.18.1-1.org/drivers/net/wireless/b43/phy_lp.c   2014-12-21 22:37:14.000000000 +0100
-+++ backports-3.18.1-1/drivers/net/wireless/b43/phy_lp.c       2014-12-28 14:10:09.564888946 +0100
+diff -Naur backports-4.2.6-1.org/drivers/net/wireless/b43/phy_lp.c backports-4.2.6-1/drivers/net/wireless/b43/phy_lp.c
+--- backports-4.2.6-1.org/drivers/net/wireless/b43/phy_lp.c    2015-11-15 22:19:39.000000000 +0100
++++ backports-4.2.6-1/drivers/net/wireless/b43/phy_lp.c        2016-01-27 12:26:21.289959656 +0100
 @@ -2502,7 +2502,7 @@
  {
        struct ssb_bus *bus = dev->dev->sdev->bus;
@@ -1560,9 +1678,9 @@ diff -Naur backports-3.18.1-1.org/drivers/net/wireless/b43/phy_lp.c backports-3.
        u32 crystal_freq = bus->chipco.pmu.crystalfreq * 1000;
        u32 freqref, vco_freq, val1, val2, val3, timeout, timeoutref, count;
        u16 old_comm15, scale;
-diff -Naur backports-3.18.1-1.org/drivers/net/wireless/iwlegacy/3945-mac.c backports-3.18.1-1/drivers/net/wireless/iwlegacy/3945-mac.c
---- backports-3.18.1-1.org/drivers/net/wireless/iwlegacy/3945-mac.c    2014-12-21 22:37:14.000000000 +0100
-+++ backports-3.18.1-1/drivers/net/wireless/iwlegacy/3945-mac.c        2014-12-28 14:10:09.564888946 +0100
+diff -Naur backports-4.2.6-1.org/drivers/net/wireless/iwlegacy/3945-mac.c backports-4.2.6-1/drivers/net/wireless/iwlegacy/3945-mac.c
+--- backports-4.2.6-1.org/drivers/net/wireless/iwlegacy/3945-mac.c     2015-11-15 22:19:40.000000000 +0100
++++ backports-4.2.6-1/drivers/net/wireless/iwlegacy/3945-mac.c 2016-01-27 12:26:21.289959656 +0100
 @@ -3633,7 +3633,9 @@
         */
        if (il3945_mod_params.disable_hw_scan) {
@@ -1574,9 +1692,9 @@ diff -Naur backports-3.18.1-1.org/drivers/net/wireless/iwlegacy/3945-mac.c backp
        }
  
        D_INFO("*** LOAD DRIVER ***\n");
-diff -Naur backports-3.18.1-1.org/drivers/net/wireless/iwlwifi/dvm/debugfs.c backports-3.18.1-1/drivers/net/wireless/iwlwifi/dvm/debugfs.c
---- backports-3.18.1-1.org/drivers/net/wireless/iwlwifi/dvm/debugfs.c  2014-12-21 22:37:14.000000000 +0100
-+++ backports-3.18.1-1/drivers/net/wireless/iwlwifi/dvm/debugfs.c      2014-12-28 14:10:09.564888946 +0100
+diff -Naur backports-4.2.6-1.org/drivers/net/wireless/iwlwifi/dvm/debugfs.c backports-4.2.6-1/drivers/net/wireless/iwlwifi/dvm/debugfs.c
+--- backports-4.2.6-1.org/drivers/net/wireless/iwlwifi/dvm/debugfs.c   2015-11-15 22:19:39.000000000 +0100
++++ backports-4.2.6-1/drivers/net/wireless/iwlwifi/dvm/debugfs.c       2016-01-27 12:26:21.289959656 +0100
 @@ -188,7 +188,7 @@
  {
        struct iwl_priv *priv = file->private_data;
@@ -1709,10 +1827,10 @@ diff -Naur backports-3.18.1-1.org/drivers/net/wireless/iwlwifi/dvm/debugfs.c bac
  
        memset(buf, 0, sizeof(buf));
        buf_size = min(count, sizeof(buf) - 1);
-diff -Naur backports-3.18.1-1.org/drivers/net/wireless/iwlwifi/pcie/trans.c backports-3.18.1-1/drivers/net/wireless/iwlwifi/pcie/trans.c
---- backports-3.18.1-1.org/drivers/net/wireless/iwlwifi/pcie/trans.c   2014-12-21 22:37:14.000000000 +0100
-+++ backports-3.18.1-1/drivers/net/wireless/iwlwifi/pcie/trans.c       2014-12-28 14:10:09.564888946 +0100
-@@ -1689,7 +1689,7 @@
+diff -Naur backports-4.2.6-1.org/drivers/net/wireless/iwlwifi/pcie/trans.c backports-4.2.6-1/drivers/net/wireless/iwlwifi/pcie/trans.c
+--- backports-4.2.6-1.org/drivers/net/wireless/iwlwifi/pcie/trans.c    2015-11-15 22:19:39.000000000 +0100
++++ backports-4.2.6-1/drivers/net/wireless/iwlwifi/pcie/trans.c        2016-01-27 12:26:21.289959656 +0100
+@@ -1950,7 +1950,7 @@
        struct isr_statistics *isr_stats = &trans_pcie->isr_stats;
  
        char buf[8];
@@ -1721,7 +1839,7 @@ diff -Naur backports-3.18.1-1.org/drivers/net/wireless/iwlwifi/pcie/trans.c back
        u32 reset_flag;
  
        memset(buf, 0, sizeof(buf));
-@@ -1710,7 +1710,7 @@
+@@ -1971,7 +1971,7 @@
  {
        struct iwl_trans *trans = file->private_data;
        char buf[8];
@@ -1730,10 +1848,10 @@ diff -Naur backports-3.18.1-1.org/drivers/net/wireless/iwlwifi/pcie/trans.c back
        int csr;
  
        memset(buf, 0, sizeof(buf));
-diff -Naur backports-3.18.1-1.org/drivers/net/wireless/mac80211_hwsim.c backports-3.18.1-1/drivers/net/wireless/mac80211_hwsim.c
---- backports-3.18.1-1.org/drivers/net/wireless/mac80211_hwsim.c       2014-12-21 22:37:14.000000000 +0100
-+++ backports-3.18.1-1/drivers/net/wireless/mac80211_hwsim.c   2014-12-28 14:10:09.568888967 +0100
-@@ -2578,20 +2578,20 @@
+diff -Naur backports-4.2.6-1.org/drivers/net/wireless/mac80211_hwsim.c backports-4.2.6-1/drivers/net/wireless/mac80211_hwsim.c
+--- backports-4.2.6-1.org/drivers/net/wireless/mac80211_hwsim.c        2015-11-15 22:19:39.000000000 +0100
++++ backports-4.2.6-1/drivers/net/wireless/mac80211_hwsim.c    2016-01-27 12:26:21.289959656 +0100
+@@ -3150,20 +3150,20 @@
        if (channels < 1)
                return -EINVAL;
  
@@ -1768,9 +1886,9 @@ diff -Naur backports-3.18.1-1.org/drivers/net/wireless/mac80211_hwsim.c backport
  
        spin_lock_init(&hwsim_radio_lock);
        INIT_LIST_HEAD(&hwsim_radios);
-diff -Naur backports-3.18.1-1.org/drivers/net/wireless/rndis_wlan.c backports-3.18.1-1/drivers/net/wireless/rndis_wlan.c
---- backports-3.18.1-1.org/drivers/net/wireless/rndis_wlan.c   2014-12-21 22:37:14.000000000 +0100
-+++ backports-3.18.1-1/drivers/net/wireless/rndis_wlan.c       2014-12-28 14:10:09.568888967 +0100
+diff -Naur backports-4.2.6-1.org/drivers/net/wireless/rndis_wlan.c backports-4.2.6-1/drivers/net/wireless/rndis_wlan.c
+--- backports-4.2.6-1.org/drivers/net/wireless/rndis_wlan.c    2015-11-15 22:19:39.000000000 +0100
++++ backports-4.2.6-1/drivers/net/wireless/rndis_wlan.c        2016-01-27 12:26:21.293292990 +0100
 @@ -1236,7 +1236,7 @@
  
        netdev_dbg(usbdev->net, "%s(): %i\n", __func__, rts_threshold);
@@ -1780,9 +1898,9 @@ diff -Naur backports-3.18.1-1.org/drivers/net/wireless/rndis_wlan.c backports-3.
                rts_threshold = 2347;
  
        tmp = cpu_to_le32(rts_threshold);
-diff -Naur backports-3.18.1-1.org/drivers/net/wireless/rt2x00/rt2x00.h backports-3.18.1-1/drivers/net/wireless/rt2x00/rt2x00.h
---- backports-3.18.1-1.org/drivers/net/wireless/rt2x00/rt2x00.h        2014-12-21 22:37:14.000000000 +0100
-+++ backports-3.18.1-1/drivers/net/wireless/rt2x00/rt2x00.h    2014-12-28 14:10:09.568888967 +0100
+diff -Naur backports-4.2.6-1.org/drivers/net/wireless/rt2x00/rt2x00.h backports-4.2.6-1/drivers/net/wireless/rt2x00/rt2x00.h
+--- backports-4.2.6-1.org/drivers/net/wireless/rt2x00/rt2x00.h 2015-11-15 22:19:39.000000000 +0100
++++ backports-4.2.6-1/drivers/net/wireless/rt2x00/rt2x00.h     2016-01-27 12:26:21.293292990 +0100
 @@ -375,7 +375,7 @@
         * for hardware which doesn't support hardware
         * sequence counting.
@@ -1792,9 +1910,9 @@ diff -Naur backports-3.18.1-1.org/drivers/net/wireless/rt2x00/rt2x00.h backports
  };
  
  static inline struct rt2x00_intf* vif_to_intf(struct ieee80211_vif *vif)
-diff -Naur backports-3.18.1-1.org/drivers/net/wireless/rt2x00/rt2x00queue.c backports-3.18.1-1/drivers/net/wireless/rt2x00/rt2x00queue.c
---- backports-3.18.1-1.org/drivers/net/wireless/rt2x00/rt2x00queue.c   2014-12-21 22:37:14.000000000 +0100
-+++ backports-3.18.1-1/drivers/net/wireless/rt2x00/rt2x00queue.c       2014-12-28 14:10:09.568888967 +0100
+diff -Naur backports-4.2.6-1.org/drivers/net/wireless/rt2x00/rt2x00queue.c backports-4.2.6-1/drivers/net/wireless/rt2x00/rt2x00queue.c
+--- backports-4.2.6-1.org/drivers/net/wireless/rt2x00/rt2x00queue.c    2015-11-15 22:19:39.000000000 +0100
++++ backports-4.2.6-1/drivers/net/wireless/rt2x00/rt2x00queue.c        2016-01-27 12:26:21.293292990 +0100
 @@ -224,9 +224,9 @@
         * sequence counter given by mac80211.
         */
@@ -1807,9 +1925,9 @@ diff -Naur backports-3.18.1-1.org/drivers/net/wireless/rt2x00/rt2x00queue.c back
  
        hdr->seq_ctrl &= cpu_to_le16(IEEE80211_SCTL_FRAG);
        hdr->seq_ctrl |= cpu_to_le16(seqno);
-diff -Naur backports-3.18.1-1.org/drivers/net/wireless/ti/wl1251/sdio.c backports-3.18.1-1/drivers/net/wireless/ti/wl1251/sdio.c
---- backports-3.18.1-1.org/drivers/net/wireless/ti/wl1251/sdio.c       2014-12-21 22:37:14.000000000 +0100
-+++ backports-3.18.1-1/drivers/net/wireless/ti/wl1251/sdio.c   2014-12-28 14:10:09.568888967 +0100
+diff -Naur backports-4.2.6-1.org/drivers/net/wireless/ti/wl1251/sdio.c backports-4.2.6-1/drivers/net/wireless/ti/wl1251/sdio.c
+--- backports-4.2.6-1.org/drivers/net/wireless/ti/wl1251/sdio.c        2015-11-15 22:19:39.000000000 +0100
++++ backports-4.2.6-1/drivers/net/wireless/ti/wl1251/sdio.c    2016-01-27 12:26:21.293292990 +0100
 @@ -282,13 +282,17 @@
  
                irq_set_irq_type(wl->irq, IRQ_TYPE_EDGE_RISING);
@@ -1832,10 +1950,10 @@ diff -Naur backports-3.18.1-1.org/drivers/net/wireless/ti/wl1251/sdio.c backport
  
                wl1251_info("using SDIO interrupt");
        }
-diff -Naur backports-3.18.1-1.org/drivers/net/wireless/ti/wl12xx/main.c backports-3.18.1-1/drivers/net/wireless/ti/wl12xx/main.c
---- backports-3.18.1-1.org/drivers/net/wireless/ti/wl12xx/main.c       2014-12-21 22:37:14.000000000 +0100
-+++ backports-3.18.1-1/drivers/net/wireless/ti/wl12xx/main.c   2014-12-28 14:10:09.568888967 +0100
-@@ -656,7 +656,9 @@
+diff -Naur backports-4.2.6-1.org/drivers/net/wireless/ti/wl12xx/main.c backports-4.2.6-1/drivers/net/wireless/ti/wl12xx/main.c
+--- backports-4.2.6-1.org/drivers/net/wireless/ti/wl12xx/main.c        2015-11-15 22:19:39.000000000 +0100
++++ backports-4.2.6-1/drivers/net/wireless/ti/wl12xx/main.c    2016-01-27 12:26:21.293292990 +0100
+@@ -655,7 +655,9 @@
                       sizeof(wl->conf.mem));
  
                /* read data preparation is only needed by wl127x */
@@ -1846,7 +1964,7 @@ diff -Naur backports-3.18.1-1.org/drivers/net/wireless/ti/wl12xx/main.c backport
  
                wlcore_set_min_fw_ver(wl, WL127X_CHIP_VER,
                              WL127X_IFTYPE_SR_VER,  WL127X_MAJOR_SR_VER,
-@@ -681,7 +683,9 @@
+@@ -680,7 +682,9 @@
                       sizeof(wl->conf.mem));
  
                /* read data preparation is only needed by wl127x */
@@ -1857,10 +1975,10 @@ diff -Naur backports-3.18.1-1.org/drivers/net/wireless/ti/wl12xx/main.c backport
  
                wlcore_set_min_fw_ver(wl, WL127X_CHIP_VER,
                              WL127X_IFTYPE_SR_VER,  WL127X_MAJOR_SR_VER,
-diff -Naur backports-3.18.1-1.org/drivers/net/wireless/ti/wl18xx/main.c backports-3.18.1-1/drivers/net/wireless/ti/wl18xx/main.c
---- backports-3.18.1-1.org/drivers/net/wireless/ti/wl18xx/main.c       2014-12-21 22:37:14.000000000 +0100
-+++ backports-3.18.1-1/drivers/net/wireless/ti/wl18xx/main.c   2014-12-28 14:10:09.568888967 +0100
-@@ -1916,8 +1916,10 @@
+diff -Naur backports-4.2.6-1.org/drivers/net/wireless/ti/wl18xx/main.c backports-4.2.6-1/drivers/net/wireless/ti/wl18xx/main.c
+--- backports-4.2.6-1.org/drivers/net/wireless/ti/wl18xx/main.c        2015-11-15 22:19:39.000000000 +0100
++++ backports-4.2.6-1/drivers/net/wireless/ti/wl18xx/main.c    2016-01-27 12:26:21.293292990 +0100
+@@ -1952,8 +1952,10 @@
        }
  
        if (!checksum_param) {
@@ -1873,9 +1991,9 @@ diff -Naur backports-3.18.1-1.org/drivers/net/wireless/ti/wl18xx/main.c backport
        }
  
        /* Enable 11a Band only if we have 5G antennas */
-diff -Naur backports-3.18.1-1.org/drivers/net/wireless/zd1211rw/zd_usb.c backports-3.18.1-1/drivers/net/wireless/zd1211rw/zd_usb.c
---- backports-3.18.1-1.org/drivers/net/wireless/zd1211rw/zd_usb.c      2014-12-21 22:37:14.000000000 +0100
-+++ backports-3.18.1-1/drivers/net/wireless/zd1211rw/zd_usb.c  2014-12-28 14:10:09.568888967 +0100
+diff -Naur backports-4.2.6-1.org/drivers/net/wireless/zd1211rw/zd_usb.c backports-4.2.6-1/drivers/net/wireless/zd1211rw/zd_usb.c
+--- backports-4.2.6-1.org/drivers/net/wireless/zd1211rw/zd_usb.c       2015-11-15 22:19:39.000000000 +0100
++++ backports-4.2.6-1/drivers/net/wireless/zd1211rw/zd_usb.c   2016-01-27 12:26:21.293292990 +0100
 @@ -385,7 +385,7 @@
  {
        struct zd_usb *usb = urb->context;
@@ -1885,9 +2003,9 @@ diff -Naur backports-3.18.1-1.org/drivers/net/wireless/zd1211rw/zd_usb.c backpor
        u16 int_num;
  
        ZD_ASSERT(in_interrupt());
-diff -Naur backports-3.18.1-1.org/drivers/nfc/nfcwilink.c backports-3.18.1-1/drivers/nfc/nfcwilink.c
---- backports-3.18.1-1.org/drivers/nfc/nfcwilink.c     2014-12-21 22:37:14.000000000 +0100
-+++ backports-3.18.1-1/drivers/nfc/nfcwilink.c 2014-12-28 14:10:09.568888967 +0100
+diff -Naur backports-4.2.6-1.org/drivers/nfc/nfcwilink.c backports-4.2.6-1/drivers/nfc/nfcwilink.c
+--- backports-4.2.6-1.org/drivers/nfc/nfcwilink.c      2015-11-15 22:19:39.000000000 +0100
++++ backports-4.2.6-1/drivers/nfc/nfcwilink.c  2016-01-27 12:26:21.293292990 +0100
 @@ -497,7 +497,7 @@
  
  static int nfcwilink_probe(struct platform_device *pdev)
@@ -1897,9 +2015,9 @@ diff -Naur backports-3.18.1-1.org/drivers/nfc/nfcwilink.c backports-3.18.1-1/dri
        int rc;
        __u32 protocols;
  
-diff -Naur backports-3.18.1-1.org/include/linux/gracl_compat.h backports-3.18.1-1/include/linux/gracl_compat.h
---- backports-3.18.1-1.org/include/linux/gracl_compat.h        1970-01-01 01:00:00.000000000 +0100
-+++ backports-3.18.1-1/include/linux/gracl_compat.h    2014-12-28 14:10:09.684889542 +0100
+diff -Naur backports-4.2.6-1.org/include/linux/gracl_compat.h backports-4.2.6-1/include/linux/gracl_compat.h
+--- backports-4.2.6-1.org/include/linux/gracl_compat.h 1970-01-01 01:00:00.000000000 +0100
++++ backports-4.2.6-1/include/linux/gracl_compat.h     2016-01-27 12:26:26.289959354 +0100
 @@ -0,0 +1,156 @@
 +#ifndef GR_ACL_COMPAT_H
 +#define GR_ACL_COMPAT_H
@@ -1924,7 +2042,7 @@ diff -Naur backports-3.18.1-1.org/include/linux/gracl_compat.h backports-3.18.1-
 +
 +struct acl_subject_label_compat {
 +      compat_uptr_t filename;
-+      compat_ino_t inode;
++      compat_u64 inode;
 +      __u32 device;
 +      __u32 mode;
 +      kernel_cap_t cap_mask;
@@ -2012,7 +2130,7 @@ diff -Naur backports-3.18.1-1.org/include/linux/gracl_compat.h backports-3.18.1-
 +
 +struct acl_object_label_compat {
 +      compat_uptr_t filename;
-+      compat_ino_t inode;
++      compat_u64 inode;
 +      __u32 device;
 +      __u32 mode;
 +
@@ -2044,7 +2162,7 @@ diff -Naur backports-3.18.1-1.org/include/linux/gracl_compat.h backports-3.18.1-
 +      unsigned char sp_role[GR_SPROLE_LEN];
 +      compat_uptr_t sprole_pws;
 +      __u32 segv_device;
-+      compat_ino_t segv_inode;
++      compat_u64 segv_inode;
 +      uid_t segv_uid;
 +      __u16 num_sprole_pws;
 +      __u16 mode;
@@ -2057,10 +2175,10 @@ diff -Naur backports-3.18.1-1.org/include/linux/gracl_compat.h backports-3.18.1-
 +};
 +
 +#endif
-diff -Naur backports-3.18.1-1.org/include/linux/gracl.h backports-3.18.1-1/include/linux/gracl.h
---- backports-3.18.1-1.org/include/linux/gracl.h       1970-01-01 01:00:00.000000000 +0100
-+++ backports-3.18.1-1/include/linux/gracl.h   2014-12-28 14:10:09.684889542 +0100
-@@ -0,0 +1,340 @@
+diff -Naur backports-4.2.6-1.org/include/linux/gracl.h backports-4.2.6-1/include/linux/gracl.h
+--- backports-4.2.6-1.org/include/linux/gracl.h        1970-01-01 01:00:00.000000000 +0100
++++ backports-4.2.6-1/include/linux/gracl.h    2016-01-27 12:26:26.289959354 +0100
+@@ -0,0 +1,342 @@
 +#ifndef GR_ACL_H
 +#define GR_ACL_H
 +
@@ -2072,8 +2190,8 @@ diff -Naur backports-3.18.1-1.org/include/linux/gracl.h backports-3.18.1-1/inclu
 +
 +/* Major status information */
 +
-+#define GR_VERSION  "grsecurity 3.0"
-+#define GRSECURITY_VERSION 0x3000
++#define GR_VERSION  "grsecurity 3.1"
++#define GRSECURITY_VERSION 0x3100
 +
 +enum {
 +      GR_SHUTDOWN = 0,
@@ -2118,7 +2236,7 @@ diff -Naur backports-3.18.1-1.org/include/linux/gracl.h backports-3.18.1-1/inclu
 +
 +struct name_entry {
 +      __u32 key;
-+      ino_t inode;
++      u64 inode;
 +      dev_t device;
 +      char *name;
 +      __u16 len;
@@ -2166,7 +2284,7 @@ diff -Naur backports-3.18.1-1.org/include/linux/gracl.h backports-3.18.1-1/inclu
 +
 +struct acl_subject_label {
 +      char *filename;
-+      ino_t inode;
++      u64 inode;
 +      dev_t device;
 +      __u32 mode;
 +      kernel_cap_t cap_mask;
@@ -2254,7 +2372,7 @@ diff -Naur backports-3.18.1-1.org/include/linux/gracl.h backports-3.18.1-1/inclu
 +
 +struct acl_object_label {
 +      char *filename;
-+      ino_t inode;
++      u64 inode;
 +      dev_t device;
 +      __u32 mode;
 +
@@ -2290,7 +2408,7 @@ diff -Naur backports-3.18.1-1.org/include/linux/gracl.h backports-3.18.1-1/inclu
 +      unsigned char sp_role[GR_SPROLE_LEN];
 +      struct sprole_pw *sprole_pws;
 +      dev_t segv_device;
-+      ino_t segv_inode;
++      u64 segv_inode;
 +      uid_t segv_uid;
 +      __u16 num_sprole_pws;
 +      __u16 mode;
@@ -2362,9 +2480,11 @@ diff -Naur backports-3.18.1-1.org/include/linux/gracl.h backports-3.18.1-1/inclu
 +}
 +
 +static __inline__ unsigned int
-+gr_fhash(const ino_t ino, const dev_t dev, const unsigned int sz)
++gr_fhash(const u64 ino, const dev_t dev, const unsigned int sz)
 +{
-+      return (((ino + dev) ^ ((ino << 13) + (ino << 23) + (dev << 9))) % sz);
++      unsigned int rem;
++      div_u64_rem((ino + dev) ^ ((ino << 13) + (ino << 23) + (dev << 9)), sz, &rem);
++      return rem;
 +}
 +
 +static __inline__ unsigned int
@@ -2401,9 +2521,9 @@ diff -Naur backports-3.18.1-1.org/include/linux/gracl.h backports-3.18.1-1/inclu
 +
 +#endif
 +
-diff -Naur backports-3.18.1-1.org/include/linux/gralloc.h backports-3.18.1-1/include/linux/gralloc.h
---- backports-3.18.1-1.org/include/linux/gralloc.h     1970-01-01 01:00:00.000000000 +0100
-+++ backports-3.18.1-1/include/linux/gralloc.h 2014-12-28 14:10:09.684889542 +0100
+diff -Naur backports-4.2.6-1.org/include/linux/gralloc.h backports-4.2.6-1/include/linux/gralloc.h
+--- backports-4.2.6-1.org/include/linux/gralloc.h      1970-01-01 01:00:00.000000000 +0100
++++ backports-4.2.6-1/include/linux/gralloc.h  2016-01-27 12:26:26.289959354 +0100
 @@ -0,0 +1,9 @@
 +#ifndef __GRALLOC_H
 +#define __GRALLOC_H
@@ -2414,9 +2534,9 @@ diff -Naur backports-3.18.1-1.org/include/linux/gralloc.h backports-3.18.1-1/inc
 +void *acl_alloc_num(unsigned long num, unsigned long len);
 +
 +#endif
-diff -Naur backports-3.18.1-1.org/include/linux/grdefs.h backports-3.18.1-1/include/linux/grdefs.h
---- backports-3.18.1-1.org/include/linux/grdefs.h      1970-01-01 01:00:00.000000000 +0100
-+++ backports-3.18.1-1/include/linux/grdefs.h  2014-12-28 14:10:09.688889562 +0100
+diff -Naur backports-4.2.6-1.org/include/linux/grdefs.h backports-4.2.6-1/include/linux/grdefs.h
+--- backports-4.2.6-1.org/include/linux/grdefs.h       1970-01-01 01:00:00.000000000 +0100
++++ backports-4.2.6-1/include/linux/grdefs.h   2016-01-27 12:26:26.289959354 +0100
 @@ -0,0 +1,140 @@
 +#ifndef GRDEFS_H
 +#define GRDEFS_H
@@ -2558,10 +2678,10 @@ diff -Naur backports-3.18.1-1.org/include/linux/grdefs.h backports-3.18.1-1/incl
 +};
 +
 +#endif
-diff -Naur backports-3.18.1-1.org/include/linux/grinternal.h backports-3.18.1-1/include/linux/grinternal.h
---- backports-3.18.1-1.org/include/linux/grinternal.h  1970-01-01 01:00:00.000000000 +0100
-+++ backports-3.18.1-1/include/linux/grinternal.h      2014-12-28 14:10:09.688889562 +0100
-@@ -0,0 +1,229 @@
+diff -Naur backports-4.2.6-1.org/include/linux/grinternal.h backports-4.2.6-1/include/linux/grinternal.h
+--- backports-4.2.6-1.org/include/linux/grinternal.h   1970-01-01 01:00:00.000000000 +0100
++++ backports-4.2.6-1/include/linux/grinternal.h       2016-01-27 12:26:26.289959354 +0100
+@@ -0,0 +1,230 @@
 +#ifndef __GRINTERNAL_H
 +#define __GRINTERNAL_H
 +
@@ -2621,6 +2741,7 @@ diff -Naur backports-3.18.1-1.org/include/linux/grinternal.h backports-3.18.1-1/
 +extern int grsec_enable_chroot_nice;
 +extern int grsec_enable_chroot_execlog;
 +extern int grsec_enable_chroot_caps;
++extern int grsec_enable_chroot_rename;
 +extern int grsec_enable_chroot_sysctl;
 +extern int grsec_enable_chroot_unix;
 +extern int grsec_enable_symlinkown;
@@ -2774,7 +2895,7 @@ diff -Naur backports-3.18.1-1.org/include/linux/grinternal.h backports-3.18.1-1/
 +#define gr_log_fs_str(audit, msg, dentry, mnt, str) gr_log_varargs(audit, msg, GR_FILENAME_STR, dentry, mnt, str)
 +#define gr_log_fs_int2(audit, msg, dentry, mnt, num1, num2) gr_log_varargs(audit, msg, GR_FILENAME_TWO_INT, dentry, mnt, num1, num2)
 +#define gr_log_fs_int2_str(audit, msg, dentry, mnt, num1, num2, str) gr_log_varargs(audit, msg, GR_FILENAME_TWO_INT_STR, dentry, mnt, num1, num2, str)
-+#define gr_log_textrel_ulong_ulong(audit, msg, file, ulong1, ulong2) gr_log_varargs(audit, msg, GR_TEXTREL, file, ulong1, ulong2)
++#define gr_log_textrel_ulong_ulong(audit, msg, str, file, ulong1, ulong2) gr_log_varargs(audit, msg, GR_TEXTREL, str, file, ulong1, ulong2)
 +#define gr_log_ptrace(audit, msg, task) gr_log_varargs(audit, msg, GR_PTRACE, task)
 +#define gr_log_res_ulong2_str(audit, msg, task, ulong1, str, ulong2) gr_log_varargs(audit, msg, GR_RESOURCE, task, ulong1, str, ulong2)
 +#define gr_log_cap(audit, msg, task, str) gr_log_varargs(audit, msg, GR_CAP, task, str)
@@ -2791,10 +2912,10 @@ diff -Naur backports-3.18.1-1.org/include/linux/grinternal.h backports-3.18.1-1/
 +#endif
 +
 +#endif
-diff -Naur backports-3.18.1-1.org/include/linux/grmsg.h backports-3.18.1-1/include/linux/grmsg.h
---- backports-3.18.1-1.org/include/linux/grmsg.h       1970-01-01 01:00:00.000000000 +0100
-+++ backports-3.18.1-1/include/linux/grmsg.h   2014-12-28 14:10:09.688889562 +0100
-@@ -0,0 +1,117 @@
+diff -Naur backports-4.2.6-1.org/include/linux/grmsg.h backports-4.2.6-1/include/linux/grmsg.h
+--- backports-4.2.6-1.org/include/linux/grmsg.h        1970-01-01 01:00:00.000000000 +0100
++++ backports-4.2.6-1/include/linux/grmsg.h    2016-01-27 12:26:26.289959354 +0100
+@@ -0,0 +1,118 @@
 +#define DEFAULTSECMSG "%.256s[%.16s:%d] uid/euid:%u/%u gid/egid:%u/%u, parent %.256s[%.16s:%d] uid/euid:%u/%u gid/egid:%u/%u"
 +#define GR_ACL_PROCACCT_MSG "%.256s[%.16s:%d] IP:%pI4 TTY:%.64s uid/euid:%u/%u gid/egid:%u/%u run time:[%ud %uh %um %us] cpu time:[%ud %uh %um %us] %s with exit code %ld, parent %.256s[%.16s:%d] IP:%pI4 TTY:%.64s uid/euid:%u/%u gid/egid:%u/%u"
 +#define GR_PTRACE_ACL_MSG "denied ptrace of %.950s(%.16s:%d) by "
@@ -2838,6 +2959,7 @@ diff -Naur backports-3.18.1-1.org/include/linux/grmsg.h backports-3.18.1-1/inclu
 +#define GR_ATIME_ACL_MSG "%s access time change of %.950s by "
 +#define GR_ACCESS_ACL_MSG "%s access of %.950s for%s%s%s by "
 +#define GR_CHROOT_CHROOT_MSG "denied double chroot to %.950s by "
++#define GR_CHROOT_RENAME_MSG "denied bad rename of %.950s out of a chroot by "
 +#define GR_CHMOD_CHROOT_MSG "denied chmod +s of %.950s by "
 +#define GR_CHMOD_ACL_MSG "%s chmod of %.950s by "
 +#define GR_CHROOT_FCHDIR_MSG "denied fchdir outside of chroot to %.950s by "
@@ -2900,7 +3022,7 @@ diff -Naur backports-3.18.1-1.org/include/linux/grmsg.h backports-3.18.1-1/inclu
 +#define GR_RESOURCE_MSG "denied resource overstep by requesting %lu for %.16s against limit %lu for "
 +#define GR_RWXMMAP_MSG "denied RWX mmap of %.950s by "
 +#define GR_RWXMPROTECT_MSG "denied RWX mprotect of %.950s by "
-+#define GR_TEXTREL_AUDIT_MSG "denied text relocation in %.950s, VMA:0x%08lx 0x%08lx by "
++#define GR_TEXTREL_AUDIT_MSG "allowed %s text relocation transition in %.950s, VMA:0x%08lx 0x%08lx by "
 +#define GR_PTGNUSTACK_MSG "denied marking stack executable as requested by PT_GNU_STACK marking in %.950s by "
 +#define GR_VM86_MSG "denied use of vm86 by "
 +#define GR_PTRACE_AUDIT_MSG "process %.950s(%.16s:%d) attached to via ptrace by "
@@ -2912,10 +3034,10 @@ diff -Naur backports-3.18.1-1.org/include/linux/grmsg.h backports-3.18.1-1/inclu
 +#define GR_BRUTE_SUID_MSG "bruteforce prevention initiated due to crash of %.950s against uid %u, banning suid/sgid execs for %u minutes.  Please investigate the crash report for "
 +#define GR_IPC_DENIED_MSG "denied %s of overly-permissive IPC object with creator uid %u by "
 +#define GR_MSRWRITE_MSG "denied write to CPU MSR by "
-diff -Naur backports-3.18.1-1.org/include/linux/grsecurity.h backports-3.18.1-1/include/linux/grsecurity.h
---- backports-3.18.1-1.org/include/linux/grsecurity.h  1970-01-01 01:00:00.000000000 +0100
-+++ backports-3.18.1-1/include/linux/grsecurity.h      2014-12-28 14:10:09.688889562 +0100
-@@ -0,0 +1,254 @@
+diff -Naur backports-4.2.6-1.org/include/linux/grsecurity.h backports-4.2.6-1/include/linux/grsecurity.h
+--- backports-4.2.6-1.org/include/linux/grsecurity.h   1970-01-01 01:00:00.000000000 +0100
++++ backports-4.2.6-1/include/linux/grsecurity.h       2016-01-27 12:26:26.289959354 +0100
+@@ -0,0 +1,255 @@
 +#ifndef GR_SECURITY_H
 +#define GR_SECURITY_H
 +#include <linux/fs.h>
@@ -2924,6 +3046,12 @@ diff -Naur backports-3.18.1-1.org/include/linux/grsecurity.h backports-3.18.1-1/
 +#include <linux/gracl.h>
 +
 +/* notify of brain-dead configs */
++#if defined(CONFIG_DEBUG_FS) && defined(CONFIG_GRKERNSEC_KMEM)
++#error "CONFIG_DEBUG_FS being enabled is a security risk when CONFIG_GRKERNSEC_KMEM is enabled"
++#endif
++#if defined(CONFIG_PROC_PAGE_MONITOR) && defined(CONFIG_GRKERNSEC)
++#error "CONFIG_PROC_PAGE_MONITOR is a security risk"
++#endif
 +#if defined(CONFIG_GRKERNSEC_PROC_USER) && defined(CONFIG_GRKERNSEC_PROC_USERGROUP)
 +#error "CONFIG_GRKERNSEC_PROC_USER and CONFIG_GRKERNSEC_PROC_USERGROUP cannot both be enabled."
 +#endif
@@ -3002,15 +3130,13 @@ diff -Naur backports-3.18.1-1.org/include/linux/grsecurity.h backports-3.18.1-1/
 +                             const struct vfsmount *mnt);
 +void gr_log_remount(const char *devname, const int retval);
 +void gr_log_unmount(const char *devname, const int retval);
-+void gr_log_mount(const char *from, const char *to, const int retval);
-+void gr_log_textrel(struct vm_area_struct *vma);
++void gr_log_mount(const char *from, struct path *to, const int retval);
++void gr_log_textrel(struct vm_area_struct *vma, bool is_textrel_rw);
 +void gr_log_ptgnustack(struct file *file);
 +void gr_log_rwxmmap(struct file *file);
 +void gr_log_rwxmprotect(struct vm_area_struct *vma);
 +
-+int gr_handle_follow_link(const struct inode *parent,
-+                               const struct inode *inode,
-+                               const struct dentry *dentry,
++int gr_handle_follow_link(const struct dentry *dentry,
 +                               const struct vfsmount *mnt);
 +int gr_handle_fifo(const struct dentry *dentry,
 +                        const struct vfsmount *mnt,
@@ -3018,8 +3144,7 @@ diff -Naur backports-3.18.1-1.org/include/linux/grsecurity.h backports-3.18.1-1/
 +                        const int acc_mode);
 +int gr_handle_hardlink(const struct dentry *dentry,
 +                            const struct vfsmount *mnt,
-+                            struct inode *inode,
-+                            const int mode, const struct filename *to);
++                            const struct filename *to);
 +
 +int gr_is_capable(const int cap);
 +int gr_is_capable_nolog(const int cap);
@@ -3083,7 +3208,7 @@ diff -Naur backports-3.18.1-1.org/include/linux/grsecurity.h backports-3.18.1-1/
 +                               const struct vfsmount *parent_mnt);
 +__u32 gr_acl_handle_rmdir(const struct dentry *dentry,
 +                               const struct vfsmount *mnt);
-+void gr_handle_delete(const ino_t ino, const dev_t dev);
++void gr_handle_delete(const u64 ino, const dev_t dev);
 +__u32 gr_acl_handle_unlink(const struct dentry *dentry,
 +                                const struct vfsmount *mnt);
 +__u32 gr_acl_handle_symlink(const struct dentry *new_dentry,
@@ -3112,7 +3237,7 @@ diff -Naur backports-3.18.1-1.org/include/linux/grsecurity.h backports-3.18.1-1/
 +                         const struct dentry *old_dentry,
 +                         const struct vfsmount *old_mnt);
 +int gr_acl_handle_filldir(const struct file *file, const char *name,
-+                               const unsigned int namelen, const ino_t ino);
++                               const unsigned int namelen, const u64 ino);
 +
 +__u32 gr_acl_handle_unix(const struct dentry *dentry,
 +                              const struct vfsmount *mnt);
@@ -3123,19 +3248,17 @@ diff -Naur backports-3.18.1-1.org/include/linux/grsecurity.h backports-3.18.1-1/
 +int gr_handle_rofs_blockwrite(struct dentry *dentry, struct vfsmount *mnt, int acc_mode);
 +void gr_audit_ptrace(struct task_struct *task);
 +dev_t gr_get_dev_from_dentry(struct dentry *dentry);
++u64 gr_get_ino_from_dentry(struct dentry *dentry);
 +void gr_put_exec_file(struct task_struct *task);
 +
++int gr_get_symlinkown_enabled(void);
++
 +int gr_ptrace_readexec(struct file *file, int unsafe_flags);
 +
-+#if defined(CONFIG_GRKERNSEC) && (defined(CONFIG_GRKERNSEC_RESLOG) || !defined(CONFIG_GRKERNSEC_NO_RBAC))
-+extern void gr_learn_resource(const struct task_struct *task, const int res,
-+                            const unsigned long wanted, const int gt);
-+#else
-+static inline void gr_learn_resource(const struct task_struct *task, const int res,
-+                                   const unsigned long wanted, const int gt)
-+{
-+}
-+#endif
++void gr_inc_chroot_refcnts(struct dentry *dentry, struct vfsmount *mnt);
++void gr_dec_chroot_refcnts(struct dentry *dentry, struct vfsmount *mnt);
++int gr_bad_chroot_rename(struct dentry *olddentry, struct vfsmount *oldmnt,
++                       struct dentry *newdentry, struct vfsmount *newmnt);
 +
 +#ifdef CONFIG_GRKERNSEC_RESLOG
 +extern void gr_log_resource(const struct task_struct *task, const int res,
@@ -3170,9 +3293,9 @@ diff -Naur backports-3.18.1-1.org/include/linux/grsecurity.h backports-3.18.1-1/
 +#endif
 +
 +#endif
-diff -Naur backports-3.18.1-1.org/include/linux/grsock.h backports-3.18.1-1/include/linux/grsock.h
---- backports-3.18.1-1.org/include/linux/grsock.h      1970-01-01 01:00:00.000000000 +0100
-+++ backports-3.18.1-1/include/linux/grsock.h  2014-12-28 14:10:09.688889562 +0100
+diff -Naur backports-4.2.6-1.org/include/linux/grsock.h backports-4.2.6-1/include/linux/grsock.h
+--- backports-4.2.6-1.org/include/linux/grsock.h       1970-01-01 01:00:00.000000000 +0100
++++ backports-4.2.6-1/include/linux/grsock.h   2016-01-27 12:26:26.289959354 +0100
 @@ -0,0 +1,19 @@
 +#ifndef __GRSOCK_H
 +#define __GRSOCK_H
@@ -3193,9 +3316,22 @@ diff -Naur backports-3.18.1-1.org/include/linux/grsock.h backports-3.18.1-1/incl
 +                          const int protocol);
 +
 +#endif
-diff -Naur backports-3.18.1-1.org/include/linux/unaligned/access_ok.h backports-3.18.1-1/include/linux/unaligned/access_ok.h
---- backports-3.18.1-1.org/include/linux/unaligned/access_ok.h 2014-12-21 22:37:13.000000000 +0100
-+++ backports-3.18.1-1/include/linux/unaligned/access_ok.h     2014-12-28 14:10:09.712889681 +0100
+diff -Naur backports-4.2.6-1.org/include/linux/netfilter/xt_gradm.h backports-4.2.6-1/include/linux/netfilter/xt_gradm.h
+--- backports-4.2.6-1.org/include/linux/netfilter/xt_gradm.h   1970-01-01 01:00:00.000000000 +0100
++++ backports-4.2.6-1/include/linux/netfilter/xt_gradm.h       2016-01-27 12:26:31.209959056 +0100
+@@ -0,0 +1,9 @@
++#ifndef _LINUX_NETFILTER_XT_GRADM_H
++#define _LINUX_NETFILTER_XT_GRADM_H 1
++
++struct xt_gradm_mtinfo {
++      __u16 flags;
++      __u16 invflags;
++};
++
++#endif
+diff -Naur backports-4.2.6-1.org/include/linux/unaligned/access_ok.h backports-4.2.6-1/include/linux/unaligned/access_ok.h
+--- backports-4.2.6-1.org/include/linux/unaligned/access_ok.h  2015-11-15 22:19:38.000000000 +0100
++++ backports-4.2.6-1/include/linux/unaligned/access_ok.h      2016-01-27 12:26:31.219959057 +0100
 @@ -4,34 +4,34 @@
  #include <linux/kernel.h>
  #include <asm/byteorder.h>
@@ -3243,10 +3379,10 @@ diff -Naur backports-3.18.1-1.org/include/linux/unaligned/access_ok.h backports-
  }
  
  static inline void put_unaligned_le16(u16 val, void *p)
-diff -Naur backports-3.18.1-1.org/include/media/v4l2-dev.h backports-3.18.1-1/include/media/v4l2-dev.h
---- backports-3.18.1-1.org/include/media/v4l2-dev.h    2014-12-21 22:37:13.000000000 +0100
-+++ backports-3.18.1-1/include/media/v4l2-dev.h        2014-12-28 14:10:09.716889709 +0100
-@@ -75,7 +75,7 @@
+diff -Naur backports-4.2.6-1.org/include/media/v4l2-dev.h backports-4.2.6-1/include/media/v4l2-dev.h
+--- backports-4.2.6-1.org/include/media/v4l2-dev.h     2015-11-15 22:19:38.000000000 +0100
++++ backports-4.2.6-1/include/media/v4l2-dev.h 2016-01-27 12:26:31.219959057 +0100
+@@ -74,7 +74,7 @@
        int (*mmap) (struct file *, struct vm_area_struct *);
        int (*open) (struct file *);
        int (*release) (struct file *);
@@ -3255,10 +3391,10 @@ diff -Naur backports-3.18.1-1.org/include/media/v4l2-dev.h backports-3.18.1-1/in
  
  /*
   * Newer version of video_device, handled by videodev2.c
-diff -Naur backports-3.18.1-1.org/include/media/v4l2-device.h backports-3.18.1-1/include/media/v4l2-device.h
---- backports-3.18.1-1.org/include/media/v4l2-device.h 2014-12-21 22:37:13.000000000 +0100
-+++ backports-3.18.1-1/include/media/v4l2-device.h     2014-12-28 14:10:09.716889709 +0100
-@@ -95,7 +95,7 @@
+diff -Naur backports-4.2.6-1.org/include/media/v4l2-device.h backports-4.2.6-1/include/media/v4l2-device.h
+--- backports-4.2.6-1.org/include/media/v4l2-device.h  2015-11-15 22:19:38.000000000 +0100
++++ backports-4.2.6-1/include/media/v4l2-device.h      2016-01-27 12:26:31.219959057 +0100
+@@ -93,7 +93,7 @@
     this function returns 0. If the name ends with a digit (e.g. cx18),
     then the name will be set to cx18-0 since cx180 looks really odd. */
  int v4l2_device_set_name(struct v4l2_device *v4l2_dev, const char *basename,
@@ -3267,22 +3403,31 @@ diff -Naur backports-3.18.1-1.org/include/media/v4l2-device.h backports-3.18.1-1
  
  /* Set v4l2_dev->dev to NULL. Call when the USB parent disconnects.
     Since the parent disappears this ensures that v4l2_dev doesn't have an
-diff -Naur backports-3.18.1-1.org/include/net/bluetooth/l2cap.h backports-3.18.1-1/include/net/bluetooth/l2cap.h
---- backports-3.18.1-1.org/include/net/bluetooth/l2cap.h       2014-12-21 22:37:13.000000000 +0100
-+++ backports-3.18.1-1/include/net/bluetooth/l2cap.h   2014-12-28 14:10:09.716889709 +0100
-@@ -608,7 +608,7 @@
-                                                    unsigned char *kdata,
+diff -Naur backports-4.2.6-1.org/include/net/bluetooth/l2cap.h backports-4.2.6-1/include/net/bluetooth/l2cap.h
+--- backports-4.2.6-1.org/include/net/bluetooth/l2cap.h        2015-11-15 22:19:38.000000000 +0100
++++ backports-4.2.6-1/include/net/bluetooth/l2cap.h    2016-01-27 12:31:52.866600109 +0100
+@@ -615,7 +615,7 @@
                                                     struct iovec *iov,
                                                     int len);
+ #endif
 -};
 +} __do_const;
  
  struct l2cap_conn {
        struct hci_conn         *hcon;
-diff -Naur backports-3.18.1-1.org/include/net/mac80211.h backports-3.18.1-1/include/net/mac80211.h
---- backports-3.18.1-1.org/include/net/mac80211.h      2014-12-21 22:37:13.000000000 +0100
-+++ backports-3.18.1-1/include/net/mac80211.h  2014-12-28 14:10:09.724889743 +0100
-@@ -4648,7 +4648,7 @@
+diff -Naur backports-4.2.6-1.org/include/net/mac80211.h backports-4.2.6-1/include/net/mac80211.h
+--- backports-4.2.6-1.org/include/net/mac80211.h       2015-11-15 22:19:38.000000000 +0100
++++ backports-4.2.6-1/include/net/mac80211.h   2016-01-27 12:26:31.223292389 +0100
+@@ -5106,7 +5106,7 @@
+       struct sk_buff *skb;
+       struct ieee80211_tx_rate reported_rate;
+       bool rts, short_preamble;
+-      u8 max_rate_idx;
++      s8 max_rate_idx;
+       u32 rate_idx_mask;
+       u8 *rate_idx_mcs_mask;
+       bool bss;
+@@ -5143,7 +5143,7 @@
        void (*remove_sta_debugfs)(void *priv, void *priv_sta);
  
        u32 (*get_expected_throughput)(void *priv_sta);
@@ -3291,9 +3436,9 @@ diff -Naur backports-3.18.1-1.org/include/net/mac80211.h backports-3.18.1-1/incl
  
  static inline int rate_supported(struct ieee80211_sta *sta,
                                 enum ieee80211_band band,
-diff -Naur backports-3.18.1-1.org/include/trace/events/fs.h backports-3.18.1-1/include/trace/events/fs.h
---- backports-3.18.1-1.org/include/trace/events/fs.h   1970-01-01 01:00:00.000000000 +0100
-+++ backports-3.18.1-1/include/trace/events/fs.h       2014-12-28 14:10:09.728889769 +0100
+diff -Naur backports-4.2.6-1.org/include/trace/events/fs.h backports-4.2.6-1/include/trace/events/fs.h
+--- backports-4.2.6-1.org/include/trace/events/fs.h    1970-01-01 01:00:00.000000000 +0100
++++ backports-4.2.6-1/include/trace/events/fs.h        2016-01-27 12:26:31.226625722 +0100
 @@ -0,0 +1,53 @@
 +#undef TRACE_SYSTEM
 +#define TRACE_SYSTEM fs
@@ -3348,47 +3493,10 @@ diff -Naur backports-3.18.1-1.org/include/trace/events/fs.h backports-3.18.1-1/i
 +
 +/* This part must be outside protection */
 +#include <trace/define_trace.h>
-diff -Naur backports-3.18.1-1.org/net/bluetooth/6lowpan.c backports-3.18.1-1/net/bluetooth/6lowpan.c
---- backports-3.18.1-1.org/net/bluetooth/6lowpan.c     2014-12-21 22:37:15.000000000 +0100
-+++ backports-3.18.1-1/net/bluetooth/6lowpan.c 2014-12-28 14:10:09.784890034 +0100
-@@ -367,7 +367,6 @@
- drop:
-       dev->stats.rx_dropped++;
--      kfree_skb(skb);
-       return NET_RX_DROP;
- }
-diff -Naur backports-3.18.1-1.org/net/bluetooth/bnep/core.c backports-3.18.1-1/net/bluetooth/bnep/core.c
---- backports-3.18.1-1.org/net/bluetooth/bnep/core.c   2014-12-21 22:37:15.000000000 +0100
-+++ backports-3.18.1-1/net/bluetooth/bnep/core.c       2014-12-28 14:10:09.784890034 +0100
-@@ -533,6 +533,9 @@
-       BT_DBG("");
-+      if (!l2cap_is_socket(sock))
-+              return -EBADFD;
-+
-       baswap((void *) dst, &l2cap_pi(sock->sk)->chan->dst);
-       baswap((void *) src, &l2cap_pi(sock->sk)->chan->src);
-diff -Naur backports-3.18.1-1.org/net/bluetooth/cmtp/core.c backports-3.18.1-1/net/bluetooth/cmtp/core.c
---- backports-3.18.1-1.org/net/bluetooth/cmtp/core.c   2014-12-21 22:37:15.000000000 +0100
-+++ backports-3.18.1-1/net/bluetooth/cmtp/core.c       2014-12-28 14:10:09.784890034 +0100
-@@ -334,6 +334,9 @@
-       BT_DBG("");
-+      if (!l2cap_is_socket(sock))
-+              return -EBADFD;
-+
-       session = kzalloc(sizeof(struct cmtp_session), GFP_KERNEL);
-       if (!session)
-               return -ENOMEM;
-diff -Naur backports-3.18.1-1.org/net/bluetooth/hci_sock.c backports-3.18.1-1/net/bluetooth/hci_sock.c
---- backports-3.18.1-1.org/net/bluetooth/hci_sock.c    2014-12-21 22:37:15.000000000 +0100
-+++ backports-3.18.1-1/net/bluetooth/hci_sock.c        2014-12-28 14:10:09.784890034 +0100
-@@ -1067,7 +1067,7 @@
+diff -Naur backports-4.2.6-1.org/net/bluetooth/hci_sock.c backports-4.2.6-1/net/bluetooth/hci_sock.c
+--- backports-4.2.6-1.org/net/bluetooth/hci_sock.c     2015-11-15 22:19:40.000000000 +0100
++++ backports-4.2.6-1/net/bluetooth/hci_sock.c 2016-01-27 12:26:36.269958751 +0100
+@@ -1266,7 +1266,7 @@
                        uf.event_mask[1] = *((u32 *) f->event_mask + 1);
                }
  
@@ -3397,29 +3505,10 @@ diff -Naur backports-3.18.1-1.org/net/bluetooth/hci_sock.c backports-3.18.1-1/ne
                if (copy_from_user(&uf, optval, len)) {
                        err = -EFAULT;
                        break;
-diff -Naur backports-3.18.1-1.org/net/bluetooth/hidp/core.c backports-3.18.1-1/net/bluetooth/hidp/core.c
---- backports-3.18.1-1.org/net/bluetooth/hidp/core.c   2014-12-21 22:37:15.000000000 +0100
-+++ backports-3.18.1-1/net/bluetooth/hidp/core.c       2014-12-28 14:10:09.784890034 +0100
-@@ -1322,13 +1322,14 @@
- {
-       struct hidp_session *session;
-       struct l2cap_conn *conn;
--      struct l2cap_chan *chan = l2cap_pi(ctrl_sock->sk)->chan;
-+      struct l2cap_chan *chan;
-       int ret;
-       ret = hidp_verify_sockets(ctrl_sock, intr_sock);
-       if (ret)
-               return ret;
-+      chan = l2cap_pi(ctrl_sock->sk)->chan;
-       conn = NULL;
-       l2cap_chan_lock(chan);
-       if (chan->conn)
-diff -Naur backports-3.18.1-1.org/net/bluetooth/l2cap_core.c backports-3.18.1-1/net/bluetooth/l2cap_core.c
---- backports-3.18.1-1.org/net/bluetooth/l2cap_core.c  2014-12-21 22:37:15.000000000 +0100
-+++ backports-3.18.1-1/net/bluetooth/l2cap_core.c      2014-12-28 14:10:09.784890034 +0100
-@@ -3512,8 +3512,10 @@
+diff -Naur backports-4.2.6-1.org/net/bluetooth/l2cap_core.c backports-4.2.6-1/net/bluetooth/l2cap_core.c
+--- backports-4.2.6-1.org/net/bluetooth/l2cap_core.c   2015-11-15 22:19:40.000000000 +0100
++++ backports-4.2.6-1/net/bluetooth/l2cap_core.c       2016-01-27 12:26:36.269958751 +0100
+@@ -3547,8 +3547,10 @@
                        break;
  
                case L2CAP_CONF_RFC:
@@ -3432,10 +3521,10 @@ diff -Naur backports-3.18.1-1.org/net/bluetooth/l2cap_core.c backports-3.18.1-1/
  
                        if (test_bit(CONF_STATE2_DEVICE, &chan->conf_state) &&
                            rfc.mode != chan->mode)
-diff -Naur backports-3.18.1-1.org/net/bluetooth/l2cap_sock.c backports-3.18.1-1/net/bluetooth/l2cap_sock.c
---- backports-3.18.1-1.org/net/bluetooth/l2cap_sock.c  2014-12-21 22:37:15.000000000 +0100
-+++ backports-3.18.1-1/net/bluetooth/l2cap_sock.c      2014-12-28 14:10:09.788890064 +0100
-@@ -628,7 +628,8 @@
+diff -Naur backports-4.2.6-1.org/net/bluetooth/l2cap_sock.c backports-4.2.6-1/net/bluetooth/l2cap_sock.c
+--- backports-4.2.6-1.org/net/bluetooth/l2cap_sock.c   2015-11-15 22:19:40.000000000 +0100
++++ backports-4.2.6-1/net/bluetooth/l2cap_sock.c       2016-01-27 12:26:36.269958751 +0100
+@@ -633,7 +633,8 @@
        struct sock *sk = sock->sk;
        struct l2cap_chan *chan = l2cap_pi(sk)->chan;
        struct l2cap_options opts;
@@ -3445,7 +3534,7 @@ diff -Naur backports-3.18.1-1.org/net/bluetooth/l2cap_sock.c backports-3.18.1-1/
        u32 opt;
  
        BT_DBG("sk %p", sk);
-@@ -655,7 +656,7 @@
+@@ -660,7 +661,7 @@
                opts.max_tx   = chan->max_tx;
                opts.txwin_size = chan->tx_win;
  
@@ -3454,7 +3543,7 @@ diff -Naur backports-3.18.1-1.org/net/bluetooth/l2cap_sock.c backports-3.18.1-1/
                if (copy_from_user((char *) &opts, optval, len)) {
                        err = -EFAULT;
                        break;
-@@ -742,7 +743,8 @@
+@@ -747,7 +748,8 @@
        struct bt_security sec;
        struct bt_power pwr;
        struct l2cap_conn *conn;
@@ -3464,7 +3553,7 @@ diff -Naur backports-3.18.1-1.org/net/bluetooth/l2cap_sock.c backports-3.18.1-1/
        u32 opt;
  
        BT_DBG("sk %p", sk);
-@@ -766,7 +768,7 @@
+@@ -771,7 +773,7 @@
  
                sec.level = BT_SECURITY_LOW;
  
@@ -3473,7 +3562,7 @@ diff -Naur backports-3.18.1-1.org/net/bluetooth/l2cap_sock.c backports-3.18.1-1/
                if (copy_from_user((char *) &sec, optval, len)) {
                        err = -EFAULT;
                        break;
-@@ -862,7 +864,7 @@
+@@ -867,7 +869,7 @@
  
                pwr.force_active = BT_POWER_FORCE_ACTIVE_ON;
  
@@ -3482,10 +3571,10 @@ diff -Naur backports-3.18.1-1.org/net/bluetooth/l2cap_sock.c backports-3.18.1-1/
                if (copy_from_user((char *) &pwr, optval, len)) {
                        err = -EFAULT;
                        break;
-diff -Naur backports-3.18.1-1.org/net/bluetooth/rfcomm/sock.c backports-3.18.1-1/net/bluetooth/rfcomm/sock.c
---- backports-3.18.1-1.org/net/bluetooth/rfcomm/sock.c 2014-12-21 22:37:15.000000000 +0100
-+++ backports-3.18.1-1/net/bluetooth/rfcomm/sock.c     2014-12-28 14:10:09.788890064 +0100
-@@ -695,7 +695,7 @@
+diff -Naur backports-4.2.6-1.org/net/bluetooth/rfcomm/sock.c backports-4.2.6-1/net/bluetooth/rfcomm/sock.c
+--- backports-4.2.6-1.org/net/bluetooth/rfcomm/sock.c  2015-11-15 22:19:40.000000000 +0100
++++ backports-4.2.6-1/net/bluetooth/rfcomm/sock.c      2016-01-27 12:26:36.269958751 +0100
+@@ -713,7 +713,7 @@
        struct sock *sk = sock->sk;
        struct bt_security sec;
        int err = 0;
@@ -3494,7 +3583,7 @@ diff -Naur backports-3.18.1-1.org/net/bluetooth/rfcomm/sock.c backports-3.18.1-1
        u32 opt;
  
        BT_DBG("sk %p", sk);
-@@ -717,7 +717,7 @@
+@@ -735,7 +735,7 @@
  
                sec.level = BT_SECURITY_LOW;
  
@@ -3503,9 +3592,9 @@ diff -Naur backports-3.18.1-1.org/net/bluetooth/rfcomm/sock.c backports-3.18.1-1
                if (copy_from_user((char *) &sec, optval, len)) {
                        err = -EFAULT;
                        break;
-diff -Naur backports-3.18.1-1.org/net/bluetooth/rfcomm/tty.c backports-3.18.1-1/net/bluetooth/rfcomm/tty.c
---- backports-3.18.1-1.org/net/bluetooth/rfcomm/tty.c  2014-12-21 22:37:15.000000000 +0100
-+++ backports-3.18.1-1/net/bluetooth/rfcomm/tty.c      2014-12-28 14:10:09.788890064 +0100
+diff -Naur backports-4.2.6-1.org/net/bluetooth/rfcomm/tty.c backports-4.2.6-1/net/bluetooth/rfcomm/tty.c
+--- backports-4.2.6-1.org/net/bluetooth/rfcomm/tty.c   2015-11-15 22:19:40.000000000 +0100
++++ backports-4.2.6-1/net/bluetooth/rfcomm/tty.c       2016-01-27 12:26:36.269958751 +0100
 @@ -752,7 +752,7 @@
        BT_DBG("tty %p id %d", tty, tty->index);
  
@@ -3524,10 +3613,10 @@ diff -Naur backports-3.18.1-1.org/net/bluetooth/rfcomm/tty.c backports-3.18.1-1/
  
        tty_port_close(&dev->port, tty, filp);
  }
-diff -Naur backports-3.18.1-1.org/net/ieee802154/6lowpan_rtnl.c backports-3.18.1-1/net/ieee802154/6lowpan_rtnl.c
---- backports-3.18.1-1.org/net/ieee802154/6lowpan_rtnl.c       2014-12-21 22:37:15.000000000 +0100
-+++ backports-3.18.1-1/net/ieee802154/6lowpan_rtnl.c   2014-12-28 14:10:09.796890100 +0100
-@@ -639,7 +639,7 @@
+diff -Naur backports-4.2.6-1.org/net/ieee802154/6lowpan/core.c backports-4.2.6-1/net/ieee802154/6lowpan/core.c
+--- backports-4.2.6-1.org/net/ieee802154/6lowpan/core.c        2015-11-15 22:19:40.000000000 +0100
++++ backports-4.2.6-1/net/ieee802154/6lowpan/core.c    2016-01-27 12:26:36.273292083 +0100
+@@ -191,7 +191,7 @@
        dev_put(real_dev);
  }
  
@@ -3536,10 +3625,10 @@ diff -Naur backports-3.18.1-1.org/net/ieee802154/6lowpan_rtnl.c backports-3.18.1
        .kind           = "lowpan",
        .priv_size      = sizeof(struct lowpan_dev_info),
        .setup          = lowpan_setup,
-diff -Naur backports-3.18.1-1.org/net/ieee802154/reassembly.c backports-3.18.1-1/net/ieee802154/reassembly.c
---- backports-3.18.1-1.org/net/ieee802154/reassembly.c 2014-12-21 22:37:15.000000000 +0100
-+++ backports-3.18.1-1/net/ieee802154/reassembly.c     2014-12-28 14:10:09.796890100 +0100
-@@ -460,14 +460,13 @@
+diff -Naur backports-4.2.6-1.org/net/ieee802154/6lowpan/reassembly.c backports-4.2.6-1/net/ieee802154/6lowpan/reassembly.c
+--- backports-4.2.6-1.org/net/ieee802154/6lowpan/reassembly.c  2015-11-15 22:19:40.000000000 +0100
++++ backports-4.2.6-1/net/ieee802154/6lowpan/reassembly.c      2016-01-27 12:26:36.273292083 +0100
+@@ -435,14 +435,13 @@
  
  static int __net_init lowpan_frags_ns_sysctl_register(struct net *net)
  {
@@ -3556,7 +3645,20 @@ diff -Naur backports-3.18.1-1.org/net/ieee802154/reassembly.c backports-3.18.1-1
                                GFP_KERNEL);
                if (table == NULL)
                        goto err_alloc;
-@@ -494,8 +493,7 @@
+@@ -457,9 +456,9 @@
+               /* Don't export sysctls to unprivileged users */
+               if (net->user_ns != &init_user_ns)
+                       table[0].procname = NULL;
+-      }
+-
+-      hdr = register_net_sysctl(net, "net/ieee802154/6lowpan", table);
++              hdr = register_net_sysctl(net, "net/ieee802154/6lowpan", table);
++      } else
++              hdr = register_net_sysctl(net, "net/ieee802154/6lowpan", lowpan_frags_ns_ctl_table);
+       if (hdr == NULL)
+               goto err_reg;
+@@ -467,8 +466,7 @@
        return 0;
  
  err_reg:
@@ -3566,10 +3668,10 @@ diff -Naur backports-3.18.1-1.org/net/ieee802154/reassembly.c backports-3.18.1-1
  err_alloc:
        return -ENOMEM;
  }
-diff -Naur backports-3.18.1-1.org/net/mac80211/cfg.c backports-3.18.1-1/net/mac80211/cfg.c
---- backports-3.18.1-1.org/net/mac80211/cfg.c  2014-12-21 22:37:15.000000000 +0100
-+++ backports-3.18.1-1/net/mac80211/cfg.c      2014-12-28 14:10:09.812890175 +0100
-@@ -541,7 +541,7 @@
+diff -Naur backports-4.2.6-1.org/net/mac80211/cfg.c backports-4.2.6-1/net/mac80211/cfg.c
+--- backports-4.2.6-1.org/net/mac80211/cfg.c   2015-11-15 22:19:40.000000000 +0100
++++ backports-4.2.6-1/net/mac80211/cfg.c       2016-01-27 12:26:36.286625417 +0100
+@@ -580,7 +580,7 @@
                        ret = ieee80211_vif_use_channel(sdata, chandef,
                                        IEEE80211_CHANCTX_EXCLUSIVE);
                }
@@ -3578,7 +3680,7 @@ diff -Naur backports-3.18.1-1.org/net/mac80211/cfg.c backports-3.18.1-1/net/mac8
                local->_oper_chandef = *chandef;
                ieee80211_hw_config(local, 0);
        }
-@@ -3326,7 +3326,7 @@
+@@ -3488,7 +3488,7 @@
                else
                        local->probe_req_reg--;
  
@@ -3587,7 +3689,7 @@ diff -Naur backports-3.18.1-1.org/net/mac80211/cfg.c backports-3.18.1-1/net/mac8
                        break;
  
                ieee80211_queue_work(&local->hw, &local->reconfig_filter);
-@@ -3460,8 +3460,8 @@
+@@ -3637,8 +3637,8 @@
        if (chanctx_conf) {
                *chandef = sdata->vif.bss_conf.chandef;
                ret = 0;
@@ -3598,10 +3700,10 @@ diff -Naur backports-3.18.1-1.org/net/mac80211/cfg.c backports-3.18.1-1/net/mac8
                   sdata->vif.type == NL80211_IFTYPE_MONITOR) {
                if (local->use_chanctx)
                        *chandef = local->monitor_chandef;
-diff -Naur backports-3.18.1-1.org/net/mac80211/ieee80211_i.h backports-3.18.1-1/net/mac80211/ieee80211_i.h
---- backports-3.18.1-1.org/net/mac80211/ieee80211_i.h  2014-12-21 22:37:15.000000000 +0100
-+++ backports-3.18.1-1/net/mac80211/ieee80211_i.h      2014-12-28 14:10:09.812890175 +0100
-@@ -29,6 +29,7 @@
+diff -Naur backports-4.2.6-1.org/net/mac80211/ieee80211_i.h backports-4.2.6-1/net/mac80211/ieee80211_i.h
+--- backports-4.2.6-1.org/net/mac80211/ieee80211_i.h   2015-11-15 22:19:40.000000000 +0100
++++ backports-4.2.6-1/net/mac80211/ieee80211_i.h       2016-01-27 12:26:36.289958749 +0100
+@@ -30,6 +30,7 @@
  #include <net/ieee80211_radiotap.h>
  #include <net/cfg80211.h>
  #include <net/mac80211.h>
@@ -3609,7 +3711,7 @@ diff -Naur backports-3.18.1-1.org/net/mac80211/ieee80211_i.h backports-3.18.1-1/
  #include "key.h"
  #include "sta_info.h"
  #include "debug.h"
-@@ -1057,7 +1058,7 @@
+@@ -1112,7 +1113,7 @@
        /* also used to protect ampdu_ac_queue and amdpu_ac_stop_refcnt */
        spinlock_t queue_stop_reason_lock;
  
@@ -3618,10 +3720,10 @@ diff -Naur backports-3.18.1-1.org/net/mac80211/ieee80211_i.h backports-3.18.1-1/
        int monitors, cooked_mntrs;
        /* number of interfaces with corresponding FIF_ flags */
        int fif_fcsfail, fif_plcpfail, fif_control, fif_other_bss, fif_pspoll,
-diff -Naur backports-3.18.1-1.org/net/mac80211/iface.c backports-3.18.1-1/net/mac80211/iface.c
---- backports-3.18.1-1.org/net/mac80211/iface.c        2014-12-21 22:37:15.000000000 +0100
-+++ backports-3.18.1-1/net/mac80211/iface.c    2014-12-28 14:10:09.812890175 +0100
-@@ -532,7 +532,7 @@
+diff -Naur backports-4.2.6-1.org/net/mac80211/iface.c backports-4.2.6-1/net/mac80211/iface.c
+--- backports-4.2.6-1.org/net/mac80211/iface.c 2015-11-15 22:19:40.000000000 +0100
++++ backports-4.2.6-1/net/mac80211/iface.c     2016-01-27 12:26:36.289958749 +0100
+@@ -550,7 +550,7 @@
                break;
        }
  
@@ -3630,7 +3732,7 @@ diff -Naur backports-3.18.1-1.org/net/mac80211/iface.c backports-3.18.1-1/net/ma
                res = drv_start(local);
                if (res)
                        goto err_del_bss;
-@@ -579,7 +579,7 @@
+@@ -597,7 +597,7 @@
                        res = drv_add_interface(local, sdata);
                        if (res)
                                goto err_stop;
@@ -3639,8 +3741,8 @@ diff -Naur backports-3.18.1-1.org/net/mac80211/iface.c backports-3.18.1-1/net/ma
                        res = ieee80211_add_virtual_monitor(local);
                        if (res)
                                goto err_stop;
-@@ -688,7 +688,7 @@
-               atomic_inc(&local->iff_promiscs);
+@@ -704,7 +704,7 @@
+               atomic_inc(&local->iff_allmultis);
  
        if (coming_up)
 -              local->open_count++;
@@ -3648,7 +3750,7 @@ diff -Naur backports-3.18.1-1.org/net/mac80211/iface.c backports-3.18.1-1/net/ma
  
        if (hw_reconf_flags)
                ieee80211_hw_config(local, hw_reconf_flags);
-@@ -726,7 +726,7 @@
+@@ -742,7 +742,7 @@
   err_del_interface:
        drv_remove_interface(local, sdata);
   err_stop:
@@ -3657,7 +3759,7 @@ diff -Naur backports-3.18.1-1.org/net/mac80211/iface.c backports-3.18.1-1/net/ma
                drv_stop(local);
   err_del_bss:
        sdata->bss = NULL;
-@@ -892,7 +892,7 @@
+@@ -909,7 +909,7 @@
        }
  
        if (going_down)
@@ -3666,16 +3768,16 @@ diff -Naur backports-3.18.1-1.org/net/mac80211/iface.c backports-3.18.1-1/net/ma
  
        switch (sdata->vif.type) {
        case NL80211_IFTYPE_AP_VLAN:
-@@ -954,7 +954,7 @@
+@@ -978,7 +978,7 @@
+               atomic_set(&sdata->txqs_len[txqi->txq.ac], 0);
        }
-       spin_unlock_irqrestore(&local->queue_stop_reason_lock, flags);
  
 -      if (local->open_count == 0)
 +      if (local_read(&local->open_count) == 0)
                ieee80211_clear_tx_pending(local);
  
        /*
-@@ -997,7 +997,7 @@
+@@ -1021,7 +1021,7 @@
        if (cancel_scan)
                flush_delayed_work(&local->scan_work);
  
@@ -3684,7 +3786,7 @@ diff -Naur backports-3.18.1-1.org/net/mac80211/iface.c backports-3.18.1-1/net/ma
                ieee80211_stop_device(local);
  
                /* no reconfiguring after stop! */
-@@ -1008,7 +1008,7 @@
+@@ -1032,7 +1032,7 @@
        ieee80211_configure_filter(local);
        ieee80211_hw_config(local, hw_reconf_flags);
  
@@ -3693,10 +3795,21 @@ diff -Naur backports-3.18.1-1.org/net/mac80211/iface.c backports-3.18.1-1/net/ma
                ieee80211_add_virtual_monitor(local);
  }
  
-diff -Naur backports-3.18.1-1.org/net/mac80211/main.c backports-3.18.1-1/net/mac80211/main.c
---- backports-3.18.1-1.org/net/mac80211/main.c 2014-12-21 22:37:15.000000000 +0100
-+++ backports-3.18.1-1/net/mac80211/main.c     2014-12-28 14:10:09.812890175 +0100
-@@ -175,7 +175,7 @@
+@@ -1905,8 +1905,8 @@
+        */
+       cfg80211_shutdown_all_interfaces(local->hw.wiphy);
+-      WARN(local->open_count, "%s: open count remains %d\n",
+-           wiphy_name(local->hw.wiphy), local->open_count);
++      WARN(local_read(&local->open_count), "%s: open count remains %ld\n",
++           wiphy_name(local->hw.wiphy), local_read(&local->open_count));
+       mutex_lock(&local->iflist_mtx);
+       list_for_each_entry_safe(sdata, tmp, &local->interfaces, list) {
+diff -Naur backports-4.2.6-1.org/net/mac80211/main.c backports-4.2.6-1/net/mac80211/main.c
+--- backports-4.2.6-1.org/net/mac80211/main.c  2015-11-15 22:19:40.000000000 +0100
++++ backports-4.2.6-1/net/mac80211/main.c      2016-01-27 12:26:36.289958749 +0100
+@@ -172,7 +172,7 @@
                changed &= ~(IEEE80211_CONF_CHANGE_CHANNEL |
                             IEEE80211_CONF_CHANGE_POWER);
  
@@ -3705,9 +3818,9 @@ diff -Naur backports-3.18.1-1.org/net/mac80211/main.c backports-3.18.1-1/net/mac
                ret = drv_config(local, changed);
                /*
                 * Goal:
-diff -Naur backports-3.18.1-1.org/net/mac80211/pm.c backports-3.18.1-1/net/mac80211/pm.c
---- backports-3.18.1-1.org/net/mac80211/pm.c   2014-12-21 22:37:15.000000000 +0100
-+++ backports-3.18.1-1/net/mac80211/pm.c       2014-12-28 14:10:09.812890175 +0100
+diff -Naur backports-4.2.6-1.org/net/mac80211/pm.c backports-4.2.6-1/net/mac80211/pm.c
+--- backports-4.2.6-1.org/net/mac80211/pm.c    2015-11-15 22:19:40.000000000 +0100
++++ backports-4.2.6-1/net/mac80211/pm.c        2016-01-27 12:26:36.289958749 +0100
 @@ -12,7 +12,7 @@
        struct ieee80211_sub_if_data *sdata;
        struct sta_info *sta;
@@ -3717,16 +3830,7 @@ diff -Naur backports-3.18.1-1.org/net/mac80211/pm.c backports-3.18.1-1/net/mac80
                goto suspend;
  
        ieee80211_scan_cancel(local);
-@@ -59,7 +59,7 @@
-       cancel_work_sync(&local->dynamic_ps_enable_work);
-       del_timer_sync(&local->dynamic_ps_timer);
--      local->wowlan = wowlan && local->open_count;
-+      local->wowlan = wowlan && local_read(&local->open_count);
-       if (local->wowlan) {
-               int err = drv_suspend(local, wowlan);
-               if (err < 0) {
-@@ -125,7 +125,7 @@
+@@ -166,7 +166,7 @@
        WARN_ON(!list_empty(&local->chanctx_list));
  
        /* stop hardware - this must stop RX */
@@ -3735,10 +3839,10 @@ diff -Naur backports-3.18.1-1.org/net/mac80211/pm.c backports-3.18.1-1/net/mac80
                ieee80211_stop_device(local);
  
   suspend:
-diff -Naur backports-3.18.1-1.org/net/mac80211/rate.c backports-3.18.1-1/net/mac80211/rate.c
---- backports-3.18.1-1.org/net/mac80211/rate.c 2014-12-21 22:37:15.000000000 +0100
-+++ backports-3.18.1-1/net/mac80211/rate.c     2014-12-28 14:10:09.812890175 +0100
-@@ -720,7 +720,7 @@
+diff -Naur backports-4.2.6-1.org/net/mac80211/rate.c backports-4.2.6-1/net/mac80211/rate.c
+--- backports-4.2.6-1.org/net/mac80211/rate.c  2015-11-15 22:19:40.000000000 +0100
++++ backports-4.2.6-1/net/mac80211/rate.c      2016-01-27 12:26:36.289958749 +0100
+@@ -730,7 +730,7 @@
  
        ASSERT_RTNL();
  
@@ -3746,20 +3850,32 @@ diff -Naur backports-3.18.1-1.org/net/mac80211/rate.c backports-3.18.1-1/net/mac
 +      if (local_read(&local->open_count))
                return -EBUSY;
  
-       if (local->hw.flags & IEEE80211_HW_HAS_RATE_CONTROL) {
-diff -Naur backports-3.18.1-1.org/net/mac80211/util.c backports-3.18.1-1/net/mac80211/util.c
---- backports-3.18.1-1.org/net/mac80211/util.c 2014-12-21 22:37:15.000000000 +0100
-+++ backports-3.18.1-1/net/mac80211/util.c     2014-12-28 14:10:09.816890209 +0100
-@@ -1669,7 +1669,7 @@
-       }
- #endif
-       /* everything else happens only if HW was up & running */
+       if (ieee80211_hw_check(&local->hw, HAS_RATE_CONTROL)) {
+diff -Naur backports-4.2.6-1.org/net/mac80211/sta_info.c backports-4.2.6-1/net/mac80211/sta_info.c
+--- backports-4.2.6-1.org/net/mac80211/sta_info.c      2015-11-15 22:19:40.000000000 +0100
++++ backports-4.2.6-1/net/mac80211/sta_info.c  2016-01-27 12:26:36.289958749 +0100
+@@ -341,7 +341,7 @@
+               int size = sizeof(struct txq_info) +
+                          ALIGN(hw->txq_data_size, sizeof(void *));
+-              txq_data = kcalloc(ARRAY_SIZE(sta->sta.txq), size, gfp);
++              txq_data = kcalloc(size, ARRAY_SIZE(sta->sta.txq), gfp);
+               if (!txq_data)
+                       goto free;
+diff -Naur backports-4.2.6-1.org/net/mac80211/util.c backports-4.2.6-1/net/mac80211/util.c
+--- backports-4.2.6-1.org/net/mac80211/util.c  2015-11-15 22:19:40.000000000 +0100
++++ backports-4.2.6-1/net/mac80211/util.c      2016-01-27 12:26:36.289958749 +0100
+@@ -1761,7 +1761,7 @@
+       bool sched_scan_stopped = false;
+       /* nothing to do if HW shouldn't run */
 -      if (!local->open_count)
 +      if (!local_read(&local->open_count))
                goto wake_up;
  
-       /*
-@@ -1895,7 +1895,7 @@
+ #ifdef CONFIG_PM
+@@ -2033,7 +2033,7 @@
        local->in_reconfig = false;
        barrier();
  
@@ -3768,9 +3884,27 @@ diff -Naur backports-3.18.1-1.org/net/mac80211/util.c backports-3.18.1-1/net/mac
                ieee80211_add_virtual_monitor(local);
  
        /*
-diff -Naur backports-3.18.1-1.org/net/wireless/wext-core.c backports-3.18.1-1/net/wireless/wext-core.c
---- backports-3.18.1-1.org/net/wireless/wext-core.c    2014-12-21 22:37:15.000000000 +0100
-+++ backports-3.18.1-1/net/wireless/wext-core.c        2014-12-28 14:10:09.832890290 +0100
+@@ -2088,7 +2088,7 @@
+        * If this is for hw restart things are still running.
+        * We may want to change that later, however.
+        */
+-      if (local->open_count && (!local->suspended || reconfig_due_to_wowlan))
++      if (local_read(&local->open_count) && (!local->suspended || reconfig_due_to_wowlan))
+               drv_reconfig_complete(local, IEEE80211_RECONFIG_TYPE_RESTART);
+       if (!local->suspended)
+@@ -2112,7 +2112,7 @@
+               flush_delayed_work(&local->scan_work);
+       }
+-      if (local->open_count && !reconfig_due_to_wowlan)
++      if (local_read(&local->open_count) && !reconfig_due_to_wowlan)
+               drv_reconfig_complete(local, IEEE80211_RECONFIG_TYPE_SUSPEND);
+       list_for_each_entry(sdata, &local->interfaces, list) {
+diff -Naur backports-4.2.6-1.org/net/wireless/wext-core.c backports-4.2.6-1/net/wireless/wext-core.c
+--- backports-4.2.6-1.org/net/wireless/wext-core.c     2015-11-15 22:19:40.000000000 +0100
++++ backports-4.2.6-1/net/wireless/wext-core.c 2016-01-27 12:26:36.303292082 +0100
 @@ -748,8 +748,7 @@
                 */
  
@@ -3804,3 +3938,58 @@ diff -Naur backports-3.18.1-1.org/net/wireless/wext-core.c backports-3.18.1-1/ne
        err = handler(dev, info, (union iwreq_data *) iwp, extra);
  
        iwp->length += essid_compat;
+diff -Naur backports-4.2.6-1.org/scripts/gcc-plugin.sh backports-4.2.6-1/scripts/gcc-plugin.sh
+--- backports-4.2.6-1.org/scripts/gcc-plugin.sh        1970-01-01 01:00:00.000000000 +0100
++++ backports-4.2.6-1/scripts/gcc-plugin.sh    2016-01-27 12:26:36.303292082 +0100
+@@ -0,0 +1,51 @@
++#!/bin/sh
++srctree=$(dirname "$0")
++gccplugins_dir=$($3 -print-file-name=plugin)
++plugincc=$($1 -E -x c++ - -o /dev/null -I"${srctree}"/../tools/gcc -I"${gccplugins_dir}"/include 2>&1 <<EOF
++#include "gcc-common.h"
++#if BUILDING_GCC_VERSION >= 4008 || defined(ENABLE_BUILD_WITH_CXX)
++#warning $2 CXX
++#else
++#warning $1 CC
++#endif
++EOF
++)
++
++if [ $? -ne 0 ]
++then
++      exit 1
++fi
++
++case "$plugincc" in
++      *"$1 CC"*)
++              echo "$1"
++              exit 0
++              ;;
++
++      *"$2 CXX"*)
++              # the c++ compiler needs another test, see below
++              ;;
++
++      *)
++              exit 1
++              ;;
++esac
++
++# we need a c++ compiler that supports the designated initializer GNU extension
++plugincc=$($2 -c -x c++ -std=gnu++98 - -fsyntax-only -I"${srctree}"/../tools/gcc -I"${gccplugins_dir}"/include 2>&1 <<EOF
++#include "gcc-common.h"
++class test {
++public:
++      int test;
++} test = {
++      .test = 1
++};
++EOF
++)
++
++if [ $? -eq 0 ]
++then
++      echo "$2"
++      exit 0
++fi
++exit 1
diff --git a/src/patches/backports-4.2.6-1-mt7601_upstream_fixes.patch b/src/patches/backports-4.2.6-1-mt7601_upstream_fixes.patch
new file mode 100644 (file)
index 0000000..9918d65
--- /dev/null
@@ -0,0 +1,441 @@
+From bed429e1ae8b7ee207e01f3aa60dcc0d06a8ed4d Mon Sep 17 00:00:00 2001
+From: Jakub Kicinski <kubakici@wp.pl>
+Date: Fri, 31 Jul 2015 15:04:46 +0200
+Subject: mt7601u: fix dma from stack address
+
+DMA to variables located on the stack is a bad idea.
+For simplicity and to avoid frequent allocations create
+a buffer inside the device structure.  Protect this
+buffer with vendor_req_mutex.  Don't protect vendor
+requests which don't use this buffer.
+
+Signed-off-by: Jakub Kicinski <kubakici@wp.pl>
+Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
+---
+ drivers/net/wireless/mediatek/mt7601u/mt7601u.h |  4 +-
+ drivers/net/wireless/mediatek/mt7601u/usb.c     | 63 ++++++++++++-------------
+ drivers/net/wireless/mediatek/mt7601u/usb.h     |  2 +
+ 3 files changed, 34 insertions(+), 35 deletions(-)
+
+diff --git a/drivers/net/wireless/mediatek/mt7601u/mt7601u.h b/drivers/net/wireless/mediatek/mt7601u/mt7601u.h
+index 9102be6b..6bdfc11 100644
+--- a/drivers/net/wireless/mediatek/mt7601u/mt7601u.h
++++ b/drivers/net/wireless/mediatek/mt7601u/mt7601u.h
+@@ -146,7 +146,7 @@ enum {
+  * @rx_lock:          protects @rx_q.
+  * @con_mon_lock:     protects @ap_bssid, @bcn_*, @avg_rssi.
+  * @mutex:            ensures exclusive access from mac80211 callbacks.
+- * @vendor_req_mutex: ensures atomicity of vendor requests.
++ * @vendor_req_mutex: protects @vend_buf, ensures atomicity of split writes.
+  * @reg_atomic_mutex: ensures atomicity of indirect register accesses
+  *                    (accesses to RF and BBP).
+  * @hw_atomic_mutex:  ensures exclusive access to HW during critical
+@@ -184,6 +184,8 @@ struct mt7601u_dev {
+       struct mt7601u_eeprom_params *ee;
+       struct mutex vendor_req_mutex;
++      void *vend_buf;
++
+       struct mutex reg_atomic_mutex;
+       struct mutex hw_atomic_mutex;
+diff --git a/drivers/net/wireless/mediatek/mt7601u/usb.c b/drivers/net/wireless/mediatek/mt7601u/usb.c
+index 54dba40..416c604 100644
+--- a/drivers/net/wireless/mediatek/mt7601u/usb.c
++++ b/drivers/net/wireless/mediatek/mt7601u/usb.c
+@@ -92,10 +92,9 @@ void mt7601u_complete_urb(struct urb *urb)
+       complete(cmpl);
+ }
+-static int
+-__mt7601u_vendor_request(struct mt7601u_dev *dev, const u8 req,
+-                       const u8 direction, const u16 val, const u16 offset,
+-                       void *buf, const size_t buflen)
++int mt7601u_vendor_request(struct mt7601u_dev *dev, const u8 req,
++                         const u8 direction, const u16 val, const u16 offset,
++                         void *buf, const size_t buflen)
+ {
+       int i, ret;
+       struct usb_device *usb_dev = mt7601u_to_usb_dev(dev);
+@@ -110,6 +109,8 @@ __mt7601u_vendor_request(struct mt7601u_dev *dev, const u8 req,
+               trace_mt_vend_req(dev, pipe, req, req_type, val, offset,
+                                 buf, buflen, ret);
++              if (ret == -ENODEV)
++                      set_bit(MT7601U_STATE_REMOVED, &dev->state);
+               if (ret >= 0 || ret == -ENODEV)
+                       return ret;
+@@ -122,25 +123,6 @@ __mt7601u_vendor_request(struct mt7601u_dev *dev, const u8 req,
+       return ret;
+ }
+-int
+-mt7601u_vendor_request(struct mt7601u_dev *dev, const u8 req,
+-                     const u8 direction, const u16 val, const u16 offset,
+-                     void *buf, const size_t buflen)
+-{
+-      int ret;
+-
+-      mutex_lock(&dev->vendor_req_mutex);
+-
+-      ret = __mt7601u_vendor_request(dev, req, direction, val, offset,
+-                                     buf, buflen);
+-      if (ret == -ENODEV)
+-              set_bit(MT7601U_STATE_REMOVED, &dev->state);
+-
+-      mutex_unlock(&dev->vendor_req_mutex);
+-
+-      return ret;
+-}
+-
+ void mt7601u_vendor_reset(struct mt7601u_dev *dev)
+ {
+       mt7601u_vendor_request(dev, MT_VEND_DEV_MODE, USB_DIR_OUT,
+@@ -150,19 +132,21 @@ void mt7601u_vendor_reset(struct mt7601u_dev *dev)
+ u32 mt7601u_rr(struct mt7601u_dev *dev, u32 offset)
+ {
+       int ret;
+-      __le32 reg;
+-      u32 val;
++      u32 val = ~0;
+       WARN_ONCE(offset > USHRT_MAX, "read high off:%08x", offset);
++      mutex_lock(&dev->vendor_req_mutex);
++
+       ret = mt7601u_vendor_request(dev, MT_VEND_MULTI_READ, USB_DIR_IN,
+-                                   0, offset, &reg, sizeof(reg));
+-      val = le32_to_cpu(reg);
+-      if (ret > 0 && ret != sizeof(reg)) {
++                                   0, offset, dev->vend_buf, MT_VEND_BUF);
++      if (ret == MT_VEND_BUF)
++              val = get_unaligned_le32(dev->vend_buf);
++      else if (ret > 0)
+               dev_err(dev->dev, "Error: wrong size read:%d off:%08x\n",
+                       ret, offset);
+-              val = ~0;
+-      }
++
++      mutex_unlock(&dev->vendor_req_mutex);
+       trace_reg_read(dev, offset, val);
+       return val;
+@@ -173,12 +157,17 @@ int mt7601u_vendor_single_wr(struct mt7601u_dev *dev, const u8 req,
+ {
+       int ret;
++      mutex_lock(&dev->vendor_req_mutex);
++
+       ret = mt7601u_vendor_request(dev, req, USB_DIR_OUT,
+                                    val & 0xffff, offset, NULL, 0);
+-      if (ret)
+-              return ret;
+-      return mt7601u_vendor_request(dev, req, USB_DIR_OUT,
+-                                    val >> 16, offset + 2, NULL, 0);
++      if (!ret)
++              ret = mt7601u_vendor_request(dev, req, USB_DIR_OUT,
++                                           val >> 16, offset + 2, NULL, 0);
++
++      mutex_unlock(&dev->vendor_req_mutex);
++
++      return ret;
+ }
+ void mt7601u_wr(struct mt7601u_dev *dev, u32 offset, u32 val)
+@@ -275,6 +264,12 @@ static int mt7601u_probe(struct usb_interface *usb_intf,
+       usb_set_intfdata(usb_intf, dev);
++      dev->vend_buf = devm_kmalloc(dev->dev, MT_VEND_BUF, GFP_KERNEL);
++      if (!dev->vend_buf) {
++              ret = -ENOMEM;
++              goto err;
++      }
++
+       ret = mt7601u_assign_pipes(usb_intf, dev);
+       if (ret)
+               goto err;
+diff --git a/drivers/net/wireless/mediatek/mt7601u/usb.h b/drivers/net/wireless/mediatek/mt7601u/usb.h
+index 49e188f..bc18202 100644
+--- a/drivers/net/wireless/mediatek/mt7601u/usb.h
++++ b/drivers/net/wireless/mediatek/mt7601u/usb.h
+@@ -23,6 +23,8 @@
+ #define MT_VEND_DEV_MODE_RESET        1
++#define MT_VEND_BUF           sizeof(__le32)
++
+ enum mt_vendor_req {
+       MT_VEND_DEV_MODE = 1,
+       MT_VEND_WRITE = 2,
+-- 
+cgit v0.12
+
+From d9517c0a5d7468a7ea63086057604fcb0fff480e Mon Sep 17 00:00:00 2001
+From: Jakub Kicinski <kubakici@wp.pl>
+Date: Fri, 31 Jul 2015 15:04:47 +0200
+Subject: mt7601u: use correct ieee80211_rx variant
+
+Rx is run inside a tasklet so ieee80211_rx() should be used
+instead of ieee80211_rx_ni().
+
+Signed-off-by: Jakub Kicinski <kubakici@wp.pl>
+Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
+---
+ drivers/net/wireless/mediatek/mt7601u/dma.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/drivers/net/wireless/mediatek/mt7601u/dma.c b/drivers/net/wireless/mediatek/mt7601u/dma.c
+index 7217da4..fb183e3 100644
+--- a/drivers/net/wireless/mediatek/mt7601u/dma.c
++++ b/drivers/net/wireless/mediatek/mt7601u/dma.c
+@@ -112,7 +112,7 @@ static void mt7601u_rx_process_seg(struct mt7601u_dev *dev, u8 *data,
+       if (!skb)
+               return;
+-      ieee80211_rx_ni(dev->hw, skb);
++      ieee80211_rx(dev->hw, skb);
+ }
+ static u16 mt7601u_rx_next_seg_len(u8 *data, u32 data_len)
+-- 
+cgit v0.12
+
+From 4513493d188d5e3052aee68eda85eaaa1a4e41c2 Mon Sep 17 00:00:00 2001
+From: Jakub Kicinski <kubakici@wp.pl>
+Date: Fri, 31 Jul 2015 15:04:48 +0200
+Subject: mt7601u: fix tx status reporting contexts
+
+mac80211 requires that rx path does not run concurrently with
+tx status reporting.  Since rx path is run in driver tasklet,
+tx status cannot be reported directly from interrupt context
+(there would be no way to lock it out).
+
+Add tasklet for tx and move all possible code from irq handler
+there.
+
+Note: tx tasklet is needed because workqueue is queued very
+      rarely and that kills TCP performance.
+
+Signed-off-by: Jakub Kicinski <kubakici@wp.pl>
+Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
+---
+ drivers/net/wireless/mediatek/mt7601u/dma.c     | 30 +++++++++++++++++++++----
+ drivers/net/wireless/mediatek/mt7601u/init.c    |  1 +
+ drivers/net/wireless/mediatek/mt7601u/mac.c     |  4 ++++
+ drivers/net/wireless/mediatek/mt7601u/mt7601u.h |  2 ++
+ 4 files changed, 33 insertions(+), 4 deletions(-)
+
+diff --git a/drivers/net/wireless/mediatek/mt7601u/dma.c b/drivers/net/wireless/mediatek/mt7601u/dma.c
+index fb183e3..63c4854 100644
+--- a/drivers/net/wireless/mediatek/mt7601u/dma.c
++++ b/drivers/net/wireless/mediatek/mt7601u/dma.c
+@@ -236,23 +236,42 @@ static void mt7601u_complete_tx(struct urb *urb)
+       skb = q->e[q->start].skb;
+       trace_mt_tx_dma_done(dev, skb);
+-      mt7601u_tx_status(dev, skb);
++      __skb_queue_tail(&dev->tx_skb_done, skb);
++      tasklet_schedule(&dev->tx_tasklet);
+       if (q->used == q->entries - q->entries / 8)
+               ieee80211_wake_queue(dev->hw, skb_get_queue_mapping(skb));
+       q->start = (q->start + 1) % q->entries;
+       q->used--;
++out:
++      spin_unlock_irqrestore(&dev->tx_lock, flags);
++}
+-      if (urb->status)
+-              goto out;
++static void mt7601u_tx_tasklet(unsigned long data)
++{
++      struct mt7601u_dev *dev = (struct mt7601u_dev *) data;
++      struct sk_buff_head skbs;
++      unsigned long flags;
++
++      __skb_queue_head_init(&skbs);
++
++      spin_lock_irqsave(&dev->tx_lock, flags);
+       set_bit(MT7601U_STATE_MORE_STATS, &dev->state);
+       if (!test_and_set_bit(MT7601U_STATE_READING_STATS, &dev->state))
+               queue_delayed_work(dev->stat_wq, &dev->stat_work,
+                                  msecs_to_jiffies(10));
+-out:
++
++      skb_queue_splice_init(&dev->tx_skb_done, &skbs);
++
+       spin_unlock_irqrestore(&dev->tx_lock, flags);
++
++      while (!skb_queue_empty(&skbs)) {
++              struct sk_buff *skb = __skb_dequeue(&skbs);
++
++              mt7601u_tx_status(dev, skb);
++      }
+ }
+ static int mt7601u_dma_submit_tx(struct mt7601u_dev *dev,
+@@ -475,6 +494,7 @@ int mt7601u_dma_init(struct mt7601u_dev *dev)
+ {
+       int ret = -ENOMEM;
++      tasklet_init(&dev->tx_tasklet, mt7601u_tx_tasklet, (unsigned long) dev);
+       tasklet_init(&dev->rx_tasklet, mt7601u_rx_tasklet, (unsigned long) dev);
+       ret = mt7601u_alloc_tx(dev);
+@@ -502,4 +522,6 @@ void mt7601u_dma_cleanup(struct mt7601u_dev *dev)
+       mt7601u_free_rx(dev);
+       mt7601u_free_tx(dev);
++
++      tasklet_kill(&dev->tx_tasklet);
+ }
+diff --git a/drivers/net/wireless/mediatek/mt7601u/init.c b/drivers/net/wireless/mediatek/mt7601u/init.c
+index df3dd56..38eb20b 100644
+--- a/drivers/net/wireless/mediatek/mt7601u/init.c
++++ b/drivers/net/wireless/mediatek/mt7601u/init.c
+@@ -456,6 +456,7 @@ struct mt7601u_dev *mt7601u_alloc_device(struct device *pdev)
+       spin_lock_init(&dev->lock);
+       spin_lock_init(&dev->con_mon_lock);
+       atomic_set(&dev->avg_ampdu_len, 1);
++      skb_queue_head_init(&dev->tx_skb_done);
+       dev->stat_wq = alloc_workqueue("mt7601u", WQ_UNBOUND, 0);
+       if (!dev->stat_wq) {
+diff --git a/drivers/net/wireless/mediatek/mt7601u/mac.c b/drivers/net/wireless/mediatek/mt7601u/mac.c
+index 7514bce..e3928cf 100644
+--- a/drivers/net/wireless/mediatek/mt7601u/mac.c
++++ b/drivers/net/wireless/mediatek/mt7601u/mac.c
+@@ -181,7 +181,11 @@ void mt76_send_tx_status(struct mt7601u_dev *dev, struct mt76_tx_status *stat)
+       }
+       mt76_mac_fill_tx_status(dev, &info, stat);
++
++      local_bh_disable();
+       ieee80211_tx_status_noskb(dev->hw, sta, &info);
++      local_bh_enable();
++
+       rcu_read_unlock();
+ }
+diff --git a/drivers/net/wireless/mediatek/mt7601u/mt7601u.h b/drivers/net/wireless/mediatek/mt7601u/mt7601u.h
+index 6bdfc11..bc5e294 100644
+--- a/drivers/net/wireless/mediatek/mt7601u/mt7601u.h
++++ b/drivers/net/wireless/mediatek/mt7601u/mt7601u.h
+@@ -199,7 +199,9 @@ struct mt7601u_dev {
+       /* TX */
+       spinlock_t tx_lock;
++      struct tasklet_struct tx_tasklet;
+       struct mt7601u_tx_queue *tx_q;
++      struct sk_buff_head tx_skb_done;
+       atomic_t avg_ampdu_len;
+-- 
+cgit v0.12
+
+From 78623bfb6f4cbdba3183621e8e0e781611217022 Mon Sep 17 00:00:00 2001
+From: Jakub Kicinski <kubakici@wp.pl>
+Date: Fri, 31 Jul 2015 15:04:49 +0200
+Subject: mt7601u: lock out rx path and tx status reporting
+
+mac80211 requires that rx path does not run concurrently with
+tx status reporting.  Add a spinlock which will ensure that.
+
+Signed-off-by: Jakub Kicinski <kubakici@wp.pl>
+Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
+---
+ drivers/net/wireless/mediatek/mt7601u/dma.c     | 2 ++
+ drivers/net/wireless/mediatek/mt7601u/init.c    | 1 +
+ drivers/net/wireless/mediatek/mt7601u/mac.c     | 4 ++--
+ drivers/net/wireless/mediatek/mt7601u/mt7601u.h | 4 +++-
+ drivers/net/wireless/mediatek/mt7601u/tx.c      | 3 +++
+ 5 files changed, 11 insertions(+), 3 deletions(-)
+
+diff --git a/drivers/net/wireless/mediatek/mt7601u/dma.c b/drivers/net/wireless/mediatek/mt7601u/dma.c
+index 63c4854..57a80cf 100644
+--- a/drivers/net/wireless/mediatek/mt7601u/dma.c
++++ b/drivers/net/wireless/mediatek/mt7601u/dma.c
+@@ -112,7 +112,9 @@ static void mt7601u_rx_process_seg(struct mt7601u_dev *dev, u8 *data,
+       if (!skb)
+               return;
++      spin_lock(&dev->mac_lock);
+       ieee80211_rx(dev->hw, skb);
++      spin_unlock(&dev->mac_lock);
+ }
+ static u16 mt7601u_rx_next_seg_len(u8 *data, u32 data_len)
+diff --git a/drivers/net/wireless/mediatek/mt7601u/init.c b/drivers/net/wireless/mediatek/mt7601u/init.c
+index 38eb20b..26190fd 100644
+--- a/drivers/net/wireless/mediatek/mt7601u/init.c
++++ b/drivers/net/wireless/mediatek/mt7601u/init.c
+@@ -454,6 +454,7 @@ struct mt7601u_dev *mt7601u_alloc_device(struct device *pdev)
+       spin_lock_init(&dev->tx_lock);
+       spin_lock_init(&dev->rx_lock);
+       spin_lock_init(&dev->lock);
++      spin_lock_init(&dev->mac_lock);
+       spin_lock_init(&dev->con_mon_lock);
+       atomic_set(&dev->avg_ampdu_len, 1);
+       skb_queue_head_init(&dev->tx_skb_done);
+diff --git a/drivers/net/wireless/mediatek/mt7601u/mac.c b/drivers/net/wireless/mediatek/mt7601u/mac.c
+index e3928cf..e21c53e 100644
+--- a/drivers/net/wireless/mediatek/mt7601u/mac.c
++++ b/drivers/net/wireless/mediatek/mt7601u/mac.c
+@@ -182,9 +182,9 @@ void mt76_send_tx_status(struct mt7601u_dev *dev, struct mt76_tx_status *stat)
+       mt76_mac_fill_tx_status(dev, &info, stat);
+-      local_bh_disable();
++      spin_lock_bh(&dev->mac_lock);
+       ieee80211_tx_status_noskb(dev->hw, sta, &info);
+-      local_bh_enable();
++      spin_unlock_bh(&dev->mac_lock);
+       rcu_read_unlock();
+ }
+diff --git a/drivers/net/wireless/mediatek/mt7601u/mt7601u.h b/drivers/net/wireless/mediatek/mt7601u/mt7601u.h
+index bc5e294..428bd2f 100644
+--- a/drivers/net/wireless/mediatek/mt7601u/mt7601u.h
++++ b/drivers/net/wireless/mediatek/mt7601u/mt7601u.h
+@@ -141,8 +141,9 @@ enum {
+ /**
+  * struct mt7601u_dev - adapter structure
+  * @lock:             protects @wcid->tx_rate.
++ * @mac_lock:         locks out mac80211's tx status and rx paths.
+  * @tx_lock:          protects @tx_q and changes of MT7601U_STATE_*_STATS
+-                      flags in @state.
++ *                    flags in @state.
+  * @rx_lock:          protects @rx_q.
+  * @con_mon_lock:     protects @ap_bssid, @bcn_*, @avg_rssi.
+  * @mutex:            ensures exclusive access from mac80211 callbacks.
+@@ -177,6 +178,7 @@ struct mt7601u_dev {
+       struct mt76_wcid __rcu *wcid[N_WCIDS];
+       spinlock_t lock;
++      spinlock_t mac_lock;
+       const u16 *beacon_offsets;
+diff --git a/drivers/net/wireless/mediatek/mt7601u/tx.c b/drivers/net/wireless/mediatek/mt7601u/tx.c
+index 0be2080..a0a33dc 100644
+--- a/drivers/net/wireless/mediatek/mt7601u/tx.c
++++ b/drivers/net/wireless/mediatek/mt7601u/tx.c
+@@ -116,7 +116,10 @@ void mt7601u_tx_status(struct mt7601u_dev *dev, struct sk_buff *skb)
+       ieee80211_tx_info_clear_status(info);
+       info->status.rates[0].idx = -1;
+       info->flags |= IEEE80211_TX_STAT_ACK;
++
++      spin_lock(&dev->mac_lock);
+       ieee80211_tx_status(dev->hw, skb);
++      spin_unlock(&dev->mac_lock);
+ }
+ static int mt7601u_skb_rooms(struct mt7601u_dev *dev, struct sk_buff *skb)
+-- 
+cgit v0.12
+
diff --git a/src/patches/binutils-2.22-pt-pax-flags-20111121.patch b/src/patches/binutils-2.22-pt-pax-flags-20111121.patch
deleted file mode 100644 (file)
index 3ba1a87..0000000
+++ /dev/null
@@ -1,1859 +0,0 @@
---- binutils-2.22/bfd/elf-bfd.h
-+++ binutils-2.22/bfd/elf-bfd.h
-@@ -1577,6 +1577,9 @@ struct elf_obj_tdata
-   /* Segment flags for the PT_GNU_STACK segment.  */
-   unsigned int stack_flags;
-+  /* Segment flags for the PT_PAX_FLAGS segment.  */
-+  unsigned int pax_flags;
-+
-   /* Symbol version definitions in external objects.  */
-   Elf_Internal_Verdef *verdef;
---- binutils-2.22/bfd/elf.c
-+++ binutils-2.22/bfd/elf.c
-@@ -1158,6 +1158,7 @@ get_segment_type (unsigned int p_type)
-     case PT_GNU_EH_FRAME: pt = "EH_FRAME"; break;
-     case PT_GNU_STACK: pt = "STACK"; break;
-     case PT_GNU_RELRO: pt = "RELRO"; break;
-+    case PT_PAX_FLAGS: pt = "PAX_FLAGS"; break;
-     default: pt = NULL; break;
-     }
-   return pt;
-@@ -2477,6 +2478,9 @@ bfd_section_from_phdr (bfd *abfd, Elf_Internal_Phdr *hdr, int hdr_index)
-     case PT_GNU_RELRO:
-       return _bfd_elf_make_section_from_phdr (abfd, hdr, hdr_index, "relro");
-+    case PT_PAX_FLAGS:
-+      return _bfd_elf_make_section_from_phdr (abfd, hdr, hdr_index, "pax_flags");
-+
-     default:
-       /* Check for any processor-specific program segment types.  */
-       bed = get_elf_backend_data (abfd);
-@@ -3551,6 +3555,11 @@ get_program_header_size (bfd *abfd, struct bfd_link_info *info)
-       ++segs;
-     }
-+    {
-+      /* We need a PT_PAX_FLAGS segment.  */
-+      ++segs;
-+    }
-+
-   for (s = abfd->sections; s != NULL; s = s->next)
-     {
-       if ((s->flags & SEC_LOAD) != 0
-@@ -4153,6 +4162,20 @@ _bfd_elf_map_sections_to_segments (bfd *abfd, struct bfd_link_info *info)
-           }
-       }
-+    {
-+      amt = sizeof (struct elf_segment_map);
-+      m = bfd_zalloc (abfd, amt);
-+      if (m == NULL)
-+      goto error_return;
-+      m->next = NULL;
-+      m->p_type = PT_PAX_FLAGS;
-+      m->p_flags = elf_tdata (abfd)->pax_flags;
-+      m->p_flags_valid = 1;
-+
-+      *pm = m;
-+      pm = &m->next;
-+    }
-+
-       free (sections);
-       elf_tdata (abfd)->segment_map = mfirst;
-     }
-@@ -5417,7 +5440,8 @@ rewrite_elf_program_header (bfd *ibfd, bfd *obfd)
-        6. PT_TLS segment includes only SHF_TLS sections.
-        7. SHF_TLS sections are only in PT_TLS or PT_LOAD segments.
-        8. PT_DYNAMIC should not contain empty sections at the beginning
--        (with the possible exception of .dynamic).  */
-+        (with the possible exception of .dynamic).
-+       9. PT_PAX_FLAGS segments do not include any sections.  */
- #define IS_SECTION_IN_INPUT_SEGMENT(section, segment, bed)            \
-   ((((segment->p_paddr                                                        \
-       ? IS_CONTAINED_BY_LMA (section, segment, segment->p_paddr)      \
-@@ -5425,6 +5449,7 @@ rewrite_elf_program_header (bfd *ibfd, bfd *obfd)
-      && (section->flags & SEC_ALLOC) != 0)                            \
-     || IS_NOTE (segment, section))                                    \
-    && segment->p_type != PT_GNU_STACK                                 \
-+   && segment->p_type != PT_PAX_FLAGS                                 \
-    && (segment->p_type != PT_TLS                                      \
-        || (section->flags & SEC_THREAD_LOCAL))                                \
-    && (segment->p_type == PT_LOAD                                     \
---- binutils-2.22/bfd/elflink.c
-+++ binutils-2.22/bfd/elflink.c
-@@ -5545,16 +5545,30 @@ bfd_elf_size_dynamic_sections (bfd *output_bfd,
-     return TRUE;
-   bed = get_elf_backend_data (output_bfd);
-+
-+  elf_tdata (output_bfd)->pax_flags = PF_NORANDEXEC;
-+  if (info->execheap)
-+    elf_tdata (output_bfd)->pax_flags |= PF_NOMPROTECT;
-+  else if (info->noexecheap)
-+    elf_tdata (output_bfd)->pax_flags |= PF_MPROTECT;
-+
-   if (info->execstack)
--    elf_tdata (output_bfd)->stack_flags = PF_R | PF_W | PF_X;
-+    {
-+      elf_tdata (output_bfd)->stack_flags = PF_R | PF_W | PF_X;
-+      elf_tdata (output_bfd)->pax_flags |= PF_EMUTRAMP;
-+    }
-   else if (info->noexecstack)
--    elf_tdata (output_bfd)->stack_flags = PF_R | PF_W;
-+    {
-+      elf_tdata (output_bfd)->stack_flags = PF_R | PF_W;
-+      elf_tdata (output_bfd)->pax_flags |= PF_NOEMUTRAMP;
-+    }
-   else
-     {
-       bfd *inputobj;
-       asection *notesec = NULL;
-       int exec = 0;
-+      elf_tdata (output_bfd)->pax_flags |= PF_NOEMUTRAMP;
-       for (inputobj = info->input_bfds;
-          inputobj;
-          inputobj = inputobj->link_next)
-@@ -5567,7 +5581,11 @@ bfd_elf_size_dynamic_sections (bfd *output_bfd,
-         if (s)
-           {
-             if (s->flags & SEC_CODE)
--              exec = PF_X;
-+              {
-+                elf_tdata (output_bfd)->pax_flags &= ~PF_NOEMUTRAMP;
-+                elf_tdata (output_bfd)->pax_flags |= PF_EMUTRAMP;
-+                exec = PF_X;
-+              }
-             notesec = s;
-           }
-         else if (bed->default_execstack)
---- binutils-2.22/binutils/readelf.c
-+++ binutils-2.22/binutils/readelf.c
-@@ -2740,6 +2740,7 @@ get_segment_type (unsigned long p_type)
-                       return "GNU_EH_FRAME";
-     case PT_GNU_STACK:        return "GNU_STACK";
-     case PT_GNU_RELRO:  return "GNU_RELRO";
-+    case PT_PAX_FLAGS:  return "PAX_FLAGS";
-     default:
-       if ((p_type >= PT_LOPROC) && (p_type <= PT_HIPROC))
---- binutils-2.22/include/bfdlink.h
-+++ binutils-2.22/include/bfdlink.h
-@@ -322,6 +322,14 @@ struct bfd_link_info
-   /* TRUE if PT_GNU_RELRO segment should be created.  */
-   unsigned int relro: 1;
-+  /* TRUE if PT_PAX_FLAGS segment should be created with PF_NOMPROTECT
-+     flags.  */
-+  unsigned int execheap: 1;
-+
-+  /* TRUE if PT_PAX_FLAGS segment should be created with PF_MPROTECT
-+     flags.  */
-+  unsigned int noexecheap: 1;
-+
-   /* TRUE if .eh_frame_hdr section and PT_GNU_EH_FRAME ELF segment
-      should be created.  */
-   unsigned int eh_frame_hdr: 1;
---- binutils-2.22/include/elf/common.h
-+++ binutils-2.22/include/elf/common.h
-@@ -429,6 +429,7 @@
- #define PT_SUNW_EH_FRAME PT_GNU_EH_FRAME      /* Solaris uses the same value */
- #define PT_GNU_STACK  (PT_LOOS + 0x474e551) /* Stack flags */
- #define PT_GNU_RELRO  (PT_LOOS + 0x474e552) /* Read-only after relocation */
-+#define PT_PAX_FLAGS  (PT_LOOS + 0x5041580) /* PaX flags */
- /* Program segment permissions, in program header p_flags field.  */
-@@ -439,6 +440,21 @@
- #define PF_MASKOS     0x0FF00000      /* New value, Oct 4, 1999 Draft */
- #define PF_MASKPROC   0xF0000000      /* Processor-specific reserved bits */
-+/* Flags to control PaX behavior.  */
-+
-+#define PF_PAGEEXEC   (1 << 4)        /* Enable  PAGEEXEC */
-+#define PF_NOPAGEEXEC (1 << 5)        /* Disable PAGEEXEC */
-+#define PF_SEGMEXEC   (1 << 6)        /* Enable  SEGMEXEC */
-+#define PF_NOSEGMEXEC (1 << 7)        /* Disable SEGMEXEC */
-+#define PF_MPROTECT   (1 << 8)        /* Enable  MPROTECT */
-+#define PF_NOMPROTECT (1 << 9)        /* Disable MPROTECT */
-+#define PF_RANDEXEC   (1 << 10)       /* Enable  RANDEXEC */
-+#define PF_NORANDEXEC (1 << 11)       /* Disable RANDEXEC */
-+#define PF_EMUTRAMP   (1 << 12)       /* Enable  EMUTRAMP */
-+#define PF_NOEMUTRAMP (1 << 13)       /* Disable EMUTRAMP */
-+#define PF_RANDMMAP   (1 << 14)       /* Enable  RANDMMAP */
-+#define PF_NORANDMMAP (1 << 15)       /* Disable RANDMMAP */
-+
- /* Values for section header, sh_type field.  */
- #define SHT_NULL      0               /* Section header table entry unused */
---- binutils-2.22/ld/emultempl/elf32.em
-+++ binutils-2.22/ld/emultempl/elf32.em
-@@ -2285,6 +2285,16 @@ fragment <<EOF
-         link_info.noexecstack = TRUE;
-         link_info.execstack = FALSE;
-       }
-+      else if (strcmp (optarg, "execheap") == 0)
-+      {
-+        link_info.execheap = TRUE;
-+        link_info.noexecheap = FALSE;
-+      }
-+      else if (strcmp (optarg, "noexecheap") == 0)
-+      {
-+        link_info.noexecheap = TRUE;
-+        link_info.execheap = FALSE;
-+      }
- EOF
- if test x"$GENERATE_SHLIB_SCRIPT" = xyes; then
- fragment <<EOF
-@@ -2368,6 +2378,8 @@ fragment <<EOF
-   -z defs                     Report unresolved symbols in object files.\n"));
-   fprintf (file, _("\
-   -z execstack                Mark executable as requiring executable stack\n"));
-+  fprintf (file, _("\
-+  -z execheap                 Mark executable as requiring executable heap\n"));
- EOF
- if test x"$GENERATE_SHLIB_SCRIPT" = xyes; then
-@@ -2391,6 +2403,8 @@ fragment <<EOF
- fragment <<EOF
-   fprintf (file, _("\
-   -z noexecstack              Mark executable as not requiring executable stack\n"));
-+  fprintf (file, _("\
-+  -z noexecheap               Mark executable as not requiring executable heap\n"));
- EOF
- if test x"$GENERATE_SHLIB_SCRIPT" = xyes; then
- fragment <<EOF
---- binutils-2.22/ld/ldgram.y
-+++ binutils-2.22/ld/ldgram.y
-@@ -1119,6 +1119,8 @@ phdr_type:
-                           $$ = exp_intop (0x6474e550);
-                         else if (strcmp (s, "PT_GNU_STACK") == 0)
-                           $$ = exp_intop (0x6474e551);
-+                        else if (strcmp (s, "PT_PAX_FLAGS") == 0)
-+                          $$ = exp_intop (0x65041580);
-                         else
-                           {
-                             einfo (_("\
---- binutils-2.22/ld/testsuite/ld-alpha/tlsbin.rd
-+++ binutils-2.22/ld/testsuite/ld-alpha/tlsbin.rd
-@@ -35,13 +35,14 @@ There are [0-9]+ program headers, starting at offset [0-9]+
- Program Headers:
-   Type +Offset +VirtAddr +PhysAddr +FileSiz +MemSiz +Flg Align
--  PHDR +0x[0-9a-f]+ 0x[0-9a-f]+ 0x[0-9a-f]+ 0x[0-9a-f]+ 0x0+150 R E 0x8
-+  PHDR +0x[0-9a-f]+ 0x[0-9a-f]+ 0x[0-9a-f]+ 0x[0-9a-f]+ 0x0+188 R E 0x8
-   INTERP +0x[0-9a-f]+ 0x[0-9a-f]+ 0x[0-9a-f]+ 0x[0-9a-f]+ 0x[0-9a-f]+ R +0x1
- .*Requesting program interpreter.*
-   LOAD +0x[0-9a-f]+ 0x[0-9a-f]+ 0x[0-9a-f]+ 0x[0-9a-f]+ 0x[0-9a-f]+ R E 0x10000
-   LOAD +0x[0-9a-f]+ 0x[0-9a-f]+ 0x[0-9a-f]+ 0x[0-9a-f]+ 0x[0-9a-f]+ RWE 0x10000
-   DYNAMIC +0x[0-9a-f]+ 0x[0-9a-f]+ 0x[0-9a-f]+ 0x[0-9a-f]+ 0x[0-9a-f]+ RW +0x8
-   TLS +0x[0-9a-f]+ 0x[0-9a-f]+ 0x[0-9a-f]+ 0x[0-9a-f]+ 0x[0-9a-f]+ R +0x4
-+ +PAX_FLAGS +0x0+ 0x0+ 0x0+ 0x0+ 0x0+ +0x[48]
- #...
- Relocation section '.rela.dyn' at offset 0x[0-9a-f]+ contains 3 entries:
---- binutils-2.22/ld/testsuite/ld-alpha/tlsbinr.rd
-+++ binutils-2.22/ld/testsuite/ld-alpha/tlsbinr.rd
-@@ -42,6 +42,7 @@ Program Headers:
-  +LOAD +0x[0-9a-f]+ 0x[0-9a-f]+ 0x[0-9a-f]+ 0x[0-9a-f]+ 0x[0-9a-f]+ RWE 0x10000
-  +DYNAMIC +0x[0-9a-f]+ 0x[0-9a-f]+ 0x[0-9a-f]+ 0x[0-9a-f]+ 0x[0-9a-f]+ RW +0x8
-  +TLS +0x[0-9a-f]+ 0x[0-9a-f]+ 0x[0-9a-f]+ 0x[0-9a-f]+ 0x[0-9a-f]+ R +0x4
-+ +PAX_FLAGS +0x0+ 0x0+ 0x0+ 0x0+ 0x0+ +0x[48]
- #...
- Relocation section '.rela.dyn' at offset 0x[0-9a-f]+ contains 2 entries:
---- binutils-2.22/ld/testsuite/ld-alpha/tlspic.rd
-+++ binutils-2.22/ld/testsuite/ld-alpha/tlspic.rd
-@@ -38,6 +38,7 @@ Program Headers:
-  +LOAD +0x[0-9a-f]+ 0x[0-9a-f]+ 0x[0-9a-f]+ 0x[0-9a-f]+ 0x[0-9a-f]+ RWE 0x10000
-  +DYNAMIC +0x[0-9a-f]+ 0x[0-9a-f]+ 0x[0-9a-f]+ 0x[0-9a-f]+ 0x[0-9a-f]+ RW +0x8
-  +TLS +0x0+10e0 0x0+110e0 0x0+110e0 0x0+60 0x0+80 R +0x4
-+ +PAX_FLAGS +0x0+ 0x0+ 0x0+ 0x0+ 0x0+ +0x[48]
- #...
- Relocation section '.rela.dyn' at offset 0x[0-9a-f]+ contains 7 entries:
---- binutils-2.22/ld/testsuite/ld-elf/eh1.d
-+++ binutils-2.22/ld/testsuite/ld-elf/eh1.d
-@@ -22,11 +22,11 @@ Contents of the .eh_frame section:
-   DW_CFA_nop
-   DW_CFA_nop
--00000018 0000001c 0000001c FDE cie=00000000 pc=00400078..00400078
--  DW_CFA_advance_loc: 0 to 00400078
-+00000018 0000001c 0000001c FDE cie=00000000 pc=([0-9a-f]+)..\1
-+  DW_CFA_advance_loc: 0 to [0-9a-f]+
-   DW_CFA_def_cfa_offset: 16
-   DW_CFA_offset: r6 \(rbp\) at cfa-16
--  DW_CFA_advance_loc: 0 to 00400078
-+  DW_CFA_advance_loc: 0 to [0-9a-f]+
-   DW_CFA_def_cfa_register: r6 \(rbp\)
- 00000038 ZERO terminator
---- binutils-2.22/ld/testsuite/ld-elf/eh2.d
-+++ binutils-2.22/ld/testsuite/ld-elf/eh2.d
-@@ -22,11 +22,11 @@ Contents of the .eh_frame section:
-   DW_CFA_nop
-   DW_CFA_nop
--00000018 0000001c 0000001c FDE cie=00000000 pc=00400078..00400078
--  DW_CFA_advance_loc: 0 to 00400078
-+00000018 0000001c 0000001c FDE cie=00000000 pc=([0-9a-f]+)..\1
-+  DW_CFA_advance_loc: 0 to [0-9a-f]+
-   DW_CFA_def_cfa_offset: 16
-   DW_CFA_offset: r6 \(rbp\) at cfa-16
--  DW_CFA_advance_loc: 0 to 00400078
-+  DW_CFA_advance_loc: 0 to [0-9a-f]+
-   DW_CFA_def_cfa_register: r6 \(rbp\)
- 00000038 ZERO terminator
---- binutils-2.22/ld/testsuite/ld-elf/eh3.d
-+++ binutils-2.22/ld/testsuite/ld-elf/eh3.d
-@@ -22,11 +22,11 @@ Contents of the .eh_frame section:
-   DW_CFA_nop
-   DW_CFA_nop
--00000018 0000001c 0000001c FDE cie=00000000 pc=00400078..00400078
--  DW_CFA_advance_loc: 0 to 00400078
-+00000018 0000001c 0000001c FDE cie=00000000 pc=([0-9a-f]+)..\1
-+  DW_CFA_advance_loc: 0 to [0-9a-f]+
-   DW_CFA_def_cfa_offset: 16
-   DW_CFA_offset: r6 \(rbp\) at cfa-16
--  DW_CFA_advance_loc: 0 to 00400078
-+  DW_CFA_advance_loc: 0 to [0-9a-f]+
-   DW_CFA_def_cfa_register: r6 \(rbp\)
- 00000038 ZERO terminator
---- binutils-2.22/ld/testsuite/ld-elf/orphan-region.d
-+++ binutils-2.22/ld/testsuite/ld-elf/orphan-region.d
-@@ -15,7 +15,9 @@
- Program Headers:
-   Type.*
-   LOAD[ \t]+0x[0-9a-f]+ 0x0*40000000 0x0*40000000 0x[0-9a-f]+ 0x[0-9a-f]+ RWE 0x[0-9a-f]+
-+ +PAX_FLAGS +0x0+ 0x0+ 0x0+ 0x0+ 0x0+ +0x[48]
-  Section to Segment mapping:
-   Segment Sections...
-    00     .text .rodata .moredata *
-+   01 +
---- binutils-2.22/ld/testsuite/ld-i386/tlsbin.rd
-+++ binutils-2.22/ld/testsuite/ld-i386/tlsbin.rd
-@@ -44,6 +44,7 @@ Program Headers:
-  +LOAD.*
-  +DYNAMIC.*
-  +TLS +0x[0-9a-f]+ 0x[0-9a-f]+ 0x[0-9a-f]+ 0x0+60 0x0+a0 R +0x1000
-+ +PAX_FLAGS +0x0+ 0x0+ 0x0+ 0x0+ 0x0+ +0x[48]
-  Section to Segment mapping:
-  +Segment Sections...
-@@ -53,6 +54,7 @@ Program Headers:
-  +03 +.tdata .dynamic .got .got.plt *
-  +04 +.dynamic *
-  +05 +.tdata .tbss *
-+ +06 +
- Relocation section '.rel.dyn' at offset 0x[0-9a-f]+ contains 9 entries:
-  Offset +Info +Type +Sym.Value +Sym. Name
---- binutils-2.22/ld/testsuite/ld-i386/tlsbindesc.rd
-+++ binutils-2.22/ld/testsuite/ld-i386/tlsbindesc.rd
-@@ -42,6 +42,7 @@ Program Headers:
-  +LOAD.*
-  +DYNAMIC.*
-  +TLS +0x[0-9a-f]+ 0x[0-9a-f]+ 0x[0-9a-f]+ 0x0+60 0x0+a0 R +0x1000
-+ +PAX_FLAGS +0x0+ 0x0+ 0x0+ 0x0+ 0x0+ +0x[48]
-  Section to Segment mapping:
-  +Segment Sections...
-@@ -51,6 +52,7 @@ Program Headers:
-  +03 +.tdata .dynamic .got .got.plt *
-  +04 +.dynamic *
-  +05 +.tdata .tbss *
-+ +06 +
- Relocation section '.rel.dyn' at offset 0x[0-9a-f]+ contains 9 entries:
-  Offset +Info +Type +Sym.Value +Sym. Name
---- binutils-2.22/ld/testsuite/ld-i386/tlsdesc.rd
-+++ binutils-2.22/ld/testsuite/ld-i386/tlsdesc.rd
-@@ -39,6 +39,7 @@ Program Headers:
-  +LOAD.*
-  +DYNAMIC.*
-  +TLS +0x[0-9a-f]+ 0x[0-9a-f]+ 0x[0-9a-f]+ 0x0+60 0x0+80 R +0x1
-+ +PAX_FLAGS +0x0+ 0x0+ 0x0+ 0x0+ 0x0+ +0x[48]
-  Section to Segment mapping:
-  +Segment Sections...
-@@ -46,6 +47,7 @@ Program Headers:
-  +01 +.tdata .dynamic .got .got.plt *
-  +02 +.dynamic *
-  +03 +.tdata .tbss *
-+ +04 +
- Relocation section '.rel.dyn' at offset 0x[0-9a-f]+ contains 20 entries:
-  Offset +Info +Type +Sym.Value +Sym. Name
---- binutils-2.22/ld/testsuite/ld-i386/tlsdesc.sd
-+++ binutils-2.22/ld/testsuite/ld-i386/tlsdesc.sd
-@@ -14,7 +14,7 @@ Contents of section \.got:
-  [0-9a-f]+ 6c000000 b4ffffff 4c000000 68000000  .*
-  [0-9a-f]+ 50000000 70000000 00000000 bcffffff  .*
- Contents of section \.got\.plt:
-- [0-9a-f]+ b0150000 00000000 00000000 00000000  .*
-+ [0-9a-f]+ [a-f]0150000 00000000 00000000 00000000  .*
-  [0-9a-f]+ 20000000 00000000 60000000 00000000  .*
-  [0-9a-f]+ 00000000 00000000 00000000 00000000  .*
-  [0-9a-f]+ 40000000 +.*
---- binutils-2.22/ld/testsuite/ld-i386/tlsgdesc.rd
-+++ binutils-2.22/ld/testsuite/ld-i386/tlsgdesc.rd
-@@ -36,12 +36,14 @@ Program Headers:
-  +LOAD.*
-  +LOAD.*
-  +DYNAMIC.*
-+ +PAX_FLAGS.*
-  Section to Segment mapping:
-  +Segment Sections...
-  +00 +.hash .dynsym .dynstr .rel.dyn .rel.plt .plt .text *
-  +01 +.dynamic .got .got.plt *
-  +02 +.dynamic *
-+ +03 +
- Relocation section '.rel.dyn' at offset 0x[0-9a-f]+ contains 8 entries:
-  Offset +Info +Type +Sym.Value +Sym. Name
---- binutils-2.22/ld/testsuite/ld-i386/tlsnopic.rd
-+++ binutils-2.22/ld/testsuite/ld-i386/tlsnopic.rd
-@@ -37,6 +37,7 @@ Program Headers:
-  +LOAD.*
-  +DYNAMIC.*
-  +TLS +0x[0-9a-f]+ 0x[0-9a-f]+ 0x[0-9a-f]+ 0x0+ 0x0+24 R +0x1
-+ +PAX_FLAGS +0x0+ 0x0+ 0x0+ 0x0+ 0x0+ +0x[48]
-  Section to Segment mapping:
-  +Segment Sections...
-@@ -44,6 +45,7 @@ Program Headers:
-  +01 +.dynamic .got .got.plt *
-  +02 +.dynamic *
-  +03 +.tbss *
-+ +04 +
- Relocation section '.rel.dyn' at offset 0x[0-9a-f]+ contains 20 entries:
-  Offset +Info +Type +Sym.Value +Sym. Name
---- binutils-2.22/ld/testsuite/ld-i386/tlspic.rd
-+++ binutils-2.22/ld/testsuite/ld-i386/tlspic.rd
-@@ -40,6 +40,7 @@ Program Headers:
-  +LOAD.*
-  +DYNAMIC.*
-  +TLS +0x[0-9a-f]+ 0x[0-9a-f]+ 0x[0-9a-f]+ 0x0+60 0x0+80 R +0x1
-+ +PAX_FLAGS +0x0+ 0x0+ 0x0+ 0x0+ 0x0+ +0x[48]
-  Section to Segment mapping:
-  +Segment Sections...
-@@ -47,6 +48,7 @@ Program Headers:
-  +01 +.tdata .dynamic .got .got.plt *
-  +02 +.dynamic *
-  +03 +.tdata .tbss *
-+ +04 +
- Relocation section '.rel.dyn' at offset 0x[0-9a-f]+ contains 26 entries:
-  Offset +Info +Type +Sym.Value +Sym. Name
---- binutils-2.22/ld/testsuite/ld-ia64/merge1.d
-+++ binutils-2.22/ld/testsuite/ld-ia64/merge1.d
-@@ -4,7 +4,7 @@
- #objdump: -d
- #...
--0+1e0 <.text>:
-+[a-f0-9]+ <.text>:
- [     ]*[a-f0-9]+:    0b 60 80 02 00 24       \[MMI\]       addl r12=32,r1;;
- [     ]*[a-f0-9]+:    c0 c0 04 00 48 00                   addl r12=24,r1
- [     ]*[a-f0-9]+:    00 00 04 00                         nop.i 0x0;;
---- binutils-2.22/ld/testsuite/ld-ia64/merge2.d
-+++ binutils-2.22/ld/testsuite/ld-ia64/merge2.d
-@@ -4,7 +4,7 @@
- #objdump: -d
- #...
--0+1e0 <.text>:
-+[a-f0-9]+ <.text>:
- [     ]*[a-f0-9]+:    0b 60 80 02 00 24       \[MMI\]       addl r12=32,r1;;
- [     ]*[a-f0-9]+:    c0 c0 04 00 48 00                   addl r12=24,r1
- [     ]*[a-f0-9]+:    00 00 04 00                         nop.i 0x0;;
---- binutils-2.22/ld/testsuite/ld-ia64/merge3.d
-+++ binutils-2.22/ld/testsuite/ld-ia64/merge3.d
-@@ -4,7 +4,7 @@
- #objdump: -d
- #...
--0+210 <.text>:
-+[a-f0-9]+ <.text>:
- [     ]*[a-f0-9]+:    0b 60 80 02 00 24       \[MMI\]       addl r12=32,r1;;
- [     ]*[a-f0-9]+:    c0 40 05 00 48 00                   addl r12=40,r1
- [     ]*[a-f0-9]+:    00 00 04 00                         nop.i 0x0;;
---- binutils-2.22/ld/testsuite/ld-ia64/merge4.d
-+++ binutils-2.22/ld/testsuite/ld-ia64/merge4.d
-@@ -4,7 +4,7 @@
- #objdump: -d
- #...
--0+240 <.text>:
-+[a-f0-9]+ <.text>:
- [     ]*[a-f0-9]+:    0b 60 80 02 00 24       \[MMI\]       addl r12=32,r1;;
- [     ]*[a-f0-9]+:    c0 40 05 00 48 00                   addl r12=40,r1
- [     ]*[a-f0-9]+:    00 00 04 00                         nop.i 0x0;;
---- binutils-2.22/ld/testsuite/ld-ia64/merge5.d
-+++ binutils-2.22/ld/testsuite/ld-ia64/merge5.d
-@@ -4,7 +4,7 @@
- #objdump: -d
- #...
--0+270 <.text>:
-+[a-f0-9]+ <.text>:
- [     ]*[a-f0-9]+:    0b 60 80 02 00 24       \[MMI\]       addl r12=32,r1;;
- [     ]*[a-f0-9]+:    c0 40 05 00 48 00                   addl r12=40,r1
- [     ]*[a-f0-9]+:    00 00 04 00                         nop.i 0x0;;
---- binutils-2.22/ld/testsuite/ld-ia64/tlsbin.rd
-+++ binutils-2.22/ld/testsuite/ld-ia64/tlsbin.rd
-@@ -36,13 +36,14 @@ There are [0-9]+ program headers, starting at offset [0-9]+
- Program Headers:
-  +Type +Offset +VirtAddr +PhysAddr +FileSiz +MemSiz +Flg Align
-- +PHDR +0x0+40 0x40+40 0x40+40 0x0+188 0x0+188 R E 0x8
-- +INTERP +0x0+1c8 0x40+1c8 0x40+1c8 0x[0-9a-f]+ 0x[0-9a-f]+ R +0x1
-+ +PHDR +0x0+40 0x40+40 0x40+40 (0x[0-9a-f]+) \1 R E 0x8
-+ +INTERP +0x0+([0-9a-f]+) (0x40+\1) \2 0x[0-9a-f]+ 0x[0-9a-f]+ R +0x1
- .*Requesting program interpreter.*
-  +LOAD +0x0+ 0x40+ 0x40+ 0x0+1[0-9a-f]+ 0x0+1[0-9a-f]+ R E 0x10000
-  +LOAD +0x0+1[0-9a-f]+ 0x60+1[0-9a-f]+ 0x60+1[0-9a-f]+ 0x0+0[0-9a-f]+ 0x0+0[0-9a-f]+ RW +0x10000
-  +DYNAMIC +0x0+1[0-9a-f]+ 0x60+1[0-9a-f]+ 0x60+1[0-9a-f]+ 0x0+150 0x0+150 RW +0x8
-  +TLS +0x0+1[0-9a-f]+ 0x60+1[0-9a-f]+ 0x60+1[0-9a-f]+ 0x0+60 0x0+a0 R +0x4
-+ +PAX_FLAGS +0x0+ 0x0+ 0x0+ 0x0+ 0x0+ +0x[48]
-  +IA_64_UNWIND .* R +0x8
- #...
---- binutils-2.22/ld/testsuite/ld-ia64/tlspic.rd
-+++ binutils-2.22/ld/testsuite/ld-ia64/tlspic.rd
-@@ -40,6 +40,7 @@ Program Headers:
-  +LOAD +0x0+1[0-9a-f]+ 0x0+11[0-9a-f]+ 0x0+11[0-9a-f]+ 0x0+0[0-9a-f]+ 0x0+0[0-9a-f]+ RW +0x10000
-  +DYNAMIC +0x0+1[0-9a-f]+ 0x0+11[0-9a-f]+ 0x0+11[0-9a-f]+ 0x0+140 0x0+140 RW +0x8
-  +TLS +0x0+1[0-9a-f]+ 0x0+11[0-9a-f]+ 0x0+11[0-9a-f]+ 0x0+60 0x0+80 R +0x4
-+ +PAX_FLAGS +0x0+ 0x0+ 0x0+ 0x0+ 0x0+ +0x[48]
-  +IA_64_UNWIND +0x0+1[0-9a-f]+ 0x0+1[0-9a-f]+ 0x0+1[0-9a-f]+ 0x0+18 0x0+18 R +0x8
- #...
---- binutils-2.22/ld/testsuite/ld-mips-elf/multi-got-no-shared.d
-+++ binutils-2.22/ld/testsuite/ld-mips-elf/multi-got-no-shared.d
-@@ -8,9 +8,9 @@
- .*: +file format.*
- Disassembly of section \.text:
--004000b0 <[^>]*> 3c1c0043     lui     gp,0x43
--004000b4 <[^>]*> 279c9ff0     addiu   gp,gp,-24592
--004000b8 <[^>]*> afbc0008     sw      gp,8\(sp\)
-+004000d0 <[^>]*> 3c1c0043     lui     gp,0x43
-+004000d4 <[^>]*> 279c9ff0     addiu   gp,gp,-24592
-+004000d8 <[^>]*> afbc0008     sw      gp,8\(sp\)
- #...
- 00408d60 <[^>]*> 3c1c0043     lui     gp,0x43
- 00408d64 <[^>]*> 279c2c98     addiu   gp,gp,11416
---- binutils-2.22/ld/testsuite/ld-mips-elf/pic-and-nonpic-3a.sd
-+++ binutils-2.22/ld/testsuite/ld-mips-elf/pic-and-nonpic-3a.sd
-@@ -1,7 +1,7 @@
- Elf file type is DYN \(Shared object file\)
- Entry point .*
--There are 5 program headers, starting at offset .*
-+There are [0-9] program headers, starting at offset .*
- Program Headers:
-  * Type * Offset * VirtAddr * PhysAddr * FileSiz * MemSiz * Flg * Align
-@@ -9,6 +9,7 @@ Program Headers:
-  * LOAD * [^ ]+ * 0x0+00000 * 0x0+00000 [^ ]+ * [^ ]+ * R E * 0x.*
-  * LOAD * [^ ]+ * 0x0+10000 * 0x0+10000 [^ ]+ * [^ ]+ * RW  * 0x.*
-  * DYNAMIC * [^ ]+ * 0x0+00400 * 0x0+00400 .*
-+ * PAX_FLAGS +0x0+ 0x0+ 0x0+ 0x0+ 0x0+ +0x[48]
-  * NULL * .*
-  *Section to Segment mapping:
-@@ -18,3 +19,4 @@ Program Headers:
-  *0*2 * \.data \.got *
-  *0*3 * \.dynamic *
-  *0*4 *
-+ *0*5 *
---- binutils-2.22/ld/testsuite/ld-mips-elf/pic-and-nonpic-3b.sd
-+++ binutils-2.22/ld/testsuite/ld-mips-elf/pic-and-nonpic-3b.sd
-@@ -1,7 +1,7 @@
- Elf file type is EXEC \(Executable file\)
- Entry point 0x44000
--There are 8 program headers, starting at offset .*
-+There are [0-9] program headers, starting at offset .*
- Program Headers:
-  * Type * Offset * VirtAddr * PhysAddr * FileSiz * MemSiz * Flg * Align
-@@ -13,6 +13,7 @@ Program Headers:
-  * LOAD * [^ ]+ * 0x0+80000 * 0x0+80000 [^ ]+ * [^ ]+ * RW  * 0x.*
-  * LOAD * [^ ]+ * 0x0+a0000 * 0x0+a0000 [^ ]+ * [^ ]+ * RW  * 0x.*
-  * DYNAMIC * [^ ]+ * 0x0+42000 * 0x0+42000 .*
-+ * PAX_FLAGS +0x0+ 0x0+ 0x0+ 0x0+ 0x0+ +0x[48]
-  * NULL * .*
-  *Section to Segment mapping:
-@@ -25,3 +26,4 @@ Program Headers:
-  *0*5 *\.got \.data *
-  *0*6 *\.dynamic *
-  *0*7 *
-+ *0*8 *
---- binutils-2.22/ld/testsuite/ld-mips-elf/pic-and-nonpic-4b.sd
-+++ binutils-2.22/ld/testsuite/ld-mips-elf/pic-and-nonpic-4b.sd
-@@ -1,7 +1,7 @@
- Elf file type is EXEC \(Executable file\)
- Entry point 0x44000
--There are 8 program headers, starting at offset .*
-+There are [0-9] program headers, starting at offset .*
- Program Headers:
-  * Type * Offset * VirtAddr * PhysAddr * FileSiz * MemSiz * Flg * Align
-@@ -13,6 +13,7 @@ Program Headers:
-  * LOAD * [^ ]+ * 0x0+80000 * 0x0+80000 [^ ]+ * [^ ]+ * RW  * 0x.*
-  * LOAD * [^ ]+ * 0x0+a0000 * 0x0+a0000 [^ ]+ * [^ ]+ * RW  * 0x.*
-  * DYNAMIC * [^ ]+ * 0x0+42000 * 0x0+42000 .*
-+ * PAX_FLAGS +0x0+ 0x0+ 0x0+ 0x0+ 0x0+ +0x[48]
-  * NULL * .*
-  *Section to Segment mapping:
-@@ -25,3 +26,4 @@ Program Headers:
-  *0*5 * \.got \.data \.bss *
-  *0*6 * \.dynamic *
-  *0*7 *
-+ *0*8 *
---- binutils-2.22/ld/testsuite/ld-mips-elf/pic-and-nonpic-5b.sd
-+++ binutils-2.22/ld/testsuite/ld-mips-elf/pic-and-nonpic-5b.sd
-@@ -1,7 +1,7 @@
- Elf file type is EXEC \(Executable file\)
- Entry point 0x44000
--There are 8 program headers, starting at offset .*
-+There are [0-9] program headers, starting at offset .*
- Program Headers:
-  * Type * Offset * VirtAddr * PhysAddr * FileSiz * MemSiz * Flg * Align
-@@ -13,6 +13,7 @@ Program Headers:
-  * LOAD * [^ ]+ * 0x0+80000 * 0x0+80000 [^ ]+ * [^ ]+ * RW  * 0x.*
-  * LOAD * [^ ]+ * 0x0+a0000 * 0x0+a0000 [^ ]+ * [^ ]+ * RW  * 0x.*
-  * DYNAMIC * [^ ]+ * 0x0+42000 * 0x0+42000 .*
-+ * PAX_FLAGS +0x0+ 0x0+ 0x0+ 0x0+ 0x0+ +0x[48]
-  * NULL * .*
-  *Section to Segment mapping:
-@@ -25,3 +26,4 @@ Program Headers:
-  *0*5 * \.got \.data \.bss *
-  *0*6 * \.dynamic *
-  *0*7 *
-+ *0*8 *
---- binutils-2.22/ld/testsuite/ld-mips-elf/pic-and-nonpic-6-n32.sd
-+++ binutils-2.22/ld/testsuite/ld-mips-elf/pic-and-nonpic-6-n32.sd
-@@ -1,7 +1,7 @@
- Elf file type is EXEC \(Executable file\)
- Entry point 0x44000
--There are 8 program headers, starting at offset .*
-+There are [0-9] program headers, starting at offset .*
- Program Headers:
-  * Type * Offset * VirtAddr * PhysAddr * FileSiz * MemSiz * Flg * Align
-@@ -13,6 +13,7 @@ Program Headers:
-  * LOAD * [^ ]+ * 0x0+80000 * 0x0+80000 [^ ]+ * [^ ]+ * RW  * 0x.*
-  * LOAD * [^ ]+ * 0x0+a0000 * 0x0+a0000 [^ ]+ * [^ ]+ * RW  * 0x.*
-  * DYNAMIC * [^ ]+ * 0x0+42000 * 0x0+42000 .*
-+ * PAX_FLAGS +0x0+ 0x0+ 0x0+ 0x0+ 0x0+ +0x[48]
-  * NULL * .*
-  *Section to Segment mapping:
-@@ -25,3 +26,4 @@ Program Headers:
-  *0*5 * \.got \.data \.bss *
-  *0*6 * \.dynamic *
-  *0*7 *
-+ *0*8 *
---- binutils-2.22/ld/testsuite/ld-mips-elf/pic-and-nonpic-6-n64.sd
-+++ binutils-2.22/ld/testsuite/ld-mips-elf/pic-and-nonpic-6-n64.sd
-@@ -1,7 +1,7 @@
- Elf file type is EXEC \(Executable file\)
- Entry point 0x44000
--There are 7 program headers, starting at offset .*
-+There are [0-9] program headers, starting at offset .*
- Program Headers:
-  * Type * Offset * VirtAddr * PhysAddr * FileSiz * MemSiz * Flg * Align
-@@ -12,6 +12,7 @@ Program Headers:
-  * LOAD * [^ ]+ * 0x0+80000 * 0x0+80000 [^ ]+ * [^ ]+ * RW  * 0x.*
-  * LOAD * [^ ]+ * 0x0+a0000 * 0x0+a0000 [^ ]+ * [^ ]+ * RW  * 0x.*
-  * DYNAMIC * [^ ]+ * 0x0+42000 * 0x0+42000 .*
-+ * PAX_FLAGS +0x0+ 0x0+ 0x0+ 0x0+ 0x0+ +0x[48]
-  * NULL * .*
-  *Section to Segment mapping:
-@@ -23,3 +24,4 @@ Program Headers:
-  *0*4 * \.got \.data \.bss *
-  *0*5 * \.dynamic *
-  *0*6 *
-+ *0*7 *
---- binutils-2.22/ld/testsuite/ld-mips-elf/pic-and-nonpic-6-o32.sd
-+++ binutils-2.22/ld/testsuite/ld-mips-elf/pic-and-nonpic-6-o32.sd
-@@ -1,7 +1,7 @@
- Elf file type is EXEC \(Executable file\)
- Entry point 0x44000
--There are 8 program headers, starting at offset .*
-+There are [0-9] program headers, starting at offset .*
- Program Headers:
-  * Type * Offset * VirtAddr * PhysAddr * FileSiz * MemSiz * Flg * Align
-@@ -13,6 +13,7 @@ Program Headers:
-  * LOAD * [^ ]+ * 0x0+80000 * 0x0+80000 [^ ]+ * [^ ]+ * RW  * 0x.*
-  * LOAD * [^ ]+ * 0x0+a0000 * 0x0+a0000 [^ ]+ * [^ ]+ * RW  * 0x.*
-  * DYNAMIC * [^ ]+ * 0x0+42000 * 0x0+42000 .*
-+ * PAX_FLAGS +0x0+ 0x0+ 0x0+ 0x0+ 0x0+ +0x[48]
-  * NULL * .*
-  *Section to Segment mapping:
-@@ -25,3 +26,4 @@ Program Headers:
-  *0*5 * \.got \.data \.bss *
-  *0*6 * \.dynamic *
-  *0*7 *
-+ *0*8 *
---- binutils-2.22/ld/testsuite/ld-mips-elf/rel32-n32.d
-+++ binutils-2.22/ld/testsuite/ld-mips-elf/rel32-n32.d
-@@ -10,6 +10,6 @@ Relocation section '.rel.dyn' at offset .* contains 2 entries:
- [0-9a-f ]+R_MIPS_REL32     
- Hex dump of section '.text':
--  0x000002e0 00000000 00000000 00000000 00000000 ................
--  0x000002f0 000002f0 00000000 00000000 00000000 ................
-   0x00000300 00000000 00000000 00000000 00000000 ................
-+  0x00000310 00000310 00000000 00000000 00000000 ................
-+  0x00000320 00000000 00000000 00000000 00000000 ................
---- binutils-2.22/ld/testsuite/ld-mips-elf/rel32-o32.d
-+++ binutils-2.22/ld/testsuite/ld-mips-elf/rel32-o32.d
-@@ -10,6 +10,6 @@ Relocation section '.rel.dyn' at offset .* contains 2 entries:
- [0-9a-f ]+R_MIPS_REL32     
- Hex dump of section '.text':
--  0x000002e0 00000000 00000000 00000000 00000000 ................
--  0x000002f0 000002f0 00000000 00000000 00000000 ................
-   0x00000300 00000000 00000000 00000000 00000000 ................
-+  0x00000310 00000310 00000000 00000000 00000000 ................
-+  0x00000320 00000000 00000000 00000000 00000000 ................
---- binutils-2.22/ld/testsuite/ld-mips-elf/rel64.d
-+++ binutils-2.22/ld/testsuite/ld-mips-elf/rel64.d
-@@ -14,6 +14,6 @@ Relocation section '.rel.dyn' at offset .* contains 2 entries:
-  +Type3: R_MIPS_NONE      
- Hex dump of section '.text':
--  0x00000450 00000000 00000000 00000000 00000000 ................
--  0x00000460 00000000 00000460 00000000 00000000 ................
--  0x00000470 00000000 00000000 00000000 00000000 ................
-+  0x00000490 00000000 00000000 00000000 00000000 ................
-+  0x000004a0 00000000 000004a0 00000000 00000000 ................
-+  0x000004b0 00000000 00000000 00000000 00000000 ................
---- binutils-2.22/ld/testsuite/ld-mips-elf/tlsbin-o32.d
-+++ binutils-2.22/ld/testsuite/ld-mips-elf/tlsbin-o32.d
-@@ -2,42 +2,42 @@
- Disassembly of section .text:
--004000d0 <__start>:
--  4000d0:     3c1c0fc0        lui     gp,0xfc0
--  4000d4:     279c7f30        addiu   gp,gp,32560
--  4000d8:     0399e021        addu    gp,gp,t9
--  4000dc:     27bdfff0        addiu   sp,sp,-16
--  4000e0:     afbe0008        sw      s8,8\(sp\)
--  4000e4:     03a0f021        move    s8,sp
--  4000e8:     afbc0000        sw      gp,0\(sp\)
--  4000ec:     8f998018        lw      t9,-32744\(gp\)
--  4000f0:     27848028        addiu   a0,gp,-32728
--  4000f4:     0320f809        jalr    t9
--  4000f8:     00000000        nop
--  4000fc:     8fdc0000        lw      gp,0\(s8\)
--  400100:     00000000        nop
--  400104:     8f998018        lw      t9,-32744\(gp\)
--  400108:     27848020        addiu   a0,gp,-32736
--  40010c:     0320f809        jalr    t9
--  400110:     00000000        nop
--  400114:     8fdc0000        lw      gp,0\(s8\)
--  400118:     00401021        move    v0,v0
--  40011c:     3c030000        lui     v1,0x0
--  400120:     24638000        addiu   v1,v1,-32768
--  400124:     00621821        addu    v1,v1,v0
--  400128:     7c02283b        rdhwr   v0,\$5
--  40012c:     8f83801c        lw      v1,-32740\(gp\)
--  400130:     00000000        nop
--  400134:     00621821        addu    v1,v1,v0
--  400138:     7c02283b        rdhwr   v0,\$5
--  40013c:     3c030000        lui     v1,0x0
--  400140:     24639004        addiu   v1,v1,-28668
--  400144:     00621821        addu    v1,v1,v0
--  400148:     03c0e821        move    sp,s8
--  40014c:     8fbe0008        lw      s8,8\(sp\)
--  400150:     03e00008        jr      ra
--  400154:     27bd0010        addiu   sp,sp,16
-+00400[0-9a-f]{3} <__start>:
-+  400[0-9a-f]{3}:     3c1c0fc0        lui     gp,0xfc0
-+  400[0-9a-f]{3}:     279c7f30        addiu   gp,gp,32560
-+  400[0-9a-f]{3}:     0399e021        addu    gp,gp,t9
-+  400[0-9a-f]{3}:     27bdfff0        addiu   sp,sp,-16
-+  400[0-9a-f]{3}:     afbe0008        sw      s8,8\(sp\)
-+  400[0-9a-f]{3}:     03a0f021        move    s8,sp
-+  400[0-9a-f]{3}:     afbc0000        sw      gp,0\(sp\)
-+  400[0-9a-f]{3}:     8f998018        lw      t9,-32744\(gp\)
-+  400[0-9a-f]{3}:     27848028        addiu   a0,gp,-32728
-+  400[0-9a-f]{3}:     0320f809        jalr    t9
-+  400[0-9a-f]{3}:     00000000        nop
-+  400[0-9a-f]{3}:     8fdc0000        lw      gp,0\(s8\)
-+  400[0-9a-f]{3}:     00000000        nop
-+  400[0-9a-f]{3}:     8f998018        lw      t9,-32744\(gp\)
-+  400[0-9a-f]{3}:     27848020        addiu   a0,gp,-32736
-+  400[0-9a-f]{3}:     0320f809        jalr    t9
-+  400[0-9a-f]{3}:     00000000        nop
-+  400[0-9a-f]{3}:     8fdc0000        lw      gp,0\(s8\)
-+  400[0-9a-f]{3}:     00401021        move    v0,v0
-+  400[0-9a-f]{3}:     3c030000        lui     v1,0x0
-+  400[0-9a-f]{3}:     24638000        addiu   v1,v1,-32768
-+  400[0-9a-f]{3}:     00621821        addu    v1,v1,v0
-+  400[0-9a-f]{3}:     7c02283b        rdhwr   v0,\$5
-+  400[0-9a-f]{3}:     8f83801c        lw      v1,-32740\(gp\)
-+  400[0-9a-f]{3}:     00000000        nop
-+  400[0-9a-f]{3}:     00621821        addu    v1,v1,v0
-+  400[0-9a-f]{3}:     7c02283b        rdhwr   v0,\$5
-+  400[0-9a-f]{3}:     3c030000        lui     v1,0x0
-+  400[0-9a-f]{3}:     24639004        addiu   v1,v1,-28668
-+  400[0-9a-f]{3}:     00621821        addu    v1,v1,v0
-+  400[0-9a-f]{3}:     03c0e821        move    sp,s8
-+  400[0-9a-f]{3}:     8fbe0008        lw      s8,8\(sp\)
-+  400[0-9a-f]{3}:     03e00008        jr      ra
-+  400[0-9a-f]{3}:     27bd0010        addiu   sp,sp,16
--00400158 <__tls_get_addr>:
--  400158:     03e00008        jr      ra
--  40015c:     00000000        nop
-+00400[0-9a-f]{3} <__tls_get_addr>:
-+  400[0-9a-f]{3}:     03e00008        jr      ra
-+  400[0-9a-f]{3}:     00000000        nop
---- binutils-2.22/ld/testsuite/ld-powerpc/tls.d
-+++ binutils-2.22/ld/testsuite/ld-powerpc/tls.d
-@@ -9,45 +9,45 @@
- Disassembly of section \.text:
--0+100000e8 <_start>:
--    100000e8: 3c 6d 00 00     addis   r3,r13,0
--    100000ec: 60 00 00 00     nop
--    100000f0: 38 63 90 78     addi    r3,r3,-28552
--    100000f4: 3c 6d 00 00     addis   r3,r13,0
--    100000f8: 60 00 00 00     nop
--    100000fc: 38 63 10 00     addi    r3,r3,4096
--    10000100: 3c 6d 00 00     addis   r3,r13,0
--    10000104: 60 00 00 00     nop
--    10000108: 38 63 90 40     addi    r3,r3,-28608
--    1000010c: 3c 6d 00 00     addis   r3,r13,0
--    10000110: 60 00 00 00     nop
--    10000114: 38 63 10 00     addi    r3,r3,4096
--    10000118: 39 23 80 48     addi    r9,r3,-32696
--    1000011c: 3d 23 00 00     addis   r9,r3,0
--    10000120: 81 49 80 50     lwz     r10,-32688\(r9\)
--    10000124: e9 22 80 10     ld      r9,-32752\(r2\)
--    10000128: 7d 49 18 2a     ldx     r10,r9,r3
--    1000012c: 3d 2d 00 00     addis   r9,r13,0
--    10000130: a1 49 90 60     lhz     r10,-28576\(r9\)
--    10000134: 89 4d 90 68     lbz     r10,-28568\(r13\)
--    10000138: 3d 2d 00 00     addis   r9,r13,0
--    1000013c: 99 49 90 70     stb     r10,-28560\(r9\)
--    10000140: 3c 6d 00 00     addis   r3,r13,0
--    10000144: 60 00 00 00     nop
--    10000148: 38 63 90 00     addi    r3,r3,-28672
--    1000014c: 3c 6d 00 00     addis   r3,r13,0
--    10000150: 60 00 00 00     nop
--    10000154: 38 63 10 00     addi    r3,r3,4096
--    10000158: f9 43 80 08     std     r10,-32760\(r3\)
--    1000015c: 3d 23 00 00     addis   r9,r3,0
--    10000160: 91 49 80 10     stw     r10,-32752\(r9\)
--    10000164: e9 22 80 08     ld      r9,-32760\(r2\)
--    10000168: 7d 49 19 2a     stdx    r10,r9,r3
--    1000016c: 3d 2d 00 00     addis   r9,r13,0
--    10000170: b1 49 90 60     sth     r10,-28576\(r9\)
--    10000174: e9 4d 90 2a     lwa     r10,-28632\(r13\)
--    10000178: 3d 2d 00 00     addis   r9,r13,0
--    1000017c: a9 49 90 30     lha     r10,-28624\(r9\)
-+0+10000[0-9a-f]{3} <_start>:
-+    10000[0-9a-f]{3}: 3c 6d 00 00     addis   r3,r13,0
-+    10000[0-9a-f]{3}: 60 00 00 00     nop
-+    10000[0-9a-f]{3}: 38 63 90 78     addi    r3,r3,-28552
-+    10000[0-9a-f]{3}: 3c 6d 00 00     addis   r3,r13,0
-+    10000[0-9a-f]{3}: 60 00 00 00     nop
-+    10000[0-9a-f]{3}: 38 63 10 00     addi    r3,r3,4096
-+    10000[0-9a-f]{3}: 3c 6d 00 00     addis   r3,r13,0
-+    10000[0-9a-f]{3}: 60 00 00 00     nop
-+    10000[0-9a-f]{3}: 38 63 90 40     addi    r3,r3,-28608
-+    10000[0-9a-f]{3}: 3c 6d 00 00     addis   r3,r13,0
-+    10000[0-9a-f]{3}: 60 00 00 00     nop
-+    10000[0-9a-f]{3}: 38 63 10 00     addi    r3,r3,4096
-+    10000[0-9a-f]{3}: 39 23 80 48     addi    r9,r3,-32696
-+    10000[0-9a-f]{3}: 3d 23 00 00     addis   r9,r3,0
-+    10000[0-9a-f]{3}: 81 49 80 50     lwz     r10,-32688\(r9\)
-+    10000[0-9a-f]{3}: e9 22 80 10     ld      r9,-32752\(r2\)
-+    10000[0-9a-f]{3}: 7d 49 18 2a     ldx     r10,r9,r3
-+    10000[0-9a-f]{3}: 3d 2d 00 00     addis   r9,r13,0
-+    10000[0-9a-f]{3}: a1 49 90 60     lhz     r10,-28576\(r9\)
-+    10000[0-9a-f]{3}: 89 4d 90 68     lbz     r10,-28568\(r13\)
-+    10000[0-9a-f]{3}: 3d 2d 00 00     addis   r9,r13,0
-+    10000[0-9a-f]{3}: 99 49 90 70     stb     r10,-28560\(r9\)
-+    10000[0-9a-f]{3}: 3c 6d 00 00     addis   r3,r13,0
-+    10000[0-9a-f]{3}: 60 00 00 00     nop
-+    10000[0-9a-f]{3}: 38 63 90 00     addi    r3,r3,-28672
-+    10000[0-9a-f]{3}: 3c 6d 00 00     addis   r3,r13,0
-+    10000[0-9a-f]{3}: 60 00 00 00     nop
-+    10000[0-9a-f]{3}: 38 63 10 00     addi    r3,r3,4096
-+    10000[0-9a-f]{3}: f9 43 80 08     std     r10,-32760\(r3\)
-+    10000[0-9a-f]{3}: 3d 23 00 00     addis   r9,r3,0
-+    10000[0-9a-f]{3}: 91 49 80 10     stw     r10,-32752\(r9\)
-+    10000[0-9a-f]{3}: e9 22 80 08     ld      r9,-32760\(r2\)
-+    10000[0-9a-f]{3}: 7d 49 19 2a     stdx    r10,r9,r3
-+    10000[0-9a-f]{3}: 3d 2d 00 00     addis   r9,r13,0
-+    10000[0-9a-f]{3}: b1 49 90 60     sth     r10,-28576\(r9\)
-+    10000[0-9a-f]{3}: e9 4d 90 2a     lwa     r10,-28632\(r13\)
-+    10000[0-9a-f]{3}: 3d 2d 00 00     addis   r9,r13,0
-+    10000[0-9a-f]{3}: a9 49 90 30     lha     r10,-28624\(r9\)
--0+10000180 <\.__tls_get_addr>:
--    10000180: 4e 80 00 20     blr
-+0+10000[0-9a-f]{3} <\.__tls_get_addr>:
-+    10000[0-9a-f]{3}: 4e 80 00 20     blr
---- binutils-2.22/ld/testsuite/ld-powerpc/tls.g
-+++ binutils-2.22/ld/testsuite/ld-powerpc/tls.g
-@@ -8,5 +8,5 @@
- .*: +file format elf64-powerpc
- Contents of section \.got:
-- 100101e0 00000000 100181e0 ffffffff ffff8018  .*
-- 100101f0 ffffffff ffff8058                    .*
-+ 10010([0-9a-f]{3}) 00000000 10018\1 ffffffff ffff8018  .*
-+ 10010[0-9a-f]{3} ffffffff ffff8058                    .*
---- binutils-2.22/ld/testsuite/ld-powerpc/tls32.d
-+++ binutils-2.22/ld/testsuite/ld-powerpc/tls32.d
-@@ -9,42 +9,42 @@
- Disassembly of section \.text:
--0+1800094 <_start>:
-- 1800094:     3c 62 00 00     addis   r3,r2,0
-- 1800098:     38 63 90 3c     addi    r3,r3,-28612
-- 180009c:     3c 62 00 00     addis   r3,r2,0
-- 18000a0:     38 63 10 00     addi    r3,r3,4096
-- 18000a4:     3c 62 00 00     addis   r3,r2,0
-- 18000a8:     38 63 90 20     addi    r3,r3,-28640
-- 18000ac:     3c 62 00 00     addis   r3,r2,0
-- 18000b0:     38 63 10 00     addi    r3,r3,4096
-- 18000b4:     39 23 80 24     addi    r9,r3,-32732
-- 18000b8:     3d 23 00 00     addis   r9,r3,0
-- 18000bc:     81 49 80 28     lwz     r10,-32728\(r9\)
-- 18000c0:     3d 22 00 00     addis   r9,r2,0
-- 18000c4:     a1 49 90 30     lhz     r10,-28624\(r9\)
-- 18000c8:     89 42 90 34     lbz     r10,-28620\(r2\)
-- 18000cc:     3d 22 00 00     addis   r9,r2,0
-- 18000d0:     99 49 90 38     stb     r10,-28616\(r9\)
-- 18000d4:     3c 62 00 00     addis   r3,r2,0
-- 18000d8:     38 63 90 00     addi    r3,r3,-28672
-- 18000dc:     3c 62 00 00     addis   r3,r2,0
-- 18000e0:     38 63 10 00     addi    r3,r3,4096
-- 18000e4:     91 43 80 04     stw     r10,-32764\(r3\)
-- 18000e8:     3d 23 00 00     addis   r9,r3,0
-- 18000ec:     91 49 80 08     stw     r10,-32760\(r9\)
-- 18000f0:     3d 22 00 00     addis   r9,r2,0
-- 18000f4:     b1 49 90 30     sth     r10,-28624\(r9\)
-- 18000f8:     a1 42 90 14     lhz     r10,-28652\(r2\)
-- 18000fc:     3d 22 00 00     addis   r9,r2,0
-- 1800100:     a9 49 90 18     lha     r10,-28648\(r9\)
-+0+1800[0-9a-f]{3} <_start>:
-+ 1800[0-9a-f]{3}:     3c 62 00 00     addis   r3,r2,0
-+ 1800[0-9a-f]{3}:     38 63 90 3c     addi    r3,r3,-28612
-+ 1800[0-9a-f]{3}:     3c 62 00 00     addis   r3,r2,0
-+ 1800[0-9a-f]{3}:     38 63 10 00     addi    r3,r3,4096
-+ 1800[0-9a-f]{3}:     3c 62 00 00     addis   r3,r2,0
-+ 1800[0-9a-f]{3}:     38 63 90 20     addi    r3,r3,-28640
-+ 1800[0-9a-f]{3}:     3c 62 00 00     addis   r3,r2,0
-+ 1800[0-9a-f]{3}:     38 63 10 00     addi    r3,r3,4096
-+ 1800[0-9a-f]{3}:     39 23 80 24     addi    r9,r3,-32732
-+ 1800[0-9a-f]{3}:     3d 23 00 00     addis   r9,r3,0
-+ 1800[0-9a-f]{3}:     81 49 80 28     lwz     r10,-32728\(r9\)
-+ 1800[0-9a-f]{3}:     3d 22 00 00     addis   r9,r2,0
-+ 1800[0-9a-f]{3}:     a1 49 90 30     lhz     r10,-28624\(r9\)
-+ 1800[0-9a-f]{3}:     89 42 90 34     lbz     r10,-28620\(r2\)
-+ 1800[0-9a-f]{3}:     3d 22 00 00     addis   r9,r2,0
-+ 1800[0-9a-f]{3}:     99 49 90 38     stb     r10,-28616\(r9\)
-+ 1800[0-9a-f]{3}:     3c 62 00 00     addis   r3,r2,0
-+ 1800[0-9a-f]{3}:     38 63 90 00     addi    r3,r3,-28672
-+ 1800[0-9a-f]{3}:     3c 62 00 00     addis   r3,r2,0
-+ 1800[0-9a-f]{3}:     38 63 10 00     addi    r3,r3,4096
-+ 1800[0-9a-f]{3}:     91 43 80 04     stw     r10,-32764\(r3\)
-+ 1800[0-9a-f]{3}:     3d 23 00 00     addis   r9,r3,0
-+ 1800[0-9a-f]{3}:     91 49 80 08     stw     r10,-32760\(r9\)
-+ 1800[0-9a-f]{3}:     3d 22 00 00     addis   r9,r2,0
-+ 1800[0-9a-f]{3}:     b1 49 90 30     sth     r10,-28624\(r9\)
-+ 1800[0-9a-f]{3}:     a1 42 90 14     lhz     r10,-28652\(r2\)
-+ 1800[0-9a-f]{3}:     3d 22 00 00     addis   r9,r2,0
-+ 1800[0-9a-f]{3}:     a9 49 90 18     lha     r10,-28648\(r9\)
--0+1800104 <__tls_get_addr>:
-- 1800104:     4e 80 00 20     blr
-+0+1800[0-9a-f]{3} <__tls_get_addr>:
-+ 1800[0-9a-f]{3}:     4e 80 00 20     blr
- Disassembly of section \.got:
--0+1810128 <_GLOBAL_OFFSET_TABLE_-0x4>:
-- 1810128:     4e 80 00 21     blrl
-+0+1810[0-9a-f]{3} <_GLOBAL_OFFSET_TABLE_-0x4>:
-+ 1810[0-9a-f]{3}:     4e 80 00 21     blrl
--0+181012c <_GLOBAL_OFFSET_TABLE_>:
-+0+1810[0-9a-f]{3} <_GLOBAL_OFFSET_TABLE_>:
-       \.\.\.
---- binutils-2.22/ld/testsuite/ld-powerpc/tls32.g
-+++ binutils-2.22/ld/testsuite/ld-powerpc/tls32.g
-@@ -8,4 +8,4 @@
- .*: +file format elf32-powerpc
- Contents of section \.got:
-- 1810128 4e800021 00000000 00000000 00000000  .*
-+ 18101[0-9a-f]{2} 4e800021 00000000 00000000 00000000  .*
---- binutils-2.22/ld/testsuite/ld-powerpc/tls32.t
-+++ binutils-2.22/ld/testsuite/ld-powerpc/tls32.t
-@@ -8,5 +8,5 @@
- .*: +file format elf32-powerpc
- Contents of section \.tdata:
-- 1810108 12345678 23456789 3456789a 456789ab  .*
-- 1810118 56789abc 6789abcd 789abcde 00c0ffee  .*
-+ 18101[0-9a-f]{2} 12345678 23456789 3456789a 456789ab  .*
-+ 18101[0-9a-f]{2} 56789abc 6789abcd 789abcde 00c0ffee  .*
---- binutils-2.22/ld/testsuite/ld-powerpc/tlsexe32.d
-+++ binutils-2.22/ld/testsuite/ld-powerpc/tlsexe32.d
-@@ -44,4 +44,4 @@ Disassembly of section \.got:
- .*:   4e 80 00 21     blrl
- .* <_GLOBAL_OFFSET_TABLE_>:
--.*:   01 81 02 b8 00 00 00 00 00 00 00 00  .*
-+.*:   01 81 02 [bd]8 00 00 00 00 00 00 00 00  .*
---- binutils-2.22/ld/testsuite/ld-powerpc/tlsexe32.g
-+++ binutils-2.22/ld/testsuite/ld-powerpc/tlsexe32.g
-@@ -8,4 +8,4 @@
- Contents of section \.got:
- .* 00000000 00000000 00000000 4e800021  .*
--.* 018102b8 00000000 00000000           .*
-+.* 018102[bd]8 00000000 00000000           .*
---- binutils-2.22/ld/testsuite/ld-powerpc/tlsexe32.r
-+++ binutils-2.22/ld/testsuite/ld-powerpc/tlsexe32.r
-@@ -33,13 +33,14 @@ There are [0-9]+ program headers, starting at offset [0-9]+
- Program Headers:
-  +Type +Offset +VirtAddr +PhysAddr +FileSiz MemSiz +Flg Align
-- +PHDR +0x000034 0x01800034 0x01800034 0x000c0 0x000c0 R E 0x4
-- +INTERP +0x0000f4 0x018000f4 0x018000f4 0x00011 0x00011 R +0x1
-+ +PHDR +0x000034 0x01800034 0x01800034 (0x000[0-9a-f]{2}) \1 R E 0x4
-+ +INTERP +0x000([0-9a-f]{3}) 0x01800\1 0x01800\1 0x00011 0x00011 R +0x1
-  +\[Requesting program interpreter: .*\]
-  +LOAD .* R E 0x10000
-  +LOAD .* RWE 0x10000
-  +DYNAMIC .* RW +0x4
-  +TLS .* 0x0001c 0x00038 R +0x4
-+ +PAX_FLAGS +0x0+ 0x0+ 0x0+ 0x0+ 0x0+ +0x[48]
-  Section to Segment mapping:
-  +Segment Sections\.\.\.
-@@ -49,6 +50,7 @@ Program Headers:
-  +03 +\.tdata \.dynamic \.got \.plt 
-  +04 +\.dynamic 
-  +05 +\.tdata \.tbss 
-+ +06 +
- Relocation section '\.rela\.dyn' at offset .* contains 2 entries:
-  Offset +Info +Type +Sym\. Value +Symbol's Name \+ Addend
---- binutils-2.22/ld/testsuite/ld-powerpc/tlsmark.d
-+++ binutils-2.22/ld/testsuite/ld-powerpc/tlsmark.d
-@@ -9,29 +9,29 @@
- Disassembly of section \.text:
--0+100000e8 <_start>:
--    100000e8: 48 00 00 18     b       10000100 <_start\+0x18>
--    100000ec: 60 00 00 00     nop
--    100000f0: 38 63 90 00     addi    r3,r3,-28672
--    100000f4: e8 83 00 00     ld      r4,0\(r3\)
--    100000f8: 3c 6d 00 00     addis   r3,r13,0
--    100000fc: 48 00 00 0c     b       10000108 <_start\+0x20>
--    10000100: 3c 6d 00 00     addis   r3,r13,0
--    10000104: 4b ff ff e8     b       100000ec <_start\+0x4>
--    10000108: 60 00 00 00     nop
--    1000010c: 38 63 10 00     addi    r3,r3,4096
--    10000110: e8 83 80 00     ld      r4,-32768\(r3\)
--    10000114: 3c 6d 00 00     addis   r3,r13,0
--    10000118: 48 00 00 0c     b       10000124 <_start\+0x3c>
--    1000011c: 3c 6d 00 00     addis   r3,r13,0
--    10000120: 48 00 00 14     b       10000134 <_start\+0x4c>
--    10000124: 60 00 00 00     nop
--    10000128: 38 63 90 04     addi    r3,r3,-28668
--    1000012c: e8 a3 00 00     ld      r5,0\(r3\)
--    10000130: 4b ff ff ec     b       1000011c <_start\+0x34>
--    10000134: 60 00 00 00     nop
--    10000138: 38 63 10 00     addi    r3,r3,4096
--    1000013c: e8 a3 80 04     ld      r5,-32764\(r3\)
-+0+10000[0-9a-f]{3} <_start>:
-+    10000[0-9a-f]{3}: 48 00 00 18     b       10000[0-9a-f]{3} <_start\+0x18>
-+    10000[0-9a-f]{3}: 60 00 00 00     nop
-+    10000[0-9a-f]{3}: 38 63 90 00     addi    r3,r3,-28672
-+    10000[0-9a-f]{3}: e8 83 00 00     ld      r4,0\(r3\)
-+    10000[0-9a-f]{3}: 3c 6d 00 00     addis   r3,r13,0
-+    10000[0-9a-f]{3}: 48 00 00 0c     b       10000[0-9a-f]{3} <_start\+0x20>
-+    10000[0-9a-f]{3}: 3c 6d 00 00     addis   r3,r13,0
-+    10000[0-9a-f]{3}: 4b ff ff e8     b       10000[0-9a-f]{3} <_start\+0x4>
-+    10000[0-9a-f]{3}: 60 00 00 00     nop
-+    10000[0-9a-f]{3}: 38 63 10 00     addi    r3,r3,4096
-+    10000[0-9a-f]{3}: e8 83 80 00     ld      r4,-32768\(r3\)
-+    10000[0-9a-f]{3}: 3c 6d 00 00     addis   r3,r13,0
-+    10000[0-9a-f]{3}: 48 00 00 0c     b       10000[0-9a-f]{3} <_start\+0x3c>
-+    10000[0-9a-f]{3}: 3c 6d 00 00     addis   r3,r13,0
-+    10000[0-9a-f]{3}: 48 00 00 14     b       10000[0-9a-f]{3} <_start\+0x4c>
-+    10000[0-9a-f]{3}: 60 00 00 00     nop
-+    10000[0-9a-f]{3}: 38 63 90 04     addi    r3,r3,-28668
-+    10000[0-9a-f]{3}: e8 a3 00 00     ld      r5,0\(r3\)
-+    10000[0-9a-f]{3}: 4b ff ff ec     b       10000[0-9a-f]{3} <_start\+0x34>
-+    10000[0-9a-f]{3}: 60 00 00 00     nop
-+    10000[0-9a-f]{3}: 38 63 10 00     addi    r3,r3,4096
-+    10000[0-9a-f]{3}: e8 a3 80 04     ld      r5,-32764\(r3\)
--0+10000140 <\.__tls_get_addr>:
--    10000140: 4e 80 00 20     blr
-+0+10000[0-9a-f]{3} <\.__tls_get_addr>:
-+    10000[0-9a-f]{3}: 4e 80 00 20     blr
---- binutils-2.22/ld/testsuite/ld-powerpc/tlsmark32.d
-+++ binutils-2.22/ld/testsuite/ld-powerpc/tlsmark32.d
-@@ -9,17 +9,17 @@
- Disassembly of section \.text:
--0+1800094 <_start>:
-- 1800094:     48 00 00 14     b       18000a8 <_start\+0x14>
-- 1800098:     38 63 90 00     addi    r3,r3,-28672
-- 180009c:     80 83 00 00     lwz     r4,0\(r3\)
-- 18000a0:     3c 62 00 00     addis   r3,r2,0
-- 18000a4:     48 00 00 0c     b       18000b0 <_start\+0x1c>
-- 18000a8:     3c 62 00 00     addis   r3,r2,0
-- 18000ac:     4b ff ff ec     b       1800098 <_start\+0x4>
-- 18000b0:     38 63 10 00     addi    r3,r3,4096
-- 18000b4:     80 83 80 00     lwz     r4,-32768\(r3\)
-+0+18000[0-9a-f]{2} <_start>:
-+ 18000[0-9a-f]{2}:    48 00 00 14     b       18000[0-9a-f]{2} <_start\+0x14>
-+ 18000[0-9a-f]{2}:    38 63 90 00     addi    r3,r3,-28672
-+ 18000[0-9a-f]{2}:    80 83 00 00     lwz     r4,0\(r3\)
-+ 18000[0-9a-f]{2}:    3c 62 00 00     addis   r3,r2,0
-+ 18000[0-9a-f]{2}:    48 00 00 0c     b       18000[0-9a-f]{2} <_start\+0x1c>
-+ 18000[0-9a-f]{2}:    3c 62 00 00     addis   r3,r2,0
-+ 18000[0-9a-f]{2}:    4b ff ff ec     b       18000[0-9a-f]{2} <_start\+0x4>
-+ 18000[0-9a-f]{2}:    38 63 10 00     addi    r3,r3,4096
-+ 18000[0-9a-f]{2}:    80 83 80 00     lwz     r4,-32768\(r3\)
--0+18000b8 <__tls_get_addr>:
-- 18000b8:     4e 80 00 20     blr
--#pass
-\ No newline at end of file
-+0+18000[0-9a-f]{2} <__tls_get_addr>:
-+ 18000[0-9a-f]{2}:    4e 80 00 20     blr
-+#pass
---- binutils-2.22/ld/testsuite/ld-powerpc/tlsopt1.d
-+++ binutils-2.22/ld/testsuite/ld-powerpc/tlsopt1.d
-@@ -9,17 +9,17 @@
- Disassembly of section \.text:
--0+100000e8 <\.__tls_get_addr>:
--    100000e8: 4e 80 00 20     blr
-+0+10000[0-9a-f]{3} <\.__tls_get_addr>:
-+    10000[0-9a-f]{3}: 4e 80 00 20     blr
- Disassembly of section \.no_opt1:
--0+100000ec <\.no_opt1>:
--    100000ec: 38 62 80 08     addi    r3,r2,-32760
--    100000f0: 2c 24 00 00     cmpdi   r4,0
--    100000f4: 41 82 00 10     beq-    .*
--    100000f8: 4b ff ff f1     bl      100000e8 <\.__tls_get_addr>
--    100000fc: 60 00 00 00     nop
--    10000100: 48 00 00 0c     b       .*
--    10000104: 4b ff ff e5     bl      100000e8 <\.__tls_get_addr>
--    10000108: 60 00 00 00     nop
-+0+10000[0-9a-f]{3} <\.no_opt1>:
-+    10000[0-9a-f]{3}: 38 62 80 08     addi    r3,r2,-32760
-+    10000[0-9a-f]{3}: 2c 24 00 00     cmpdi   r4,0
-+    10000[0-9a-f]{3}: 41 82 00 10     beq-    .*
-+    10000[0-9a-f]{3}: 4b ff ff f1     bl      10000[0-9a-f]{3} <\.__tls_get_addr>
-+    10000[0-9a-f]{3}: 60 00 00 00     nop
-+    10000[0-9a-f]{3}: 48 00 00 0c     b       .*
-+    10000[0-9a-f]{3}: 4b ff ff e5     bl      10000[0-9a-f]{3} <\.__tls_get_addr>
-+    10000[0-9a-f]{3}: 60 00 00 00     nop
---- binutils-2.22/ld/testsuite/ld-powerpc/tlsopt1_32.d
-+++ binutils-2.22/ld/testsuite/ld-powerpc/tlsopt1_32.d
-@@ -9,16 +9,16 @@
- Disassembly of section \.text:
--0+1800094 <__tls_get_addr>:
-- 1800094:     4e 80 00 20     blr
-+0+18000[0-9a-f]{2} <__tls_get_addr>:
-+ 18000[0-9a-f]{2}:    4e 80 00 20     blr
- Disassembly of section \.no_opt1:
--0+1800098 <\.no_opt1>:
-- 1800098:     38 6d ff f4     addi    r3,r13,-12
-- 180009c:     2c 04 00 00     cmpwi   r4,0
-- 18000a0:     41 82 00 0c     beq-    .*
-- 18000a4:     4b ff ff f1     bl      1800094 <__tls_get_addr>
-- 18000a8:     48 00 00 08     b       .*
-- 18000ac:     4b ff ff e9     bl      1800094 <__tls_get_addr>
-+0+18000[0-9a-f]{2} <\.no_opt1>:
-+ 18000[0-9a-f]{2}:    38 6d ff f4     addi    r3,r13,-12
-+ 18000[0-9a-f]{2}:    2c 04 00 00     cmpwi   r4,0
-+ 18000[0-9a-f]{2}:    41 82 00 0c     beq-    .*
-+ 18000[0-9a-f]{2}:    4b ff ff f1     bl      18000[0-9a-f]{2} <__tls_get_addr>
-+ 18000[0-9a-f]{2}:    48 00 00 08     b       .*
-+ 18000[0-9a-f]{2}:    4b ff ff e9     bl      18000[0-9a-f]{2} <__tls_get_addr>
- #pass
---- binutils-2.22/ld/testsuite/ld-powerpc/tlsopt2.d
-+++ binutils-2.22/ld/testsuite/ld-powerpc/tlsopt2.d
-@@ -9,15 +9,15 @@
- Disassembly of section \.text:
--0+100000e8 <\.__tls_get_addr>:
--    100000e8: 4e 80 00 20     blr
-+0+10000[0-9a-f]{3} <\.__tls_get_addr>:
-+    10000[0-9a-f]{3}: 4e 80 00 20     blr
- Disassembly of section \.no_opt2:
--0+100000ec <\.no_opt2>:
--    100000ec: 38 62 80 08     addi    r3,r2,-32760
--    100000f0: 2c 24 00 00     cmpdi   r4,0
--    100000f4: 41 82 00 08     beq-    .*
--    100000f8: 38 62 80 08     addi    r3,r2,-32760
--    100000fc: 4b ff ff ed     bl      100000e8 <\.__tls_get_addr>
--    10000100: 60 00 00 00     nop
-+0+10000[0-9a-f]{3} <\.no_opt2>:
-+    10000[0-9a-f]{3}: 38 62 80 08     addi    r3,r2,-32760
-+    10000[0-9a-f]{3}: 2c 24 00 00     cmpdi   r4,0
-+    10000[0-9a-f]{3}: 41 82 00 08     beq-    .*
-+    10000[0-9a-f]{3}: 38 62 80 08     addi    r3,r2,-32760
-+    10000[0-9a-f]{3}: 4b ff ff ed     bl      10000[0-9a-f]{3} <\.__tls_get_addr>
-+    10000[0-9a-f]{3}: 60 00 00 00     nop
---- binutils-2.22/ld/testsuite/ld-powerpc/tlsopt2_32.d
-+++ binutils-2.22/ld/testsuite/ld-powerpc/tlsopt2_32.d
-@@ -9,15 +9,15 @@
- Disassembly of section \.text:
--0+1800094 <__tls_get_addr>:
-- 1800094:     4e 80 00 20     blr
-+0+18000[0-9a-f]{2} <__tls_get_addr>:
-+ 18000[0-9a-f]{2}:    4e 80 00 20     blr
- Disassembly of section \.no_opt2:
--0+1800098 <\.no_opt2>:
-- 1800098:     38 6d ff f4     addi    r3,r13,-12
-- 180009c:     2c 04 00 00     cmpwi   r4,0
-- 18000a0:     41 82 00 08     beq-    .*
-- 18000a4:     38 6d ff f4     addi    r3,r13,-12
-- 18000a8:     4b ff ff ed     bl      1800094 <__tls_get_addr>
-+0+18000[0-9a-f]{2} <\.no_opt2>:
-+ 18000[0-9a-f]{2}:    38 6d ff f4     addi    r3,r13,-12
-+ 18000[0-9a-f]{2}:    2c 04 00 00     cmpwi   r4,0
-+ 18000[0-9a-f]{2}:    41 82 00 08     beq-    .*
-+ 18000[0-9a-f]{2}:    38 6d ff f4     addi    r3,r13,-12
-+ 18000[0-9a-f]{2}:    4b ff ff ed     bl      18000[0-9a-f]{2} <__tls_get_addr>
- #pass
---- binutils-2.22/ld/testsuite/ld-powerpc/tlsopt3.d
-+++ binutils-2.22/ld/testsuite/ld-powerpc/tlsopt3.d
-@@ -9,18 +9,18 @@
- Disassembly of section \.text:
--00000000100000e8 <\.__tls_get_addr>:
--    100000e8: 4e 80 00 20     blr
-+0000000010000[0-9a-f]{3} <\.__tls_get_addr>:
-+    10000[0-9a-f]{3}: 4e 80 00 20     blr
- Disassembly of section \.no_opt3:
--00000000100000ec <\.no_opt3>:
--    100000ec: 38 62 80 08     addi    r3,r2,-32760
--    100000f0: 48 00 00 0c     b       .*
--    100000f4: 38 62 80 18     addi    r3,r2,-32744
--    100000f8: 48 00 00 10     b       .*
--    100000fc: 4b ff ff ed     bl      100000e8 <\.__tls_get_addr>
--    10000100: 60 00 00 00     nop
--    10000104: 48 00 00 0c     b       .*
--    10000108: 4b ff ff e1     bl      100000e8 <\.__tls_get_addr>
--    1000010c: 60 00 00 00     nop
-+0000000010000[0-9a-f]{3} <\.no_opt3>:
-+    10000[0-9a-f]{3}: 38 62 80 08     addi    r3,r2,-32760
-+    10000[0-9a-f]{3}: 48 00 00 0c     b       .*
-+    10000[0-9a-f]{3}: 38 62 80 18     addi    r3,r2,-32744
-+    10000[0-9a-f]{3}: 48 00 00 10     b       .*
-+    10000[0-9a-f]{3}: 4b ff ff ed     bl      10000[0-9a-f]{3} <\.__tls_get_addr>
-+    10000[0-9a-f]{3}: 60 00 00 00     nop
-+    10000[0-9a-f]{3}: 48 00 00 0c     b       .*
-+    10000[0-9a-f]{3}: 4b ff ff e1     bl      10000[0-9a-f]{3} <\.__tls_get_addr>
-+    10000[0-9a-f]{3}: 60 00 00 00     nop
---- binutils-2.22/ld/testsuite/ld-powerpc/tlsopt3_32.d
-+++ binutils-2.22/ld/testsuite/ld-powerpc/tlsopt3_32.d
-@@ -9,17 +9,17 @@
- Disassembly of section \.text:
--0+1800094 <__tls_get_addr>:
-- 1800094:     4e 80 00 20     blr
-+0+18000[0-9a-f]{2} <__tls_get_addr>:
-+ 18000[0-9a-f]{2}:    4e 80 00 20     blr
- Disassembly of section \.no_opt3:
--0+1800098 <\.no_opt3>:
-- 1800098:     38 6d ff ec     addi    r3,r13,-20
-- 180009c:     48 00 00 0c     b       .*
-- 18000a0:     38 6d ff f4     addi    r3,r13,-12
-- 18000a4:     48 00 00 0c     b       .*
-- 18000a8:     4b ff ff ed     bl      1800094 <__tls_get_addr>
-- 18000ac:     48 00 00 08     b       .*
-- 18000b0:     4b ff ff e5     bl      1800094 <__tls_get_addr>
-+0+18000[0-9a-f]{2} <\.no_opt3>:
-+ 18000[0-9a-f]{2}:    38 6d ff ec     addi    r3,r13,-20
-+ 18000[0-9a-f]{2}:    48 00 00 0c     b       .*
-+ 18000[0-9a-f]{2}:    38 6d ff f4     addi    r3,r13,-12
-+ 18000[0-9a-f]{2}:    48 00 00 0c     b       .*
-+ 18000[0-9a-f]{2}:    4b ff ff ed     bl      18000[0-9a-f]{2} <__tls_get_addr>
-+ 18000[0-9a-f]{2}:    48 00 00 08     b       .*
-+ 18000[0-9a-f]{2}:    4b ff ff e5     bl      18000[0-9a-f]{2} <__tls_get_addr>
- #pass
---- binutils-2.22/ld/testsuite/ld-powerpc/tlsopt4.d
-+++ binutils-2.22/ld/testsuite/ld-powerpc/tlsopt4.d
-@@ -9,40 +9,40 @@
- Disassembly of section \.text:
--0+100000e8 <\.__tls_get_addr>:
--    100000e8: 4e 80 00 20     blr
-+0+10000[0-9a-f]{3} <\.__tls_get_addr>:
-+    10000[0-9a-f]{3}: 4e 80 00 20     blr
- Disassembly of section \.opt1:
--0+100000ec <\.opt1>:
--    100000ec: 3c 6d 00 00     addis   r3,r13,0
--    100000f0: 2c 24 00 00     cmpdi   r4,0
--    100000f4: 41 82 00 10     beq-    .*
--    100000f8: 60 00 00 00     nop
--    100000fc: 38 63 90 10     addi    r3,r3,-28656
--    10000100: 48 00 00 0c     b       .*
--    10000104: 60 00 00 00     nop
--    10000108: 38 63 90 10     addi    r3,r3,-28656
-+0+10000[0-9a-f]{3} <\.opt1>:
-+    10000[0-9a-f]{3}: 3c 6d 00 00     addis   r3,r13,0
-+    10000[0-9a-f]{3}: 2c 24 00 00     cmpdi   r4,0
-+    10000[0-9a-f]{3}: 41 82 00 10     beq-    .*
-+    10000[0-9a-f]{3}: 60 00 00 00     nop
-+    10000[0-9a-f]{3}: 38 63 90 10     addi    r3,r3,-28656
-+    10000[0-9a-f]{3}: 48 00 00 0c     b       .*
-+    10000[0-9a-f]{3}: 60 00 00 00     nop
-+    10000[0-9a-f]{3}: 38 63 90 10     addi    r3,r3,-28656
- Disassembly of section \.opt2:
--0+1000010c <\.opt2>:
--    1000010c: 3c 6d 00 00     addis   r3,r13,0
--    10000110: 2c 24 00 00     cmpdi   r4,0
--    10000114: 41 82 00 08     beq-    .*
--    10000118: 3c 6d 00 00     addis   r3,r13,0
--    1000011c: 60 00 00 00     nop
--    10000120: 38 63 90 10     addi    r3,r3,-28656
-+0+10000[0-9a-f]{3} <\.opt2>:
-+    10000[0-9a-f]{3}: 3c 6d 00 00     addis   r3,r13,0
-+    10000[0-9a-f]{3}: 2c 24 00 00     cmpdi   r4,0
-+    10000[0-9a-f]{3}: 41 82 00 08     beq-    .*
-+    10000[0-9a-f]{3}: 3c 6d 00 00     addis   r3,r13,0
-+    10000[0-9a-f]{3}: 60 00 00 00     nop
-+    10000[0-9a-f]{3}: 38 63 90 10     addi    r3,r3,-28656
- Disassembly of section \.opt3:
--0+10000124 <\.opt3>:
--    10000124: 3c 6d 00 00     addis   r3,r13,0
--    10000128: 48 00 00 0c     b       .*
--    1000012c: 3c 6d 00 00     addis   r3,r13,0
--    10000130: 48 00 00 10     b       .*
--    10000134: 60 00 00 00     nop
--    10000138: 38 63 90 10     addi    r3,r3,-28656
--    1000013c: 48 00 00 0c     b       .*
--    10000140: 60 00 00 00     nop
--    10000144: 38 63 90 08     addi    r3,r3,-28664
-+0+10000[0-9a-f]{3} <\.opt3>:
-+    10000[0-9a-f]{3}: 3c 6d 00 00     addis   r3,r13,0
-+    10000[0-9a-f]{3}: 48 00 00 0c     b       .*
-+    10000[0-9a-f]{3}: 3c 6d 00 00     addis   r3,r13,0
-+    10000[0-9a-f]{3}: 48 00 00 10     b       .*
-+    10000[0-9a-f]{3}: 60 00 00 00     nop
-+    10000[0-9a-f]{3}: 38 63 90 10     addi    r3,r3,-28656
-+    10000[0-9a-f]{3}: 48 00 00 0c     b       .*
-+    10000[0-9a-f]{3}: 60 00 00 00     nop
-+    10000[0-9a-f]{3}: 38 63 90 08     addi    r3,r3,-28664
---- binutils-2.22/ld/testsuite/ld-powerpc/tlsopt4_32.d
-+++ binutils-2.22/ld/testsuite/ld-powerpc/tlsopt4_32.d
-@@ -9,36 +9,36 @@
- Disassembly of section \.text:
--0+1800094 <__tls_get_addr>:
-- 1800094:     4e 80 00 20     blr
-+0+18000[0-9a-f]{2} <__tls_get_addr>:
-+ 18000[0-9a-f]{2}:    4e 80 00 20     blr
- Disassembly of section \.opt1:
--0+1800098 <\.opt1>:
-- 1800098:     3c 62 00 00     addis   r3,r2,0
-- 180009c:     2c 04 00 00     cmpwi   r4,0
-- 18000a0:     41 82 00 0c     beq-    .*
-- 18000a4:     38 63 90 10     addi    r3,r3,-28656
-- 18000a8:     48 00 00 08     b       .*
-- 18000ac:     38 63 90 10     addi    r3,r3,-28656
-+0+18000[0-9a-f]{2} <\.opt1>:
-+ 18000[0-9a-f]{2}:    3c 62 00 00     addis   r3,r2,0
-+ 18000[0-9a-f]{2}:    2c 04 00 00     cmpwi   r4,0
-+ 18000[0-9a-f]{2}:    41 82 00 0c     beq-    .*
-+ 18000[0-9a-f]{2}:    38 63 90 10     addi    r3,r3,-28656
-+ 18000[0-9a-f]{2}:    48 00 00 08     b       .*
-+ 18000[0-9a-f]{2}:    38 63 90 10     addi    r3,r3,-28656
- Disassembly of section \.opt2:
--0+18000b0 <\.opt2>:
-- 18000b0:     3c 62 00 00     addis   r3,r2,0
-- 18000b4:     2c 04 00 00     cmpwi   r4,0
-- 18000b8:     41 82 00 08     beq-    .*
-- 18000bc:     3c 62 00 00     addis   r3,r2,0
-- 18000c0:     38 63 90 10     addi    r3,r3,-28656
-+0+18000[0-9a-f]{2} <\.opt2>:
-+ 18000[0-9a-f]{2}:    3c 62 00 00     addis   r3,r2,0
-+ 18000[0-9a-f]{2}:    2c 04 00 00     cmpwi   r4,0
-+ 18000[0-9a-f]{2}:    41 82 00 08     beq-    .*
-+ 18000[0-9a-f]{2}:    3c 62 00 00     addis   r3,r2,0
-+ 18000[0-9a-f]{2}:    38 63 90 10     addi    r3,r3,-28656
- Disassembly of section \.opt3:
--0+18000c4 <\.opt3>:
-- 18000c4:     3c 62 00 00     addis   r3,r2,0
-- 18000c8:     48 00 00 0c     b       .*
-- 18000cc:     3c 62 00 00     addis   r3,r2,0
-- 18000d0:     48 00 00 0c     b       .*
-- 18000d4:     38 63 90 10     addi    r3,r3,-28656
-- 18000d8:     48 00 00 08     b       .*
-- 18000dc:     38 63 90 08     addi    r3,r3,-28664
-+0+18000[0-9a-f]{2} <\.opt3>:
-+ 18000[0-9a-f]{2}:    3c 62 00 00     addis   r3,r2,0
-+ 18000[0-9a-f]{2}:    48 00 00 0c     b       .*
-+ 18000[0-9a-f]{2}:    3c 62 00 00     addis   r3,r2,0
-+ 18000[0-9a-f]{2}:    48 00 00 0c     b       .*
-+ 18000[0-9a-f]{2}:    38 63 90 10     addi    r3,r3,-28656
-+ 18000[0-9a-f]{2}:    48 00 00 08     b       .*
-+ 18000[0-9a-f]{2}:    38 63 90 08     addi    r3,r3,-28664
- #pass
---- binutils-2.22/ld/testsuite/ld-powerpc/tlsso32.d
-+++ binutils-2.22/ld/testsuite/ld-powerpc/tlsso32.d
-@@ -42,5 +42,5 @@ Disassembly of section \.got:
- .* <\.got>:
-       \.\.\.
- .*:   4e 80 00 21     blrl
--.*:   00 01 03 ec     .*
-+.*:   00 01 [0-9a-f]{2} [0-9a-f]{2}   .*
-       \.\.\.
---- binutils-2.22/ld/testsuite/ld-powerpc/tlsso32.g
-+++ binutils-2.22/ld/testsuite/ld-powerpc/tlsso32.g
-@@ -9,5 +9,5 @@
- Contents of section \.got:
- .* 00000000 00000000 00000000 00000000  .*
- .* 00000000 00000000 00000000 00000000  .*
--.* 00000000 4e800021 000103ec 00000000  .*
-+.* 00000000 4e800021 00010[0-9a-f]{3} 00000000  .*
- .* 00000000                             .*
---- binutils-2.22/ld/testsuite/ld-powerpc/tlsso32.r
-+++ binutils-2.22/ld/testsuite/ld-powerpc/tlsso32.r
-@@ -35,6 +35,7 @@ Program Headers:
-  +LOAD .* RWE 0x10000
-  +DYNAMIC .* RW +0x4
-  +TLS .* 0x0+1c 0x0+38 R +0x4
-+ +PAX_FLAGS +0x0+ 0x0+ 0x0+ 0x0+ 0x0+ +0x[48]
-  Section to Segment mapping:
-  +Segment Sections\.\.\.
-@@ -42,6 +43,7 @@ Program Headers:
-  +01 +\.tdata \.dynamic \.got \.plt 
-  +02 +\.dynamic 
-  +03 +\.tdata \.tbss 
-+ +04 +
- Relocation section '\.rela\.dyn' at offset 0x[0-9a-f]+ contains 18 entries:
-  Offset +Info +Type +Sym\. Value +Symbol's Name \+ Addend
-@@ -52,9 +54,9 @@ Relocation section '\.rela\.dyn' at offset 0x[0-9a-f]+ contains 18 entries:
- [0-9a-f ]+R_PPC_TPREL16 +0+30 +le0 \+ 0
- [0-9a-f ]+R_PPC_TPREL16_HA +0+34 +le1 \+ 0
- [0-9a-f ]+R_PPC_TPREL16_LO +0+34 +le1 \+ 0
--[0-9a-f ]+R_PPC_TPREL16 +0+103d0 +\.tdata \+ 103e4
--[0-9a-f ]+R_PPC_TPREL16_HA +0+103d0 +\.tdata \+ 103e8
--[0-9a-f ]+R_PPC_TPREL16_LO +0+103d0 +\.tdata \+ 103e8
-+[0-9a-f ]+R_PPC_TPREL16 +0+103[df]0 +\.tdata \+ 10[0-9a-f]{3}
-+[0-9a-f ]+R_PPC_TPREL16_HA +0+103[df]0 +\.tdata \+ 10[0-9a-f]{3}
-+[0-9a-f ]+R_PPC_TPREL16_LO +0+103[df]0 +\.tdata \+ 10[0-9a-f]{3}
- [0-9a-f ]+R_PPC_DTPMOD32 +0+
- [0-9a-f ]+R_PPC_DTPREL32 +0+
- [0-9a-f ]+R_PPC_DTPMOD32 +0+
---- binutils-2.22/ld/testsuite/ld-powerpc/tlstoc.g
-+++ binutils-2.22/ld/testsuite/ld-powerpc/tlstoc.g
-@@ -8,8 +8,8 @@
- .*: +file format elf64-powerpc
- Contents of section \.got:
-- 100101a0 00000000 00000001 00000000 00000000  .*
-- 100101b0 00000000 00000001 00000000 00000000  .*
-- 100101c0 00000000 00000001 00000000 00000000  .*
-- 100101d0 00000000 00000001 00000000 00000000  .*
-- 100101e0 ffffffff ffff8060 00000000 00000000  .*
-+ 10010[0-9a-f]{3} 00000000 00000001 00000000 00000000  .*
-+ 10010[0-9a-f]{3} 00000000 00000001 00000000 00000000  .*
-+ 10010[0-9a-f]{3} 00000000 00000001 00000000 00000000  .*
-+ 10010[0-9a-f]{3} 00000000 00000001 00000000 00000000  .*
-+ 10010[0-9a-f]{3} ffffffff ffff8060 00000000 00000000  .*
---- binutils-2.22/ld/testsuite/ld-powerpc/tlstoc.t
-+++ binutils-2.22/ld/testsuite/ld-powerpc/tlstoc.t
-@@ -8,7 +8,7 @@
- .*: +file format elf64-powerpc
- Contents of section \.tdata:
-- 10010148 00c0ffee 00000000 12345678 9abcdef0  .*
-- 10010158 23456789 abcdef01 3456789a bcdef012  .*
-- 10010168 456789ab cdef0123 56789abc def01234  .*
-- 10010178 6789abcd ef012345 789abcde f0123456  .*
-+ 10010180 00c0ffee 00000000 12345678 9abcdef0  .*
-+ 10010190 23456789 abcdef01 3456789a bcdef012  .*
-+ 100101a0 456789ab cdef0123 56789abc def01234  .*
-+ 100101b0 6789abcd ef012345 789abcde f0123456  .*
---- binutils-2.22/ld/testsuite/ld-powerpc/tlstocso.g
-+++ binutils-2.22/ld/testsuite/ld-powerpc/tlstocso.g
-@@ -7,7 +7,7 @@
- .*: +file format elf64-powerpc
- Contents of section \.got:
--.* 00000000 000186c0 00000000 00000000  .*
-+.* 00000000 000186f8 00000000 00000000  .*
- .* 00000000 00000000 00000000 00000000  .*
- .* 00000000 00000000 00000000 00000000  .*
- .* 00000000 00000000 00000000 00000000  .*
---- binutils-2.22/ld/testsuite/ld-s390/tlsbin.rd
-+++ binutils-2.22/ld/testsuite/ld-s390/tlsbin.rd
-@@ -36,13 +36,14 @@ There are [0-9]+ program headers, starting at offset [0-9]+
- Program Headers:
-  +Type +Offset +VirtAddr +PhysAddr +FileSiz +MemSiz +Flg Align
-- +PHDR +0x0+34 0x0+400034 0x0+400034 0x0+c0 0x0+c0 R E 0x4
-- +INTERP +0x0+f4 0x0+4000f4 0x0+4000f4 0x0+11 0x0+11 R +0x1
-+ +PHDR +0x0+34 0x0+400034 0x0+400034 0x0+e0 0x0+e0 R E 0x4
-+ +INTERP +0x0+114 0x0+400114 0x0+400114 0x0+11 0x0+11 R +0x1
- .*Requesting program interpreter.*
-  +LOAD .* R E 0x1000
-  +LOAD .* RW +0x1000
-  +DYNAMIC .* RW +0x4
-  +TLS .* 0x0+60 0x0+a0 R +0x20
-+ +PAX_FLAGS +0x0+ 0x0+ 0x0+ 0x0+ 0x0+ +0x[48]
-  Section to Segment mapping:
-  +Segment Sections...
-@@ -52,6 +53,7 @@ Program Headers:
-  +03 +.tdata .dynamic .got *
-  +04 +.dynamic *
-  +05 +.tdata .tbss *
-+ +06 +
- Relocation section '.rela.dyn' at offset .* contains 4 entries:
-  Offset +Info +Type +Sym.Value +Sym. Name \+ Addend
---- binutils-2.22/ld/testsuite/ld-s390/tlsbin_64.rd
-+++ binutils-2.22/ld/testsuite/ld-s390/tlsbin_64.rd
-@@ -36,13 +36,14 @@ There are [0-9]+ program headers, starting at offset [0-9]+
- Program Headers:
-  +Type +Offset +VirtAddr +PhysAddr +FileSiz +MemSiz +Flg Align
-- +PHDR +0x0+40 0x0+80000040 0x0+80000040 0x0+150 0x0+150 R E 0x8
-- +INTERP +0x0+190 0x0+80000190 0x0+80000190 0x0+11 0x0+11 R +0x1
-+ +PHDR +0x0+40 0x0+80000040 0x0+80000040 0x0+188 0x0+188 R E 0x8
-+ +INTERP +0x0+1c8 0x0+800001c8 0x0+800001c8 0x0+11 0x0+11 R +0x1
- .*Requesting program interpreter.*
-  +LOAD .* R E 0x1000
-  +LOAD .* RW +0x1000
-  +DYNAMIC .* RW +0x8
-  +TLS .* 0x0+60 0x0+a0 R +0x20
-+ +PAX_FLAGS +0x0+ 0x0+ 0x0+ 0x0+ 0x0+ +0x[48]
-  Section to Segment mapping:
-  +Segment Sections...
-@@ -52,6 +53,7 @@ Program Headers:
-  +03 +.tdata .dynamic .got *
-  +04 +.dynamic *
-  +05 +.tdata .tbss *
-+ +06 +
- Relocation section '.rela.dyn' at offset 0x[0-9a-f]+ contains 4 entries:
-  +Offset +Info +Type +Symbol's Value +Symbol's Name \+ Addend
---- binutils-2.22/ld/testsuite/ld-s390/tlspic.rd
-+++ binutils-2.22/ld/testsuite/ld-s390/tlspic.rd
-@@ -39,6 +39,7 @@ Program Headers:
-  +LOAD .* RW +0x1000
-  +DYNAMIC .* RW +0x4
-  +TLS .* 0x0+60 0x0+80 R +0x20
-+ +PAX_FLAGS +0x0+ 0x0+ 0x0+ 0x0+ 0x0+ +0x[48]
-  Section to Segment mapping:
-  +Segment Sections...
-@@ -46,6 +47,7 @@ Program Headers:
-  +01 +.tdata .dynamic .got 
-  +02 +.dynamic 
-  +03 +.tdata .tbss 
-+ +04 +
- Relocation section '.rela.dyn' at offset 0x[0-9a-f]+ contains 14 entries:
-  Offset +Info +Type +Sym.Value +Sym. Name \+ Addend
---- binutils-2.22/ld/testsuite/ld-s390/tlspic_64.rd
-+++ binutils-2.22/ld/testsuite/ld-s390/tlspic_64.rd
-@@ -39,6 +39,7 @@ Program Headers:
-  +LOAD .* RW +0x1000
-  +DYNAMIC .* RW +0x8
-  +TLS .* 0x0+60 0x0+80 R +0x20
-+ +PAX_FLAGS +0x0+ 0x0+ 0x0+ 0x0+ 0x0+ +0x[48]
-  Section to Segment mapping:
-  +Segment Sections...
-@@ -46,6 +47,7 @@ Program Headers:
-  +01 +.tdata .dynamic .got *
-  +02 +.dynamic *
-  +03 +.tdata .tbss *
-+ +04 +
- Relocation section '.rela.dyn' at offset 0x[0-9a-f]+ contains 14 entries:
-  +Offset +Info +Type +Symbol's Value +Symbol's Name \+ Addend
---- binutils-2.22/ld/testsuite/ld-scripts/empty-aligned.d
-+++ binutils-2.22/ld/testsuite/ld-scripts/empty-aligned.d
-@@ -8,7 +8,9 @@
- Program Headers:
-  +Type +Offset +VirtAddr +PhysAddr +FileSiz +MemSiz +Flg +Align
-  +LOAD +0x[0-9a-f]+ 0x[0-9a-f]+ 0x[0-9a-f]+ 0x[0-9a-f]+ 0x[0-9a-f]+ [RWE ]+ +0x[0-9a-f]+
-+ +PAX_FLAGS +0x0+ 0x0+ 0x0+ 0x0+ 0x0+ +0x[48]
-  Section to Segment mapping:
-  +Segment Sections\.\.\.
-  +00 +.text 
-+ +01 +
---- binutils-2.22/ld/testsuite/ld-sh/tlsbin-2.d
-+++ binutils-2.22/ld/testsuite/ld-sh/tlsbin-2.d
-@@ -44,6 +44,7 @@ Program Headers:
-  +LOAD.*
-  +DYNAMIC.*
-  +TLS +0x[0-9a-f]+ 0x[0-9a-f]+ 0x[0-9a-f]+ 0x0+18 0x0+28 R +0x4
-+ +PAX_FLAGS +0x0+ 0x0+ 0x0+ 0x0+ 0x0+ +0x[48]
-  Section to Segment mapping:
-  +Segment Sections\.\.\.
-@@ -53,6 +54,7 @@ Program Headers:
-  +03 +\.tdata \.dynamic \.got *
-  +04 +\.dynamic *
-  +05 +\.tdata \.tbss *
-+ +06 +
- Relocation section '\.rela\.dyn' at offset 0x[0-9a-f]+ contains 4 entries:
-  Offset +Info +Type +Sym\.Value +Sym\. Name \+ Addend
---- binutils-2.22/ld/testsuite/ld-sh/tlspic-2.d
-+++ binutils-2.22/ld/testsuite/ld-sh/tlspic-2.d
-@@ -32,7 +32,7 @@ Key to Flags:
- Elf file type is DYN \(Shared object file\)
- Entry point 0x[0-9a-f]+
--There are 4 program headers, starting at offset [0-9]+
-+There are [0-9] program headers, starting at offset [0-9]+
- Program Headers:
-  +Type +Offset +VirtAddr +PhysAddr +FileSiz +MemSiz +Flg Align
-@@ -40,6 +40,7 @@ Program Headers:
-  +LOAD.*
-  +DYNAMIC.*
-  +TLS .* 0x0+18 0x0+20 R +0x4
-+ +PAX_FLAGS +0x0+ 0x0+ 0x0+ 0x0+ 0x0+ +0x[48]
-  Section to Segment mapping:
-  +Segment Sections\.\.\.
-@@ -47,6 +48,7 @@ Program Headers:
-  +01 +\.tdata \.dynamic \.got *
-  +02 +\.dynamic *
-  +03 +\.tdata \.tbss *
-+ +04 +
- Relocation section '\.rela\.dyn' at offset 0x[0-9a-f]+ contains 10 entries:
-  Offset +Info +Type +Sym\.Value +Sym\. Name \+ Addend
---- binutils-2.22/ld/testsuite/ld-sparc/gotop32.rd
-+++ binutils-2.22/ld/testsuite/ld-sparc/gotop32.rd
-@@ -31,6 +31,7 @@ Program Headers:
-  +LOAD +0x0+ 0x0+ 0x0+ 0x0+2000 0x0+2000 R E 0x10000
-  +LOAD +0x0+2000 0x0+12000 0x0+12000 0x0+2000 0x0+2000 RW +0x10000
-  +DYNAMIC +0x0+2000 0x0+12000 0x0+12000 0x0+70 0x0+70 RW +0x4
-+ +PAX_FLAGS +0x0+ 0x0+ 0x0+ 0x0+ 0x0+ +0x[48]
- #...
- Relocation section '.rela.dyn' at offset 0x[0-9a-f]+ contains 1 entries:
---- binutils-2.22/ld/testsuite/ld-sparc/gotop64.rd
-+++ binutils-2.22/ld/testsuite/ld-sparc/gotop64.rd
-@@ -31,6 +31,7 @@ Program Headers:
-  +LOAD +0x0+ 0x0+ 0x0+ 0x0+2000 0x0+2000 R E 0x100000
-  +LOAD +0x0+2000 0x0+102000 0x0+102000 0x0+2000 0x0+2000 RW +0x100000
-  +DYNAMIC +0x0+2000 0x0+102000 0x0+102000 0x0+e0 0x0+e0 RW +0x8
-+ +PAX_FLAGS +0x0+ 0x0+ 0x0+ 0x0+ 0x0+ +0x[48]
- #...
- Relocation section '.rela.dyn' at offset 0x[0-9a-f]+ contains 1 entries:
---- binutils-2.22/ld/testsuite/ld-sparc/tlssunbin32.rd
-+++ binutils-2.22/ld/testsuite/ld-sparc/tlssunbin32.rd
-@@ -30,13 +30,14 @@ There are [0-9]+ program headers, starting at offset [0-9]+
- Program Headers:
-  +Type +Offset +VirtAddr +PhysAddr +FileSiz MemSiz +Flg Align
-- +PHDR +0x0+34 0x0+10034 0x0+10034 0x0+c0 0x0+c0 R E 0x4
-- +INTERP +0x0+f4 0x0+100f4 0x0+100f4 0x0+11 0x0+11 R +0x1
-+ +PHDR +0x0+34 0x0+10034 0x0+10034 (0x[0-9a-f]+) \1 R E 0x4
-+ +INTERP +(0x[0-9a-f]+ ){3}0x0+11 0x0+11 R +0x1
- .*Requesting program interpreter.*
-  +LOAD .* R E 0x10000
-  +LOAD .* RW +0x10000
-  +DYNAMIC .* RW +0x4
-  +TLS .* 0x0+1060 0x0+10a0 R +0x4
-+ +PAX_FLAGS +0x0+ 0x0+ 0x0+ 0x0+ 0x0+ +0x[48]
- #...
- Relocation section '.rela.dyn' at offset 0x[0-9a-f]+ contains 4 entries:
---- binutils-2.22/ld/testsuite/ld-sparc/tlssunbin64.rd
-+++ binutils-2.22/ld/testsuite/ld-sparc/tlssunbin64.rd
-@@ -30,13 +30,14 @@ There are [0-9]+ program headers, starting at offset [0-9]+
- Program Headers:
-  +Type +Offset +VirtAddr +PhysAddr +FileSiz +MemSiz +Flg Align
-- +PHDR +0x0+40 0x0+100040 0x0+100040 0x0+150 0x0+150 R E 0x8
-- +INTERP +0x0+190 0x0+100190 0x0+100190 0x0+19 0x0+19 R +0x1
-+ +PHDR +0x0+40 0x0+100040 0x0+100040 (0x[0-9a-f]+) \1 R E 0x8
-+ +INTERP +0x0+([0-9a-f]+) (0x0+10+\1) \2 0x0+19 0x0+19 R +0x1
- .*Requesting program interpreter.*
-  +LOAD .* R E 0x100000
-  +LOAD .* RW +0x100000
-  +DYNAMIC .* RW +0x8
-  +TLS .* 0x0+60 0x0+a0 R +0x4
-+ +PAX_FLAGS +0x0+ 0x0+ 0x0+ 0x0+ 0x0+ +0x[48]
- #...
- Relocation section '.rela.dyn' at offset 0x[0-9a-f]+ contains 4 entries:
---- binutils-2.22/ld/testsuite/ld-sparc/tlssunnopic32.rd
-+++ binutils-2.22/ld/testsuite/ld-sparc/tlssunnopic32.rd
-@@ -32,6 +32,7 @@ Program Headers:
-  +LOAD .* RW +0x10000
-  +DYNAMIC .* RW +0x4
-  +TLS .* 0x0+ 0x0+24 R +0x4
-+ +PAX_FLAGS +0x0+ 0x0+ 0x0+ 0x0+ 0x0+ +0x[48]
- #...
- Relocation section '.rela.dyn' at offset 0x[0-9a-f]+ contains 12 entries:
---- binutils-2.22/ld/testsuite/ld-sparc/tlssunnopic64.rd
-+++ binutils-2.22/ld/testsuite/ld-sparc/tlssunnopic64.rd
-@@ -32,6 +32,7 @@ Program Headers:
-  +LOAD .* RW +0x100000
-  +DYNAMIC .* RW +0x8
-  +TLS .* 0x0+ 0x0+24 R +0x4
-+ +PAX_FLAGS +0x0+ 0x0+ 0x0+ 0x0+ 0x0+ +0x[48]
- #...
- Relocation section '.rela.dyn' at offset 0x[0-9a-f]+ contains 14 entries:
---- binutils-2.22/ld/testsuite/ld-sparc/tlssunpic32.rd
-+++ binutils-2.22/ld/testsuite/ld-sparc/tlssunpic32.rd
-@@ -36,6 +36,7 @@ Program Headers:
-  +LOAD +0x0+2000 0x0+12000 0x0+12000 0x0+184 0x0+184 RWE 0x10000
-  +DYNAMIC +0x0+2060 0x0+12060 0x0+12060 0x0+98 0x0+98 RW +0x4
-  +TLS +0x0+2000 0x0+12000 0x0+12000 0x0+60 0x0+80 R +0x4
-+ +PAX_FLAGS +0x0+ 0x0+ 0x0+ 0x0+ 0x0+ +0x[48]
- #...
- Relocation section '.rela.dyn' at offset 0x[0-9a-f]+ contains 14 entries:
---- binutils-2.22/ld/testsuite/ld-sparc/tlssunpic64.rd
-+++ binutils-2.22/ld/testsuite/ld-sparc/tlssunpic64.rd
-@@ -36,6 +36,7 @@ Program Headers:
-  +LOAD +0x0+2000 0x0+102000 0x0+102000 0x0+3a0 0x0+3a0 RWE 0x100000
-  +DYNAMIC +0x0+2060 0x0+102060 0x0+102060 0x0+130 0x0+130 RW +0x8
-  +TLS +0x0+2000 0x0+102000 0x0+102000 0x0+60 0x0+80 R +0x4
-+ +PAX_FLAGS +0x0+ 0x0+ 0x0+ 0x0+ 0x0+ +0x[48]
- #...
- Relocation section '.rela.dyn' at offset 0x[0-9a-f]+ contains 14 entries:
---- binutils-2.22/ld/testsuite/ld-x86-64/protected3.d
-+++ binutils-2.22/ld/testsuite/ld-x86-64/protected3.d
-@@ -8,6 +8,6 @@
- Disassembly of section .text:
- 0+[a-f0-9]+ <bar>:
--[     ]*[a-f0-9]+:    8b 05 [a-f0-9][a-f0-9] 00 [a-f0-9][a-f0-9] 00           mov    0x[a-f0-9]+\(%rip\),%eax        # [a-f0-9]+ <foo>
-+[     ]*[a-f0-9]+:    8b 05 [a-f0-9][a-f0-9] [a-f0-9][a-f0-9] [a-f0-9][a-f0-9] 00     mov    0x[a-f0-9]+\(%rip\),%eax        # [a-f0-9]+ <foo>
- [     ]*[a-f0-9]+:    c3                      retq   
- #pass
---- binutils-2.22/ld/testsuite/ld-x86-64/tlsgdesc.rd
-+++ binutils-2.22/ld/testsuite/ld-x86-64/tlsgdesc.rd
-@@ -36,12 +36,14 @@ Program Headers:
-  +LOAD.*
-  +LOAD.*
-  +DYNAMIC.*
-+ +PAX_FLAGS.*
-  Section to Segment mapping:
-  +Segment Sections...
-  +00 +.hash .dynsym .dynstr .rela.dyn .rela.plt .plt .text *
-  +01 +.dynamic .got .got.plt *
-  +02 +.dynamic *
-+ +03 +
- Relocation section '.rela.dyn' at offset 0x[0-9a-f]+ contains 8 entries:
-  +Offset +Info +Type +Symbol's Value +Symbol's Name \+ Addend
---- binutils-2.22/ld/testsuite/ld-x86-64/tlspic.rd
-+++ binutils-2.22/ld/testsuite/ld-x86-64/tlspic.rd
-@@ -40,6 +40,7 @@ Program Headers:
-  +LOAD +0x0+11ac 0x0+2011ac 0x0+2011ac 0x0+244 0x0+244 RW +0x200000
-  +DYNAMIC +0x0+1210 0x0+201210 0x0+201210 0x0+130 0x0+130 RW +0x8
-  +TLS +0x0+11ac 0x0+2011ac 0x0+2011ac 0x0+60 0x0+80 R +0x1
-+ +PAX_FLAGS +0x0+ 0x0+ 0x0+ 0x0+ 0x0+ +0x[48]
-  Section to Segment mapping:
-  +Segment Sections...
-@@ -47,6 +48,7 @@ Program Headers:
-  +01 +.tdata .dynamic .got .got.plt *
-  +02 +.dynamic *
-  +03 +.tdata .tbss *
-+ +04 +
- Relocation section '.rela.dyn' at offset 0x[0-9a-f]+ contains 14 entries:
-  +Offset +Info +Type +Symbol's Value +Symbol's Name \+ Addend
diff --git a/src/patches/binutils-2.24-pt-pax-flags-20131231.patch b/src/patches/binutils-2.24-pt-pax-flags-20131231.patch
new file mode 100644 (file)
index 0000000..cfb2035
--- /dev/null
@@ -0,0 +1,1030 @@
+--- binutils-2.24/bfd/elf-bfd.h
++++ binutils-2.24/bfd/elf-bfd.h
+@@ -1577,6 +1577,9 @@ struct elf_obj_tdata
+   /* Segment flags for the PT_GNU_STACK segment.  */
+   unsigned int stack_flags;
++  /* Segment flags for the PT_PAX_FLAGS segment.  */
++  unsigned int pax_flags;
++
+   /* This is set to TRUE if the object was created by the backend
+      linker.  */
+   bfd_boolean linker;
+@@ -1707,6 +1707,7 @@
+ #define elf_eh_frame_hdr(bfd) (elf_tdata(bfd) -> o->eh_frame_hdr)
+ #define elf_linker(bfd)               (elf_tdata(bfd) -> o->linker)
+ #define elf_stack_flags(bfd)  (elf_tdata(bfd) -> o->stack_flags)
++#define elf_pax_flags(bfd)    (elf_tdata(bfd) -> o->pax_flags)
+ #define elf_shstrtab(bfd)     (elf_tdata(bfd) -> o->strtab_ptr)
+ #define elf_onesymtab(bfd)    (elf_tdata(bfd) -> symtab_section)
+ #define elf_symtab_shndx(bfd) (elf_tdata(bfd) -> symtab_shndx_section)
+--- binutils-2.24/bfd/elf.c
++++ binutils-2.24/bfd/elf.c
+@@ -1158,6 +1158,7 @@ get_segment_type (unsigned int p_type)
+     case PT_GNU_EH_FRAME: pt = "EH_FRAME"; break;
+     case PT_GNU_STACK: pt = "STACK"; break;
+     case PT_GNU_RELRO: pt = "RELRO"; break;
++    case PT_PAX_FLAGS: pt = "PAX_FLAGS"; break;
+     default: pt = NULL; break;
+     }
+   return pt;
+@@ -2477,6 +2478,9 @@ bfd_section_from_phdr (bfd *abfd, Elf_Internal_Phdr *hdr, int hdr_index)
+     case PT_GNU_RELRO:
+       return _bfd_elf_make_section_from_phdr (abfd, hdr, hdr_index, "relro");
++    case PT_PAX_FLAGS:
++      return _bfd_elf_make_section_from_phdr (abfd, hdr, hdr_index, "pax_flags");
++
+     default:
+       /* Check for any processor-specific program segment types.  */
+       bed = get_elf_backend_data (abfd);
+@@ -3551,6 +3555,11 @@ get_program_header_size (bfd *abfd, struct bfd_link_info *info)
+       ++segs;
+     }
++    {
++      /* We need a PT_PAX_FLAGS segment.  */
++      ++segs;
++    }
++
+   for (s = abfd->sections; s != NULL; s = s->next)
+     {
+       if ((s->flags & SEC_LOAD) != 0
+@@ -4153,6 +4162,20 @@ _bfd_elf_map_sections_to_segments (bfd *abfd, struct bfd_link_info *info)
+           }
+       }
++    {
++      amt = sizeof (struct elf_segment_map);
++      m = bfd_zalloc (abfd, amt);
++      if (m == NULL)
++      goto error_return;
++      m->next = NULL;
++      m->p_type = PT_PAX_FLAGS;
++      m->p_flags = elf_pax_flags (abfd);
++      m->p_flags_valid = 1;
++
++      *pm = m;
++      pm = &m->next;
++    }
++
+       free (sections);
+       elf_tdata (abfd)->segment_map = mfirst;
+     }
+@@ -5417,7 +5440,8 @@ rewrite_elf_program_header (bfd *ibfd, bfd *obfd)
+        6. PT_TLS segment includes only SHF_TLS sections.
+        7. SHF_TLS sections are only in PT_TLS or PT_LOAD segments.
+        8. PT_DYNAMIC should not contain empty sections at the beginning
+-        (with the possible exception of .dynamic).  */
++        (with the possible exception of .dynamic).
++       9. PT_PAX_FLAGS segments do not include any sections.  */
+ #define IS_SECTION_IN_INPUT_SEGMENT(section, segment, bed)            \
+   ((((segment->p_paddr                                                        \
+       ? IS_CONTAINED_BY_LMA (section, segment, segment->p_paddr)      \
+@@ -5425,6 +5449,7 @@ rewrite_elf_program_header (bfd *ibfd, bfd *obfd)
+      && (section->flags & SEC_ALLOC) != 0)                            \
+     || IS_NOTE (segment, section))                                    \
+    && segment->p_type != PT_GNU_STACK                                 \
++   && segment->p_type != PT_PAX_FLAGS                                 \
+    && (segment->p_type != PT_TLS                                      \
+        || (section->flags & SEC_THREAD_LOCAL))                                \
+    && (segment->p_type == PT_LOAD                                     \
+--- binutils-2.24/bfd/elflink.c
++++ binutils-2.24/bfd/elflink.c
+@@ -5545,17 +5545,30 @@ bfd_elf_size_dynamic_sections (bfd *output_bfd,
+       && ! (*bed->elf_backend_always_size_sections) (output_bfd, info))
+     return FALSE;
++  elf_pax_flags (output_bfd) = PF_NORANDEXEC;
++  if (info->execheap)
++    elf_pax_flags (output_bfd) |= PF_NOMPROTECT;
++  else if (info->noexecheap)
++    elf_pax_flags (output_bfd) |= PF_MPROTECT;
++
+   /* Determine any GNU_STACK segment requirements, after the backend
+      has had a chance to set a default segment size.  */
+   if (info->execstack)
+-    elf_stack_flags (output_bfd) = PF_R | PF_W | PF_X;
++    {
++      elf_stack_flags (output_bfd) = PF_R | PF_W | PF_X;
++      elf_pax_flags (output_bfd) |= PF_EMUTRAMP;
++    }
+   else if (info->noexecstack)
+-    elf_stack_flags (output_bfd) = PF_R | PF_W;
++    {
++      elf_stack_flags (output_bfd) = PF_R | PF_W;
++      elf_pax_flags (output_bfd) |= PF_NOEMUTRAMP;
++    }
+   else
+     {
+       bfd *inputobj;
+       asection *notesec = NULL;
+       int exec = 0;
++      elf_pax_flags (output_bfd) |= PF_NOEMUTRAMP;
+       for (inputobj = info->input_bfds;
+          inputobj;
+          inputobj = inputobj->link_next)
+@@ -5567,7 +5581,11 @@ bfd_elf_size_dynamic_sections (bfd *output_bfd,
+         if (s)
+           {
+             if (s->flags & SEC_CODE)
+-              exec = PF_X;
++              {
++                elf_pax_flags (output_bfd) &= ~PF_NOEMUTRAMP;
++                elf_pax_flags (output_bfd) |= PF_EMUTRAMP;
++                exec = PF_X;
++              }
+             notesec = s;
+           }
+         else if (bed->default_execstack)
+--- binutils-2.24/binutils/readelf.c
++++ binutils-2.24/binutils/readelf.c
+@@ -2740,6 +2740,7 @@ get_segment_type (unsigned long p_type)
+                       return "GNU_EH_FRAME";
+     case PT_GNU_STACK:        return "GNU_STACK";
+     case PT_GNU_RELRO:  return "GNU_RELRO";
++    case PT_PAX_FLAGS:  return "PAX_FLAGS";
+     default:
+       if ((p_type >= PT_LOPROC) && (p_type <= PT_HIPROC))
+--- binutils-2.24/include/bfdlink.h
++++ binutils-2.24/include/bfdlink.h
+@@ -322,6 +322,14 @@ struct bfd_link_info
+   /* TRUE if PT_GNU_RELRO segment should be created.  */
+   unsigned int relro: 1;
++  /* TRUE if PT_PAX_FLAGS segment should be created with PF_NOMPROTECT
++     flags.  */
++  unsigned int execheap: 1;
++
++  /* TRUE if PT_PAX_FLAGS segment should be created with PF_MPROTECT
++     flags.  */
++  unsigned int noexecheap: 1;
++
+   /* TRUE if .eh_frame_hdr section and PT_GNU_EH_FRAME ELF segment
+      should be created.  */
+   unsigned int eh_frame_hdr: 1;
+--- binutils-2.24/include/elf/common.h
++++ binutils-2.24/include/elf/common.h
+@@ -429,6 +429,7 @@
+ #define PT_SUNW_EH_FRAME PT_GNU_EH_FRAME      /* Solaris uses the same value */
+ #define PT_GNU_STACK  (PT_LOOS + 0x474e551) /* Stack flags */
+ #define PT_GNU_RELRO  (PT_LOOS + 0x474e552) /* Read-only after relocation */
++#define PT_PAX_FLAGS  (PT_LOOS + 0x5041580) /* PaX flags */
+ /* Program segment permissions, in program header p_flags field.  */
+@@ -439,6 +440,21 @@
+ #define PF_MASKOS     0x0FF00000      /* New value, Oct 4, 1999 Draft */
+ #define PF_MASKPROC   0xF0000000      /* Processor-specific reserved bits */
++/* Flags to control PaX behavior.  */
++
++#define PF_PAGEEXEC   (1 << 4)        /* Enable  PAGEEXEC */
++#define PF_NOPAGEEXEC (1 << 5)        /* Disable PAGEEXEC */
++#define PF_SEGMEXEC   (1 << 6)        /* Enable  SEGMEXEC */
++#define PF_NOSEGMEXEC (1 << 7)        /* Disable SEGMEXEC */
++#define PF_MPROTECT   (1 << 8)        /* Enable  MPROTECT */
++#define PF_NOMPROTECT (1 << 9)        /* Disable MPROTECT */
++#define PF_RANDEXEC   (1 << 10)       /* Enable  RANDEXEC */
++#define PF_NORANDEXEC (1 << 11)       /* Disable RANDEXEC */
++#define PF_EMUTRAMP   (1 << 12)       /* Enable  EMUTRAMP */
++#define PF_NOEMUTRAMP (1 << 13)       /* Disable EMUTRAMP */
++#define PF_RANDMMAP   (1 << 14)       /* Enable  RANDMMAP */
++#define PF_NORANDMMAP (1 << 15)       /* Disable RANDMMAP */
++
+ /* Values for section header, sh_type field.  */
+ #define SHT_NULL      0               /* Section header table entry unused */
+--- binutils-2.24/ld/emultempl/elf32.em
++++ binutils-2.24/ld/emultempl/elf32.em
+@@ -2285,6 +2285,16 @@ fragment <<EOF
+         link_info.noexecstack = TRUE;
+         link_info.execstack = FALSE;
+       }
++      else if (strcmp (optarg, "execheap") == 0)
++      {
++        link_info.execheap = TRUE;
++        link_info.noexecheap = FALSE;
++      }
++      else if (strcmp (optarg, "noexecheap") == 0)
++      {
++        link_info.noexecheap = TRUE;
++        link_info.execheap = FALSE;
++      }
+ EOF
+ if test x"$GENERATE_SHLIB_SCRIPT" = xyes; then
+ fragment <<EOF
+@@ -2368,6 +2378,8 @@ fragment <<EOF
+   -z defs                     Report unresolved symbols in object files.\n"));
+   fprintf (file, _("\
+   -z execstack                Mark executable as requiring executable stack\n"));
++  fprintf (file, _("\
++  -z execheap                 Mark executable as requiring executable heap\n"));
+ EOF
+ if test x"$GENERATE_SHLIB_SCRIPT" = xyes; then
+@@ -2391,6 +2403,8 @@ fragment <<EOF
+ fragment <<EOF
+   fprintf (file, _("\
+   -z noexecstack              Mark executable as not requiring executable stack\n"));
++  fprintf (file, _("\
++  -z noexecheap               Mark executable as not requiring executable heap\n"));
+ EOF
+ if test x"$GENERATE_SHLIB_SCRIPT" = xyes; then
+ fragment <<EOF
+--- binutils-2.24/ld/ldgram.y
++++ binutils-2.24/ld/ldgram.y
+@@ -1119,6 +1119,8 @@ phdr_type:
+                           $$ = exp_intop (0x6474e550);
+                         else if (strcmp (s, "PT_GNU_STACK") == 0)
+                           $$ = exp_intop (0x6474e551);
++                        else if (strcmp (s, "PT_PAX_FLAGS") == 0)
++                          $$ = exp_intop (0x65041580);
+                         else
+                           {
+                             einfo (_("\
+--- binutils-2.24/ld/testsuite/ld-alpha/tlsbin.rd
++++ binutils-2.24/ld/testsuite/ld-alpha/tlsbin.rd
+@@ -35,13 +35,14 @@ There are [0-9]+ program headers, starting at offset [0-9]+
+ Program Headers:
+   Type +Offset +VirtAddr +PhysAddr +FileSiz +MemSiz +Flg Align
+-  PHDR +0x[0-9a-f]+ 0x[0-9a-f]+ 0x[0-9a-f]+ 0x[0-9a-f]+ 0x0+150 R E 0x8
++  PHDR +0x[0-9a-f]+ 0x[0-9a-f]+ 0x[0-9a-f]+ 0x[0-9a-f]+ 0x0+188 R E 0x8
+   INTERP +0x[0-9a-f]+ 0x[0-9a-f]+ 0x[0-9a-f]+ 0x[0-9a-f]+ 0x[0-9a-f]+ R +0x1
+ .*Requesting program interpreter.*
+   LOAD +0x[0-9a-f]+ 0x[0-9a-f]+ 0x[0-9a-f]+ 0x[0-9a-f]+ 0x[0-9a-f]+ R E 0x10000
+   LOAD +0x[0-9a-f]+ 0x[0-9a-f]+ 0x[0-9a-f]+ 0x[0-9a-f]+ 0x[0-9a-f]+ RWE 0x10000
+   DYNAMIC +0x[0-9a-f]+ 0x[0-9a-f]+ 0x[0-9a-f]+ 0x[0-9a-f]+ 0x[0-9a-f]+ RW +0x8
+   TLS +0x[0-9a-f]+ 0x[0-9a-f]+ 0x[0-9a-f]+ 0x[0-9a-f]+ 0x[0-9a-f]+ R +0x4
++ +PAX_FLAGS +0x0+ 0x0+ 0x0+ 0x0+ 0x0+ +0x[48]
+ #...
+ Relocation section '.rela.dyn' at offset 0x[0-9a-f]+ contains 3 entries:
+--- binutils-2.24/ld/testsuite/ld-alpha/tlsbinr.rd
++++ binutils-2.24/ld/testsuite/ld-alpha/tlsbinr.rd
+@@ -42,6 +42,7 @@ Program Headers:
+  +LOAD +0x[0-9a-f]+ 0x[0-9a-f]+ 0x[0-9a-f]+ 0x[0-9a-f]+ 0x[0-9a-f]+ RWE 0x10000
+  +DYNAMIC +0x[0-9a-f]+ 0x[0-9a-f]+ 0x[0-9a-f]+ 0x[0-9a-f]+ 0x[0-9a-f]+ RW +0x8
+  +TLS +0x[0-9a-f]+ 0x[0-9a-f]+ 0x[0-9a-f]+ 0x[0-9a-f]+ 0x[0-9a-f]+ R +0x4
++ +PAX_FLAGS +0x0+ 0x0+ 0x0+ 0x0+ 0x0+ +0x[48]
+ #...
+ Relocation section '.rela.dyn' at offset 0x[0-9a-f]+ contains 2 entries:
+--- binutils-2.24/ld/testsuite/ld-alpha/tlspic.rd
++++ binutils-2.24/ld/testsuite/ld-alpha/tlspic.rd
+@@ -38,6 +38,7 @@ Program Headers:
+  +LOAD +0x[0-9a-f]+ 0x[0-9a-f]+ 0x[0-9a-f]+ 0x[0-9a-f]+ 0x[0-9a-f]+ RWE 0x10000
+  +DYNAMIC +0x[0-9a-f]+ 0x[0-9a-f]+ 0x[0-9a-f]+ 0x[0-9a-f]+ 0x[0-9a-f]+ RW +0x8
+  +TLS +0x0+10e0 0x0+110e0 0x0+110e0 0x0+60 0x0+80 R +0x4
++ +PAX_FLAGS +0x0+ 0x0+ 0x0+ 0x0+ 0x0+ +0x[48]
+ #...
+ Relocation section '.rela.dyn' at offset 0x[0-9a-f]+ contains 7 entries:
+--- binutils-2.24/ld/testsuite/ld-elf/eh1.d
++++ binutils-2.24/ld/testsuite/ld-elf/eh1.d
+@@ -22,11 +22,11 @@ Contents of the .eh_frame section:
+   DW_CFA_nop
+   DW_CFA_nop
+-0+0018 0+001c 0+001c FDE cie=0+0000 pc=0+400078..0+400078
+-  DW_CFA_advance_loc: 0 to 0+400078
++0+0018 0+001c 0+001c FDE cie=0+0000 pc=([0-9a-f]+)..\1
++  DW_CFA_advance_loc: 0 to [0-9a-f]+
+   DW_CFA_def_cfa_offset: 16
+   DW_CFA_offset: r6 \(rbp\) at cfa-16
+-  DW_CFA_advance_loc: 0 to 0+400078
++  DW_CFA_advance_loc: 0 to [0-9a-f]+
+   DW_CFA_def_cfa_register: r6 \(rbp\)
+ 0+0038 ZERO terminator
+--- binutils-2.24/ld/testsuite/ld-elf/eh2.d
++++ binutils-2.24/ld/testsuite/ld-elf/eh2.d
+@@ -22,11 +22,11 @@ Contents of the .eh_frame section:
+   DW_CFA_nop
+   DW_CFA_nop
+-0+0018 0+001c 0+001c FDE cie=0+0000 pc=0+400078..0+400078
+-  DW_CFA_advance_loc: 0 to 0+400078
++0+0018 0+001c 0+001c FDE cie=0+0000 pc=([0-9a-f]+)..\1
++  DW_CFA_advance_loc: 0 to [0-9a-f]+
+   DW_CFA_def_cfa_offset: 16
+   DW_CFA_offset: r6 \(rbp\) at cfa-16
+-  DW_CFA_advance_loc: 0 to 0+400078
++  DW_CFA_advance_loc: 0 to [0-9a-f]+
+   DW_CFA_def_cfa_register: r6 \(rbp\)
+ 0+0038 ZERO terminator
+--- binutils-2.24/ld/testsuite/ld-elf/eh3.d
++++ binutils-2.24/ld/testsuite/ld-elf/eh3.d
+@@ -22,11 +22,11 @@ Contents of the .eh_frame section:
+   DW_CFA_nop
+   DW_CFA_nop
+-0+0018 0+001c 0+001c FDE cie=0+0000 pc=0+400078..0+400078
+-  DW_CFA_advance_loc: 0 to 0+400078
++0+0018 0+001c 0+001c FDE cie=0+0000 pc=([0-9a-f]+)..\1
++  DW_CFA_advance_loc: 0 to [0-9a-f]+
+   DW_CFA_def_cfa_offset: 16
+   DW_CFA_offset: r6 \(rbp\) at cfa-16
+-  DW_CFA_advance_loc: 0 to 0+400078
++  DW_CFA_advance_loc: 0 to [0-9a-f]+
+   DW_CFA_def_cfa_register: r6 \(rbp\)
+ 0+0038 ZERO terminator
+--- binutils-2.24/ld/testsuite/ld-elf/orphan-region.d
++++ binutils-2.24/ld/testsuite/ld-elf/orphan-region.d
+@@ -15,7 +15,9 @@
+ Program Headers:
+   Type.*
+   LOAD[ \t]+0x[0-9a-f]+ 0x0*40000000 0x0*40000000 0x[0-9a-f]+ 0x[0-9a-f]+ RWE 0x[0-9a-f]+
++ +PAX_FLAGS +0x0+ 0x0+ 0x0+ 0x0+ 0x0+ +0x[48]
+  Section to Segment mapping:
+   Segment Sections...
+    00     .text .rodata .moredata *
++   01 +
+--- binutils-2.24/ld/testsuite/ld-i386/tlsbin.rd
++++ binutils-2.24/ld/testsuite/ld-i386/tlsbin.rd
+@@ -44,6 +44,7 @@ Program Headers:
+  +LOAD.*
+  +DYNAMIC.*
+  +TLS +0x[0-9a-f]+ 0x[0-9a-f]+ 0x[0-9a-f]+ 0x0+60 0x0+a0 R +0x1000
++ +PAX_FLAGS +0x0+ 0x0+ 0x0+ 0x0+ 0x0+ +0x[48]
+  Section to Segment mapping:
+  +Segment Sections...
+@@ -53,6 +54,7 @@ Program Headers:
+  +03 +.tdata .dynamic .got .got.plt *
+  +04 +.dynamic *
+  +05 +.tdata .tbss *
++ +06 +
+ Relocation section '.rel.dyn' at offset 0x[0-9a-f]+ contains 9 entries:
+  Offset +Info +Type +Sym.Value +Sym. Name
+--- binutils-2.24/ld/testsuite/ld-i386/tlsbindesc.rd
++++ binutils-2.24/ld/testsuite/ld-i386/tlsbindesc.rd
+@@ -42,6 +42,7 @@ Program Headers:
+  +LOAD.*
+  +DYNAMIC.*
+  +TLS +0x[0-9a-f]+ 0x[0-9a-f]+ 0x[0-9a-f]+ 0x0+60 0x0+a0 R +0x1000
++ +PAX_FLAGS +0x0+ 0x0+ 0x0+ 0x0+ 0x0+ +0x[48]
+  Section to Segment mapping:
+  +Segment Sections...
+@@ -51,6 +52,7 @@ Program Headers:
+  +03 +.tdata .dynamic .got .got.plt *
+  +04 +.dynamic *
+  +05 +.tdata .tbss *
++ +06 +
+ Relocation section '.rel.dyn' at offset 0x[0-9a-f]+ contains 9 entries:
+  Offset +Info +Type +Sym.Value +Sym. Name
+--- binutils-2.24/ld/testsuite/ld-i386/tlsdesc.rd
++++ binutils-2.24/ld/testsuite/ld-i386/tlsdesc.rd
+@@ -39,6 +39,7 @@ Program Headers:
+  +LOAD.*
+  +DYNAMIC.*
+  +TLS +0x[0-9a-f]+ 0x[0-9a-f]+ 0x[0-9a-f]+ 0x0+60 0x0+80 R +0x1
++ +PAX_FLAGS +0x0+ 0x0+ 0x0+ 0x0+ 0x0+ +0x[48]
+  Section to Segment mapping:
+  +Segment Sections...
+@@ -46,6 +47,7 @@ Program Headers:
+  +01 +.tdata .dynamic .got .got.plt *
+  +02 +.dynamic *
+  +03 +.tdata .tbss *
++ +04 +
+ Relocation section '.rel.dyn' at offset 0x[0-9a-f]+ contains 20 entries:
+  Offset +Info +Type +Sym.Value +Sym. Name
+--- binutils-2.24/ld/testsuite/ld-i386/tlsgdesc.rd
++++ binutils-2.24/ld/testsuite/ld-i386/tlsgdesc.rd
+@@ -36,12 +36,14 @@ Program Headers:
+  +LOAD.*
+  +LOAD.*
+  +DYNAMIC.*
++ +PAX_FLAGS.*
+  Section to Segment mapping:
+  +Segment Sections...
+  +00 +.hash .dynsym .dynstr .rel.dyn .rel.plt .plt .text *
+  +01 +.dynamic .got .got.plt *
+  +02 +.dynamic *
++ +03 +
+ Relocation section '.rel.dyn' at offset 0x[0-9a-f]+ contains 8 entries:
+  Offset +Info +Type +Sym.Value +Sym. Name
+--- binutils-2.24/ld/testsuite/ld-i386/tlsnopic.rd
++++ binutils-2.24/ld/testsuite/ld-i386/tlsnopic.rd
+@@ -37,6 +37,7 @@ Program Headers:
+  +LOAD.*
+  +DYNAMIC.*
+  +TLS +0x[0-9a-f]+ 0x[0-9a-f]+ 0x[0-9a-f]+ 0x0+ 0x0+24 R +0x1
++ +PAX_FLAGS +0x0+ 0x0+ 0x0+ 0x0+ 0x0+ +0x[48]
+  Section to Segment mapping:
+  +Segment Sections...
+@@ -44,6 +45,7 @@ Program Headers:
+  +01 +.dynamic .got .got.plt *
+  +02 +.dynamic *
+  +03 +.tbss *
++ +04 +
+ Relocation section '.rel.dyn' at offset 0x[0-9a-f]+ contains 20 entries:
+  Offset +Info +Type +Sym.Value +Sym. Name
+--- binutils-2.24/ld/testsuite/ld-i386/tlspic.rd
++++ binutils-2.24/ld/testsuite/ld-i386/tlspic.rd
+@@ -40,6 +40,7 @@ Program Headers:
+  +LOAD.*
+  +DYNAMIC.*
+  +TLS +0x[0-9a-f]+ 0x[0-9a-f]+ 0x[0-9a-f]+ 0x0+60 0x0+80 R +0x1
++ +PAX_FLAGS +0x0+ 0x0+ 0x0+ 0x0+ 0x0+ +0x[48]
+  Section to Segment mapping:
+  +Segment Sections...
+@@ -47,6 +48,7 @@ Program Headers:
+  +01 +.tdata .dynamic .got .got.plt *
+  +02 +.dynamic *
+  +03 +.tdata .tbss *
++ +04 +
+ Relocation section '.rel.dyn' at offset 0x[0-9a-f]+ contains 26 entries:
+  Offset +Info +Type +Sym.Value +Sym. Name
+--- binutils-2.24/ld/testsuite/ld-ia64/merge1.d
++++ binutils-2.24/ld/testsuite/ld-ia64/merge1.d
+@@ -4,7 +4,7 @@
+ #objdump: -d
+ #...
+-0+1e0 <.text>:
++[a-f0-9]+ <.text>:
+ [     ]*[a-f0-9]+:    0b 60 80 02 00 24       \[MMI\]       addl r12=32,r1;;
+ [     ]*[a-f0-9]+:    c0 c0 04 00 48 00                   addl r12=24,r1
+ [     ]*[a-f0-9]+:    00 00 04 00                         nop.i 0x0;;
+--- binutils-2.24/ld/testsuite/ld-ia64/merge2.d
++++ binutils-2.24/ld/testsuite/ld-ia64/merge2.d
+@@ -4,7 +4,7 @@
+ #objdump: -d
+ #...
+-0+1e0 <.text>:
++[a-f0-9]+ <.text>:
+ [     ]*[a-f0-9]+:    0b 60 80 02 00 24       \[MMI\]       addl r12=32,r1;;
+ [     ]*[a-f0-9]+:    c0 c0 04 00 48 00                   addl r12=24,r1
+ [     ]*[a-f0-9]+:    00 00 04 00                         nop.i 0x0;;
+--- binutils-2.24/ld/testsuite/ld-ia64/merge3.d
++++ binutils-2.24/ld/testsuite/ld-ia64/merge3.d
+@@ -4,7 +4,7 @@
+ #objdump: -d
+ #...
+-0+210 <.text>:
++[a-f0-9]+ <.text>:
+ [     ]*[a-f0-9]+:    0b 60 80 02 00 24       \[MMI\]       addl r12=32,r1;;
+ [     ]*[a-f0-9]+:    c0 40 05 00 48 00                   addl r12=40,r1
+ [     ]*[a-f0-9]+:    00 00 04 00                         nop.i 0x0;;
+--- binutils-2.24/ld/testsuite/ld-ia64/merge4.d
++++ binutils-2.24/ld/testsuite/ld-ia64/merge4.d
+@@ -4,7 +4,7 @@
+ #objdump: -d
+ #...
+-0+240 <.text>:
++[a-f0-9]+ <.text>:
+ [     ]*[a-f0-9]+:    0b 60 80 02 00 24       \[MMI\]       addl r12=32,r1;;
+ [     ]*[a-f0-9]+:    c0 40 05 00 48 00                   addl r12=40,r1
+ [     ]*[a-f0-9]+:    00 00 04 00                         nop.i 0x0;;
+--- binutils-2.24/ld/testsuite/ld-ia64/merge5.d
++++ binutils-2.24/ld/testsuite/ld-ia64/merge5.d
+@@ -4,7 +4,7 @@
+ #objdump: -d
+ #...
+-0+270 <.text>:
++[a-f0-9]+ <.text>:
+ [     ]*[a-f0-9]+:    0b 60 80 02 00 24       \[MMI\]       addl r12=32,r1;;
+ [     ]*[a-f0-9]+:    c0 40 05 00 48 00                   addl r12=40,r1
+ [     ]*[a-f0-9]+:    00 00 04 00                         nop.i 0x0;;
+--- binutils-2.24/ld/testsuite/ld-ia64/tlsbin.rd
++++ binutils-2.24/ld/testsuite/ld-ia64/tlsbin.rd
+@@ -36,13 +36,14 @@ There are [0-9]+ program headers, starting at offset [0-9]+
+ Program Headers:
+  +Type +Offset +VirtAddr +PhysAddr +FileSiz +MemSiz +Flg Align
+- +PHDR +0x0+40 0x40+40 0x40+40 0x0+188 0x0+188 R E 0x8
+- +INTERP +0x0+1c8 0x40+1c8 0x40+1c8 0x[0-9a-f]+ 0x[0-9a-f]+ R +0x1
++ +PHDR +0x0+40 0x40+40 0x40+40 (0x[0-9a-f]+) \1 R E 0x8
++ +INTERP +0x0+([0-9a-f]+) (0x40+\1) \2 0x[0-9a-f]+ 0x[0-9a-f]+ R +0x1
+ .*Requesting program interpreter.*
+  +LOAD +0x0+ 0x40+ 0x40+ 0x0+1[0-9a-f]+ 0x0+1[0-9a-f]+ R E 0x10000
+  +LOAD +0x0+1[0-9a-f]+ 0x60+1[0-9a-f]+ 0x60+1[0-9a-f]+ 0x0+0[0-9a-f]+ 0x0+0[0-9a-f]+ RW +0x10000
+  +DYNAMIC +0x0+1[0-9a-f]+ 0x60+1[0-9a-f]+ 0x60+1[0-9a-f]+ 0x0+150 0x0+150 RW +0x8
+  +TLS +0x0+1[0-9a-f]+ 0x60+1[0-9a-f]+ 0x60+1[0-9a-f]+ 0x0+60 0x0+a0 R +0x4
++ +PAX_FLAGS +0x0+ 0x0+ 0x0+ 0x0+ 0x0+ +0x[48]
+  +IA_64_UNWIND .* R +0x8
+ #...
+--- binutils-2.24/ld/testsuite/ld-ia64/tlspic.rd
++++ binutils-2.24/ld/testsuite/ld-ia64/tlspic.rd
+@@ -40,6 +40,7 @@ Program Headers:
+  +LOAD +0x0+1[0-9a-f]+ 0x0+11[0-9a-f]+ 0x0+11[0-9a-f]+ 0x0+0[0-9a-f]+ 0x0+0[0-9a-f]+ RW +0x10000
+  +DYNAMIC +0x0+1[0-9a-f]+ 0x0+11[0-9a-f]+ 0x0+11[0-9a-f]+ 0x0+140 0x0+140 RW +0x8
+  +TLS +0x0+1[0-9a-f]+ 0x0+11[0-9a-f]+ 0x0+11[0-9a-f]+ 0x0+60 0x0+80 R +0x4
++ +PAX_FLAGS +0x0+ 0x0+ 0x0+ 0x0+ 0x0+ +0x[48]
+  +IA_64_UNWIND +0x0+1[0-9a-f]+ 0x0+1[0-9a-f]+ 0x0+1[0-9a-f]+ 0x0+18 0x0+18 R +0x8
+ #...
+--- binutils-2.24/ld/testsuite/ld-mips-elf/multi-got-no-shared.d
++++ binutils-2.24/ld/testsuite/ld-mips-elf/multi-got-no-shared.d
+@@ -8,9 +8,9 @@
+ .*: +file format.*
+ Disassembly of section \.text:
+-004000b0 <[^>]*> 3c1c0043     lui     gp,0x43
+-004000b4 <[^>]*> 279c9ff0     addiu   gp,gp,-24592
+-004000b8 <[^>]*> afbc0008     sw      gp,8\(sp\)
++004000d0 <[^>]*> 3c1c0043     lui     gp,0x43
++004000d4 <[^>]*> 279c9ff0     addiu   gp,gp,-24592
++004000d8 <[^>]*> afbc0008     sw      gp,8\(sp\)
+ #...
+ 00408d60 <[^>]*> 3c1c0043     lui     gp,0x43
+ 00408d64 <[^>]*> 279c2c98     addiu   gp,gp,11416
+--- binutils-2.24/ld/testsuite/ld-mips-elf/pic-and-nonpic-3a.sd
++++ binutils-2.24/ld/testsuite/ld-mips-elf/pic-and-nonpic-3a.sd
+@@ -1,7 +1,7 @@
+ Elf file type is DYN \(Shared object file\)
+ Entry point .*
+-There are 5 program headers, starting at offset .*
++There are [0-9] program headers, starting at offset .*
+ Program Headers:
+  * Type * Offset * VirtAddr * PhysAddr * FileSiz * MemSiz * Flg * Align
+@@ -9,6 +9,7 @@ Program Headers:
+  * LOAD * [^ ]+ * 0x0+00000 * 0x0+00000 [^ ]+ * [^ ]+ * R E * 0x.*
+  * LOAD * [^ ]+ * 0x0+10000 * 0x0+10000 [^ ]+ * [^ ]+ * RW  * 0x.*
+  * DYNAMIC * [^ ]+ * 0x0+00400 * 0x0+00400 .*
++ * PAX_FLAGS +0x0+ 0x0+ 0x0+ 0x0+ 0x0+ +0x[48]
+  * NULL * .*
+  *Section to Segment mapping:
+@@ -18,3 +19,4 @@ Program Headers:
+  *0*2 * \.data \.got *
+  *0*3 * \.dynamic *
+  *0*4 *
++ *0*5 *
+--- binutils-2.24/ld/testsuite/ld-mips-elf/pic-and-nonpic-3b.sd
++++ binutils-2.24/ld/testsuite/ld-mips-elf/pic-and-nonpic-3b.sd
+@@ -1,7 +1,7 @@
+ Elf file type is EXEC \(Executable file\)
+ Entry point 0x44000
+-There are 8 program headers, starting at offset .*
++There are [0-9] program headers, starting at offset .*
+ Program Headers:
+  * Type * Offset * VirtAddr * PhysAddr * FileSiz * MemSiz * Flg * Align
+@@ -13,6 +13,7 @@ Program Headers:
+  * LOAD * [^ ]+ * 0x0+80000 * 0x0+80000 [^ ]+ * [^ ]+ * RW  * 0x.*
+  * LOAD * [^ ]+ * 0x0+a0000 * 0x0+a0000 [^ ]+ * [^ ]+ * RW  * 0x.*
+  * DYNAMIC * [^ ]+ * 0x0+42000 * 0x0+42000 .*
++ * PAX_FLAGS +0x0+ 0x0+ 0x0+ 0x0+ 0x0+ +0x[48]
+  * NULL * .*
+  *Section to Segment mapping:
+@@ -25,3 +26,4 @@ Program Headers:
+  *0*5 *\.got \.data *
+  *0*6 *\.dynamic *
+  *0*7 *
++ *0*8 *
+--- binutils-2.24/ld/testsuite/ld-mips-elf/pic-and-nonpic-4b.sd
++++ binutils-2.24/ld/testsuite/ld-mips-elf/pic-and-nonpic-4b.sd
+@@ -1,7 +1,7 @@
+ Elf file type is EXEC \(Executable file\)
+ Entry point 0x44000
+-There are 8 program headers, starting at offset .*
++There are [0-9] program headers, starting at offset .*
+ Program Headers:
+  * Type * Offset * VirtAddr * PhysAddr * FileSiz * MemSiz * Flg * Align
+@@ -13,6 +13,7 @@ Program Headers:
+  * LOAD * [^ ]+ * 0x0+80000 * 0x0+80000 [^ ]+ * [^ ]+ * RW  * 0x.*
+  * LOAD * [^ ]+ * 0x0+a0000 * 0x0+a0000 [^ ]+ * [^ ]+ * RW  * 0x.*
+  * DYNAMIC * [^ ]+ * 0x0+42000 * 0x0+42000 .*
++ * PAX_FLAGS +0x0+ 0x0+ 0x0+ 0x0+ 0x0+ +0x[48]
+  * NULL * .*
+  *Section to Segment mapping:
+@@ -25,3 +26,4 @@ Program Headers:
+  *0*5 * \.got \.data \.bss *
+  *0*6 * \.dynamic *
+  *0*7 *
++ *0*8 *
+--- binutils-2.24/ld/testsuite/ld-mips-elf/pic-and-nonpic-5b.sd
++++ binutils-2.24/ld/testsuite/ld-mips-elf/pic-and-nonpic-5b.sd
+@@ -1,7 +1,7 @@
+ Elf file type is EXEC \(Executable file\)
+ Entry point 0x44000
+-There are 8 program headers, starting at offset .*
++There are [0-9] program headers, starting at offset .*
+ Program Headers:
+  * Type * Offset * VirtAddr * PhysAddr * FileSiz * MemSiz * Flg * Align
+@@ -13,6 +13,7 @@ Program Headers:
+  * LOAD * [^ ]+ * 0x0+80000 * 0x0+80000 [^ ]+ * [^ ]+ * RW  * 0x.*
+  * LOAD * [^ ]+ * 0x0+a0000 * 0x0+a0000 [^ ]+ * [^ ]+ * RW  * 0x.*
+  * DYNAMIC * [^ ]+ * 0x0+42000 * 0x0+42000 .*
++ * PAX_FLAGS +0x0+ 0x0+ 0x0+ 0x0+ 0x0+ +0x[48]
+  * NULL * .*
+  *Section to Segment mapping:
+@@ -25,3 +26,4 @@ Program Headers:
+  *0*5 * \.got \.data \.bss *
+  *0*6 * \.dynamic *
+  *0*7 *
++ *0*8 *
+--- binutils-2.24/ld/testsuite/ld-mips-elf/pic-and-nonpic-6-n32.sd
++++ binutils-2.24/ld/testsuite/ld-mips-elf/pic-and-nonpic-6-n32.sd
+@@ -1,7 +1,7 @@
+ Elf file type is EXEC \(Executable file\)
+ Entry point 0x44000
+-There are 8 program headers, starting at offset .*
++There are [0-9] program headers, starting at offset .*
+ Program Headers:
+  * Type * Offset * VirtAddr * PhysAddr * FileSiz * MemSiz * Flg * Align
+@@ -13,6 +13,7 @@ Program Headers:
+  * LOAD * [^ ]+ * 0x0+80000 * 0x0+80000 [^ ]+ * [^ ]+ * RW  * 0x.*
+  * LOAD * [^ ]+ * 0x0+a0000 * 0x0+a0000 [^ ]+ * [^ ]+ * RW  * 0x.*
+  * DYNAMIC * [^ ]+ * 0x0+42000 * 0x0+42000 .*
++ * PAX_FLAGS +0x0+ 0x0+ 0x0+ 0x0+ 0x0+ +0x[48]
+  * NULL * .*
+  *Section to Segment mapping:
+@@ -25,3 +26,4 @@ Program Headers:
+  *0*5 * \.got \.data \.bss *
+  *0*6 * \.dynamic *
+  *0*7 *
++ *0*8 *
+--- binutils-2.24/ld/testsuite/ld-mips-elf/pic-and-nonpic-6-n64.sd
++++ binutils-2.24/ld/testsuite/ld-mips-elf/pic-and-nonpic-6-n64.sd
+@@ -1,7 +1,7 @@
+ Elf file type is EXEC \(Executable file\)
+ Entry point 0x44000
+-There are 7 program headers, starting at offset .*
++There are [0-9] program headers, starting at offset .*
+ Program Headers:
+  * Type * Offset * VirtAddr * PhysAddr * FileSiz * MemSiz * Flg * Align
+@@ -12,6 +12,7 @@ Program Headers:
+  * LOAD * [^ ]+ * 0x0+80000 * 0x0+80000 [^ ]+ * [^ ]+ * RW  * 0x.*
+  * LOAD * [^ ]+ * 0x0+a0000 * 0x0+a0000 [^ ]+ * [^ ]+ * RW  * 0x.*
+  * DYNAMIC * [^ ]+ * 0x0+42000 * 0x0+42000 .*
++ * PAX_FLAGS +0x0+ 0x0+ 0x0+ 0x0+ 0x0+ +0x[48]
+  * NULL * .*
+  *Section to Segment mapping:
+@@ -23,3 +24,4 @@ Program Headers:
+  *0*4 * \.got \.data \.bss *
+  *0*5 * \.dynamic *
+  *0*6 *
++ *0*7 *
+--- binutils-2.24/ld/testsuite/ld-mips-elf/pic-and-nonpic-6-o32.sd
++++ binutils-2.24/ld/testsuite/ld-mips-elf/pic-and-nonpic-6-o32.sd
+@@ -1,7 +1,7 @@
+ Elf file type is EXEC \(Executable file\)
+ Entry point 0x44000
+-There are 8 program headers, starting at offset .*
++There are [0-9] program headers, starting at offset .*
+ Program Headers:
+  * Type * Offset * VirtAddr * PhysAddr * FileSiz * MemSiz * Flg * Align
+@@ -13,6 +13,7 @@ Program Headers:
+  * LOAD * [^ ]+ * 0x0+80000 * 0x0+80000 [^ ]+ * [^ ]+ * RW  * 0x.*
+  * LOAD * [^ ]+ * 0x0+a0000 * 0x0+a0000 [^ ]+ * [^ ]+ * RW  * 0x.*
+  * DYNAMIC * [^ ]+ * 0x0+42000 * 0x0+42000 .*
++ * PAX_FLAGS +0x0+ 0x0+ 0x0+ 0x0+ 0x0+ +0x[48]
+  * NULL * .*
+  *Section to Segment mapping:
+@@ -25,3 +26,4 @@ Program Headers:
+  *0*5 * \.got \.data \.bss *
+  *0*6 * \.dynamic *
+  *0*7 *
++ *0*8 *
+--- binutils-2.24/ld/testsuite/ld-powerpc/tlsexe32.r
++++ binutils-2.24/ld/testsuite/ld-powerpc/tlsexe32.r
+@@ -33,13 +33,14 @@ There are [0-9]+ program headers, starting at offset [0-9]+
+ Program Headers:
+  +Type +Offset +VirtAddr +PhysAddr +FileSiz MemSiz +Flg Align
+- +PHDR +0x000034 0x01800034 0x01800034 0x000c0 0x000c0 R E 0x4
+- +INTERP +0x0000f4 0x018000f4 0x018000f4 0x00011 0x00011 R +0x1
++ +PHDR +0x000034 0x01800034 0x01800034 (0x000[0-9a-f]{2}) \1 R E 0x4
++ +INTERP +0x000([0-9a-f]{3}) 0x01800\1 0x01800\1 0x00011 0x00011 R +0x1
+  +\[Requesting program interpreter: .*\]
+  +LOAD .* R E 0x10000
+  +LOAD .* RWE 0x10000
+  +DYNAMIC .* RW +0x4
+  +TLS .* 0x0001c 0x00038 R +0x4
++ +PAX_FLAGS +0x0+ 0x0+ 0x0+ 0x0+ 0x0+ +0x[48]
+  Section to Segment mapping:
+  +Segment Sections\.\.\.
+@@ -49,6 +50,7 @@ Program Headers:
+  +03 +\.tdata \.dynamic \.got \.plt 
+  +04 +\.dynamic 
+  +05 +\.tdata \.tbss 
++ +06 +
+ Relocation section '\.rela\.dyn' at offset .* contains 2 entries:
+  Offset +Info +Type +Sym\. Value +Symbol's Name \+ Addend
+--- binutils-2.24/ld/testsuite/ld-powerpc/tlsso32.r
++++ binutils-2.24/ld/testsuite/ld-powerpc/tlsso32.r
+@@ -35,6 +35,7 @@ Program Headers:
+  +LOAD .* RWE 0x10000
+  +DYNAMIC .* RW +0x4
+  +TLS .* 0x0+1c 0x0+38 R +0x4
++ +PAX_FLAGS +0x0+ 0x0+ 0x0+ 0x0+ 0x0+ +0x[48]
+  Section to Segment mapping:
+  +Segment Sections\.\.\.
+@@ -42,6 +43,7 @@ Program Headers:
+  +01 +\.tdata \.dynamic \.got \.plt 
+  +02 +\.dynamic 
+  +03 +\.tdata \.tbss 
++ +04 +
+ Relocation section '\.rela\.dyn' at offset 0x[0-9a-f]+ contains 18 entries:
+  Offset +Info +Type +Sym\. Value +Symbol's Name \+ Addend
+@@ -52,9 +54,9 @@ Relocation section '\.rela\.dyn' at offset 0x[0-9a-f]+ contains 18 entries:
+ [0-9a-f ]+R_PPC_TPREL16 +0+30 +le0 \+ 0
+ [0-9a-f ]+R_PPC_TPREL16_HA +0+34 +le1 \+ 0
+ [0-9a-f ]+R_PPC_TPREL16_LO +0+34 +le1 \+ 0
+-[0-9a-f ]+R_PPC_TPREL16 +0+103d0 +\.tdata \+ 103e4
+-[0-9a-f ]+R_PPC_TPREL16_HA +0+103d0 +\.tdata \+ 103e8
+-[0-9a-f ]+R_PPC_TPREL16_LO +0+103d0 +\.tdata \+ 103e8
++[0-9a-f ]+R_PPC_TPREL16 +0+103[df]0 +\.tdata \+ 10[0-9a-f]{3}
++[0-9a-f ]+R_PPC_TPREL16_HA +0+103[df]0 +\.tdata \+ 10[0-9a-f]{3}
++[0-9a-f ]+R_PPC_TPREL16_LO +0+103[df]0 +\.tdata \+ 10[0-9a-f]{3}
+ [0-9a-f ]+R_PPC_DTPMOD32 +0
+ [0-9a-f ]+R_PPC_DTPREL32 +0
+ [0-9a-f ]+R_PPC_DTPMOD32 +0
+--- binutils-2.24/ld/testsuite/ld-s390/tlsbin.rd
++++ binutils-2.24/ld/testsuite/ld-s390/tlsbin.rd
+@@ -36,6 +36,7 @@ There are [0-9]+ program headers, starting at offset [0-9]+
+  +LOAD .* RW +0x1000
+  +DYNAMIC .* RW +0x4
+  +TLS .* 0x0+60 0x0+a0 R +0x20
++ +PAX_FLAGS +0x0+ 0x0+ 0x0+ 0x0+ 0x0+ +0x[48]
+  Section to Segment mapping:
+  +Segment Sections...
+@@ -52,6 +53,7 @@ Program Headers:
+  +03 +.tdata .dynamic .got *
+  +04 +.dynamic *
+  +05 +.tdata .tbss *
++ +06 +
+ Relocation section '.rela.dyn' at offset .* contains 4 entries:
+  Offset +Info +Type +Sym.Value +Sym. Name \+ Addend
+--- binutils-2.24/ld/testsuite/ld-s390/tlsbin_64.rd
++++ binutils-2.24/ld/testsuite/ld-s390/tlsbin_64.rd
+@@ -36,6 +36,7 @@ There are [0-9]+ program headers, starting at offset [0-9]+
+  +LOAD .* RW +0x1000
+  +DYNAMIC .* RW +0x8
+  +TLS .* 0x0+60 0x0+a0 R +0x20
++ +PAX_FLAGS +0x0+ 0x0+ 0x0+ 0x0+ 0x0+ +0x[48]
+  Section to Segment mapping:
+  +Segment Sections...
+@@ -52,6 +53,7 @@ Program Headers:
+  +03 +.tdata .dynamic .got *
+  +04 +.dynamic *
+  +05 +.tdata .tbss *
++ +06 +
+ Relocation section '.rela.dyn' at offset 0x[0-9a-f]+ contains 4 entries:
+  +Offset +Info +Type +Symbol's Value +Symbol's Name \+ Addend
+--- binutils-2.24/ld/testsuite/ld-s390/tlspic.rd
++++ binutils-2.24/ld/testsuite/ld-s390/tlspic.rd
+@@ -39,6 +39,7 @@ Program Headers:
+  +LOAD .* RW +0x1000
+  +DYNAMIC .* RW +0x4
+  +TLS .* 0x0+60 0x0+80 R +0x20
++ +PAX_FLAGS +0x0+ 0x0+ 0x0+ 0x0+ 0x0+ +0x[48]
+  Section to Segment mapping:
+  +Segment Sections...
+@@ -46,6 +47,7 @@ Program Headers:
+  +01 +.tdata .dynamic .got 
+  +02 +.dynamic 
+  +03 +.tdata .tbss 
++ +04 +
+ Relocation section '.rela.dyn' at offset 0x[0-9a-f]+ contains 14 entries:
+  Offset +Info +Type +Sym.Value +Sym. Name \+ Addend
+--- binutils-2.24/ld/testsuite/ld-s390/tlspic_64.rd
++++ binutils-2.24/ld/testsuite/ld-s390/tlspic_64.rd
+@@ -39,6 +39,7 @@ Program Headers:
+  +LOAD .* RW +0x1000
+  +DYNAMIC .* RW +0x8
+  +TLS .* 0x0+60 0x0+80 R +0x20
++ +PAX_FLAGS +0x0+ 0x0+ 0x0+ 0x0+ 0x0+ +0x[48]
+  Section to Segment mapping:
+  +Segment Sections...
+@@ -46,6 +47,7 @@ Program Headers:
+  +01 +.tdata .dynamic .got *
+  +02 +.dynamic *
+  +03 +.tdata .tbss *
++ +04 +
+ Relocation section '.rela.dyn' at offset 0x[0-9a-f]+ contains 14 entries:
+  +Offset +Info +Type +Symbol's Value +Symbol's Name \+ Addend
+--- binutils-2.24/ld/testsuite/ld-sh/tlsbin-2.d
++++ binutils-2.24/ld/testsuite/ld-sh/tlsbin-2.d
+@@ -44,6 +44,7 @@ Program Headers:
+  +LOAD.*
+  +DYNAMIC.*
+  +TLS +0x[0-9a-f]+ 0x[0-9a-f]+ 0x[0-9a-f]+ 0x0+18 0x0+28 R +0x4
++ +PAX_FLAGS +0x0+ 0x0+ 0x0+ 0x0+ 0x0+ +0x[48]
+  Section to Segment mapping:
+  +Segment Sections\.\.\.
+@@ -53,6 +54,7 @@ Program Headers:
+  +03 +\.tdata \.dynamic \.got *
+  +04 +\.dynamic *
+  +05 +\.tdata \.tbss *
++ +06 +
+ Relocation section '\.rela\.dyn' at offset 0x[0-9a-f]+ contains 4 entries:
+  Offset +Info +Type +Sym\.Value +Sym\. Name \+ Addend
+--- binutils-2.24/ld/testsuite/ld-sh/tlspic-2.d
++++ binutils-2.24/ld/testsuite/ld-sh/tlspic-2.d
+@@ -32,7 +32,7 @@ Key to Flags:
+ Elf file type is DYN \(Shared object file\)
+ Entry point 0x[0-9a-f]+
+-There are 4 program headers, starting at offset [0-9]+
++There are [0-9] program headers, starting at offset [0-9]+
+ Program Headers:
+  +Type +Offset +VirtAddr +PhysAddr +FileSiz +MemSiz +Flg Align
+@@ -40,6 +40,7 @@ Program Headers:
+  +LOAD.*
+  +DYNAMIC.*
+  +TLS .* 0x0+18 0x0+20 R +0x4
++ +PAX_FLAGS +0x0+ 0x0+ 0x0+ 0x0+ 0x0+ +0x[48]
+  Section to Segment mapping:
+  +Segment Sections\.\.\.
+@@ -47,6 +48,7 @@ Program Headers:
+  +01 +\.tdata \.dynamic \.got *
+  +02 +\.dynamic *
+  +03 +\.tdata \.tbss *
++ +04 +
+ Relocation section '\.rela\.dyn' at offset 0x[0-9a-f]+ contains 10 entries:
+  Offset +Info +Type +Sym\.Value +Sym\. Name \+ Addend
+--- binutils-2.24/ld/testsuite/ld-sparc/gotop32.rd
++++ binutils-2.24/ld/testsuite/ld-sparc/gotop32.rd
+@@ -31,6 +31,7 @@ Program Headers:
+  +LOAD +0x0+ 0x0+ 0x0+ 0x0+2000 0x0+2000 R E 0x10000
+  +LOAD +0x0+2000 0x0+12000 0x0+12000 0x0+2000 0x0+2000 RW +0x10000
+  +DYNAMIC +0x0+2000 0x0+12000 0x0+12000 0x0+70 0x0+70 RW +0x4
++ +PAX_FLAGS +0x0+ 0x0+ 0x0+ 0x0+ 0x0+ +0x[48]
+ #...
+ Relocation section '.rela.dyn' at offset 0x[0-9a-f]+ contains 1 entries:
+--- binutils-2.24/ld/testsuite/ld-sparc/gotop64.rd
++++ binutils-2.24/ld/testsuite/ld-sparc/gotop64.rd
+@@ -31,6 +31,7 @@ Program Headers:
+  +LOAD +0x0+ 0x0+ 0x0+ 0x0+2000 0x0+2000 R E 0x100000
+  +LOAD +0x0+2000 0x0+102000 0x0+102000 0x0+2000 0x0+2000 RW +0x100000
+  +DYNAMIC +0x0+2000 0x0+102000 0x0+102000 0x0+e0 0x0+e0 RW +0x8
++ +PAX_FLAGS +0x0+ 0x0+ 0x0+ 0x0+ 0x0+ +0x[48]
+ #...
+ Relocation section '.rela.dyn' at offset 0x[0-9a-f]+ contains 1 entries:
+--- binutils-2.24/ld/testsuite/ld-sparc/tlssunbin32.rd
++++ binutils-2.24/ld/testsuite/ld-sparc/tlssunbin32.rd
+@@ -30,13 +30,14 @@ There are [0-9]+ program headers, starting at offset [0-9]+
+ Program Headers:
+  +Type +Offset +VirtAddr +PhysAddr +FileSiz MemSiz +Flg Align
+- +PHDR +0x0+34 0x0+10034 0x0+10034 0x0+c0 0x0+c0 R E 0x4
+- +INTERP +0x0+f4 0x0+100f4 0x0+100f4 0x0+11 0x0+11 R +0x1
++ +PHDR +0x0+34 0x0+10034 0x0+10034 (0x[0-9a-f]+) \1 R E 0x4
++ +INTERP +(0x[0-9a-f]+ ){3}0x0+11 0x0+11 R +0x1
+ .*Requesting program interpreter.*
+  +LOAD .* R E 0x10000
+  +LOAD .* RW +0x10000
+  +DYNAMIC .* RW +0x4
+  +TLS .* 0x0+1060 0x0+10a0 R +0x4
++ +PAX_FLAGS +0x0+ 0x0+ 0x0+ 0x0+ 0x0+ +0x[48]
+ #...
+ Relocation section '.rela.dyn' at offset 0x[0-9a-f]+ contains 4 entries:
+--- binutils-2.24/ld/testsuite/ld-sparc/tlssunbin64.rd
++++ binutils-2.24/ld/testsuite/ld-sparc/tlssunbin64.rd
+@@ -30,13 +30,14 @@ There are [0-9]+ program headers, starting at offset [0-9]+
+ Program Headers:
+  +Type +Offset +VirtAddr +PhysAddr +FileSiz +MemSiz +Flg Align
+- +PHDR +0x0+40 0x0+100040 0x0+100040 0x0+150 0x0+150 R E 0x8
+- +INTERP +0x0+190 0x0+100190 0x0+100190 0x0+19 0x0+19 R +0x1
++ +PHDR +0x0+40 0x0+100040 0x0+100040 (0x[0-9a-f]+) \1 R E 0x8
++ +INTERP +0x0+([0-9a-f]+) (0x0+10+\1) \2 0x0+19 0x0+19 R +0x1
+ .*Requesting program interpreter.*
+  +LOAD .* R E 0x100000
+  +LOAD .* RW +0x100000
+  +DYNAMIC .* RW +0x8
+  +TLS .* 0x0+60 0x0+a0 R +0x4
++ +PAX_FLAGS +0x0+ 0x0+ 0x0+ 0x0+ 0x0+ +0x[48]
+ #...
+ Relocation section '.rela.dyn' at offset 0x[0-9a-f]+ contains 4 entries:
+--- binutils-2.24/ld/testsuite/ld-sparc/tlssunnopic32.rd
++++ binutils-2.24/ld/testsuite/ld-sparc/tlssunnopic32.rd
+@@ -32,6 +32,7 @@ Program Headers:
+  +LOAD .* RW +0x10000
+  +DYNAMIC .* RW +0x4
+  +TLS .* 0x0+ 0x0+24 R +0x4
++ +PAX_FLAGS +0x0+ 0x0+ 0x0+ 0x0+ 0x0+ +0x[48]
+ #...
+ Relocation section '.rela.dyn' at offset 0x[0-9a-f]+ contains 12 entries:
+--- binutils-2.24/ld/testsuite/ld-sparc/tlssunnopic64.rd
++++ binutils-2.24/ld/testsuite/ld-sparc/tlssunnopic64.rd
+@@ -32,6 +32,7 @@ Program Headers:
+  +LOAD .* RW +0x100000
+  +DYNAMIC .* RW +0x8
+  +TLS .* 0x0+ 0x0+24 R +0x4
++ +PAX_FLAGS +0x0+ 0x0+ 0x0+ 0x0+ 0x0+ +0x[48]
+ #...
+ Relocation section '.rela.dyn' at offset 0x[0-9a-f]+ contains 14 entries:
+--- binutils-2.24/ld/testsuite/ld-sparc/tlssunpic32.rd
++++ binutils-2.24/ld/testsuite/ld-sparc/tlssunpic32.rd
+@@ -36,6 +36,7 @@ Program Headers:
+  +LOAD +0x0+2000 0x0+12000 0x0+12000 0x0+184 0x0+184 RWE 0x10000
+  +DYNAMIC +0x0+2060 0x0+12060 0x0+12060 0x0+98 0x0+98 RW +0x4
+  +TLS +0x0+2000 0x0+12000 0x0+12000 0x0+60 0x0+80 R +0x4
++ +PAX_FLAGS +0x0+ 0x0+ 0x0+ 0x0+ 0x0+ +0x[48]
+ #...
+ Relocation section '.rela.dyn' at offset 0x[0-9a-f]+ contains 14 entries:
+--- binutils-2.24/ld/testsuite/ld-sparc/tlssunpic64.rd
++++ binutils-2.24/ld/testsuite/ld-sparc/tlssunpic64.rd
+@@ -36,6 +36,7 @@ Program Headers:
+  +LOAD +0x0+2000 0x0+102000 0x0+102000 0x0+3a0 0x0+3a0 RWE 0x100000
+  +DYNAMIC +0x0+2060 0x0+102060 0x0+102060 0x0+130 0x0+130 RW +0x8
+  +TLS +0x0+2000 0x0+102000 0x0+102000 0x0+60 0x0+80 R +0x4
++ +PAX_FLAGS +0x0+ 0x0+ 0x0+ 0x0+ 0x0+ +0x[48]
+ #...
+ Relocation section '.rela.dyn' at offset 0x[0-9a-f]+ contains 14 entries:
+--- binutils-2.24/ld/testsuite/ld-x86-64/tlsgdesc.rd
++++ binutils-2.24/ld/testsuite/ld-x86-64/tlsgdesc.rd
+@@ -36,12 +36,14 @@ Program Headers:
+  +LOAD.*
+  +LOAD.*
+  +DYNAMIC.*
++ +PAX_FLAGS.*
+  Section to Segment mapping:
+  +Segment Sections...
+  +00 +.hash .dynsym .dynstr .rela.dyn .rela.plt .plt .text *
+  +01 +.dynamic .got .got.plt *
+  +02 +.dynamic *
++ +03 +
+ Relocation section '.rela.dyn' at offset 0x[0-9a-f]+ contains 8 entries:
+  +Offset +Info +Type +Symbol's Value +Symbol's Name \+ Addend
+--- binutils-2.24/ld/testsuite/ld-x86-64/tlspic.rd
++++ binutils-2.24/ld/testsuite/ld-x86-64/tlspic.rd
+@@ -40,6 +40,7 @@ Program Headers:
+  +LOAD +0x0+131a 0x0+20131a 0x0+20131a 0x0+246 0x0+246 RW +0x200000
+  +DYNAMIC +0x0+1380 0x0+201380 0x0+201380 0x0+130 0x0+130 RW +0x8
+  +TLS +0x0+131a 0x0+20131a 0x0+20131a 0x0+60 0x0+80 R +0x1
++ +PAX_FLAGS +0x0+ 0x0+ 0x0+ 0x0+ 0x0+ +0x[48]
+  Section to Segment mapping:
+  +Segment Sections...
+@@ -47,6 +48,7 @@ Program Headers:
+  +01 +.tdata .dynamic .got .got.plt *
+  +02 +.dynamic *
+  +03 +.tdata .tbss *
++ +04 +
+ Relocation section '.rela.dyn' at offset 0x[0-9a-f]+ contains 14 entries:
+  +Offset +Info +Type +Symbol's Value +Symbol's Name \+ Addend
index f55ebe81e1485ba0cce65047705f1cc0dfd2a6f7..703e94f59283b489d11d9a0752e45e1f85d7b1e7 100644 (file)
@@ -19,7 +19,7 @@
  #ifdef HAVE_DNSSEC
    cache_blockdata_free(crecp);
  #endif
-@@ -1131,7 +1134,7 @@
+@@ -1138,7 +1141,7 @@
    
  } 
  
@@ -28,7 +28,7 @@
  struct in_addr a_record_from_hosts(char *name, time_t now)
  {
    struct crec *crecp = NULL;
-@@ -1274,7 +1277,11 @@
+@@ -1281,7 +1284,11 @@
        else
        crec->ttd = ttd;
        crec->addr.addr = *host_address;
@@ -42,7 +42,7 @@
  
 --- a/src/dnsmasq.c    Thu Jul 30 20:59:06 2015
 +++ b/src/dnsmasq.c    Wed Dec 16 19:38:32 2015
-@@ -982,6 +982,11 @@
+@@ -1013,6 +1013,11 @@
  
          poll_resolv(0, daemon->last_resolv != 0, now);          
          daemon->last_resolv = now;
@@ -56,7 +56,7 @@
  
 --- a/src/dnsmasq.h    Wed Dec 16 19:24:12 2015
 +++ b/src/dnsmasq.h    Wed Dec 16 19:40:11 2015
-@@ -1513,8 +1513,12 @@
+@@ -1514,6 +1514,11 @@
  void poll_listen(int fd, short event);
  int do_poll(int timeout);
  
 +#endif
 --- a/src/option.c     Wed Dec 16 19:24:12 2015
 +++ b/src/option.c     Wed Dec 16 19:42:48 2015
-@@ -1754,7 +1754,7 @@
+@@ -1769,7 +1769,7 @@
        ret_err(_("bad MX target"));
        break;
  
         helper.o tftp.o log.o conntrack.o dhcp6.o rfc3315.o \
         dhcp-common.o outpacket.o radv.o slaac.o auth.o ipset.o \
         domain.o dnssec.o blockdata.o tables.o loop.o inotify.o \
--       poll.o rrfilter.o
-+       poll.o rrfilter.o isc.o
+-       poll.o rrfilter.o edns0.o arp.o
++       poll.o rrfilter.o edns0.o arp.o isc.o
  
  hdrs = dnsmasq.h config.h dhcp-protocol.h dhcp6-protocol.h \
         dns-protocol.h radv-protocol.h ip6addr.h
diff --git a/src/patches/dnsmasq/001-Add_TTL_parameter_to_--host-record_and_--cname.patch b/src/patches/dnsmasq/001-Add_TTL_parameter_to_--host-record_and_--cname.patch
new file mode 100644 (file)
index 0000000..86fbc9c
--- /dev/null
@@ -0,0 +1,265 @@
+From df3d54f776a3c9b60735b45c0b7fd88b66a2d5c4 Mon Sep 17 00:00:00 2001
+From: Simon Kelley <simon@thekelleys.org.uk>
+Date: Wed, 24 Feb 2016 21:03:38 +0000
+Subject: [PATCH] Add TTL parameter to --host-record and --cname.
+
+---
+ man/dnsmasq.8 |   12 ++++++++++--
+ src/cache.c   |    7 +++++++
+ src/dnsmasq.h |    2 ++
+ src/option.c  |   46 ++++++++++++++++++++++++++++++++++++++--------
+ src/rfc1035.c |    6 +++++-
+ 5 files changed, 62 insertions(+), 11 deletions(-)
+
+diff --git a/man/dnsmasq.8 b/man/dnsmasq.8
+index b782eaf..7bc1394 100644
+--- a/man/dnsmasq.8
++++ b/man/dnsmasq.8
+@@ -529,7 +529,7 @@ zone files: the port, weight and priority numbers are in a different
+ order. More than one SRV record for a given service/domain is allowed,
+ all that match are returned.
+ .TP
+-.B --host-record=<name>[,<name>....],[<IPv4-address>],[<IPv6-address>]
++.B --host-record=<name>[,<name>....],[<IPv4-address>],[<IPv6-address>][,<TTL>]
+ Add A, AAAA and PTR records to the DNS. This adds one or more names to
+ the DNS with associated IPv4 (A) and IPv6 (AAAA) records. A name may
+ appear in more than one 
+@@ -546,6 +546,10 @@ is in effect. Short and long names may appear in the same
+ .B host-record,
+ eg. 
+ .B --host-record=laptop,laptop.thekelleys.org,192.168.0.1,1234::100
++
++If the time-to-live is given, it overrides the default, which is zero
++or the value of --local-ttl. The value is a positive integer and gives 
++the time-to-live in seconds.
+ .TP
+ .B \-Y, --txt-record=<name>[[,<text>],<text>]
+ Return a TXT DNS record. The value of TXT record is a set of strings,
+@@ -559,7 +563,7 @@ Return a PTR DNS record.
+ .B --naptr-record=<name>,<order>,<preference>,<flags>,<service>,<regexp>[,<replacement>]
+ Return an NAPTR DNS record, as specified in RFC3403.
+ .TP
+-.B --cname=<cname>,<target>
++.B --cname=<cname>,<target>[,<TTL>]
+ Return a CNAME record which indicates that <cname> is really
+ <target>. There are significant limitations on the target; it must be a
+ DNS name which is known to dnsmasq from /etc/hosts (or additional
+@@ -568,6 +572,10 @@ hosts files), from DHCP, from --interface-name or from another
+ If the target does not satisfy this
+ criteria, the whole cname is ignored. The cname must be unique, but it
+ is permissable to have more than one cname pointing to the same target.
++
++If the time-to-live is given, it overrides the default, which is zero
++or the value of -local-ttl. The value is a positive integer and gives 
++the time-to-live in seconds.
+ .TP
+ .B --dns-rr=<name>,<RR-number>,[<hex data>]
+ Return an arbitrary DNS Resource Record. The number is the type of the
+diff --git a/src/cache.c b/src/cache.c
+index a9eaa65..4ecd535 100644
+--- a/src/cache.c
++++ b/src/cache.c
+@@ -778,6 +778,7 @@ static void add_hosts_cname(struct crec *target)
+       (crec = whine_malloc(sizeof(struct crec))))
+       {
+       crec->flags = F_FORWARD | F_IMMORTAL | F_NAMEP | F_CONFIG | F_CNAME;
++      crec->ttd = a->ttl;
+       crec->name.namep = a->alias;
+       crec->addr.cname.target.cache = target;
+       crec->addr.cname.uid = target->uid;
+@@ -981,6 +982,7 @@ int read_hostsfile(char *filename, unsigned int index, int cache_size, struct cr
+                 strcat(cache->name.sname, ".");
+                 strcat(cache->name.sname, domain_suffix);
+                 cache->flags = flags;
++                cache->ttd = daemon->local_ttl;
+                 add_hosts_entry(cache, &addr, addrlen, index, rhash, hashsz);
+                 name_count++;
+               }
+@@ -988,6 +990,7 @@ int read_hostsfile(char *filename, unsigned int index, int cache_size, struct cr
+               {
+                 strcpy(cache->name.sname, canon);
+                 cache->flags = flags;
++                cache->ttd = daemon->local_ttl;
+                 add_hosts_entry(cache, &addr, addrlen, index, rhash, hashsz);
+                 name_count++;
+               }
+@@ -1057,6 +1060,7 @@ void cache_reload(void)
+         ((cache = whine_malloc(sizeof(struct crec)))))
+       {
+         cache->flags = F_FORWARD | F_NAMEP | F_CNAME | F_IMMORTAL | F_CONFIG;
++        cache->ttd = a->ttl;
+         cache->name.namep = a->alias;
+         cache->addr.cname.target.int_name = intr;
+         cache->addr.cname.uid = SRC_INTERFACE;
+@@ -1071,6 +1075,7 @@ void cache_reload(void)
+       (cache->addr.ds.keydata = blockdata_alloc(ds->digest, ds->digestlen)))
+       {
+       cache->flags = F_FORWARD | F_IMMORTAL | F_DS | F_CONFIG | F_NAMEP;
++      cache->ttd = daemon->local_ttl;
+       cache->name.namep = ds->name;
+       cache->addr.ds.keylen = ds->digestlen;
+       cache->addr.ds.algo = ds->algo;
+@@ -1095,6 +1100,7 @@ void cache_reload(void)
+           (cache = whine_malloc(sizeof(struct crec))))
+         {
+           cache->name.namep = nl->name;
++          cache->ttd = hr->ttl;
+           cache->flags = F_HOSTS | F_IMMORTAL | F_FORWARD | F_REVERSE | F_IPV4 | F_NAMEP | F_CONFIG;
+           add_hosts_entry(cache, (struct all_addr *)&hr->addr, INADDRSZ, SRC_CONFIG, (struct crec **)daemon->packet, revhashsz);
+         }
+@@ -1103,6 +1109,7 @@ void cache_reload(void)
+           (cache = whine_malloc(sizeof(struct crec))))
+         {
+           cache->name.namep = nl->name;
++          cache->ttd = hr->ttl;
+           cache->flags = F_HOSTS | F_IMMORTAL | F_FORWARD | F_REVERSE | F_IPV6 | F_NAMEP | F_CONFIG;
+           add_hosts_entry(cache, (struct all_addr *)&hr->addr6, IN6ADDRSZ, SRC_CONFIG, (struct crec **)daemon->packet, revhashsz);
+         }
+diff --git a/src/dnsmasq.h b/src/dnsmasq.h
+index 6d1c5ae..6344df5 100644
+--- a/src/dnsmasq.h
++++ b/src/dnsmasq.h
+@@ -308,6 +308,7 @@ struct ptr_record {
+ };
+ struct cname {
++  int ttl;
+   char *alias, *target;
+   struct cname *next;
+ }; 
+@@ -344,6 +345,7 @@ struct auth_zone {
+ struct host_record {
++  int ttl;
+   struct name_list {
+     char *name;
+     struct name_list *next;
+diff --git a/src/option.c b/src/option.c
+index c98bdc9..7c5e6bc 100644
+--- a/src/option.c
++++ b/src/option.c
+@@ -448,20 +448,20 @@ static struct {
+   { LOPT_GEN_NAMES, ARG_DUP, "[=tag:<tag>]", gettext_noop("Generate hostnames based on MAC address for nameless clients."), NULL},
+   { LOPT_PROXY, ARG_DUP, "[=<ipaddr>]...", gettext_noop("Use these DHCP relays as full proxies."), NULL },
+   { LOPT_RELAY, ARG_DUP, "<local-addr>,<server>[,<interface>]", gettext_noop("Relay DHCP requests to a remote server"), NULL},
+-  { LOPT_CNAME, ARG_DUP, "<alias>,<target>", gettext_noop("Specify alias name for LOCAL DNS name."), NULL },
++  { LOPT_CNAME, ARG_DUP, "<alias>,<target>[,<ttl>]", gettext_noop("Specify alias name for LOCAL DNS name."), NULL },
+   { LOPT_PXE_PROMT, ARG_DUP, "<prompt>,[<timeout>]", gettext_noop("Prompt to send to PXE clients."), NULL },
+   { LOPT_PXE_SERV, ARG_DUP, "<service>", gettext_noop("Boot service for PXE menu."), NULL },
+   { LOPT_TEST, 0, NULL, gettext_noop("Check configuration syntax."), NULL },
+   { LOPT_ADD_MAC, ARG_DUP, "[=base64|text]", gettext_noop("Add requestor's MAC address to forwarded DNS queries."), NULL },
+   { LOPT_ADD_SBNET, ARG_ONE, "<v4 pref>[,<v6 pref>]", gettext_noop("Add specified IP subnet to forwarded DNS queries."), NULL },
+-   { LOPT_CPE_ID, ARG_ONE, "<text>", gettext_noop("Add client identification to forwarded DNS queries."), NULL },
++  { LOPT_CPE_ID, ARG_ONE, "<text>", gettext_noop("Add client identification to forwarded DNS queries."), NULL },
+   { LOPT_DNSSEC, OPT_DNSSEC_PROXY, NULL, gettext_noop("Proxy DNSSEC validation results from upstream nameservers."), NULL },
+   { LOPT_INCR_ADDR, OPT_CONSEC_ADDR, NULL, gettext_noop("Attempt to allocate sequential IP addresses to DHCP clients."), NULL },
+   { LOPT_CONNTRACK, OPT_CONNTRACK, NULL, gettext_noop("Copy connection-track mark from queries to upstream connections."), NULL },
+   { LOPT_FQDN, OPT_FQDN_UPDATE, NULL, gettext_noop("Allow DHCP clients to do their own DDNS updates."), NULL },
+   { LOPT_RA, OPT_RA, NULL, gettext_noop("Send router-advertisements for interfaces doing DHCPv6"), NULL },
+   { LOPT_DUID, ARG_ONE, "<enterprise>,<duid>", gettext_noop("Specify DUID_EN-type DHCPv6 server DUID"), NULL },
+-  { LOPT_HOST_REC, ARG_DUP, "<name>,<address>", gettext_noop("Specify host (A/AAAA and PTR) records"), NULL },
++  { LOPT_HOST_REC, ARG_DUP, "<name>,<address>[,<ttl>]", gettext_noop("Specify host (A/AAAA and PTR) records"), NULL },
+   { LOPT_RR, ARG_DUP, "<name>,<RR-number>,[<data>]", gettext_noop("Specify arbitrary DNS resource record"), NULL },
+   { LOPT_CLVERBIND, OPT_CLEVERBIND, NULL, gettext_noop("Bind to interfaces in use - check for new interfaces"), NULL },
+   { LOPT_AUTHSERV, ARG_ONE, "<NS>,<interface>", gettext_noop("Export local names to global DNS"), NULL },
+@@ -3692,12 +3692,15 @@ static int one_opt(int option, char *arg, char *errstr, char *gen_err, int comma
+     case LOPT_CNAME: /* --cname */
+       {
+       struct cname *new;
+-      char *alias;
+-      char *target;
++      char *alias, *target, *ttls;
++      int ttl = -1;
+       if (!(comma = split(arg)))
+         ret_err(gen_err);
+       
++      if ((ttls = split(comma)) && !atoi_check(ttls, &ttl))
++        ret_err(_("bad TTL"));
++      
+       alias = canonicalise_opt(arg);
+       target = canonicalise_opt(comma);
+           
+@@ -3713,6 +3716,7 @@ static int one_opt(int option, char *arg, char *errstr, char *gen_err, int comma
+           daemon->cnames = new;
+           new->alias = alias;
+           new->target = target;
++          new->ttl = ttl;
+         }
+       
+       break;
+@@ -3913,14 +3917,22 @@ static int one_opt(int option, char *arg, char *errstr, char *gen_err, int comma
+       {
+       struct host_record *new = opt_malloc(sizeof(struct host_record));
+       memset(new, 0, sizeof(struct host_record));
+-      
++      new->ttl = -1;
++
+       if (!arg || !(comma = split(arg)))
+         ret_err(_("Bad host-record"));
+       
+       while (arg)
+         {
+           struct all_addr addr;
+-          if (inet_pton(AF_INET, arg, &addr))
++          char *dig;
++
++          for (dig = arg; *dig != 0; dig++)
++            if (*dig < '0' || *dig > '9')
++              break;
++          if (*dig == 0)
++            new->ttl = atoi(arg);
++          else if (inet_pton(AF_INET, arg, &addr))
+             new->addr = addr.addr.addr4;
+ #ifdef HAVE_IPV6
+           else if (inet_pton(AF_INET6, arg, &addr))
+@@ -4601,7 +4613,25 @@ void read_opts(int argc, char **argv, char *compile_opts)
+           }
+       } 
+     }
+-  
++
++  if (daemon->host_records)
++    {
++      struct host_record *hr;
++      
++      for (hr = daemon->host_records; hr; hr = hr->next)
++      if (hr->ttl == -1)
++        hr->ttl = daemon->local_ttl;
++    }
++
++  if (daemon->cnames)
++    {
++      struct cname *cn;
++      
++      for (cn = daemon->cnames; cn; cn = cn->next)
++      if (cn->ttl == -1)
++        cn->ttl = daemon->local_ttl;
++    }
++
+   if (daemon->if_addrs)
+     {  
+       struct iname *tmp;
+diff --git a/src/rfc1035.c b/src/rfc1035.c
+index 9c0ddb5..3535a71 100644
+--- a/src/rfc1035.c
++++ b/src/rfc1035.c
+@@ -1169,9 +1169,13 @@ static unsigned long crec_ttl(struct crec *crecp, time_t now)
+   /* Return 0 ttl for DHCP entries, which might change
+      before the lease expires. */
+-  if  (crecp->flags & (F_IMMORTAL | F_DHCP))
++  if (crecp->flags & F_DHCP)
+     return daemon->local_ttl;
+   
++  /* Immortal entries other than DHCP are local, and hold TTL in TTD field. */
++  if (crecp->flags & F_IMMORTAL)
++    return crecp->ttd;
++
+   /* Return the Max TTL value if it is lower then the actual TTL */
+   if (daemon->max_ttl == 0 || ((unsigned)(crecp->ttd - now) < daemon->max_ttl))
+     return crecp->ttd - now;
+-- 
+1.7.10.4
+
diff --git a/src/patches/dnsmasq/001-include_0_0_0_0_8_in_DNS_rebind_checks.patch b/src/patches/dnsmasq/001-include_0_0_0_0_8_in_DNS_rebind_checks.patch
deleted file mode 100644 (file)
index 8a2557a..0000000
+++ /dev/null
@@ -1,41 +0,0 @@
-From d2aa7dfbb6d1088dcbea9fecc61b9293b320eb95 Mon Sep 17 00:00:00 2001
-From: Simon Kelley <simon@thekelleys.org.uk>
-Date: Mon, 3 Aug 2015 21:52:12 +0100
-Subject: [PATCH] Include 0.0.0.0/8 in DNS rebind checks.
-
----
- CHANGELOG     |    7 +++++++
- src/rfc1035.c |    3 ++-
- 2 files changed, 9 insertions(+), 1 deletion(-)
-
-diff --git a/CHANGELOG b/CHANGELOG
-index 901da47..3f4026d 100644
---- a/CHANGELOG
-+++ b/CHANGELOG
-@@ -1,3 +1,10 @@
-+version 2.76
-+            Include 0.0.0.0/8 in DNS rebind checks. This range 
-+          translates to hosts on  the local network, or, at 
-+          least, 0.0.0.0 accesses the local host, so could
-+          be targets for DNS rebinding. See RFC 5735 section 3 
-+          for details. Thanks to Stephen Röttger for the bug report.
-+          
- version 2.75
-             Fix reversion on 2.74 which caused 100% CPU use when a 
-           dhcp-script is configured. Thanks to Adrian Davey for
-diff --git a/src/rfc1035.c b/src/rfc1035.c
-index 56647b0..29e9e65 100644
---- a/src/rfc1035.c
-+++ b/src/rfc1035.c
-@@ -728,7 +728,8 @@ int private_net(struct in_addr addr, int ban_localhost)
-   in_addr_t ip_addr = ntohl(addr.s_addr);
-   return
--    (((ip_addr & 0xFF000000) == 0x7F000000) && ban_localhost)  /* 127.0.0.0/8    (loopback) */ || 
-+    (((ip_addr & 0xFF000000) == 0x7F000000) && ban_localhost)  /* 127.0.0.0/8    (loopback) */ ||
-+    ((ip_addr & 0xFF000000) == 0x00000000)  /* RFC 5735 section 3. "here" network */ ||
-     ((ip_addr & 0xFFFF0000) == 0xC0A80000)  /* 192.168.0.0/16 (private)  */ ||
-     ((ip_addr & 0xFF000000) == 0x0A000000)  /* 10.0.0.0/8     (private)  */ ||
-     ((ip_addr & 0xFFF00000) == 0xAC100000)  /* 172.16.0.0/12  (private)  */ ||
--- 
-1.7.10.4
diff --git a/src/patches/dnsmasq/002-Add_--dhcp-ttl_option.patch b/src/patches/dnsmasq/002-Add_--dhcp-ttl_option.patch
new file mode 100644 (file)
index 0000000..45e3b9b
--- /dev/null
@@ -0,0 +1,117 @@
+From 832e47beab95c2918b5264f0504f2fe6fe523e4c Mon Sep 17 00:00:00 2001
+From: Simon Kelley <simon@thekelleys.org.uk>
+Date: Wed, 24 Feb 2016 21:24:45 +0000
+Subject: [PATCH] Add --dhcp-ttl option.
+
+---
+ man/dnsmasq.8 |    5 ++++-
+ src/dnsmasq.h |    2 +-
+ src/option.c  |   13 +++++++++++--
+ src/rfc1035.c |    2 +-
+ 4 files changed, 17 insertions(+), 5 deletions(-)
+
+diff --git a/man/dnsmasq.8 b/man/dnsmasq.8
+index 7bc1394..2bcce20 100644
+--- a/man/dnsmasq.8
++++ b/man/dnsmasq.8
+@@ -60,7 +60,7 @@ in the same way as for DHCP-derived names. Note that this does not
+ apply to domain names in cnames, PTR records, TXT records etc.
+ .TP
+ .B \-T, --local-ttl=<time>
+-When replying with information from /etc/hosts or the DHCP leases
++When replying with information from /etc/hosts or configuration or the DHCP leases
+ file dnsmasq by default sets the time-to-live field to zero, meaning
+ that the requester should not itself cache the information. This is
+ the correct thing to do in almost all situations. This option allows a
+@@ -68,6 +68,9 @@ time-to-live (in seconds) to be given for these replies. This will
+ reduce the load on the server at the expense of clients using stale
+ data under some circumstances.
+ .TP
++.B --dhcp-ttl=<time>
++As for --local-ttl, but affects only replies with information from DHCP leases. If both are given, --dhcp-ttl applies for DHCP information, and --local-ttl for others. Setting this to zero eliminates the effect of --local-ttl for DHCP.
++.TP
+ .B --neg-ttl=<time>
+ Negative replies from upstream servers normally contain time-to-live
+ information in SOA records which dnsmasq uses for caching. If the
+diff --git a/src/dnsmasq.h b/src/dnsmasq.h
+index 6344df5..9f73c3b 100644
+--- a/src/dnsmasq.h
++++ b/src/dnsmasq.h
+@@ -955,7 +955,7 @@ extern struct daemon {
+   int max_logs;  /* queue limit */
+   int cachesize, ftabsize;
+   int port, query_port, min_port, max_port;
+-  unsigned long local_ttl, neg_ttl, max_ttl, min_cache_ttl, max_cache_ttl, auth_ttl;
++  unsigned long local_ttl, neg_ttl, max_ttl, min_cache_ttl, max_cache_ttl, auth_ttl, dhcp_ttl, use_dhcp_ttl;
+   char *dns_client_id;
+   struct hostsfile *addn_hosts;
+   struct dhcp_context *dhcp, *dhcp6;
+diff --git a/src/option.c b/src/option.c
+index 7c5e6bc..3f6d162 100644
+--- a/src/option.c
++++ b/src/option.c
+@@ -157,6 +157,7 @@ struct myoption {
+ #define LOPT_MAXPORT       345
+ #define LOPT_CPE_ID        346
+ #define LOPT_SCRIPT_ARP    347
++#define LOPT_DHCPTTL       348
+ #ifdef HAVE_GETOPT_LONG
+ static const struct option opts[] =  
+@@ -319,6 +320,7 @@ static const struct myoption opts[] =
+     { "quiet-ra", 0, 0, LOPT_QUIET_RA },
+     { "dns-loop-detect", 0, 0, LOPT_LOOP_DETECT },
+     { "script-arp", 0, 0, LOPT_SCRIPT_ARP },
++    { "dhcp-ttl", 1, 0 , LOPT_DHCPTTL },
+     { NULL, 0, 0, 0 }
+   };
+@@ -485,9 +487,10 @@ static struct {
+   { LOPT_QUIET_DHCP, OPT_QUIET_DHCP, NULL, gettext_noop("Do not log routine DHCP."), NULL },
+   { LOPT_QUIET_DHCP6, OPT_QUIET_DHCP6, NULL, gettext_noop("Do not log routine DHCPv6."), NULL },
+   { LOPT_QUIET_RA, OPT_QUIET_RA, NULL, gettext_noop("Do not log RA."), NULL },
+-  { LOPT_LOCAL_SERVICE, OPT_LOCAL_SERVICE, NULL, gettext_noop("Accept queries only from directly-connected networks"), NULL },
+-  { LOPT_LOOP_DETECT, OPT_LOOP_DETECT, NULL, gettext_noop("Detect and remove DNS forwarding loops"), NULL },
++  { LOPT_LOCAL_SERVICE, OPT_LOCAL_SERVICE, NULL, gettext_noop("Accept queries only from directly-connected networks."), NULL },
++  { LOPT_LOOP_DETECT, OPT_LOOP_DETECT, NULL, gettext_noop("Detect and remove DNS forwarding loops."), NULL },
+   { LOPT_IGNORE_ADDR, ARG_DUP, "<ipaddr>", gettext_noop("Ignore DNS responses containing ipaddr."), NULL }, 
++  { LOPT_DHCPTTL, ARG_ONE, "<ttl>", gettext_noop("Set TTL in DNS responses with DHCP-derived addresses."), NULL }, 
+   { 0, 0, NULL, NULL, NULL }
+ }; 
+@@ -2580,6 +2583,7 @@ static int one_opt(int option, char *arg, char *errstr, char *gen_err, int comma
+     case LOPT_MINCTTL: /* --min-cache-ttl */
+     case LOPT_MAXCTTL: /* --max-cache-ttl */
+     case LOPT_AUTHTTL: /* --auth-ttl */
++    case LOPT_DHCPTTL: /* --dhcp-ttl */
+       {
+       int ttl;
+       if (!atoi_check(arg, &ttl))
+@@ -2598,6 +2602,11 @@ static int one_opt(int option, char *arg, char *errstr, char *gen_err, int comma
+         daemon->max_cache_ttl = (unsigned long)ttl;
+       else if (option == LOPT_AUTHTTL)
+         daemon->auth_ttl = (unsigned long)ttl;
++      else if (option == LOPT_DHCPTTL)
++        {
++          daemon->dhcp_ttl = (unsigned long)ttl;
++          daemon->use_dhcp_ttl = 1;
++        }
+       else
+         daemon->local_ttl = (unsigned long)ttl;
+       break;
+diff --git a/src/rfc1035.c b/src/rfc1035.c
+index 3535a71..8f1e3b4 100644
+--- a/src/rfc1035.c
++++ b/src/rfc1035.c
+@@ -1170,7 +1170,7 @@ static unsigned long crec_ttl(struct crec *crecp, time_t now)
+      before the lease expires. */
+   if (crecp->flags & F_DHCP)
+-    return daemon->local_ttl;
++    return daemon->use_dhcp_ttl ? daemon->dhcp_ttl : daemon->local_ttl;
+   
+   /* Immortal entries other than DHCP are local, and hold TTL in TTD field. */
+   if (crecp->flags & F_IMMORTAL)
+-- 
+1.7.10.4
+
diff --git a/src/patches/dnsmasq/002-enhance_add_subnet_to_allow_arbitary_subnet_addresses.patch b/src/patches/dnsmasq/002-enhance_add_subnet_to_allow_arbitary_subnet_addresses.patch
deleted file mode 100644 (file)
index 2d3d6e4..0000000
+++ /dev/null
@@ -1,271 +0,0 @@
-From a7369bef8abd241c3d85633fa9c870943f091e76 Mon Sep 17 00:00:00 2001
-From: Ed Bardsley <ebardsley@google.com>
-Date: Wed, 5 Aug 2015 21:17:18 +0100
-Subject: [PATCH] Enhance --add-subnet to allow arbitary subnet addresses.
-
----
- CHANGELOG     |    4 ++++
- man/dnsmasq.8 |   32 ++++++++++++++++++++-----------
- src/dnsmasq.h |   13 ++++++++++---
- src/option.c  |   59 ++++++++++++++++++++++++++++++++++++++++++++++++++++-----
- src/rfc1035.c |   39 +++++++++++++++++++++++++++++++-------
- 5 files changed, 121 insertions(+), 26 deletions(-)
-
-diff --git a/CHANGELOG b/CHANGELOG
-index 3f4026d..bbc2834 100644
---- a/CHANGELOG
-+++ b/CHANGELOG
-@@ -4,6 +4,10 @@ version 2.76
-           least, 0.0.0.0 accesses the local host, so could
-           be targets for DNS rebinding. See RFC 5735 section 3 
-           for details. Thanks to Stephen Röttger for the bug report.
-+
-+          Enhance --add-subnet to allow arbitrary subnet addresses.
-+            Thanks to Ed Barsley for the patch.
-+      
-           
- version 2.75
-             Fix reversion on 2.74 which caused 100% CPU use when a 
-diff --git a/man/dnsmasq.8 b/man/dnsmasq.8
-index c8913b5..a23c898 100644
---- a/man/dnsmasq.8
-+++ b/man/dnsmasq.8
-@@ -604,17 +604,27 @@ experimental. Also note that exposing MAC addresses in this way may
- have security and privacy implications. The warning about caching
- given for --add-subnet applies to --add-mac too.
- .TP 
--.B --add-subnet[[=<IPv4 prefix length>],<IPv6 prefix length>]
--Add the subnet address of the requestor to the DNS queries which are
--forwarded upstream. The amount of the address forwarded depends on the
--prefix length parameter: 32 (128 for IPv6) forwards the whole address,
--zero forwards none of it but still marks the request so that no
--upstream nameserver will add client address information either. The
--default is zero for both IPv4 and IPv6. Note that upstream nameservers
--may be configured to return different results based on this
--information, but the dnsmasq cache does not take account. If a dnsmasq
--instance is configured such that different results may be encountered,
--caching should be disabled.
-+.B --add-subnet[[=[<IPv4 address>/]<IPv4 prefix length>][,[<IPv6 address>/]<IPv6 prefix length>]]
-+Add a subnet address to the DNS queries which are forwarded
-+upstream. If an address is specified in the flag, it will be used,
-+otherwise, the address of the requestor will be used. The amount of
-+the address forwarded depends on the prefix length parameter: 32 (128
-+for IPv6) forwards the whole address, zero forwards none of it but
-+still marks the request so that no upstream nameserver will add client
-+address information either. The default is zero for both IPv4 and
-+IPv6. Note that upstream nameservers may be configured to return
-+different results based on this information, but the dnsmasq cache
-+does not take account. If a dnsmasq instance is configured such that
-+different results may be encountered, caching should be disabled.
-+
-+For example,
-+.B --add-subnet=24,96
-+will add the /24 and /96 subnets of the requestor for IPv4 and IPv6 requestors, respectively.
-+.B --add-subnet=1.2.3.4/24
-+will add 1.2.3.0/24 for IPv4 requestors and ::/0 for IPv6 requestors.
-+.B --add-subnet=1.2.3.4/24,1.2.3.4/24
-+will add 1.2.3.0/24 for both IPv4 and IPv6 requestors.
-+
- .TP
- .B \-c, --cache-size=<cachesize>
- Set the size of dnsmasq's cache. The default is 150 names. Setting the cache size to zero disables caching.
-diff --git a/src/dnsmasq.h b/src/dnsmasq.h
-index cf1a782..f42acdb 100644
---- a/src/dnsmasq.h
-+++ b/src/dnsmasq.h
-@@ -541,6 +541,13 @@ struct iname {
-   struct iname *next;
- };
-+/* subnet parameters from command line */
-+struct mysubnet {
-+  union mysockaddr addr;
-+  int addr_used;
-+  int mask;
-+};
-+
- /* resolv-file parms from command-line */
- struct resolvc {
-   struct resolvc *next;
-@@ -935,9 +942,9 @@ extern struct daemon {
-   struct auth_zone *auth_zones;
-   struct interface_name *int_names;
-   char *mxtarget;
--  int addr4_netmask;
--  int addr6_netmask;
--  char *lease_file; 
-+  struct mysubnet *add_subnet4;
-+  struct mysubnet *add_subnet6;
-+  char *lease_file;
-   char *username, *groupname, *scriptuser;
-   char *luascript;
-   char *authserver, *hostmaster;
-diff --git a/src/option.c b/src/option.c
-index ecc2619..746cd11 100644
---- a/src/option.c
-+++ b/src/option.c
-@@ -445,7 +445,7 @@ static struct {
-   { LOPT_PXE_SERV, ARG_DUP, "<service>", gettext_noop("Boot service for PXE menu."), NULL },
-   { LOPT_TEST, 0, NULL, gettext_noop("Check configuration syntax."), NULL },
-   { LOPT_ADD_MAC, OPT_ADD_MAC, NULL, gettext_noop("Add requestor's MAC address to forwarded DNS queries."), NULL },
--  { LOPT_ADD_SBNET, ARG_ONE, "<v4 pref>[,<v6 pref>]", gettext_noop("Add requestor's IP subnet to forwarded DNS queries."), NULL },
-+  { LOPT_ADD_SBNET, ARG_ONE, "<v4 pref>[,<v6 pref>]", gettext_noop("Add specified IP subnet to forwarded DNS queries."), NULL },
-   { LOPT_DNSSEC, OPT_DNSSEC_PROXY, NULL, gettext_noop("Proxy DNSSEC validation results from upstream nameservers."), NULL },
-   { LOPT_INCR_ADDR, OPT_CONSEC_ADDR, NULL, gettext_noop("Attempt to allocate sequential IP addresses to DHCP clients."), NULL },
-   { LOPT_CONNTRACK, OPT_CONNTRACK, NULL, gettext_noop("Copy connection-track mark from queries to upstream connections."), NULL },
-@@ -722,6 +722,20 @@ static void do_usage(void)
- #define ret_err(x) do { strcpy(errstr, (x)); return 0; } while (0)
-+static char *parse_mysockaddr(char *arg, union mysockaddr *addr) 
-+{
-+  if (inet_pton(AF_INET, arg, &addr->in.sin_addr) > 0)
-+    addr->sa.sa_family = AF_INET;
-+#ifdef HAVE_IPV6
-+  else if (inet_pton(AF_INET6, arg, &addr->in6.sin6_addr) > 0)
-+    addr->sa.sa_family = AF_INET6;
-+#endif
-+  else
-+    return _("bad address");
-+   
-+  return NULL;
-+}
-+
- char *parse_server(char *arg, union mysockaddr *addr, union mysockaddr *source_addr, char *interface, int *flags)
- {
-   int source_port = 0, serv_port = NAMESERVER_PORT;
-@@ -1585,7 +1599,7 @@ static int one_opt(int option, char *arg, char *errstr, char *gen_err, int comma
-           li = match_suffix->next;
-           free(match_suffix->suffix);
-           free(match_suffix);
--        }    
-+        }
-       break;
-       }
-@@ -1593,10 +1607,45 @@ static int one_opt(int option, char *arg, char *errstr, char *gen_err, int comma
-       set_option_bool(OPT_CLIENT_SUBNET);
-       if (arg)
-       {
-+          char *err, *end;
-         comma = split(arg);
--        if (!atoi_check(arg, &daemon->addr4_netmask) || 
--            (comma && !atoi_check(comma, &daemon->addr6_netmask)))
--           ret_err(gen_err);
-+
-+          struct mysubnet* new = opt_malloc(sizeof(struct mysubnet));
-+          if ((end = split_chr(arg, '/')))
-+          {
-+            /* has subnet+len */
-+            err = parse_mysockaddr(arg, &new->addr);
-+            if (err)
-+              ret_err(err);
-+            if (!atoi_check(end, &new->mask))
-+              ret_err(gen_err);
-+            new->addr_used = 1;
-+          } 
-+        else if (!atoi_check(arg, &new->mask))
-+          ret_err(gen_err);
-+          
-+          daemon->add_subnet4 = new;
-+
-+          new = opt_malloc(sizeof(struct mysubnet));
-+          if (comma)
-+            {
-+              if ((end = split_chr(comma, '/')))
-+                {
-+                  /* has subnet+len */
-+                  err = parse_mysockaddr(comma, &new->addr);
-+                  if (err)
-+                    ret_err(err);
-+                  if (!atoi_check(end, &new->mask))
-+                    ret_err(gen_err);
-+                  new->addr_used = 1;
-+                }
-+              else
-+                {
-+                  if (!atoi_check(comma, &new->mask))
-+                    ret_err(gen_err);
-+                }
-+            }
-+          daemon->add_subnet6 = new;
-       }
-       break;
-diff --git a/src/rfc1035.c b/src/rfc1035.c
-index 29e9e65..6a51b30 100644
---- a/src/rfc1035.c
-+++ b/src/rfc1035.c
-@@ -629,26 +629,47 @@ struct subnet_opt {
- #endif
- };
-+static void *get_addrp(union mysockaddr *addr, const short family) 
-+{
-+#ifdef HAVE_IPV6
-+  if (family == AF_INET6)
-+    return &addr->in6.sin6_addr;
-+#endif
-+
-+  return &addr->in.sin_addr;
-+}
-+
- static size_t calc_subnet_opt(struct subnet_opt *opt, union mysockaddr *source)
- {
-   /* http://tools.ietf.org/html/draft-vandergaast-edns-client-subnet-02 */
-   
-   int len;
-   void *addrp;
-+  int sa_family = source->sa.sa_family;
- #ifdef HAVE_IPV6
-   if (source->sa.sa_family == AF_INET6)
-     {
--      opt->family = htons(2);
--      opt->source_netmask = daemon->addr6_netmask;
--      addrp = &source->in6.sin6_addr;
-+      opt->source_netmask = daemon->add_subnet6->mask;
-+      if (daemon->add_subnet6->addr_used) 
-+      {
-+        sa_family = daemon->add_subnet6->addr.sa.sa_family;
-+        addrp = get_addrp(&daemon->add_subnet6->addr, sa_family);
-+      } 
-+      else 
-+      addrp = &source->in6.sin6_addr;
-     }
-   else
- #endif
-     {
--      opt->family = htons(1);
--      opt->source_netmask = daemon->addr4_netmask;
--      addrp = &source->in.sin_addr;
-+      opt->source_netmask = daemon->add_subnet4->mask;
-+      if (daemon->add_subnet4->addr_used)
-+      {
-+        sa_family = daemon->add_subnet4->addr.sa.sa_family;
-+        addrp = get_addrp(&daemon->add_subnet4->addr, sa_family);
-+      } 
-+      else 
-+      addrp = &source->in.sin_addr;
-     }
-   
-   opt->scope_netmask = 0;
-@@ -656,6 +677,11 @@ static size_t calc_subnet_opt(struct subnet_opt *opt, union mysockaddr *source)
-   
-   if (opt->source_netmask != 0)
-     {
-+#ifdef HAVE_IPV6
-+      opt->family = htons(sa_family == AF_INET6 ? 2 : 1);
-+#else
-+      opt->family = htons(1);
-+#endif
-       len = ((opt->source_netmask - 1) >> 3) + 1;
-       memcpy(opt->addr, addrp, len);
-       if (opt->source_netmask & 7)
-@@ -2335,4 +2361,3 @@ size_t answer_request(struct dns_header *header, char *limit, size_t qlen,
-   
-   return len;
- }
--
--- 
-1.7.10.4
diff --git a/src/patches/dnsmasq/003-Update_CHANGELOG.patch b/src/patches/dnsmasq/003-Update_CHANGELOG.patch
new file mode 100644 (file)
index 0000000..f04f943
--- /dev/null
@@ -0,0 +1,17 @@
+X-Git-Url: http://thekelleys.org.uk/gitweb/?p=dnsmasq.git;a=blobdiff_plain;f=CHANGELOG;h=6d9ba490488f80ef565f459cef3c110bdf31212c;hp=14354f2506a7fbf8360cd32c96e1d7ce1bfeb3f9;hb=e06e6e34bffd781b7cefa49b25fb8ae863654ca2;hpb=832e47beab95c2918b5264f0504f2fe6fe523e4c
+
+diff --git a/CHANGELOG b/CHANGELOG
+index 14354f2..6d9ba49 100644
+--- a/CHANGELOG
++++ b/CHANGELOG
+@@ -48,6 +48,10 @@ version 2.76
+           (ie xx::0 to xx::ffff:ffff:ffff:ffff) 
+           Thanks to Laurent Bendel for spotting this problem.
++          Add support for a TTL parameter in --host-record and
++          --cname.
++
++          Add --dhcp-ttl option.
+ version 2.75
+             Fix reversion on 2.74 which caused 100% CPU use when a 
diff --git a/src/patches/dnsmasq/003-dont_answer_non_auth_queries_for_auth_zones_locally_when_localise_queries_set.patch b/src/patches/dnsmasq/003-dont_answer_non_auth_queries_for_auth_zones_locally_when_localise_queries_set.patch
deleted file mode 100644 (file)
index cfbcdfb..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
-From 3a3965ac21b1b759eab8799b6edb09195b671306 Mon Sep 17 00:00:00 2001
-From: Simon Kelley <simon@thekelleys.org.uk>
-Date: Sun, 9 Aug 2015 17:45:06 +0100
-Subject: [PATCH] Don't answer non-auth queries for auth zones locally when
- --localise-queries set.
-
----
- src/forward.c |    4 ++--
- 1 file changed, 2 insertions(+), 2 deletions(-)
-
-diff --git a/src/forward.c b/src/forward.c
-index 2731b90..b76a974 100644
---- a/src/forward.c
-+++ b/src/forward.c
-@@ -1365,7 +1365,7 @@ void receive_query(struct listener *listen, time_t now)
- #ifdef HAVE_AUTH
-       /* find queries for zones we're authoritative for, and answer them directly */
--      if (!auth_dns)
-+      if (!auth_dns && !option_bool(OPT_LOCALISE))
-       for (zone = daemon->auth_zones; zone; zone = zone->next)
-         if (in_zone(zone, daemon->namebuff, NULL))
-           {
-@@ -1904,7 +1904,7 @@ unsigned char *tcp_request(int confd, time_t now,
-         
- #ifdef HAVE_AUTH
-         /* find queries for zones we're authoritative for, and answer them directly */
--        if (!auth_dns)
-+        if (!auth_dns && !option_bool(OPT_LOCALISE))
-           for (zone = daemon->auth_zones; zone; zone = zone->next)
-             if (in_zone(zone, daemon->namebuff, NULL))
-               {
--- 
-1.7.10.4
diff --git a/src/patches/dnsmasq/004-Add_--tftp-mtu_option.patch b/src/patches/dnsmasq/004-Add_--tftp-mtu_option.patch
new file mode 100644 (file)
index 0000000..c06705a
--- /dev/null
@@ -0,0 +1,136 @@
+From bec366b4041df72b559e713f1c924177676e6eb0 Mon Sep 17 00:00:00 2001
+From: Simon Kelley <simon@thekelleys.org.uk>
+Date: Wed, 24 Feb 2016 22:03:26 +0000
+Subject: [PATCH] Add --tftp-mtu option.
+
+---
+ CHANGELOG     |    4 ++++
+ man/dnsmasq.8 |    4 ++++
+ src/dnsmasq.h |    2 +-
+ src/option.c  |   10 +++++++++-
+ src/tftp.c    |   14 ++++++++++++--
+ 5 files changed, 30 insertions(+), 4 deletions(-)
+
+diff --git a/CHANGELOG b/CHANGELOG
+index 6d9ba49..9218b8c 100644
+--- a/CHANGELOG
++++ b/CHANGELOG
+@@ -53,6 +53,10 @@ version 2.76
+           Add --dhcp-ttl option.
++          Add --tftp-mtu option. Thanks to Patrick McLean for the 
++          initial patch.
++
++
+ version 2.75
+             Fix reversion on 2.74 which caused 100% CPU use when a 
+           dhcp-script is configured. Thanks to Adrian Davey for
+diff --git a/man/dnsmasq.8 b/man/dnsmasq.8
+index 2bcce20..3cf48cd 100644
+--- a/man/dnsmasq.8
++++ b/man/dnsmasq.8
+@@ -1810,6 +1810,10 @@ require about (2*n) + 10 descriptors. If
+ .B --tftp-port-range
+ is given, that can affect the number of concurrent connections.
+ .TP
++.B --tftp-mtu=<mtu size>
++Use size as the ceiling of the MTU supported by the intervening network when 
++negotiating TFTP blocksize, overriding the MTU setting of the local interface  if it is larger.
++.TP
+ .B --tftp-no-blocksize
+ Stop the TFTP server from negotiating the "blocksize" option with a
+ client. Some buggy clients request this option but then behave badly
+diff --git a/src/dnsmasq.h b/src/dnsmasq.h
+index 9f73c3b..280ad9d 100644
+--- a/src/dnsmasq.h
++++ b/src/dnsmasq.h
+@@ -975,7 +975,7 @@ extern struct daemon {
+   struct dhcp_netid_list *dhcp_ignore, *dhcp_ignore_names, *dhcp_gen_names; 
+   struct dhcp_netid_list *force_broadcast, *bootp_dynamic;
+   struct hostsfile *dhcp_hosts_file, *dhcp_opts_file, *dynamic_dirs;
+-  int dhcp_max, tftp_max;
++  int dhcp_max, tftp_max, tftp_mtu;
+   int dhcp_server_port, dhcp_client_port;
+   int start_tftp_port, end_tftp_port; 
+   unsigned int min_leasetime;
+diff --git a/src/option.c b/src/option.c
+index 3f6d162..765965f 100644
+--- a/src/option.c
++++ b/src/option.c
+@@ -158,7 +158,8 @@ struct myoption {
+ #define LOPT_CPE_ID        346
+ #define LOPT_SCRIPT_ARP    347
+ #define LOPT_DHCPTTL       348
+-
++#define LOPT_TFTP_MTU      349
++ 
+ #ifdef HAVE_GETOPT_LONG
+ static const struct option opts[] =  
+ #else
+@@ -244,6 +245,7 @@ static const struct myoption opts[] =
+     { "tftp-unique-root", 0, 0, LOPT_APREF },
+     { "tftp-root", 1, 0, LOPT_PREFIX },
+     { "tftp-max", 1, 0, LOPT_TFTP_MAX },
++    { "tftp-mtu", 1, 0, LOPT_TFTP_MTU },
+     { "tftp-lowercase", 0, 0, LOPT_TFTP_LC },
+     { "ptr-record", 1, 0, LOPT_PTR },
+     { "naptr-record", 1, 0, LOPT_NAPTR },
+@@ -432,6 +434,7 @@ static struct {
+   { LOPT_SECURE, OPT_TFTP_SECURE, NULL, gettext_noop("Allow access only to files owned by the user running dnsmasq."), NULL },
+   { LOPT_TFTP_NO_FAIL, OPT_TFTP_NO_FAIL, NULL, gettext_noop("Do not terminate the service if TFTP directories are inaccessible."), NULL },
+   { LOPT_TFTP_MAX, ARG_ONE, "<integer>", gettext_noop("Maximum number of conncurrent TFTP transfers (defaults to %s)."), "#" },
++  { LOPT_TFTP_MTU, ARG_ONE, "<integer>", gettext_noop("Maximum MTU to use for TFTP transfers."), NULL },
+   { LOPT_NOBLOCK, OPT_TFTP_NOBLOCK, NULL, gettext_noop("Disable the TFTP blocksize extension."), NULL },
+   { LOPT_TFTP_LC, OPT_TFTP_LC, NULL, gettext_noop("Convert TFTP filenames to lowercase"), NULL },
+   { LOPT_TFTPPORTS, ARG_ONE, "<start>,<end>", gettext_noop("Ephemeral port range for use by TFTP transfers."), NULL },
+@@ -2625,6 +2628,11 @@ static int one_opt(int option, char *arg, char *errstr, char *gen_err, int comma
+       ret_err(gen_err);
+       break;  
++    case LOPT_TFTP_MTU:  /*  --tftp-mtu */
++      if (!atoi_check(arg, &daemon->tftp_mtu))
++      ret_err(gen_err);
++      break;
++
+     case LOPT_PREFIX: /* --tftp-prefix */
+       comma = split(arg);
+       if (comma)
+diff --git a/src/tftp.c b/src/tftp.c
+index 00ed2fc..dc4aa85 100644
+--- a/src/tftp.c
++++ b/src/tftp.c
+@@ -103,8 +103,10 @@ void tftp_request(struct listener *listen, time_t now)
+       if (listen->iface)
+       {
+         addr = listen->iface->addr;
+-        mtu = listen->iface->mtu;
+         name = listen->iface->name;
++        mtu = listen->iface->mtu;
++        if (daemon->tftp_mtu != 0 && daemon->tftp_mtu < mtu)
++          mtu = daemon->tftp_mtu;
+       }
+       else
+       {
+@@ -234,9 +236,17 @@ void tftp_request(struct listener *listen, time_t now)
+       strncpy(ifr.ifr_name, name, IF_NAMESIZE);
+       if (ioctl(listen->tftpfd, SIOCGIFMTU, &ifr) != -1)
+-      mtu = ifr.ifr_mtu;      
++      {
++        mtu = ifr.ifr_mtu;  
++        if (daemon->tftp_mtu != 0 && daemon->tftp_mtu < mtu)
++          mtu = daemon->tftp_mtu;    
++      }
+     }
++  /* Failed to get interface mtu - can use configured value. */
++  if (mtu == 0)
++    mtu = daemon->tftp_mtu;
++
+   if (name)
+     {
+       /* check for per-interface prefix */ 
+-- 
+1.7.10.4
+
diff --git a/src/patches/dnsmasq/004-fix_behaviour_of_empty_dhcp-option.patch b/src/patches/dnsmasq/004-fix_behaviour_of_empty_dhcp-option.patch
deleted file mode 100644 (file)
index 492ada9..0000000
+++ /dev/null
@@ -1,38 +0,0 @@
-From 5e3e464ac4022ee0b3794513abe510817e2cf3ca Mon Sep 17 00:00:00 2001
-From: Simon Kelley <simon@thekelleys.org.uk>
-Date: Tue, 25 Aug 2015 23:08:39 +0100
-Subject: [PATCH] Fix behaviour of empty dhcp-option=option6:dns-server, which
- should inhibit sending option.
-
----
- src/rfc3315.c |    9 +++++----
- 1 file changed, 5 insertions(+), 4 deletions(-)
-
-diff --git a/src/rfc3315.c b/src/rfc3315.c
-index 2665d0d..3f1f9ee 100644
---- a/src/rfc3315.c
-+++ b/src/rfc3315.c
-@@ -1320,15 +1320,16 @@ static struct dhcp_netid *add_options(struct state *state, int do_refresh)
-       
-       if (opt_cfg->opt == OPTION6_REFRESH_TIME)
-       done_refresh = 1;
-+       
-+      if (opt_cfg->opt == OPTION6_DNS_SERVER)
-+      done_dns = 1;
-       
--      if (opt_cfg->flags & DHOPT_ADDR6)
-+      /* Empty DNS_SERVER option will not set DHOPT_ADDR6 */
-+      if ((opt_cfg->flags & DHOPT_ADDR6) || opt_cfg->opt == OPTION6_DNS_SERVER)
-       {
-         int len, j;
-         struct in6_addr *a;
-         
--        if (opt_cfg->opt == OPTION6_DNS_SERVER)
--          done_dns = 1;
--        
-         for (a = (struct in6_addr *)opt_cfg->val, len = opt_cfg->len, j = 0; 
-              j < opt_cfg->len; j += IN6ADDRSZ, a++)
-           if ((IN6_IS_ADDR_ULA_ZERO(a) && IN6_IS_ADDR_UNSPECIFIED(state->ula_addr)) ||
--- 
-1.7.10.4
-
diff --git a/src/patches/dnsmasq/005-Apply_ceiling_of_lease_length_to_TTL_when_--dhcp-ttl_in_use.patch b/src/patches/dnsmasq/005-Apply_ceiling_of_lease_length_to_TTL_when_--dhcp-ttl_in_use.patch
new file mode 100644 (file)
index 0000000..2875d2c
--- /dev/null
@@ -0,0 +1,37 @@
+From 7480aeffc8ad195e9fd8bcf424bae0fab3839d55 Mon Sep 17 00:00:00 2001
+From: Simon Kelley <simon@thekelleys.org.uk>
+Date: Fri, 26 Feb 2016 21:58:20 +0000
+Subject: [PATCH] Apply ceiling of lease length to TTL when --dhcp-ttl in use.
+
+---
+ src/rfc1035.c |   12 ++++++++++--
+ 1 file changed, 10 insertions(+), 2 deletions(-)
+
+diff --git a/src/rfc1035.c b/src/rfc1035.c
+index 8f1e3b4..bed5312 100644
+--- a/src/rfc1035.c
++++ b/src/rfc1035.c
+@@ -1167,10 +1167,18 @@ int add_resource_record(struct dns_header *header, char *limit, int *truncp, int
+ static unsigned long crec_ttl(struct crec *crecp, time_t now)
+ {
+   /* Return 0 ttl for DHCP entries, which might change
+-     before the lease expires. */
++     before the lease expires, unless configured otherwise. */
+   if (crecp->flags & F_DHCP)
+-    return daemon->use_dhcp_ttl ? daemon->dhcp_ttl : daemon->local_ttl;
++    {
++      int conf_ttl = daemon->use_dhcp_ttl ? daemon->dhcp_ttl : daemon->local_ttl;
++      
++      /* Apply ceiling of actual lease length to configured TTL. */
++      if (!(crecp->flags & F_IMMORTAL) && (crecp->ttd - now) < conf_ttl)
++      return crecp->ttd - now;
++      
++      return conf_ttl;
++    }   
+   
+   /* Immortal entries other than DHCP are local, and hold TTL in TTD field. */
+   if (crecp->flags & F_IMMORTAL)
+-- 
+1.7.10.4
+
diff --git a/src/patches/dnsmasq/005-suggest_solution_to_ENOMEM_error_with_IPv6_multicast.patch b/src/patches/dnsmasq/005-suggest_solution_to_ENOMEM_error_with_IPv6_multicast.patch
deleted file mode 100644 (file)
index c7cee60..0000000
+++ /dev/null
@@ -1,50 +0,0 @@
-From 9cdcfe9f19ffd45bac4e5b459879bf7c50a287ed Mon Sep 17 00:00:00 2001
-From: Simon Kelley <simon@thekelleys.org.uk>
-Date: Wed, 26 Aug 2015 22:38:08 +0100
-Subject: [PATCH] Suggest solution to ENOMEM error with IPv6 multicast.
-
----
- src/network.c |   13 ++++++++++---
- 1 file changed, 10 insertions(+), 3 deletions(-)
-
-diff --git a/src/network.c b/src/network.c
-index a1d90c8..819302f 100644
---- a/src/network.c
-+++ b/src/network.c
-@@ -1076,23 +1076,30 @@ void join_multicast(int dienow)
-           
-           if ((daemon->doing_dhcp6 || daemon->relay6) &&
-               setsockopt(daemon->dhcp6fd, IPPROTO_IPV6, IPV6_JOIN_GROUP, &mreq, sizeof(mreq)) == -1)
--            err = 1;
-+            err = errno;
-           
-           inet_pton(AF_INET6, ALL_SERVERS, &mreq.ipv6mr_multiaddr);
-           
-           if (daemon->doing_dhcp6 && 
-               setsockopt(daemon->dhcp6fd, IPPROTO_IPV6, IPV6_JOIN_GROUP, &mreq, sizeof(mreq)) == -1)
--            err = 1;
-+            err = errno;
-           
-           inet_pton(AF_INET6, ALL_ROUTERS, &mreq.ipv6mr_multiaddr);
-           
-           if (daemon->doing_ra &&
-               setsockopt(daemon->icmp6fd, IPPROTO_IPV6, IPV6_JOIN_GROUP, &mreq, sizeof(mreq)) == -1)
--            err = 1;
-+            err = errno;
-           
-           if (err)
-             {
-               char *s = _("interface %s failed to join DHCPv6 multicast group: %s");
-+              errno = err;
-+
-+#ifdef HAVE_LINUX_NETWORK
-+              if (errno == ENOMEM)
-+                my_syslog(LOG_ERR, _("try increasing /proc/sys/net/core/optmem_max"));
-+#endif
-+
-               if (dienow)
-                 die(s, iface->name, EC_BADNET);
-               else
--- 
-1.7.10.4
-
diff --git a/src/patches/dnsmasq/006-clarify_man_page_on_RDNSS_set_in_router_advertisement.patch b/src/patches/dnsmasq/006-clarify_man_page_on_RDNSS_set_in_router_advertisement.patch
deleted file mode 100644 (file)
index 19c76e6..0000000
+++ /dev/null
@@ -1,35 +0,0 @@
-From 20fd11e11a9d09edcea94de135396ae1541fbbab Mon Sep 17 00:00:00 2001
-From: Simon Kelley <simon@thekelleys.org.uk>
-Date: Wed, 26 Aug 2015 22:48:13 +0100
-Subject: [PATCH] Clarify man page on RDNSS set in router advertisement.
-
----
- man/dnsmasq.8 |    6 +++---
- 1 file changed, 3 insertions(+), 3 deletions(-)
-
-diff --git a/man/dnsmasq.8 b/man/dnsmasq.8
-index a23c898..d51b10f 100644
---- a/man/dnsmasq.8
-+++ b/man/dnsmasq.8
-@@ -1687,15 +1687,15 @@ creation are handled by a different protocol. When DHCP is in use,
- only a subset of this is needed, and dnsmasq can handle it, using
- existing DHCP configuration to provide most data. When RA is enabled,
- dnsmasq will advertise a prefix for each dhcp-range, with default
--router and recursive DNS server as the relevant link-local address on 
--the machine running dnsmasq. By default, he "managed address" bits are set, and
-+router  as the relevant link-local address on 
-+the machine running dnsmasq. By default, the "managed address" bits are set, and
- the "use SLAAC" bit is reset. This can be changed for individual
- subnets with the mode keywords described in
- .B --dhcp-range.
- RFC6106 DNS parameters are included in the advertisements. By default,
- the relevant link-local address of the machine running dnsmasq is sent
- as recursive DNS server. If provided, the DHCPv6 options dns-server and
--domain-search are used for RDNSS and DNSSL.
-+domain-search are used for the DNS server (RDNSS) and the domain serach list (DNSSL).
- .TP
- .B --ra-param=<interface>,[high|low],[[<ra-interval>],<router lifetime>]
- Set non-default values for router advertisements sent via an
--- 
-1.7.10.4
-
diff --git a/src/patches/dnsmasq/007-handle_signed_dangling_CNAME_replies_to_DS_queries.patch b/src/patches/dnsmasq/007-handle_signed_dangling_CNAME_replies_to_DS_queries.patch
deleted file mode 100644 (file)
index 832a22e..0000000
+++ /dev/null
@@ -1,30 +0,0 @@
-From 6de81f1250fd323c9155de065d5a9dc200a6f20b Mon Sep 17 00:00:00 2001
-From: Simon Kelley <simon@thekelleys.org.uk>
-Date: Wed, 9 Sep 2015 22:51:13 +0100
-Subject: [PATCH] Handle signed dangling CNAME replies to DS queries.
-
----
- src/dnssec.c |    7 ++-----
- 1 file changed, 2 insertions(+), 5 deletions(-)
-
-diff --git a/src/dnssec.c b/src/dnssec.c
-index 4deda24..67ce486 100644
---- a/src/dnssec.c
-+++ b/src/dnssec.c
-@@ -1232,11 +1232,8 @@ int dnssec_validate_ds(time_t now, struct dns_header *header, size_t plen, char
-    
-   /* If we return STAT_NO_SIG, name contains the name of the DS query */
-   if (val == STAT_NO_SIG)
--    {
--      *keyname = 0;
--      return val;
--    }  
--
-+    return val;
-+  
-   /* If the key needed to validate the DS is on the same domain as the DS, we'll
-      loop getting nowhere. Stop that now. This can happen of the DS answer comes
-      from the DS's zone, and not the parent zone. */
--- 
-1.7.10.4
-
diff --git a/src/patches/dnsmasq/008-DHCPv6_option_56_does_not_hold_an_address_list.patch b/src/patches/dnsmasq/008-DHCPv6_option_56_does_not_hold_an_address_list.patch
deleted file mode 100644 (file)
index fdccd0e..0000000
+++ /dev/null
@@ -1,25 +0,0 @@
-From 102208df695e886a3086754d32bf7f8c541fbe46 Mon Sep 17 00:00:00 2001
-From: Simon Kelley <simon@thekelleys.org.uk>
-Date: Thu, 10 Sep 2015 21:50:00 +0100
-Subject: [PATCH] DHCPv6 option 56 does not hold an address list. (RFC 5908).
-
----
- src/dhcp-common.c |    2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/src/dhcp-common.c b/src/dhcp-common.c
-index bc48f41..8fc171a 100644
---- a/src/dhcp-common.c
-+++ b/src/dhcp-common.c
-@@ -599,7 +599,7 @@ static const struct opttab_t opttab6[] = {
-   { "sntp-server", 31,  OT_ADDR_LIST },
-   { "information-refresh-time", 32, OT_TIME },
-   { "FQDN", 39, OT_INTERNAL | OT_RFC1035_NAME },
--  { "ntp-server", 56,  OT_ADDR_LIST },
-+  { "ntp-server", 56,  0 },
-   { "bootfile-url", 59, OT_NAME },
-   { "bootfile-param", 60, OT_CSTRING },
-   { NULL, 0, 0 }
--- 
-1.7.10.4
-
diff --git a/src/patches/dnsmasq/009-Respect_the_--no_resolv_flag_in_inotify_code.patch b/src/patches/dnsmasq/009-Respect_the_--no_resolv_flag_in_inotify_code.patch
deleted file mode 100644 (file)
index 2014fdb..0000000
+++ /dev/null
@@ -1,47 +0,0 @@
-From 77607cbea0ad0f876dfb79c8b2c121ee400d57d0 Mon Sep 17 00:00:00 2001
-From: Simon Kelley <simon@thekelleys.org.uk>
-Date: Thu, 10 Sep 2015 23:08:43 +0100
-Subject: [PATCH] Respect the --no-resolv flag in inotify code.
-
----
- CHANGELOG        |    7 ++++++-
- debian/changelog |    6 ++++++
- src/inotify.c    |    3 +++
- 3 files changed, 15 insertions(+), 1 deletion(-)
-
-diff --git a/CHANGELOG b/CHANGELOG
-index bbc2834..d6e309f 100644
---- a/CHANGELOG
-+++ b/CHANGELOG
-@@ -7,8 +7,13 @@ version 2.76
-           Enhance --add-subnet to allow arbitrary subnet addresses.
-             Thanks to Ed Barsley for the patch.
-+
-+          Respect the --no-resolv flag in inotify code. Fixes bug
-+          which caused dnsmasq to fail to start if a resolv-file 
-+          was a dangling symbolic link, even of --no-resolv set.
-+          Thanks to Alexander Kurtz for spotting the problem.
-+
-       
--          
- version 2.75
-             Fix reversion on 2.74 which caused 100% CPU use when a 
-           dhcp-script is configured. Thanks to Adrian Davey for
-diff --git a/src/inotify.c b/src/inotify.c
-index 52d412f..ef05c58 100644
---- a/src/inotify.c
-+++ b/src/inotify.c
-@@ -90,6 +90,9 @@ void inotify_dnsmasq_init()
-   
-   if (daemon->inotifyfd == -1)
-     die(_("failed to create inotify: %s"), NULL, EC_MISC);
-+
-+  if (option_bool(OPT_NO_RESOLV))
-+    return;
-   
-   for (res = daemon->resolv_files; res; res = res->next)
-     {
--- 
-1.7.10.4
-
diff --git a/src/patches/dnsmasq/010-Rationalise_5e3e464ac4022ee0b3794513abe510817e2cf3ca.patch b/src/patches/dnsmasq/010-Rationalise_5e3e464ac4022ee0b3794513abe510817e2cf3ca.patch
deleted file mode 100644 (file)
index 281697f..0000000
+++ /dev/null
@@ -1,26 +0,0 @@
-From 27b78d990b7cd901866ad6f1a17b9d633a95fdce Mon Sep 17 00:00:00 2001
-From: Simon Kelley <simon@thekelleys.org.uk>
-Date: Sat, 26 Sep 2015 21:40:45 +0100
-Subject: [PATCH] Rationalise 5e3e464ac4022ee0b3794513abe510817e2cf3ca
-
----
- src/rfc3315.c |    3 +--
- 1 file changed, 1 insertion(+), 2 deletions(-)
-
-diff --git a/src/rfc3315.c b/src/rfc3315.c
-index 3f1f9ee..3ed8623 100644
---- a/src/rfc3315.c
-+++ b/src/rfc3315.c
-@@ -1324,8 +1324,7 @@ static struct dhcp_netid *add_options(struct state *state, int do_refresh)
-       if (opt_cfg->opt == OPTION6_DNS_SERVER)
-       done_dns = 1;
-       
--      /* Empty DNS_SERVER option will not set DHOPT_ADDR6 */
--      if ((opt_cfg->flags & DHOPT_ADDR6) || opt_cfg->opt == OPTION6_DNS_SERVER)
-+      if (opt_cfg->flags & DHOPT_ADDR6)
-       {
-         int len, j;
-         struct in6_addr *a;
--- 
-1.7.10.4
-
diff --git a/src/patches/dnsmasq/011-Catch_errors_from_sendmsg_in_DHCP_code.patch b/src/patches/dnsmasq/011-Catch_errors_from_sendmsg_in_DHCP_code.patch
deleted file mode 100644 (file)
index 631495f..0000000
+++ /dev/null
@@ -1,32 +0,0 @@
-From 98079ea89851da1df4966dfdfa1852a98da02912 Mon Sep 17 00:00:00 2001
-From: Simon Kelley <simon@thekelleys.org.uk>
-Date: Tue, 13 Oct 2015 20:30:32 +0100
-Subject: [PATCH] Catch errors from sendmsg in DHCP code.  Logs, eg,  iptables
- DROPS of dest 255.255.255.255
-
----
- src/dhcp.c |    7 ++++++-
- 1 file changed, 6 insertions(+), 1 deletion(-)
-
-diff --git a/src/dhcp.c b/src/dhcp.c
-index e6fceb1..1c85e42 100644
---- a/src/dhcp.c
-+++ b/src/dhcp.c
-@@ -452,8 +452,13 @@ void dhcp_packet(time_t now, int pxe_fd)
- #endif
-   
-   while(retry_send(sendmsg(fd, &msg, 0)));
-+
-+  /* This can fail when, eg, iptables DROPS destination 255.255.255.255 */
-+  if (errno != 0)
-+    my_syslog(MS_DHCP | LOG_WARNING, _("Error sending DHCP packet to %s: %s"),
-+            inet_ntoa(dest.sin_addr), strerror(errno));
- }
-- 
-+
- /* check against secondary interface addresses */
- static int check_listen_addrs(struct in_addr local, int if_index, char *label,
-                             struct in_addr netmask, struct in_addr broadcast, void *vparam)
--- 
-1.7.10.4
-
diff --git a/src/patches/dnsmasq/012-Update_list_of_subnet_for_--bogus-priv.patch b/src/patches/dnsmasq/012-Update_list_of_subnet_for_--bogus-priv.patch
deleted file mode 100644 (file)
index 3ba98fc..0000000
+++ /dev/null
@@ -1,48 +0,0 @@
-From 90477fb79420a34124b66ebd808c578817a30e4c Mon Sep 17 00:00:00 2001
-From: Simon Kelley <simon@thekelleys.org.uk>
-Date: Tue, 20 Oct 2015 21:21:32 +0100
-Subject: [PATCH] Update list of subnet for --bogus-priv
-
-RFC6303 specifies & recommends following zones not be forwarded
-to globally facing servers.
-+------------------------------+-----------------------+
-| Zone                         | Description           |
-+------------------------------+-----------------------+
-| 0.IN-ADDR.ARPA               | IPv4 "THIS" NETWORK   |
-| 127.IN-ADDR.ARPA             | IPv4 Loopback NETWORK |
-| 254.169.IN-ADDR.ARPA         | IPv4 LINK LOCAL       |
-| 2.0.192.IN-ADDR.ARPA         | IPv4 TEST-NET-1       |
-| 100.51.198.IN-ADDR.ARPA      | IPv4 TEST-NET-2       |
-| 113.0.203.IN-ADDR.ARPA       | IPv4 TEST-NET-3       |
-| 255.255.255.255.IN-ADDR.ARPA | IPv4 BROADCAST        |
-+------------------------------+-----------------------+
-
-Signed-off-by: Kevin Darbyshire-Bryant <kevin@darbyshire-bryant.me.uk>
----
- src/rfc1035.c |    8 ++++++--
- 1 file changed, 6 insertions(+), 2 deletions(-)
-
-diff --git a/src/rfc1035.c b/src/rfc1035.c
-index 6a51b30..4eb1772 100644
---- a/src/rfc1035.c
-+++ b/src/rfc1035.c
-@@ -756,10 +756,14 @@ int private_net(struct in_addr addr, int ban_localhost)
-   return
-     (((ip_addr & 0xFF000000) == 0x7F000000) && ban_localhost)  /* 127.0.0.0/8    (loopback) */ ||
-     ((ip_addr & 0xFF000000) == 0x00000000)  /* RFC 5735 section 3. "here" network */ ||
--    ((ip_addr & 0xFFFF0000) == 0xC0A80000)  /* 192.168.0.0/16 (private)  */ ||
-     ((ip_addr & 0xFF000000) == 0x0A000000)  /* 10.0.0.0/8     (private)  */ ||
-     ((ip_addr & 0xFFF00000) == 0xAC100000)  /* 172.16.0.0/12  (private)  */ ||
--    ((ip_addr & 0xFFFF0000) == 0xA9FE0000)  /* 169.254.0.0/16 (zeroconf) */ ;
-+    ((ip_addr & 0xFFFF0000) == 0xC0A80000)  /* 192.168.0.0/16 (private)  */ ||
-+    ((ip_addr & 0xFFFF0000) == 0xA9FE0000)  /* 169.254.0.0/16 (zeroconf) */ ||
-+    ((ip_addr & 0xFFFFFF00) == 0xC0000200)  /* 192.0.2.0/24   (test-net) */ ||
-+    ((ip_addr & 0xFFFFFF00) == 0xC6336400)  /* 198.51.100.0/24(test-net) */ ||
-+    ((ip_addr & 0xFFFFFF00) == 0xCB007100)  /* 203.0.113.0/24 (test-net) */ ||
-+    ((ip_addr & 0xFFFFFFFF) == 0xFFFFFFFF)  /* 255.255.255.255/32 (broadcast)*/ ;
- }
- static unsigned char *do_doctor(unsigned char *p, int count, struct dns_header *header, size_t qlen, char *name, int *doctored)
--- 
-1.7.10.4
-
diff --git a/src/patches/dnsmasq/013-Fix_crash_when_empty_address_from_DNS_overlays_A_record_from.patch b/src/patches/dnsmasq/013-Fix_crash_when_empty_address_from_DNS_overlays_A_record_from.patch
deleted file mode 100644 (file)
index 736cf38..0000000
+++ /dev/null
@@ -1,43 +0,0 @@
-From 41a8d9e99be9f2cc8b02051dd322cb45e0faac87 Mon Sep 17 00:00:00 2001
-From: =?utf8?q?Edwin=20T=C3=B6r=C3=B6k?= <edwin+ml-cerowrt@etorok.net>
-Date: Sat, 14 Nov 2015 17:45:48 +0000
-Subject: [PATCH] Fix crash when empty address from DNS overlays A record from
- hosts.
-
----
- CHANGELOG   |    5 +++++
- src/cache.c |    2 +-
- 2 files changed, 6 insertions(+), 1 deletion(-)
-
-diff --git a/CHANGELOG b/CHANGELOG
-index d6e309f..93c73d0 100644
---- a/CHANGELOG
-+++ b/CHANGELOG
-@@ -13,6 +13,11 @@ version 2.76
-           was a dangling symbolic link, even of --no-resolv set.
-           Thanks to Alexander Kurtz for spotting the problem.
-+          Fix crash when an A or AAAA record is defined locally,
-+          in a hosts file, and an upstream server sends a reply
-+          that the same name is empty. Thanks to Edwin Török for
-+          the patch.
-+
-       
- version 2.75
-             Fix reversion on 2.74 which caused 100% CPU use when a 
-diff --git a/src/cache.c b/src/cache.c
-index 178d654..1b76b67 100644
---- a/src/cache.c
-+++ b/src/cache.c
-@@ -481,7 +481,7 @@ struct crec *cache_insert(char *name, struct all_addr *addr,
-        existing record is for an A or AAAA and
-        the record we're trying to insert is the same, 
-        just drop the insert, but don't error the whole process. */
--      if ((flags & (F_IPV4 | F_IPV6)) && (flags & F_FORWARD))
-+      if ((flags & (F_IPV4 | F_IPV6)) && (flags & F_FORWARD) && addr)
-       {
-         if ((flags & F_IPV4) && (new->flags & F_IPV4) &&
-             new->addr.addr.addr.addr4.s_addr == addr->addr.addr4.s_addr)
--- 
-1.7.10.4
-
diff --git a/src/patches/dnsmasq/014-Handle_unknown_DS_hash_algos_correctly.patch b/src/patches/dnsmasq/014-Handle_unknown_DS_hash_algos_correctly.patch
deleted file mode 100644 (file)
index 8b17431..0000000
+++ /dev/null
@@ -1,39 +0,0 @@
-From 67ab3285b5d9a1b1e20e034cf272867fdab8a0f9 Mon Sep 17 00:00:00 2001
-From: Simon Kelley <simon@thekelleys.org.uk>
-Date: Fri, 20 Nov 2015 23:20:47 +0000
-Subject: [PATCH] Handle unknown DS hash algos correctly.
-
-When we can validate a DS RRset, but don't speak the hash algo it
-contains, treat that the same as an NSEC/3 proving that the DS
-doesn't exist. 4025 5.2
----
- src/dnssec.c |   13 +++++++++++++
- 1 file changed, 13 insertions(+)
-
-diff --git a/src/dnssec.c b/src/dnssec.c
-index 67ce486..b4dc14e 100644
---- a/src/dnssec.c
-+++ b/src/dnssec.c
-@@ -1005,6 +1005,19 @@ int dnssec_validate_by_ds(time_t now, struct dns_header *header, size_t plen, ch
-   if (crecp->flags & F_NEG)
-     return STAT_INSECURE_DS;
-   
-+  /* 4035 5.2 
-+     If the validator does not support any of the algorithms listed in an
-+     authenticated DS RRset, then the resolver has no supported
-+     authentication path leading from the parent to the child.  The
-+     resolver should treat this case as it would the case of an
-+     authenticated NSEC RRset proving that no DS RRset exists,  */
-+  for (recp1 = crecp; recp1; recp1 = cache_find_by_name(recp1, name, now, F_DS))
-+    if (hash_find(ds_digest_name(recp1->addr.ds.digest)))
-+      break;
-+  
-+  if (!recp1)
-+    return STAT_INSECURE_DS;
-+
-   /* NOTE, we need to find ONE DNSKEY which matches the DS */
-   for (valid = 0, j = ntohs(header->ancount); j != 0 && !valid; j--) 
-     {
--- 
-1.7.10.4
-
diff --git a/src/patches/dnsmasq/015-Fix_crash_at_start_up_with_conf-dir.patch b/src/patches/dnsmasq/015-Fix_crash_at_start_up_with_conf-dir.patch
deleted file mode 100644 (file)
index a9102c1..0000000
+++ /dev/null
@@ -1,38 +0,0 @@
-From 0007ee90646a5a78a96ee729932e89d31c69513a Mon Sep 17 00:00:00 2001
-From: Simon Kelley <simon@thekelleys.org.uk>
-Date: Sat, 21 Nov 2015 21:47:41 +0000
-Subject: [PATCH] Fix crash at start up with conf-dir=/path,*
-
-Thanks to Brian Carpenter and American Fuzzy Lop for finding the bug.
----
- src/option.c |   14 ++++++++++----
- 1 file changed, 10 insertions(+), 4 deletions(-)
-
-diff --git a/src/option.c b/src/option.c
-index 746cd11..71beb98 100644
---- a/src/option.c
-+++ b/src/option.c
-@@ -1515,10 +1515,16 @@ static int one_opt(int option, char *arg, char *errstr, char *gen_err, int comma
-               li = opt_malloc(sizeof(struct list));
-               if (*arg == '*')
-                 {
--                  li->next = match_suffix;
--                  match_suffix = li;
--                  /* Have to copy: buffer is overwritten */
--                  li->suffix = opt_string_alloc(arg+1);
-+                  /* "*" with no suffix is a no-op */
-+                  if (arg[1] == 0)
-+                    free(li);
-+                  else
-+                    {
-+                      li->next = match_suffix;
-+                      match_suffix = li;
-+                      /* Have to copy: buffer is overwritten */
-+                      li->suffix = opt_string_alloc(arg+1);
-+                    }
-                 }
-               else
-                 {
--- 
-1.7.10.4
-
diff --git a/src/patches/dnsmasq/016-Major_rationalisation_of_DNSSEC_validation.patch b/src/patches/dnsmasq/016-Major_rationalisation_of_DNSSEC_validation.patch
deleted file mode 100644 (file)
index 7f25066..0000000
+++ /dev/null
@@ -1,2209 +0,0 @@
-From 9a31b68b59adcac01016d4026d906b69c4216c01 Mon Sep 17 00:00:00 2001
-From: Simon Kelley <simon@thekelleys.org.uk>
-Date: Tue, 15 Dec 2015 10:20:39 +0000
-Subject: [PATCH] Major rationalisation of DNSSEC validation.
-
-Much gnarly special-case code removed and replaced with correct
-general implementaion. Checking of zone-status moved to DNSSEC code,
-where it should be, vastly simplifying query-forwarding code.
----
- src/dnsmasq.h |   19 +-
- src/dnssec.c  |  926 ++++++++++++++++++++++++++++++---------------------------
- src/forward.c |  741 ++++++++++-----------------------------------
- 3 files changed, 653 insertions(+), 1033 deletions(-)
-
-diff --git a/src/dnsmasq.h b/src/dnsmasq.h
-index f42acdb..023a1cf 100644
---- a/src/dnsmasq.h
-+++ b/src/dnsmasq.h
-@@ -586,12 +586,8 @@ struct hostsfile {
- #define STAT_NEED_KEY           5
- #define STAT_TRUNCATED          6
- #define STAT_SECURE_WILDCARD    7
--#define STAT_NO_SIG             8
--#define STAT_NO_DS              9
--#define STAT_NO_NS             10
--#define STAT_NEED_DS_NEG       11
--#define STAT_CHASE_CNAME       12
--#define STAT_INSECURE_DS       13
-+#define STAT_OK                 8
-+#define STAT_ABANDONED          9
- #define FREC_NOREBIND           1
- #define FREC_CHECKING_DISABLED  2
-@@ -601,8 +597,7 @@ struct hostsfile {
- #define FREC_AD_QUESTION       32
- #define FREC_DO_QUESTION       64
- #define FREC_ADDED_PHEADER    128
--#define FREC_CHECK_NOSIGN     256
--#define FREC_TEST_PKTSZ       512
-+#define FREC_TEST_PKTSZ       256
- #ifdef HAVE_DNSSEC
- #define HASH_SIZE 20 /* SHA-1 digest size */
-@@ -626,9 +621,7 @@ struct frec {
- #ifdef HAVE_DNSSEC 
-   int class, work_counter;
-   struct blockdata *stash; /* Saved reply, whilst we validate */
--  struct blockdata *orig_domain; /* domain of original query, whilst
--                                  we're seeing is if in unsigned domain */
--  size_t stash_len, name_start, name_len;
-+  size_t stash_len;
-   struct frec *dependent; /* Query awaiting internally-generated DNSKEY or DS query */
-   struct frec *blocking_query; /* Query which is blocking us. */
- #endif
-@@ -1162,8 +1155,8 @@ int in_zone(struct auth_zone *zone, char *name, char **cut);
- size_t dnssec_generate_query(struct dns_header *header, char *end, char *name, int class, int type, union mysockaddr *addr, int edns_pktsz);
- int dnssec_validate_by_ds(time_t now, struct dns_header *header, size_t n, char *name, char *keyname, int class);
- int dnssec_validate_ds(time_t now, struct dns_header *header, size_t plen, char *name, char *keyname, int class);
--int dnssec_validate_reply(time_t now, struct dns_header *header, size_t plen, char *name, char *keyname, int *class, int *neganswer, int *nons);
--int dnssec_chase_cname(time_t now, struct dns_header *header, size_t plen, char *name, char *keyname);
-+int dnssec_validate_reply(time_t now, struct dns_header *header, size_t plen, char *name, char *keyname, int *class,
-+                        int check_unsigned, int *neganswer, int *nons);
- int dnskey_keytag(int alg, int flags, unsigned char *rdata, int rdlen);
- size_t filter_rrsigs(struct dns_header *header, size_t plen);
- unsigned char* hash_questions(struct dns_header *header, size_t plen, char *name);
-diff --git a/src/dnssec.c b/src/dnssec.c
-index b4dc14e..de7b335 100644
---- a/src/dnssec.c
-+++ b/src/dnssec.c
-@@ -65,8 +65,10 @@ static char *algo_digest_name(int algo)
-     case 8: return "sha256";
-     case 10: return "sha512";
-     case 12: return "gosthash94";
-+#ifndef NO_NETTLE_ECC
-     case 13: return "sha256";
-     case 14: return "sha384";
-+#endif
-     default: return NULL;
-     }
- }
-@@ -592,30 +594,30 @@ static int get_rdata(struct dns_header *header, size_t plen, unsigned char *end,
-     }
- }
--static int expand_workspace(unsigned char ***wkspc, int *sz, int new)
-+static int expand_workspace(unsigned char ***wkspc, int *szp, int new)
- {
-   unsigned char **p;
--  int new_sz = *sz;
--  
--  if (new_sz > new)
-+  int old = *szp;
-+
-+  if (old >= new+1)
-     return 1;
-   if (new >= 100)
-     return 0;
--  new_sz += 5;
-+  new += 5;
-   
--  if (!(p = whine_malloc((new_sz) * sizeof(unsigned char **))))
-+  if (!(p = whine_malloc(new * sizeof(unsigned char **))))
-     return 0;  
-   
--  if (*wkspc)
-+  if (old != 0 && *wkspc)
-     {
--      memcpy(p, *wkspc, *sz * sizeof(unsigned char **));
-+      memcpy(p, *wkspc, old * sizeof(unsigned char **));
-       free(*wkspc);
-     }
-   
-   *wkspc = p;
--  *sz = new_sz;
-+  *szp = new;
-   return 1;
- }
-@@ -706,47 +708,28 @@ static void sort_rrset(struct dns_header *header, size_t plen, u16 *rr_desc, int
-     } while (swap);
- }
--/* Validate a single RRset (class, type, name) in the supplied DNS reply 
--   Return code:
--   STAT_SECURE   if it validates.
--   STAT_SECURE_WILDCARD if it validates and is the result of wildcard expansion.
--   (In this case *wildcard_out points to the "body" of the wildcard within name.) 
--   STAT_NO_SIG no RRsigs found.
--   STAT_INSECURE RRset empty.
--   STAT_BOGUS    signature is wrong, bad packet.
--   STAT_NEED_KEY need DNSKEY to complete validation (name is returned in keyname)
--
--   if key is non-NULL, use that key, which has the algo and tag given in the params of those names,
--   otherwise find the key in the cache.
-+static unsigned char **rrset = NULL, **sigs = NULL;
--   name is unchanged on exit. keyname is used as workspace and trashed.
--*/
--static int validate_rrset(time_t now, struct dns_header *header, size_t plen, int class, int type, 
--                        char *name, char *keyname, char **wildcard_out, struct blockdata *key, int keylen, int algo_in, int keytag_in)
-+/* Get pointers to RRset menbers and signature(s) for same.
-+   Check signatures, and return keyname associated in keyname. */
-+static int explore_rrset(struct dns_header *header, size_t plen, int class, int type, 
-+                       char *name, char *keyname, int *sigcnt, int *rrcnt)
- {
--  static unsigned char **rrset = NULL, **sigs = NULL;
--  static int rrset_sz = 0, sig_sz = 0;
--  
-+  static int rrset_sz = 0, sig_sz = 0; 
-   unsigned char *p;
--  int rrsetidx, sigidx, res, rdlen, j, name_labels;
--  struct crec *crecp = NULL;
--  int type_covered, algo, labels, orig_ttl, sig_expiration, sig_inception, key_tag;
--  u16 *rr_desc = get_desc(type);
-- 
--  if (wildcard_out)
--    *wildcard_out = NULL;
--  
-+  int rrsetidx, sigidx, j, rdlen, res;
-+  int name_labels = count_labels(name); /* For 4035 5.3.2 check */
-+  int gotkey = 0;
-+
-   if (!(p = skip_questions(header, plen)))
-     return STAT_BOGUS;
--  
--  name_labels = count_labels(name); /* For 4035 5.3.2 check */
--  /* look for RRSIGs for this RRset and get pointers to each RR in the set. */
-+   /* look for RRSIGs for this RRset and get pointers to each RR in the set. */
-   for (rrsetidx = 0, sigidx = 0, j = ntohs(header->ancount) + ntohs(header->nscount); 
-        j != 0; j--) 
-     {
-       unsigned char *pstart, *pdata;
--      int stype, sclass;
-+      int stype, sclass, algo, type_covered, labels, sig_expiration, sig_inception;
-       pstart = p;
-       
-@@ -762,14 +745,14 @@ static int validate_rrset(time_t now, struct dns_header *header, size_t plen, in
-       GETSHORT(rdlen, p);
-       
-       if (!CHECK_LEN(header, p, plen, rdlen))
--      return STAT_BOGUS; 
-+      return 0; 
-       
-       if (res == 1 && sclass == class)
-       {
-         if (stype == type)
-           {
-             if (!expand_workspace(&rrset, &rrset_sz, rrsetidx))
--              return STAT_BOGUS; 
-+              return 0; 
-             
-             rrset[rrsetidx++] = pstart;
-           }
-@@ -777,14 +760,54 @@ static int validate_rrset(time_t now, struct dns_header *header, size_t plen, in
-         if (stype == T_RRSIG)
-           {
-             if (rdlen < 18)
--              return STAT_BOGUS; /* bad packet */ 
-+              return 0; /* bad packet */ 
-             
-             GETSHORT(type_covered, p);
-+            algo = *p++;
-+            labels = *p++;
-+            p += 4; /* orig_ttl */
-+            GETLONG(sig_expiration, p);
-+            GETLONG(sig_inception, p);
-+            p += 2; /* key_tag */
-             
--            if (type_covered == type)
-+            if (gotkey)
-+              {
-+                /* If there's more than one SIG, ensure they all have same keyname */
-+                if (extract_name(header, plen, &p, keyname, 0, 0) != 1)
-+                  return 0;
-+              }
-+            else
-+              {
-+                gotkey = 1;
-+                
-+                if (!extract_name(header, plen, &p, keyname, 1, 0))
-+                  return 0;
-+                
-+                /* RFC 4035 5.3.1 says that the Signer's Name field MUST equal
-+                   the name of the zone containing the RRset. We can't tell that
-+                   for certain, but we can check that  the RRset name is equal to
-+                   or encloses the signers name, which should be enough to stop 
-+                   an attacker using signatures made with the key of an unrelated 
-+                   zone he controls. Note that the root key is always allowed. */
-+                if (*keyname != 0)
-+                  {
-+                    char *name_start;
-+                    for (name_start = name; !hostname_isequal(name_start, keyname); )
-+                      if ((name_start = strchr(name_start, '.')))
-+                        name_start++; /* chop a label off and try again */
-+                      else
-+                        return 0;
-+                  }
-+              }
-+                
-+            /* Don't count signatures for algos we don't support */
-+            if (check_date_range(sig_inception, sig_expiration) &&
-+                labels <= name_labels &&
-+                type_covered == type && 
-+                algo_digest_name(algo))
-               {
-                 if (!expand_workspace(&sigs, &sig_sz, sigidx))
--                  return STAT_BOGUS; 
-+                  return 0; 
-                 
-                 sigs[sigidx++] = pdata;
-               } 
-@@ -794,17 +817,45 @@ static int validate_rrset(time_t now, struct dns_header *header, size_t plen, in
-       }
-       
-       if (!ADD_RDLEN(header, p, plen, rdlen))
--      return STAT_BOGUS;
-+      return 0;
-     }
-   
--  /* RRset empty */
--  if (rrsetidx == 0)
--    return STAT_INSECURE; 
-+  *sigcnt = sigidx;
-+  *rrcnt = rrsetidx;
-+
-+  return 1;
-+}
-+
-+/* Validate a single RRset (class, type, name) in the supplied DNS reply 
-+   Return code:
-+   STAT_SECURE   if it validates.
-+   STAT_SECURE_WILDCARD if it validates and is the result of wildcard expansion.
-+   (In this case *wildcard_out points to the "body" of the wildcard within name.) 
-+   STAT_BOGUS    signature is wrong, bad packet.
-+   STAT_NEED_KEY need DNSKEY to complete validation (name is returned in keyname)
-+   STAT_NEED_DS  need DS to complete validation (name is returned in keyname)
-+
-+   if key is non-NULL, use that key, which has the algo and tag given in the params of those names,
-+   otherwise find the key in the cache.
--  /* no RRSIGs */
--  if (sigidx == 0)
--    return STAT_NO_SIG; 
-+   name is unchanged on exit. keyname is used as workspace and trashed.
-+
-+   Call explore_rrset first to find and count RRs and sigs.
-+*/
-+static int validate_rrset(time_t now, struct dns_header *header, size_t plen, int class, int type, int sigidx, int rrsetidx, 
-+                        char *name, char *keyname, char **wildcard_out, struct blockdata *key, int keylen, int algo_in, int keytag_in)
-+{
-+  unsigned char *p;
-+  int rdlen, j, name_labels;
-+  struct crec *crecp = NULL;
-+  int algo, labels, orig_ttl, key_tag;
-+  u16 *rr_desc = get_desc(type);
-+ 
-+  if (wildcard_out)
-+    *wildcard_out = NULL;
-   
-+  name_labels = count_labels(name); /* For 4035 5.3.2 check */
-+
-   /* Sort RRset records into canonical order. 
-      Note that at this point keyname and daemon->workspacename buffs are
-      unused, and used as workspace by the sort. */
-@@ -828,44 +879,16 @@ static int validate_rrset(time_t now, struct dns_header *header, size_t plen, in
-       algo = *p++;
-       labels = *p++;
-       GETLONG(orig_ttl, p);
--      GETLONG(sig_expiration, p);
--      GETLONG(sig_inception, p);
-+      p += 8; /* sig_expiration, sig_inception already checked */
-       GETSHORT(key_tag, p);
-       
-       if (!extract_name(header, plen, &p, keyname, 1, 0))
-       return STAT_BOGUS;
--      /* RFC 4035 5.3.1 says that the Signer's Name field MUST equal
--       the name of the zone containing the RRset. We can't tell that
--       for certain, but we can check that  the RRset name is equal to
--       or encloses the signers name, which should be enough to stop 
--       an attacker using signatures made with the key of an unrelated 
--       zone he controls. Note that the root key is always allowed. */
--      if (*keyname != 0)
--      {
--        int failed = 0;
--        
--        for (name_start = name; !hostname_isequal(name_start, keyname); )
--          if ((name_start = strchr(name_start, '.')))
--            name_start++; /* chop a label off and try again */
--          else
--            {
--              failed = 1;
--              break;
--            }
--
--        /* Bad sig, try another */
--        if (failed)
--          continue;
--      }
--      
--      /* Other 5.3.1 checks */
--      if (!check_date_range(sig_inception, sig_expiration) ||
--        labels > name_labels ||
--        !(hash = hash_find(algo_digest_name(algo))) ||
-+      if (!(hash = hash_find(algo_digest_name(algo))) ||
-         !hash_init(hash, &ctx, &digest))
-       continue;
--      
-+      
-       /* OK, we have the signature record, see if the relevant DNSKEY is in the cache. */
-       if (!key && !(crecp = cache_find_by_name(NULL, keyname, now, F_DNSKEY)))
-       return STAT_NEED_KEY;
-@@ -971,10 +994,11 @@ static int validate_rrset(time_t now, struct dns_header *header, size_t plen, in
- /* The DNS packet is expected to contain the answer to a DNSKEY query.
-    Put all DNSKEYs in the answer which are valid into the cache.
-    return codes:
--         STAT_SECURE   At least one valid DNSKEY found and in cache.
--       STAT_BOGUS    No DNSKEYs found, which  can be validated with DS,
--                     or self-sign for DNSKEY RRset is not valid, bad packet.
--       STAT_NEED_DS  DS records to validate a key not found, name in keyname 
-+         STAT_OK           Done, key(s) in cache.
-+       STAT_BOGUS        No DNSKEYs found, which  can be validated with DS,
-+                         or self-sign for DNSKEY RRset is not valid, bad packet.
-+       STAT_NEED_DS      DS records to validate a key not found, name in keyname 
-+       STAT_NEED_DNSKEY  DNSKEY records to validate a key not found, name in keyname 
- */
- int dnssec_validate_by_ds(time_t now, struct dns_header *header, size_t plen, char *name, char *keyname, int class)
- {
-@@ -1001,23 +1025,6 @@ int dnssec_validate_by_ds(time_t now, struct dns_header *header, size_t plen, ch
-       return STAT_NEED_DS;
-     }
-   
--  /* If we've cached that DS provably doesn't exist, result must be INSECURE */
--  if (crecp->flags & F_NEG)
--    return STAT_INSECURE_DS;
--  
--  /* 4035 5.2 
--     If the validator does not support any of the algorithms listed in an
--     authenticated DS RRset, then the resolver has no supported
--     authentication path leading from the parent to the child.  The
--     resolver should treat this case as it would the case of an
--     authenticated NSEC RRset proving that no DS RRset exists,  */
--  for (recp1 = crecp; recp1; recp1 = cache_find_by_name(recp1, name, now, F_DS))
--    if (hash_find(ds_digest_name(recp1->addr.ds.digest)))
--      break;
--  
--  if (!recp1)
--    return STAT_INSECURE_DS;
--
-   /* NOTE, we need to find ONE DNSKEY which matches the DS */
-   for (valid = 0, j = ntohs(header->ancount); j != 0 && !valid; j--) 
-     {
-@@ -1070,7 +1077,8 @@ int dnssec_validate_by_ds(time_t now, struct dns_header *header, size_t plen, ch
-         void *ctx;
-         unsigned char *digest, *ds_digest;
-         const struct nettle_hash *hash;
--        
-+        int sigcnt, rrcnt;
-+
-         if (recp1->addr.ds.algo == algo && 
-             recp1->addr.ds.keytag == keytag &&
-             recp1->uid == (unsigned int)class &&
-@@ -1088,10 +1096,14 @@ int dnssec_validate_by_ds(time_t now, struct dns_header *header, size_t plen, ch
-             
-             from_wire(name);
-             
--            if (recp1->addr.ds.keylen == (int)hash->digest_size &&
-+            if (!(recp1->flags & F_NEG) &&
-+                recp1->addr.ds.keylen == (int)hash->digest_size &&
-                 (ds_digest = blockdata_retrieve(recp1->addr.key.keydata, recp1->addr.ds.keylen, NULL)) &&
-                 memcmp(ds_digest, digest, recp1->addr.ds.keylen) == 0 &&
--                validate_rrset(now, header, plen, class, T_DNSKEY, name, keyname, NULL, key, rdlen - 4, algo, keytag) == STAT_SECURE)
-+                explore_rrset(header, plen, class, T_DNSKEY, name, keyname, &sigcnt, &rrcnt) &&
-+                sigcnt != 0 && rrcnt != 0 &&
-+                validate_rrset(now, header, plen, class, T_DNSKEY, sigcnt, rrcnt, name, keyname, 
-+                               NULL, key, rdlen - 4, algo, keytag) == STAT_SECURE)
-               {
-                 valid = 1;
-                 break;
-@@ -1112,7 +1124,7 @@ int dnssec_validate_by_ds(time_t now, struct dns_header *header, size_t plen, ch
-       {
-         /* Ensure we have type, class  TTL and length */
-         if (!(rc = extract_name(header, plen, &p, name, 0, 10)))
--          return STAT_INSECURE; /* bad packet */
-+          return STAT_BOGUS; /* bad packet */
-         
-         GETSHORT(qtype, p); 
-         GETSHORT(qclass, p);
-@@ -1198,7 +1210,7 @@ int dnssec_validate_by_ds(time_t now, struct dns_header *header, size_t plen, ch
-       
-       /* commit cache insert. */
-       cache_end_insert();
--      return STAT_SECURE;
-+      return STAT_OK;
-     }
-   log_query(F_NOEXTRA | F_UPSTREAM, name, NULL, "BOGUS DNSKEY");
-@@ -1207,12 +1219,14 @@ int dnssec_validate_by_ds(time_t now, struct dns_header *header, size_t plen, ch
- /* The DNS packet is expected to contain the answer to a DS query
-    Put all DSs in the answer which are valid into the cache.
-+   Also handles replies which prove that there's no DS at this location, 
-+   either because the zone is unsigned or this isn't a zone cut. These are
-+   cached too.
-    return codes:
--   STAT_SECURE      At least one valid DS found and in cache.
--   STAT_NO_DS       It's proved there's no DS here.
--   STAT_NO_NS       It's proved there's no DS _or_ NS here.
-+   STAT_OK          At least one valid DS found and in cache.
-    STAT_BOGUS       no DS in reply or not signed, fails validation, bad packet.
-    STAT_NEED_KEY    DNSKEY records to validate a DS not found, name in keyname
-+   STAT_NEED_DS     DS record needed.
- */
- int dnssec_validate_ds(time_t now, struct dns_header *header, size_t plen, char *name, char *keyname, int class)
-@@ -1230,7 +1244,7 @@ int dnssec_validate_ds(time_t now, struct dns_header *header, size_t plen, char
-   if (qtype != T_DS || qclass != class)
-     val = STAT_BOGUS;
-   else
--    val = dnssec_validate_reply(now, header, plen, name, keyname, NULL, &neganswer, &nons);
-+    val = dnssec_validate_reply(now, header, plen, name, keyname, NULL, 0, &neganswer, &nons);
-   /* Note dnssec_validate_reply() will have cached positive answers */
-   
-   if (val == STAT_INSECURE)
-@@ -1242,22 +1256,21 @@ int dnssec_validate_ds(time_t now, struct dns_header *header, size_t plen, char
-   
-   if (!(p = skip_section(p, ntohs(header->ancount), header, plen)))
-     val = STAT_BOGUS;
--   
--  /* If we return STAT_NO_SIG, name contains the name of the DS query */
--  if (val == STAT_NO_SIG)
--    return val;
-   
-   /* If the key needed to validate the DS is on the same domain as the DS, we'll
-      loop getting nowhere. Stop that now. This can happen of the DS answer comes
-      from the DS's zone, and not the parent zone. */
--  if (val == STAT_BOGUS ||  (val == STAT_NEED_KEY && hostname_isequal(name, keyname)))
-+  if (val == STAT_BOGUS || (val == STAT_NEED_KEY && hostname_isequal(name, keyname)))
-     {
-       log_query(F_NOEXTRA | F_UPSTREAM, name, NULL, "BOGUS DS");
-       return STAT_BOGUS;
-     }
-+  
-+  if (val != STAT_SECURE)
-+    return val;
-   /* By here, the answer is proved secure, and a positive answer has been cached. */
--  if (val == STAT_SECURE && neganswer)
-+  if (neganswer)
-     {
-       int rdlen, flags = F_FORWARD | F_DS | F_NEG | F_DNSSECOK;
-       unsigned long ttl, minttl = ULONG_MAX;
-@@ -1317,15 +1330,14 @@ int dnssec_validate_ds(time_t now, struct dns_header *header, size_t plen, char
-         
-         cache_end_insert();  
-         
--        log_query(F_NOEXTRA | F_UPSTREAM, name, NULL, nons ? "no delegation" : "no DS");
-+        log_query(F_NOEXTRA | F_UPSTREAM, name, NULL, "no DS");
-       }
--
--      return nons ? STAT_NO_NS : STAT_NO_DS; 
-     }
--  return val;
-+  return STAT_OK;
- }
-+
- /* 4034 6.1 */
- static int hostname_cmp(const char *a, const char *b)
- {
-@@ -1452,7 +1464,7 @@ static int prove_non_existence_nsec(struct dns_header *header, size_t plen, unsi
-   int mask = 0x80 >> (type & 0x07);
-   if (nons)
--    *nons = 0;
-+    *nons = 1;
-   
-   /* Find NSEC record that proves name doesn't exist */
-   for (i = 0; i < nsec_count; i++)
-@@ -1480,9 +1492,22 @@ static int prove_non_existence_nsec(struct dns_header *header, size_t plen, unsi
-         /* rdlen is now length of type map, and p points to it */
-         
-         /* If we can prove that there's no NS record, return that information. */
--        if (nons && rdlen >= 2 && p[0] == 0 && (p[2] & (0x80 >> T_NS)) == 0)
--          *nons = 1;
-+        if (nons && rdlen >= 2 && p[0] == 0 && (p[2] & (0x80 >> T_NS)) != 0)
-+          *nons = 0;
-         
-+        if (rdlen >= 2 && p[0] == 0)
-+          {
-+            /* A CNAME answer would also be valid, so if there's a CNAME is should 
-+               have been returned. */
-+            if ((p[2] & (0x80 >> T_CNAME)) != 0)
-+              return STAT_BOGUS;
-+            
-+            /* If the SOA bit is set for a DS record, then we have the
-+               DS from the wrong side of the delegation. */
-+            if (type == T_DS && (p[2] & (0x80 >> T_SOA)) != 0)
-+              return STAT_BOGUS;
-+          }
-+
-         while (rdlen >= 2)
-           {
-             if (!CHECK_LEN(header, p, plen, rdlen))
-@@ -1586,7 +1611,7 @@ static int base32_decode(char *in, unsigned char *out)
- static int check_nsec3_coverage(struct dns_header *header, size_t plen, int digest_len, unsigned char *digest, int type,
-                               char *workspace1, char *workspace2, unsigned char **nsecs, int nsec_count, int *nons)
- {
--  int i, hash_len, salt_len, base32_len, rdlen;
-+  int i, hash_len, salt_len, base32_len, rdlen, flags;
-   unsigned char *p, *psave;
-   for (i = 0; i < nsec_count; i++)
-@@ -1599,7 +1624,9 @@ static int check_nsec3_coverage(struct dns_header *header, size_t plen, int dige
-       p += 8; /* class, type, TTL */
-       GETSHORT(rdlen, p);
-       psave = p;
--      p += 4; /* algo, flags, iterations */
-+      p++; /* algo */
-+      flags = *p++; /* flags */
-+      p += 2; /* iterations */
-       salt_len = *p++; /* salt_len */
-       p += salt_len; /* salt */
-       hash_len = *p++; /* p now points to next hashed name */
-@@ -1626,16 +1653,29 @@ static int check_nsec3_coverage(struct dns_header *header, size_t plen, int dige
-                 return 0;
-               
-               /* If we can prove that there's no NS record, return that information. */
--              if (nons && rdlen >= 2 && p[0] == 0 && (p[2] & (0x80 >> T_NS)) == 0)
--                *nons = 1;
-+              if (nons && rdlen >= 2 && p[0] == 0 && (p[2] & (0x80 >> T_NS)) != 0)
-+                *nons = 0;
-               
-+              if (rdlen >= 2 && p[0] == 0)
-+                {
-+                  /* A CNAME answer would also be valid, so if there's a CNAME is should 
-+                     have been returned. */
-+                  if ((p[2] & (0x80 >> T_CNAME)) != 0)
-+                    return 0;
-+                  
-+                  /* If the SOA bit is set for a DS record, then we have the
-+                     DS from the wrong side of the delegation. */
-+                  if (type == T_DS && (p[2] & (0x80 >> T_SOA)) != 0)
-+                    return 0;
-+                }
-+
-               while (rdlen >= 2)
-                 {
-                   if (p[0] == type >> 8)
-                     {
-                       /* Does the NSEC3 say our type exists? */
-                       if (offset < p[1] && (p[offset+2] & mask) != 0)
--                        return STAT_BOGUS;
-+                        return 0;
-                       
-                       break; /* finshed checking */
-                     }
-@@ -1643,7 +1683,7 @@ static int check_nsec3_coverage(struct dns_header *header, size_t plen, int dige
-                   rdlen -= p[1];
-                   p +=  p[1];
-                 }
--
-+              
-               return 1;
-             }
-           else if (rc < 0)
-@@ -1651,16 +1691,27 @@ static int check_nsec3_coverage(struct dns_header *header, size_t plen, int dige
-               /* Normal case, hash falls between NSEC3 name-hash and next domain name-hash,
-                  wrap around case, name-hash falls between NSEC3 name-hash and end */
-               if (memcmp(p, digest, digest_len) >= 0 || memcmp(workspace2, p, digest_len) >= 0)
--                return 1;
-+                {
-+                  if ((flags & 0x01) && nons) /* opt out */
-+                    *nons = 0;
-+
-+                  return 1;
-+                }
-             }
-           else 
-             {
-               /* wrap around case, name falls between start and next domain name */
-               if (memcmp(workspace2, p, digest_len) >= 0 && memcmp(p, digest, digest_len) >= 0)
--                return 1;
-+                {
-+                  if ((flags & 0x01) && nons) /* opt out */
-+                    *nons = 0;
-+
-+                  return 1;
-+                }
-             }
-         }
-       }
-+
-   return 0;
- }
-@@ -1673,7 +1724,7 @@ static int prove_non_existence_nsec3(struct dns_header *header, size_t plen, uns
-   char *closest_encloser, *next_closest, *wildcard;
-   
-   if (nons)
--    *nons = 0;
-+    *nons = 1;
-   
-   /* Look though the NSEC3 records to find the first one with 
-      an algorithm we support (currently only algo == 1).
-@@ -1813,16 +1864,81 @@ static int prove_non_existence_nsec3(struct dns_header *header, size_t plen, uns
-   
-   return STAT_SECURE;
- }
--    
--/* Validate all the RRsets in the answer and authority sections of the reply (4035:3.2.3) */
--/* Returns are the same as validate_rrset, plus the class if the missing key is in *class */
-+
-+/* Check signing status of name.
-+   returns:
-+   STAT_SECURE zone is signed.
-+   STAT_INSECURE zone proved unsigned.
-+   STAT_NEED_DS require DS record of name returned in keyname.
-+   
-+   name returned unaltered.
-+*/
-+static int zone_status(char *name, int class, char *keyname, time_t now)
-+{
-+  int name_start = strlen(name);
-+  struct crec *crecp;
-+  char *p;
-+  
-+  while (1)
-+    {
-+      strcpy(keyname, &name[name_start]);
-+      
-+      if (!(crecp = cache_find_by_name(NULL, keyname, now, F_DS)))
-+      return STAT_NEED_DS;
-+      else
-+      do 
-+        {
-+          if (crecp->uid == (unsigned int)class)
-+            {
-+              /* F_DNSSECOK misused in DS cache records to non-existance of NS record.
-+                 F_NEG && !F_DNSSECOK implies that we've proved there's no DS record here,
-+                 but that's because there's no NS record either, ie this isn't the start
-+                 of a zone. We only prove that the DNS tree below a node is unsigned when
-+                 we prove that we're at a zone cut AND there's no DS record.
-+              */        
-+              if (crecp->flags & F_NEG)
-+                {
-+                  if (crecp->flags & F_DNSSECOK)
-+                    return STAT_INSECURE; /* proved no DS here */
-+                }
-+              else if (!ds_digest_name(crecp->addr.ds.digest) || !algo_digest_name(crecp->addr.ds.algo))
-+                return STAT_INSECURE; /* algo we can't use - insecure */
-+            }
-+        }
-+      while ((crecp = cache_find_by_name(crecp, keyname, now, F_DS)));
-+      
-+      if (name_start == 0)
-+      break;
-+
-+      for (p = &name[name_start-2]; (*p != '.') && (p != name); p--);
-+      
-+      if (p != name)
-+        p++;
-+      
-+      name_start = p - name;
-+    } 
-+
-+  return STAT_SECURE;
-+}
-+       
-+/* Validate all the RRsets in the answer and authority sections of the reply (4035:3.2.3) 
-+   Return code:
-+   STAT_SECURE   if it validates.
-+   STAT_INSECURE at least one RRset not validated, because in unsigned zone.
-+   STAT_BOGUS    signature is wrong, bad packet, no validation where there should be.
-+   STAT_NEED_KEY need DNSKEY to complete validation (name is returned in keyname, class in *class)
-+   STAT_NEED_DS  need DS to complete validation (name is returned in keyname) 
-+*/
- int dnssec_validate_reply(time_t now, struct dns_header *header, size_t plen, char *name, char *keyname, 
--                        int *class, int *neganswer, int *nons)
-+                        int *class, int check_unsigned, int *neganswer, int *nons)
- {
--  unsigned char *ans_start, *qname, *p1, *p2, **nsecs;
--  int type1, class1, rdlen1, type2, class2, rdlen2, qclass, qtype;
--  int i, j, rc, nsec_count, cname_count = CNAME_CHAIN;
--  int nsec_type = 0, have_answer = 0;
-+  static unsigned char **targets = NULL;
-+  static int target_sz = 0;
-+
-+  unsigned char *ans_start, *p1, *p2, **nsecs;
-+  int type1, class1, rdlen1, type2, class2, rdlen2, qclass, qtype, targetidx;
-+  int i, j, rc, nsec_count;
-+  int nsec_type;
-   if (neganswer)
-     *neganswer = 0;
-@@ -1833,70 +1949,51 @@ int dnssec_validate_reply(time_t now, struct dns_header *header, size_t plen, ch
-   if (RCODE(header) != NXDOMAIN && RCODE(header) != NOERROR)
-     return STAT_INSECURE;
--  qname = p1 = (unsigned char *)(header+1);
-+  p1 = (unsigned char *)(header+1);
-   
-+   /* Find all the targets we're looking for answers to.
-+     The zeroth array element is for the query, subsequent ones
-+     for CNAME targets, unless the query is for a CNAME. */
-+
-+  if (!expand_workspace(&targets, &target_sz, 0))
-+    return STAT_BOGUS;
-+  
-+  targets[0] = p1;
-+  targetidx = 1;
-+   
-   if (!extract_name(header, plen, &p1, name, 1, 4))
-     return STAT_BOGUS;
--
-+  
-   GETSHORT(qtype, p1);
-   GETSHORT(qclass, p1);
-   ans_start = p1;
--
--  if (qtype == T_ANY)
--    have_answer = 1;
-  
--  /* Can't validate an RRISG query */
-+  /* Can't validate an RRSIG query */
-   if (qtype == T_RRSIG)
-     return STAT_INSECURE;
-- 
-- cname_loop:
--  for (j = ntohs(header->ancount); j != 0; j--) 
--    {
--      /* leave pointer to missing name in qname */
--           
--      if (!(rc = extract_name(header, plen, &p1, name, 0, 10)))
--      return STAT_BOGUS; /* bad packet */
--      
--      GETSHORT(type2, p1); 
--      GETSHORT(class2, p1);
--      p1 += 4; /* TTL */
--      GETSHORT(rdlen2, p1);
--
--      if (rc == 1 && qclass == class2)
--      {
--        /* Do we have an answer for the question? */
--        if (type2 == qtype)
--          {
--            have_answer = 1;
--            break;
--          }
--        else if (type2 == T_CNAME)
--          {
--            qname = p1;
--            
--            /* looped CNAMES */
--            if (!cname_count-- || !extract_name(header, plen, &p1, name, 1, 0))
--              return STAT_BOGUS;
--             
--            p1 = ans_start;
--            goto cname_loop;
--          }
--      } 
--
--      if (!ADD_RDLEN(header, p1, plen, rdlen2))
--      return STAT_BOGUS;
--    }
--   
--  if (neganswer && !have_answer)
--    *neganswer = 1;
-   
--  /* No data, therefore no sigs */
--  if (ntohs(header->ancount) + ntohs(header->nscount) == 0)
--    {
--      *keyname = 0;
--      return STAT_NO_SIG;
--    }
--
-+  if (qtype != T_CNAME)
-+    for (j = ntohs(header->ancount); j != 0; j--) 
-+      {
-+      if (!(p1 = skip_name(p1, header, plen, 10)))
-+        return STAT_BOGUS; /* bad packet */
-+      
-+      GETSHORT(type2, p1); 
-+      p1 += 6; /* class, TTL */
-+      GETSHORT(rdlen2, p1);  
-+      
-+      if (type2 == T_CNAME)
-+        {
-+          if (!expand_workspace(&targets, &target_sz, targetidx))
-+            return STAT_BOGUS;
-+          
-+          targets[targetidx++] = p1; /* pointer to target name */
-+        }
-+      
-+      if (!ADD_RDLEN(header, p1, plen, rdlen2))
-+        return STAT_BOGUS;
-+      }
-+  
-   for (p1 = ans_start, i = 0; i < ntohs(header->ancount) + ntohs(header->nscount); i++)
-     {
-       if (!extract_name(header, plen, &p1, name, 1, 10))
-@@ -1931,7 +2028,7 @@ int dnssec_validate_reply(time_t now, struct dns_header *header, size_t plen, ch
-         /* Not done, validate now */
-         if (j == i)
-           {
--            int ttl, keytag, algo, digest, type_covered;
-+            int ttl, keytag, algo, digest, type_covered, sigcnt, rrcnt;
-             unsigned char *psave;
-             struct all_addr a;
-             struct blockdata *key;
-@@ -1939,143 +2036,186 @@ int dnssec_validate_reply(time_t now, struct dns_header *header, size_t plen, ch
-             char *wildname;
-             int have_wildcard = 0;
--            rc = validate_rrset(now, header, plen, class1, type1, name, keyname, &wildname, NULL, 0, 0, 0);
--            
--            if (rc == STAT_SECURE_WILDCARD)
--              {
--                have_wildcard = 1;
--
--                /* An attacker replay a wildcard answer with a different
--                   answer and overlay a genuine RR. To prove this
--                   hasn't happened, the answer must prove that
--                   the gennuine record doesn't exist. Check that here. */
--                if (!nsec_type && !(nsec_type = find_nsec_records(header, plen, &nsecs, &nsec_count, class1)))
--                  return STAT_BOGUS; /* No NSECs or bad packet */
--                
--                if (nsec_type == T_NSEC)
--                  rc = prove_non_existence_nsec(header, plen, nsecs, nsec_count, daemon->workspacename, keyname, name, type1, NULL);
--                else
--                  rc = prove_non_existence_nsec3(header, plen, nsecs, nsec_count, daemon->workspacename, 
--                                                 keyname, name, type1, wildname, NULL);
--                
--                if (rc != STAT_SECURE)
--                  return rc;
--              } 
--            else if (rc != STAT_SECURE)
--              {
--                if (class)
--                  *class = class1; /* Class for DS or DNSKEY */
-+            if (!explore_rrset(header, plen, class1, type1, name, keyname, &sigcnt, &rrcnt))
-+              return STAT_BOGUS;
--                if (rc == STAT_NO_SIG)
-+            /* No signatures for RRset. We can be configured to assume this is OK and return a INSECURE result. */
-+            if (sigcnt == 0)
-+              {
-+                if (check_unsigned)
-                   {
--                    /* If we dropped off the end of a CNAME chain, return
--                       STAT_NO_SIG and the last name is keyname. This is used for proving non-existence
--                       if DS records in CNAME chains. */
--                    if (cname_count == CNAME_CHAIN || i < ntohs(header->ancount)) 
--                      /* No CNAME chain, or no sig in answer section, return empty name. */
--                      *keyname = 0;
--                    else if (!extract_name(header, plen, &qname, keyname, 1, 0))
--                      return STAT_BOGUS;
-+                    rc = zone_status(name, class1, keyname, now);
-+                    if (rc == STAT_SECURE)
-+                      rc = STAT_BOGUS;
-+                     if (class)
-+                       *class = class1; /* Class for NEED_DS or NEED_DNSKEY */
-                   }
-- 
-+                else 
-+                  rc = STAT_INSECURE; 
-+                
-                 return rc;
-               }
-             
--            /* Cache RRsigs in answer section, and if we just validated a DS RRset, cache it */
--            cache_start_insert();
-+            /* explore_rrset() gives us key name from sigs in keyname.
-+               Can't overwrite name here. */
-+            strcpy(daemon->workspacename, keyname);
-+            rc = zone_status(daemon->workspacename, class1, keyname, now);
-+            if (rc != STAT_SECURE)
-+              {
-+                /* Zone is insecure, don't need to validate RRset */
-+                if (class)
-+                  *class = class1; /* Class for NEED_DS or NEED_DNSKEY */
-+                return rc;
-+              } 
-+            
-+            rc = validate_rrset(now, header, plen, class1, type1, sigcnt, rrcnt, name, keyname, &wildname, NULL, 0, 0, 0);
-             
--            for (p2 = ans_start, j = 0; j < ntohs(header->ancount); j++)
-+            if (rc == STAT_BOGUS || rc == STAT_NEED_KEY || rc == STAT_NEED_DS)
-               {
--                if (!(rc = extract_name(header, plen, &p2, name, 0, 10)))
--                  return STAT_BOGUS; /* bad packet */
-+                if (class)
-+                  *class = class1; /* Class for DS or DNSKEY */
-+                return rc;
-+              } 
-+            else 
-+              {
-+                /* rc is now STAT_SECURE or STAT_SECURE_WILDCARD */
-+               
-+                /* Note if we've validated either the answer to the question
-+                   or the target of a CNAME. Any not noted will need NSEC or
-+                   to be in unsigned space. */
-+
-+                for (j = 0; j <targetidx; j++)
-+                  if ((p2 = targets[j]))
-+                    {
-+                      if (!(rc = extract_name(header, plen, &p2, name, 0, 10)))
-+                        return STAT_BOGUS; /* bad packet */
-+                      
-+                      if (class1 == qclass && rc == 1 && (type1 == T_CNAME || type1 == qtype || qtype == T_ANY ))
-+                        targets[j] = NULL;
-+                    }
-+                          
-+                if (rc == STAT_SECURE_WILDCARD)
-+                  {
-+                    have_wildcard = 1;
-                     
--                GETSHORT(type2, p2);
--                GETSHORT(class2, p2);
--                GETLONG(ttl, p2);
--                GETSHORT(rdlen2, p2);
--                     
--                if (!CHECK_LEN(header, p2, plen, rdlen2))
--                  return STAT_BOGUS; /* bad packet */
--                
--                if (class2 == class1 && rc == 1)
--                  { 
--                    psave = p2;
-+                    /* An attacker replay a wildcard answer with a different
-+                       answer and overlay a genuine RR. To prove this
-+                       hasn't happened, the answer must prove that
-+                       the gennuine record doesn't exist. Check that here. */
-+                    if (!(nsec_type = find_nsec_records(header, plen, &nsecs, &nsec_count, class1)))
-+                      return STAT_BOGUS; /* No NSECs or bad packet */
-+                    
-+                    /* Note that we may not yet have validated the NSEC/NSEC3 RRsets. Since the check
-+                       below returns either SECURE or BOGUS, that's not a problem. If the RRsets later fail
-+                       we'll return BOGUS then. */
--                    if (type1 == T_DS && type2 == T_DS)
--                      {
--                        if (rdlen2 < 4)
--                          return STAT_BOGUS; /* bad packet */
--                        
--                        GETSHORT(keytag, p2);
--                        algo = *p2++;
--                        digest = *p2++;
--                        
--                        /* Cache needs to known class for DNSSEC stuff */
--                        a.addr.dnssec.class = class2;
--                        
--                        if ((key = blockdata_alloc((char*)p2, rdlen2 - 4)))
--                          {
--                            if (!(crecp = cache_insert(name, &a, now, ttl, F_FORWARD | F_DS | F_DNSSECOK)))
--                              blockdata_free(key);
--                            else
--                              {
--                                a.addr.keytag = keytag;
--                                log_query(F_NOEXTRA | F_KEYTAG | F_UPSTREAM, name, &a, "DS keytag %u");
--                                crecp->addr.ds.digest = digest;
--                                crecp->addr.ds.keydata = key;
--                                crecp->addr.ds.algo = algo;
--                                crecp->addr.ds.keytag = keytag;
--                                crecp->addr.ds.keylen = rdlen2 - 4; 
--                              } 
--                          }
--                      }
--                    else if (type2 == T_RRSIG)
--                      {
--                        if (rdlen2 < 18)
--                          return STAT_BOGUS; /* bad packet */
-+                    if (nsec_type == T_NSEC)
-+                      rc = prove_non_existence_nsec(header, plen, nsecs, nsec_count, daemon->workspacename, keyname, name, type1, NULL);
-+                    else
-+                      rc = prove_non_existence_nsec3(header, plen, nsecs, nsec_count, daemon->workspacename, 
-+                                                     keyname, name, type1, wildname, NULL);
-+                    
-+                    if (rc == STAT_BOGUS)
-+                      return rc;
-+                  } 
-+                
-+                /* Cache RRsigs in answer section, and if we just validated a DS RRset, cache it */
-+                /* Also note if the RRset is the answer to the question, or the target of a CNAME */
-+                cache_start_insert();
-+                
-+                for (p2 = ans_start, j = 0; j < ntohs(header->ancount); j++)
-+                  {
-+                    if (!(rc = extract_name(header, plen, &p2, name, 0, 10)))
-+                      return STAT_BOGUS; /* bad packet */
-+                    
-+                    GETSHORT(type2, p2);
-+                    GETSHORT(class2, p2);
-+                    GETLONG(ttl, p2);
-+                    GETSHORT(rdlen2, p2);
-+                    
-+                    if (!CHECK_LEN(header, p2, plen, rdlen2))
-+                      return STAT_BOGUS; /* bad packet */
-+                    
-+                    if (class2 == class1 && rc == 1)
-+                      { 
-+                        psave = p2;
-                         
--                        GETSHORT(type_covered, p2);
--
--                        if (type_covered == type1 && 
--                            (type_covered == T_A || type_covered == T_AAAA ||
--                             type_covered == T_CNAME || type_covered == T_DS || 
--                             type_covered == T_DNSKEY || type_covered == T_PTR)) 
-+                        if (type1 == T_DS && type2 == T_DS)
-                           {
--                            a.addr.dnssec.type = type_covered;
--                            a.addr.dnssec.class = class1;
-+                            if (rdlen2 < 4)
-+                              return STAT_BOGUS; /* bad packet */
-                             
--                            algo = *p2++;
--                            p2 += 13; /* labels, orig_ttl, expiration, inception */
-                             GETSHORT(keytag, p2);
-+                            algo = *p2++;
-+                            digest = *p2++;
-+                            
-+                            /* Cache needs to known class for DNSSEC stuff */
-+                            a.addr.dnssec.class = class2;
-                             
--                            /* We don't cache sigs for wildcard answers, because to reproduce the
--                               answer from the cache will require one or more NSEC/NSEC3 records 
--                               which we don't cache. The lack of the RRSIG ensures that a query for
--                               this RRset asking for a secure answer will always be forwarded. */
--                            if (!have_wildcard && (key = blockdata_alloc((char*)psave, rdlen2)))
-+                            if ((key = blockdata_alloc((char*)p2, rdlen2 - 4)))
-                               {
--                                if (!(crecp = cache_insert(name, &a, now, ttl,  F_FORWARD | F_DNSKEY | F_DS)))
-+                                if (!(crecp = cache_insert(name, &a, now, ttl, F_FORWARD | F_DS | F_DNSSECOK)))
-                                   blockdata_free(key);
-                                 else
-                                   {
--                                    crecp->addr.sig.keydata = key;
--                                    crecp->addr.sig.keylen = rdlen2;
--                                    crecp->addr.sig.keytag = keytag;
--                                    crecp->addr.sig.type_covered = type_covered;
--                                    crecp->addr.sig.algo = algo;
-+                                    a.addr.keytag = keytag;
-+                                    log_query(F_NOEXTRA | F_KEYTAG | F_UPSTREAM, name, &a, "DS keytag %u");
-+                                    crecp->addr.ds.digest = digest;
-+                                    crecp->addr.ds.keydata = key;
-+                                    crecp->addr.ds.algo = algo;
-+                                    crecp->addr.ds.keytag = keytag;
-+                                    crecp->addr.ds.keylen = rdlen2 - 4; 
-+                                  } 
-+                              }
-+                          }
-+                        else if (type2 == T_RRSIG)
-+                          {
-+                            if (rdlen2 < 18)
-+                              return STAT_BOGUS; /* bad packet */
-+                            
-+                            GETSHORT(type_covered, p2);
-+                            
-+                            if (type_covered == type1 && 
-+                                (type_covered == T_A || type_covered == T_AAAA ||
-+                                 type_covered == T_CNAME || type_covered == T_DS || 
-+                                 type_covered == T_DNSKEY || type_covered == T_PTR)) 
-+                              {
-+                                a.addr.dnssec.type = type_covered;
-+                                a.addr.dnssec.class = class1;
-+                                
-+                                algo = *p2++;
-+                                p2 += 13; /* labels, orig_ttl, expiration, inception */
-+                                GETSHORT(keytag, p2);
-+                                
-+                                /* We don't cache sigs for wildcard answers, because to reproduce the
-+                                   answer from the cache will require one or more NSEC/NSEC3 records 
-+                                   which we don't cache. The lack of the RRSIG ensures that a query for
-+                                   this RRset asking for a secure answer will always be forwarded. */
-+                                if (!have_wildcard && (key = blockdata_alloc((char*)psave, rdlen2)))
-+                                  {
-+                                    if (!(crecp = cache_insert(name, &a, now, ttl,  F_FORWARD | F_DNSKEY | F_DS)))
-+                                      blockdata_free(key);
-+                                    else
-+                                      {
-+                                        crecp->addr.sig.keydata = key;
-+                                        crecp->addr.sig.keylen = rdlen2;
-+                                        crecp->addr.sig.keytag = keytag;
-+                                        crecp->addr.sig.type_covered = type_covered;
-+                                        crecp->addr.sig.algo = algo;
-+                                      }
-                                   }
-                               }
-                           }
-+                        
-+                        p2 = psave;
-                       }
-                     
--                    p2 = psave;
-+                    if (!ADD_RDLEN(header, p2, plen, rdlen2))
-+                      return STAT_BOGUS; /* bad packet */
-                   }
-                 
--                if (!ADD_RDLEN(header, p2, plen, rdlen2))
--                  return STAT_BOGUS; /* bad packet */
-+                cache_end_insert();
-               }
--                
--            cache_end_insert();
-           }
-       }
-@@ -2083,143 +2223,49 @@ int dnssec_validate_reply(time_t now, struct dns_header *header, size_t plen, ch
-       return STAT_BOGUS;
-     }
--  /* OK, all the RRsets validate, now see if we have a NODATA or NXDOMAIN reply */
--  if (have_answer)
--    return STAT_SECURE;
--     
--  /* NXDOMAIN or NODATA reply, prove that (name, class1, type1) can't exist */
--  /* First marshall the NSEC records, if we've not done it previously */
--  if (!nsec_type && !(nsec_type = find_nsec_records(header, plen, &nsecs, &nsec_count, qclass)))
--    {
--      /* No NSEC records. If we dropped off the end of a CNAME chain, return
--       STAT_NO_SIG and the last name is keyname. This is used for proving non-existence
--       if DS records in CNAME chains. */
--      if (cname_count == CNAME_CHAIN) /* No CNAME chain, return empty name. */
--      *keyname = 0;
--      else if (!extract_name(header, plen, &qname, keyname, 1, 0))
--      return STAT_BOGUS;
--      return STAT_NO_SIG; /* No NSECs, this is probably a dangling CNAME pointing into
--                           an unsigned zone. Return STAT_NO_SIG to cause this to be proved. */
--    }
--   
--  /* Get name of missing answer */
--  if (!extract_name(header, plen, &qname, name, 1, 0))
--    return STAT_BOGUS;
--  
--  if (nsec_type == T_NSEC)
--    return prove_non_existence_nsec(header, plen, nsecs, nsec_count, daemon->workspacename, keyname, name, qtype, nons);
--  else
--    return prove_non_existence_nsec3(header, plen, nsecs, nsec_count, daemon->workspacename, keyname, name, qtype, NULL, nons);
--}
--
--/* Chase the CNAME chain in the packet until the first record which _doesn't validate.
--   Needed for proving answer in unsigned space.
--   Return STAT_NEED_* 
--          STAT_BOGUS - error
--          STAT_INSECURE - name of first non-secure record in name 
--*/
--int dnssec_chase_cname(time_t now, struct dns_header *header, size_t plen, char *name, char *keyname)
--{
--  unsigned char *p = (unsigned char *)(header+1);
--  int type, class, qclass, rdlen, j, rc;
--  int cname_count = CNAME_CHAIN;
--  char *wildname;
--
--  /* Get question */
--  if (!extract_name(header, plen, &p, name, 1, 4))
--    return STAT_BOGUS;
--  
--  p +=2; /* type */
--  GETSHORT(qclass, p);
--
--  while (1)
--    {
--      for (j = ntohs(header->ancount); j != 0; j--) 
--      {
--        if (!(rc = extract_name(header, plen, &p, name, 0, 10)))
--          return STAT_BOGUS; /* bad packet */
--        
--        GETSHORT(type, p); 
--        GETSHORT(class, p);
--        p += 4; /* TTL */
--        GETSHORT(rdlen, p);
--
--        /* Not target, loop */
--        if (rc == 2 || qclass != class)
--          {
--            if (!ADD_RDLEN(header, p, plen, rdlen))
--              return STAT_BOGUS;
--            continue;
--          }
--        
--        /* Got to end of CNAME chain. */
--        if (type != T_CNAME)
--          return STAT_INSECURE;
--        
--        /* validate CNAME chain, return if insecure or need more data */
--        rc = validate_rrset(now, header, plen, class, type, name, keyname, &wildname, NULL, 0, 0, 0);
--         
--        if (rc == STAT_SECURE_WILDCARD)
--          {
--            int nsec_type, nsec_count, i;
--            unsigned char **nsecs;
--
--            /* An attacker can replay a wildcard answer with a different
--               answer and overlay a genuine RR. To prove this
--               hasn't happened, the answer must prove that
--               the genuine record doesn't exist. Check that here. */
--            if (!(nsec_type = find_nsec_records(header, plen, &nsecs, &nsec_count, class)))
--              return STAT_BOGUS; /* No NSECs or bad packet */
--            
--            /* Note that we're called here because something didn't validate in validate_reply,
--               so we can't assume that any NSEC records have been validated. We do them by steam here */
--
--            for (i = 0; i < nsec_count; i++)
--              {
--                unsigned char *p1 = nsecs[i];
--                
--                if (!extract_name(header, plen, &p1, daemon->workspacename, 1, 0))
--                  return STAT_BOGUS;
--
--                rc = validate_rrset(now, header, plen, class, nsec_type, daemon->workspacename, keyname, NULL, NULL, 0, 0, 0);
-+  /* OK, all the RRsets validate, now see if we have a missing answer or CNAME target. */
-+  for (j = 0; j <targetidx; j++)
-+    if ((p2 = targets[j]))
-+      {
-+      if (neganswer)
-+        *neganswer = 1;
--                /* NSECs can't be wildcards. */
--                if (rc == STAT_SECURE_WILDCARD)
--                  rc = STAT_BOGUS;
-+      if (!extract_name(header, plen, &p2, name, 1, 10))
-+        return STAT_BOGUS; /* bad packet */
-+          
-+      /* NXDOMAIN or NODATA reply, unanswered question is (name, qclass, qtype) */
--                if (rc != STAT_SECURE)
-+      /* For anything other than a DS record, this situation is OK if either
-+         the answer is in an unsigned zone, or there's a NSEC records. */
-+      if (!(nsec_type = find_nsec_records(header, plen, &nsecs, &nsec_count, qclass)))
-+        {
-+          /* Empty DS without NSECS */
-+          if (qtype == T_DS)
-+            return STAT_BOGUS;
-+          else
-+            {
-+              rc = zone_status(name, qclass, keyname, now);
-+              if (rc != STAT_SECURE)
-+                {
-+                  if (class)
-+                    *class = qclass; /* Class for NEED_DS or NEED_DNSKEY */
-                   return rc;
--              }
--
--            if (nsec_type == T_NSEC)
--              rc = prove_non_existence_nsec(header, plen, nsecs, nsec_count, daemon->workspacename, keyname, name, type, NULL);
--            else
--              rc = prove_non_existence_nsec3(header, plen, nsecs, nsec_count, daemon->workspacename, 
--                                             keyname, name, type, wildname, NULL);
--            
--            if (rc != STAT_SECURE)
--              return rc;
--          }
--        
--        if (rc != STAT_SECURE)
--          {
--            if (rc == STAT_NO_SIG)
--              rc = STAT_INSECURE;
--            return rc;
--          }
-+                } 
-+              
-+              return STAT_BOGUS; /* signed zone, no NSECs */
-+            }
-+        }
--        /* Loop down CNAME chain/ */
--        if (!cname_count-- || 
--            !extract_name(header, plen, &p, name, 1, 0) ||
--            !(p = skip_questions(header, plen)))
--          return STAT_BOGUS;
--        
--        break;
--      }
-+        if (nsec_type == T_NSEC)
-+        rc = prove_non_existence_nsec(header, plen, nsecs, nsec_count, daemon->workspacename, keyname, name, qtype, nons);
-+      else
-+        rc = prove_non_existence_nsec3(header, plen, nsecs, nsec_count, daemon->workspacename, keyname, name, qtype, NULL, nons);
--      /* End of CNAME chain */
--      return STAT_INSECURE;   
--    }
-+      if (rc != STAT_SECURE)
-+        return rc;
-+      }
-+  
-+  return STAT_SECURE;
- }
-diff --git a/src/forward.c b/src/forward.c
-index b76a974..dd22a62 100644
---- a/src/forward.c
-+++ b/src/forward.c
-@@ -23,15 +23,6 @@ static struct frec *lookup_frec_by_sender(unsigned short id,
- static unsigned short get_id(void);
- static void free_frec(struct frec *f);
--#ifdef HAVE_DNSSEC
--static int tcp_key_recurse(time_t now, int status, struct dns_header *header, size_t n, 
--                         int class, char *name, char *keyname, struct server *server, int *keycount);
--static int do_check_sign(struct frec *forward, int status, time_t now, char *name, char *keyname);
--static int send_check_sign(struct frec *forward, time_t now, struct dns_header *header, size_t plen, 
--                         char *name, char *keyname);
--#endif
--
--
- /* Send a UDP packet with its source address set as "source" 
-    unless nowild is true, when we just send it with the kernel default */
- int send_from(int fd, int nowild, char *packet, size_t len, 
-@@ -825,236 +816,142 @@ void reply_query(int fd, int family, time_t now)
- #ifdef HAVE_DNSSEC
-       if (server && option_bool(OPT_DNSSEC_VALID) && !(forward->flags & FREC_CHECKING_DISABLED))
-       {
--        int status;
-+        int status = 0;
-         /* We've had a reply already, which we're validating. Ignore this duplicate */
-         if (forward->blocking_query)
-           return;
--
--        if (header->hb3 & HB3_TC)
--          {
--            /* Truncated answer can't be validated.
-+        
-+         /* Truncated answer can't be validated.
-                If this is an answer to a DNSSEC-generated query, we still
-                need to get the client to retry over TCP, so return
-                an answer with the TC bit set, even if the actual answer fits.
-             */
--            status = STAT_TRUNCATED;
--          }
--        else if (forward->flags & FREC_DNSKEY_QUERY)
--          status = dnssec_validate_by_ds(now, header, n, daemon->namebuff, daemon->keyname, forward->class);
--        else if (forward->flags & FREC_DS_QUERY)
--          {
--            status = dnssec_validate_ds(now, header, n, daemon->namebuff, daemon->keyname, forward->class);
--            /* Provably no DS, everything below is insecure, even if signatures are offered */
--            if (status == STAT_NO_DS)
--              /* We only cache sigs when we've validated a reply.
--                 Avoid caching a reply with sigs if there's a vaildated break in the 
--                 DS chain, so we don't return replies from cache missing sigs. */
--                      status = STAT_INSECURE_DS;
--            else if (status == STAT_NO_SIG)
--                {
--                  if (option_bool(OPT_DNSSEC_NO_SIGN))
--                    {
--                    status = send_check_sign(forward, now, header, n, daemon->namebuff, daemon->keyname);
--                    if (status == STAT_INSECURE)
--                      status = STAT_INSECURE_DS;
--                  }
--                else
--                  status = STAT_INSECURE_DS;
--              }
--              else if (status == STAT_NO_NS)
--              status = STAT_BOGUS;
--          }
--        else if (forward->flags & FREC_CHECK_NOSIGN)
--          {
--            status = dnssec_validate_ds(now, header, n, daemon->namebuff, daemon->keyname, forward->class);
--            if (status != STAT_NEED_KEY)
--              status = do_check_sign(forward, status, now, daemon->namebuff, daemon->keyname);
--          }
--        else
-+        if (header->hb3 & HB3_TC)
-+          status = STAT_TRUNCATED;
-+        
-+        while (1)
-           {
--            status = dnssec_validate_reply(now, header, n, daemon->namebuff, daemon->keyname, &forward->class, NULL, NULL);
--            if (status == STAT_NO_SIG)
-+            /* As soon as anything returns BOGUS, we stop and unwind, to do otherwise
-+               would invite infinite loops, since the answers to DNSKEY and DS queries
-+               will not be cached, so they'll be repeated. */
-+            if (status != STAT_BOGUS && status != STAT_TRUNCATED && status != STAT_ABANDONED)
-               {
--                if (option_bool(OPT_DNSSEC_NO_SIGN))
--                  status = send_check_sign(forward, now, header, n, daemon->namebuff, daemon->keyname);
-+                if (forward->flags & FREC_DNSKEY_QUERY)
-+                  status = dnssec_validate_by_ds(now, header, n, daemon->namebuff, daemon->keyname, forward->class);
-+                else if (forward->flags & FREC_DS_QUERY)
-+                  status = dnssec_validate_ds(now, header, n, daemon->namebuff, daemon->keyname, forward->class);
-                 else
--                  status = STAT_INSECURE;
-+                  status = dnssec_validate_reply(now, header, n, daemon->namebuff, daemon->keyname, &forward->class, 
-+                                                 option_bool(OPT_DNSSEC_NO_SIGN), NULL, NULL);
-               }
--          }
--        /* Can't validate, as we're missing key data. Put this
--           answer aside, whilst we get that. */     
--        if (status == STAT_NEED_DS || status == STAT_NEED_DS_NEG || status == STAT_NEED_KEY)
--          {
--            struct frec *new, *orig;
--            
--            /* Free any saved query */
--            if (forward->stash)
--              blockdata_free(forward->stash);
--            
--            /* Now save reply pending receipt of key data */
--            if (!(forward->stash = blockdata_alloc((char *)header, n)))
--              return;
--            forward->stash_len = n;
-             
--          anotherkey:       
--            /* Find the original query that started it all.... */
--            for (orig = forward; orig->dependent; orig = orig->dependent);
--
--            if (--orig->work_counter == 0 || !(new = get_new_frec(now, NULL, 1)))
--              status = STAT_INSECURE;
--            else
-+            /* Can't validate, as we're missing key data. Put this
-+               answer aside, whilst we get that. */     
-+            if (status == STAT_NEED_DS || status == STAT_NEED_KEY)
-               {
--                int fd;
--                struct frec *next = new->next;
--                *new = *forward; /* copy everything, then overwrite */
--                new->next = next;
--                new->blocking_query = NULL;
--                new->sentto = server;
--                new->rfd4 = NULL;
--                new->orig_domain = NULL;
--#ifdef HAVE_IPV6
--                new->rfd6 = NULL;
--#endif
--                new->flags &= ~(FREC_DNSKEY_QUERY | FREC_DS_QUERY | FREC_CHECK_NOSIGN);
-+                struct frec *new, *orig;
-                 
--                new->dependent = forward; /* to find query awaiting new one. */
--                forward->blocking_query = new; /* for garbage cleaning */
--                /* validate routines leave name of required record in daemon->keyname */
--                if (status == STAT_NEED_KEY)
--                  {
--                    new->flags |= FREC_DNSKEY_QUERY; 
--                    nn = dnssec_generate_query(header, ((char *) header) + daemon->packet_buff_sz,
--                                               daemon->keyname, forward->class, T_DNSKEY, &server->addr, server->edns_pktsz);
--                  }
--                else 
--                  {
--                    if (status == STAT_NEED_DS_NEG)
--                      new->flags |= FREC_CHECK_NOSIGN;
--                    else
--                      new->flags |= FREC_DS_QUERY;
--                    nn = dnssec_generate_query(header,((char *) header) + daemon->packet_buff_sz,
--                                               daemon->keyname, forward->class, T_DS, &server->addr, server->edns_pktsz);
--                  }
--                if ((hash = hash_questions(header, nn, daemon->namebuff)))
--                  memcpy(new->hash, hash, HASH_SIZE);
--                new->new_id = get_id();
--                header->id = htons(new->new_id);
--                /* Save query for retransmission */
--                if (!(new->stash = blockdata_alloc((char *)header, nn)))
-+                /* Free any saved query */
-+                if (forward->stash)
-+                  blockdata_free(forward->stash);
-+                
-+                /* Now save reply pending receipt of key data */
-+                if (!(forward->stash = blockdata_alloc((char *)header, n)))
-                   return;
--                    
--                new->stash_len = nn;
-+                forward->stash_len = n;
-                 
--                /* Don't resend this. */
--                daemon->srv_save = NULL;
-+                /* Find the original query that started it all.... */
-+                for (orig = forward; orig->dependent; orig = orig->dependent);
-                 
--                if (server->sfd)
--                  fd = server->sfd->fd;
-+                if (--orig->work_counter == 0 || !(new = get_new_frec(now, NULL, 1)))
-+                  status = STAT_ABANDONED;
-                 else
-                   {
--                    fd = -1;
-+                    int fd;
-+                    struct frec *next = new->next;
-+                    *new = *forward; /* copy everything, then overwrite */
-+                    new->next = next;
-+                    new->blocking_query = NULL;
-+                    new->sentto = server;
-+                    new->rfd4 = NULL;
- #ifdef HAVE_IPV6
--                    if (server->addr.sa.sa_family == AF_INET6)
-+                    new->rfd6 = NULL;
-+#endif
-+                    new->flags &= ~(FREC_DNSKEY_QUERY | FREC_DS_QUERY);
-+                    
-+                    new->dependent = forward; /* to find query awaiting new one. */
-+                    forward->blocking_query = new; /* for garbage cleaning */
-+                    /* validate routines leave name of required record in daemon->keyname */
-+                    if (status == STAT_NEED_KEY)
-+                      {
-+                        new->flags |= FREC_DNSKEY_QUERY; 
-+                        nn = dnssec_generate_query(header, ((char *) header) + daemon->packet_buff_sz,
-+                                                   daemon->keyname, forward->class, T_DNSKEY, &server->addr, server->edns_pktsz);
-+                      }
-+                    else 
-                       {
--                        if (new->rfd6 || (new->rfd6 = allocate_rfd(AF_INET6)))
--                          fd = new->rfd6->fd;
-+                        new->flags |= FREC_DS_QUERY;
-+                        nn = dnssec_generate_query(header,((char *) header) + daemon->packet_buff_sz,
-+                                                   daemon->keyname, forward->class, T_DS, &server->addr, server->edns_pktsz);
-                       }
-+                    if ((hash = hash_questions(header, nn, daemon->namebuff)))
-+                      memcpy(new->hash, hash, HASH_SIZE);
-+                    new->new_id = get_id();
-+                    header->id = htons(new->new_id);
-+                    /* Save query for retransmission */
-+                    new->stash = blockdata_alloc((char *)header, nn);
-+                    new->stash_len = nn;
-+                    
-+                    /* Don't resend this. */
-+                    daemon->srv_save = NULL;
-+                    
-+                    if (server->sfd)
-+                      fd = server->sfd->fd;
-                     else
-+                      {
-+                        fd = -1;
-+#ifdef HAVE_IPV6
-+                        if (server->addr.sa.sa_family == AF_INET6)
-+                          {
-+                            if (new->rfd6 || (new->rfd6 = allocate_rfd(AF_INET6)))
-+                              fd = new->rfd6->fd;
-+                          }
-+                        else
- #endif
-+                          {
-+                            if (new->rfd4 || (new->rfd4 = allocate_rfd(AF_INET)))
-+                              fd = new->rfd4->fd;
-+                          }
-+                      }
-+                    
-+                    if (fd != -1)
-                       {
--                        if (new->rfd4 || (new->rfd4 = allocate_rfd(AF_INET)))
--                          fd = new->rfd4->fd;
-+                        while (retry_send(sendto(fd, (char *)header, nn, 0, 
-+                                                 &server->addr.sa, 
-+                                                 sa_len(&server->addr)))); 
-+                        server->queries++;
-                       }
--                  }
--                
--                if (fd != -1)
--                  {
--                    while (retry_send(sendto(fd, (char *)header, nn, 0, 
--                                             &server->addr.sa, 
--                                             sa_len(&server->addr)))); 
--                    server->queries++;
--                  }
--                
-+                  }             
-                 return;
-               }
--          }
-         
--        /* Ok, we reached far enough up the chain-of-trust that we can validate something.
--           Now wind back down, pulling back answers which wouldn't previously validate
--           and validate them with the new data. Note that if an answer needs multiple
--           keys to validate, we may find another key is needed, in which case we set off
--           down another branch of the tree. Once we get to the original answer 
--           (FREC_DNSSEC_QUERY not set) and it validates, return it to the original requestor. */
--        while (forward->dependent)
--          {
-+            /* Validated original answer, all done. */
-+            if (!forward->dependent)
-+              break;
-+            
-+            /* validated subsdiary query, (and cached result)
-+               pop that and return to the previous query we were working on. */
-             struct frec *prev = forward->dependent;
-             free_frec(forward);
-             forward = prev;
-             forward->blocking_query = NULL; /* already gone */
-             blockdata_retrieve(forward->stash, forward->stash_len, (void *)header);
-             n = forward->stash_len;
--            
--            if (status == STAT_SECURE)
--              {
--                if (forward->flags & FREC_DNSKEY_QUERY)
--                  status = dnssec_validate_by_ds(now, header, n, daemon->namebuff, daemon->keyname, forward->class);
--                else if (forward->flags & FREC_DS_QUERY)
--                  {
--                    status = dnssec_validate_ds(now, header, n, daemon->namebuff, daemon->keyname, forward->class);
--                     /* Provably no DS, everything below is insecure, even if signatures are offered */
--                    if (status == STAT_NO_DS)
--                      /* We only cache sigs when we've validated a reply.
--                         Avoid caching a reply with sigs if there's a vaildated break in the 
--                         DS chain, so we don't return replies from cache missing sigs. */
--                      status = STAT_INSECURE_DS;
--                     else if (status == STAT_NO_SIG)
--                       {
--                         if (option_bool(OPT_DNSSEC_NO_SIGN))
--                           {
--                             status = send_check_sign(forward, now, header, n, daemon->namebuff, daemon->keyname); 
--                             if (status == STAT_INSECURE)
--                               status = STAT_INSECURE_DS;
--                           }
--                         else
--                           status = STAT_INSECURE_DS;
--                       }
--                     else if (status == STAT_NO_NS)
--                       status = STAT_BOGUS;
--                  }
--                else if (forward->flags & FREC_CHECK_NOSIGN)
--                  {
--                    status = dnssec_validate_ds(now, header, n, daemon->namebuff, daemon->keyname, forward->class);
--                    if (status != STAT_NEED_KEY)
--                      status = do_check_sign(forward, status, now, daemon->namebuff, daemon->keyname);
--                  }
--                else
--                  {
--                    status = dnssec_validate_reply(now, header, n, daemon->namebuff, daemon->keyname, &forward->class, NULL, NULL);   
--                    if (status == STAT_NO_SIG)
--                      {
--                        if (option_bool(OPT_DNSSEC_NO_SIGN))
--                          status = send_check_sign(forward, now, header, n, daemon->namebuff, daemon->keyname);
--                        else
--                          status = STAT_INSECURE;
--                      }
--                  }
--             
--                if (status == STAT_NEED_DS || status == STAT_NEED_DS_NEG || status == STAT_NEED_KEY)
--                  goto anotherkey;
--              }
-           }
-+      
-         
-         no_cache_dnssec = 0;
--
--        if (status == STAT_INSECURE_DS)
--          {
--            /* We only cache sigs when we've validated a reply.
--               Avoid caching a reply with sigs if there's a vaildated break in the 
--               DS chain, so we don't return replies from cache missing sigs. */
--            status = STAT_INSECURE;
--            no_cache_dnssec = 1;
--          }
-         
-         if (status == STAT_TRUNCATED)
-           header->hb3 |= HB3_TC;
-@@ -1062,7 +959,7 @@ void reply_query(int fd, int family, time_t now)
-           {
-             char *result, *domain = "result";
-             
--            if (forward->work_counter == 0)
-+            if (status == STAT_ABANDONED)
-               {
-                 result = "ABANDONED";
-                 status = STAT_BOGUS;
-@@ -1072,7 +969,7 @@ void reply_query(int fd, int family, time_t now)
-             
-             if (status == STAT_BOGUS && extract_request(header, n, daemon->namebuff, NULL))
-               domain = daemon->namebuff;
--
-+            
-             log_query(F_KEYTAG | F_SECSTAT, domain, NULL, result);
-           }
-         
-@@ -1415,315 +1312,49 @@ void receive_query(struct listener *listen, time_t now)
- }
- #ifdef HAVE_DNSSEC
--
--/* UDP: we've got an unsigned answer, return STAT_INSECURE if we can prove there's no DS
--   and therefore the answer shouldn't be signed, or STAT_BOGUS if it should be, or 
--   STAT_NEED_DS_NEG and keyname if we need to do the query. */
--static int send_check_sign(struct frec *forward, time_t now, struct dns_header *header, size_t plen, 
--                         char *name, char *keyname)
--{
--  int status = dnssec_chase_cname(now, header, plen, name, keyname);
--  
--  if (status != STAT_INSECURE)
--    return status;
--
--  /* Store the domain we're trying to check. */
--  forward->name_start = strlen(name);
--  forward->name_len = forward->name_start + 1;
--  if (!(forward->orig_domain = blockdata_alloc(name, forward->name_len)))
--    return STAT_BOGUS;
--  
--  return do_check_sign(forward, 0, now, name, keyname);
--}
-- 
--/* We either have a a reply (header non-NULL, or we need to start by looking in the cache */ 
--static int do_check_sign(struct frec *forward, int status, time_t now, char *name, char *keyname)
--{
--  /* get domain we're checking back from blockdata store, it's stored on the original query. */
--  while (forward->dependent && !forward->orig_domain)
--    forward = forward->dependent;
--
--  blockdata_retrieve(forward->orig_domain, forward->name_len, name);
--  
--  while (1)
--    {
--      char *p; 
--
--      if (status == 0)
--      {
--        struct crec *crecp;
--
--        /* Haven't received answer, see if in cache */
--        if (!(crecp = cache_find_by_name(NULL, &name[forward->name_start], now, F_DS)))
--          {
--            /* put name of DS record we're missing into keyname */
--            strcpy(keyname, &name[forward->name_start]);
--            /* and wait for reply to arrive */
--            return STAT_NEED_DS_NEG;
--          }
--
--        /* F_DNSSECOK misused in DS cache records to non-existance of NS record */ 
--        if (!(crecp->flags & F_NEG))
--          status = STAT_SECURE;
--        else if (crecp->flags & F_DNSSECOK)
--          status = STAT_NO_DS;
--        else
--          status = STAT_NO_NS;
--      }
--      
--      /* Have entered non-signed part of DNS tree. */ 
--      if (status == STAT_NO_DS)
--      return forward->dependent ? STAT_INSECURE_DS : STAT_INSECURE;
--
--      if (status == STAT_BOGUS)
--      return STAT_BOGUS;
--
--      if (status == STAT_NO_SIG && *keyname != 0)
--      {
--        /* There is a validated CNAME chain that doesn't end in a DS record. Start 
--           the search again in that domain. */
--        blockdata_free(forward->orig_domain);
--        forward->name_start = strlen(keyname);
--        forward->name_len = forward->name_start + 1;
--        if (!(forward->orig_domain = blockdata_alloc(keyname, forward->name_len)))
--          return STAT_BOGUS;
--        
--        strcpy(name, keyname);
--        status = 0; /* force to cache when we iterate. */
--        continue;
--      }
--      
--      /* There's a proven DS record, or we're within a zone, where there doesn't need
--       to be a DS record. Add a name and try again. 
--       If we've already tried the whole name, then fail */
--
--      if (forward->name_start == 0)
--      return STAT_BOGUS;
--      
--      for (p = &name[forward->name_start-2]; (*p != '.') && (p != name); p--);
--      
--      if (p != name)
--      p++;
--      
--      forward->name_start = p - name;
--      status = 0; /* force to cache when we iterate. */
--    }
--}
--
--/* Move down from the root, until we find a signed non-existance of a DS, in which case
--   an unsigned answer is OK, or we find a signed DS, in which case there should be 
--   a signature, and the answer is BOGUS */
--static int  tcp_check_for_unsigned_zone(time_t now, struct dns_header *header, size_t plen, int class, char *name, 
--                                      char *keyname, struct server *server, int *keycount)
--{
--  size_t m;
--  unsigned char *packet, *payload;
--  u16 *length;
--  int status, name_len;
--  struct blockdata *block;
--
--  char *name_start;
--
--  /* Get first insecure entry in CNAME chain */
--  status = tcp_key_recurse(now, STAT_CHASE_CNAME, header, plen, class, name, keyname, server, keycount);
--  if (status == STAT_BOGUS)
--    return STAT_BOGUS;
--  
--  if (!(packet = whine_malloc(65536 + MAXDNAME + RRFIXEDSZ + sizeof(u16))))
--    return STAT_BOGUS;
--  
--  payload = &packet[2];
--  header = (struct dns_header *)payload;
--  length = (u16 *)packet;
--
--  /* Stash the name away, since the buffer will be trashed when we recurse */
--  name_len = strlen(name) + 1;
--  name_start = name + name_len - 1;
--  
--  if (!(block = blockdata_alloc(name, name_len)))
--    {
--      free(packet);
--      return STAT_BOGUS;
--    }
--
--  while (1)
--    {
--      unsigned char c1, c2;
--      struct crec *crecp;
--
--      if (--(*keycount) == 0)
--      {
--        free(packet);
--        blockdata_free(block);
--        return STAT_BOGUS;    
--      }
--      
--      while ((crecp = cache_find_by_name(NULL, name_start, now, F_DS)))
--      {      
--        if ((crecp->flags & F_NEG) && (crecp->flags & F_DNSSECOK))
--          {
--            /* Found a secure denial of DS - delegation is indeed insecure */
--            free(packet);
--            blockdata_free(block);
--            return STAT_INSECURE;
--          }
--      
--        /* Here, either there's a secure DS, or no NS and no DS, and therefore no delegation.
--           Add another label and continue. */
-- 
--        if (name_start == name)
--          {
--            free(packet);
--            blockdata_free(block);
--            return STAT_BOGUS; /* run out of labels */
--          }
--        
--        name_start -= 2;
--        while (*name_start != '.' && name_start != name) 
--          name_start--;
--        if (name_start != name)
--          name_start++;
--      }
--      
--      /* Can't find it in the cache, have to send a query */
--
--      m = dnssec_generate_query(header, ((char *) header) + 65536, name_start, class, T_DS, &server->addr, server->edns_pktsz);
--      
--      *length = htons(m);
--      
--      if (read_write(server->tcpfd, packet, m + sizeof(u16), 0) &&
--        read_write(server->tcpfd, &c1, 1, 1) &&
--        read_write(server->tcpfd, &c2, 1, 1) &&
--        read_write(server->tcpfd, payload, (c1 << 8) | c2, 1))
--      {
--        m = (c1 << 8) | c2;
--        
--        /* Note this trashes all three name workspaces */
--        status = tcp_key_recurse(now, STAT_NEED_DS_NEG, header, m, class, name, keyname, server, keycount);
--        
--        if (status == STAT_NO_DS)
--          {
--            /* Found a secure denial of DS - delegation is indeed insecure */
--            free(packet);
--            blockdata_free(block);
--            return STAT_INSECURE;
--          }
--        
--        if (status == STAT_NO_SIG && *keyname != 0)
--          {
--            /* There is a validated CNAME chain that doesn't end in a DS record. Start 
--               the search again in that domain. */
--            blockdata_free(block);
--            name_len = strlen(keyname) + 1;
--            name_start = name + name_len - 1;
--            
--            if (!(block = blockdata_alloc(keyname, name_len)))
--              return STAT_BOGUS;
--            
--            strcpy(name, keyname);
--            continue;
--          }
--        
--        if (status == STAT_BOGUS)
--          {
--            free(packet);
--            blockdata_free(block);
--            return STAT_BOGUS;
--          }
--        
--        /* Here, either there's a secure DS, or no NS and no DS, and therefore no delegation.
--           Add another label and continue. */
--        
--        /* Get name we're checking back. */
--        blockdata_retrieve(block, name_len, name);
--        
--        if (name_start == name)
--          {
--            free(packet);
--            blockdata_free(block);
--            return STAT_BOGUS; /* run out of labels */
--          }
--        
--        name_start -= 2;
--        while (*name_start != '.' && name_start != name) 
--          name_start--;
--        if (name_start != name)
--          name_start++;
--      }
--      else
--      {
--        /* IO failure */
--        free(packet);
--        blockdata_free(block);
--        return STAT_BOGUS; /* run out of labels */
--      }
--    }
--}
--
- static int tcp_key_recurse(time_t now, int status, struct dns_header *header, size_t n, 
-                          int class, char *name, char *keyname, struct server *server, int *keycount)
- {
-   /* Recurse up the key heirarchy */
-   int new_status;
-+  unsigned char *packet = NULL;
-+  size_t m; 
-+  unsigned char *payload = NULL;
-+  struct dns_header *new_header = NULL;
-+  u16 *length = NULL;
-+  unsigned char c1, c2;
--  /* limit the amount of work we do, to avoid cycling forever on loops in the DNS */
--  if (--(*keycount) == 0)
--    return STAT_INSECURE;
--  
--  if (status == STAT_NEED_KEY)
--    new_status = dnssec_validate_by_ds(now, header, n, name, keyname, class);
--  else if (status == STAT_NEED_DS || status == STAT_NEED_DS_NEG)
-+  while (1)
-     {
--      new_status = dnssec_validate_ds(now, header, n, name, keyname, class);
--      if (status == STAT_NEED_DS)
-+      /* limit the amount of work we do, to avoid cycling forever on loops in the DNS */
-+      if (--(*keycount) == 0)
-+      new_status = STAT_ABANDONED;
-+      else if (status == STAT_NEED_KEY)
-+      new_status = dnssec_validate_by_ds(now, header, n, name, keyname, class);
-+      else if (status == STAT_NEED_DS)
-+      new_status = dnssec_validate_ds(now, header, n, name, keyname, class);
-+      else 
-+      new_status = dnssec_validate_reply(now, header, n, name, keyname, &class, option_bool(OPT_DNSSEC_NO_SIGN), NULL, NULL);
-+      
-+      if (new_status != STAT_NEED_DS && new_status != STAT_NEED_KEY)
-+      break;
-+
-+      /* Can't validate because we need a key/DS whose name now in keyname.
-+       Make query for same, and recurse to validate */
-+      if (!packet)
-       {
--        if (new_status == STAT_NO_DS)
--          new_status = STAT_INSECURE_DS;
--        if (new_status == STAT_NO_SIG)
--         {
--           if (option_bool(OPT_DNSSEC_NO_SIGN))
--             {
--               new_status = tcp_check_for_unsigned_zone(now, header, n, class, name, keyname, server, keycount);
--               if (new_status == STAT_INSECURE)
--                 new_status = STAT_INSECURE_DS;
--             }
--           else
--             new_status = STAT_INSECURE_DS;
--         }
--        else if (new_status == STAT_NO_NS)
--          new_status = STAT_BOGUS;
-+        packet = whine_malloc(65536 + MAXDNAME + RRFIXEDSZ + sizeof(u16));
-+        payload = &packet[2];
-+        new_header = (struct dns_header *)payload;
-+        length = (u16 *)packet;
-       }
--    }
--  else if (status == STAT_CHASE_CNAME)
--    new_status = dnssec_chase_cname(now, header, n, name, keyname);
--  else 
--    {
--      new_status = dnssec_validate_reply(now, header, n, name, keyname, &class, NULL, NULL);
-       
--      if (new_status == STAT_NO_SIG)
-+      if (!packet)
-       {
--        if (option_bool(OPT_DNSSEC_NO_SIGN))
--          new_status = tcp_check_for_unsigned_zone(now, header, n, class, name, keyname, server, keycount);
--        else
--          new_status = STAT_INSECURE;
-+        new_status = STAT_ABANDONED;
-+        break;
-       }
--    }
--
--  /* Can't validate because we need a key/DS whose name now in keyname.
--     Make query for same, and recurse to validate */
--  if (new_status == STAT_NEED_DS || new_status == STAT_NEED_KEY)
--    {
--      size_t m; 
--      unsigned char *packet = whine_malloc(65536 + MAXDNAME + RRFIXEDSZ + sizeof(u16));
--      unsigned char *payload = &packet[2];
--      struct dns_header *new_header = (struct dns_header *)payload;
--      u16 *length = (u16 *)packet;
--      unsigned char c1, c2;
--       
--      if (!packet)
--      return STAT_INSECURE;
--
--    another_tcp_key:
-+       
-       m = dnssec_generate_query(new_header, ((char *) new_header) + 65536, keyname, class, 
-                               new_status == STAT_NEED_KEY ? T_DNSKEY : T_DS, &server->addr, server->edns_pktsz);
-       
-@@ -1733,65 +1364,22 @@ static int tcp_key_recurse(time_t now, int status, struct dns_header *header, si
-         !read_write(server->tcpfd, &c1, 1, 1) ||
-         !read_write(server->tcpfd, &c2, 1, 1) ||
-         !read_write(server->tcpfd, payload, (c1 << 8) | c2, 1))
--      new_status = STAT_INSECURE;
--      else
-       {
--        m = (c1 << 8) | c2;
--        
--        new_status = tcp_key_recurse(now, new_status, new_header, m, class, name, keyname, server, keycount);
--        
--        if (new_status == STAT_SECURE)
--          {
--            /* Reached a validated record, now try again at this level.
--               Note that we may get ANOTHER NEED_* if an answer needs more than one key.
--               If so, go round again. */
--            
--            if (status == STAT_NEED_KEY)
--              new_status = dnssec_validate_by_ds(now, header, n, name, keyname, class);
--            else if (status == STAT_NEED_DS || status == STAT_NEED_DS_NEG)
--              {
--                new_status = dnssec_validate_ds(now, header, n, name, keyname, class);
--                if (status == STAT_NEED_DS)
--                  {
--                    if (new_status == STAT_NO_DS)
--                      new_status = STAT_INSECURE_DS;
--                    else if (new_status == STAT_NO_SIG)
--                      {
--                        if (option_bool(OPT_DNSSEC_NO_SIGN))
--                          {
--                            new_status = tcp_check_for_unsigned_zone(now, header, n, class, name, keyname, server, keycount); 
--                            if (new_status == STAT_INSECURE)
--                              new_status = STAT_INSECURE_DS;
--                          }
--                        else
--                          new_status = STAT_INSECURE_DS;
--                      }
--                    else if (new_status == STAT_NO_NS)
--                      new_status = STAT_BOGUS;
--                  }
--              }
--            else if (status == STAT_CHASE_CNAME)
--              new_status = dnssec_chase_cname(now, header, n, name, keyname);
--            else 
--              {
--                new_status = dnssec_validate_reply(now, header, n, name, keyname, &class, NULL, NULL);
--                
--                if (new_status == STAT_NO_SIG)
--                  {
--                    if (option_bool(OPT_DNSSEC_NO_SIGN))
--                      new_status = tcp_check_for_unsigned_zone(now, header, n, class, name, keyname, server, keycount);
--                    else
--                      new_status = STAT_INSECURE;
--                  }
--              }
--            
--            if (new_status == STAT_NEED_DS || new_status == STAT_NEED_KEY)
--              goto another_tcp_key;
--          }
-+        new_status = STAT_ABANDONED;
-+        break;
-       }
-+
-+      m = (c1 << 8) | c2;
-       
--      free(packet);
-+      new_status = tcp_key_recurse(now, new_status, new_header, m, class, name, keyname, server, keycount);
-+      
-+      if (new_status != STAT_OK)
-+      break;
-     }
-+
-+  if (packet)
-+    free(packet);
-+    
-   return new_status;
- }
- #endif
-@@ -2075,19 +1663,10 @@ unsigned char *tcp_request(int confd, time_t now,
-                     if (option_bool(OPT_DNSSEC_VALID) && !checking_disabled)
-                       {
-                         int keycount = DNSSEC_WORK; /* Limit to number of DNSSEC questions, to catch loops and avoid filling cache. */
--                        int status = tcp_key_recurse(now, STAT_TRUNCATED, header, m, 0, daemon->namebuff, daemon->keyname, last_server, &keycount);
-+                        int status = tcp_key_recurse(now, STAT_OK, header, m, 0, daemon->namebuff, daemon->keyname, last_server, &keycount);
-                         char *result, *domain = "result";
--
--                        if (status == STAT_INSECURE_DS)
--                          {
--                            /* We only cache sigs when we've validated a reply.
--                               Avoid caching a reply with sigs if there's a vaildated break in the 
--                               DS chain, so we don't return replies from cache missing sigs. */
--                            status = STAT_INSECURE;
--                            no_cache_dnssec = 1;
--                          }
-                         
--                        if (keycount == 0)
-+                        if (status == STAT_ABANDONED)
-                           {
-                             result = "ABANDONED";
-                             status = STAT_BOGUS;
-@@ -2179,7 +1758,6 @@ static struct frec *allocate_frec(time_t now)
-       f->dependent = NULL;
-       f->blocking_query = NULL;
-       f->stash = NULL;
--      f->orig_domain = NULL;
- #endif
-       daemon->frec_list = f;
-     }
-@@ -2248,12 +1826,6 @@ static void free_frec(struct frec *f)
-       f->stash = NULL;
-     }
--  if (f->orig_domain)
--    {
--      blockdata_free(f->orig_domain);
--      f->orig_domain = NULL;
--    }
--
-   /* Anything we're waiting on is pointless now, too */
-   if (f->blocking_query)
-     free_frec(f->blocking_query);
-@@ -2281,14 +1853,23 @@ struct frec *get_new_frec(time_t now, int *wait, int force)
-       target = f;
-     else 
-       {
--      if (difftime(now, f->time) >= 4*TIMEOUT)
--        {
--          free_frec(f);
--          target = f;
--        }
--      
--      if (!oldest || difftime(f->time, oldest->time) <= 0)
--        oldest = f;
-+#ifdef HAVE_DNSSEC
-+          /* Don't free DNSSEC sub-queries here, as we may end up with
-+             dangling references to them. They'll go when their "real" query 
-+             is freed. */
-+          if (!f->dependent)
-+#endif
-+            {
-+              if (difftime(now, f->time) >= 4*TIMEOUT)
-+                {
-+                  free_frec(f);
-+                  target = f;
-+                }
-+           
-+          
-+              if (!oldest || difftime(f->time, oldest->time) <= 0)
-+                oldest = f;
-+            }
-       }
-   if (target)
--- 
-1.7.10.4
-
diff --git a/src/patches/dnsmasq/017-Abandon_caching_RRSIGs_and_returning_them_from_cache.patch b/src/patches/dnsmasq/017-Abandon_caching_RRSIGs_and_returning_them_from_cache.patch
deleted file mode 100644 (file)
index 5ffaf97..0000000
+++ /dev/null
@@ -1,612 +0,0 @@
-From 93be5b1e023b0c661e1ec2cd6d811a8ec9055c49 Mon Sep 17 00:00:00 2001
-From: Simon Kelley <simon@thekelleys.org.uk>
-Date: Tue, 15 Dec 2015 12:04:40 +0000
-Subject: [PATCH] Abandon caching RRSIGs and returning them from cache.
-
-The list of exceptions to being able to locally answer
-cached data for validated records when DNSSEC data is requested
-was getting too long, so don't ever do that. This means
-that the cache no longer has to hold RRSIGS and allows
-us to lose lots of code. Note that cached validated
-answers are still returned as long as do=0
----
- src/cache.c   |   38 ++---------
- src/dnsmasq.h |   10 +--
- src/dnssec.c  |   94 ++++-----------------------
- src/rfc1035.c |  197 ++++++---------------------------------------------------
- 4 files changed, 42 insertions(+), 297 deletions(-)
-
-diff --git a/src/cache.c b/src/cache.c
-index 1b76b67..51ba7cc 100644
---- a/src/cache.c
-+++ b/src/cache.c
-@@ -189,12 +189,7 @@ static void cache_hash(struct crec *crecp)
- static void cache_blockdata_free(struct crec *crecp)
- {
-   if (crecp->flags & F_DNSKEY)
--    {
--      if (crecp->flags & F_DS)
--      blockdata_free(crecp->addr.sig.keydata);
--      else
--      blockdata_free(crecp->addr.key.keydata);
--    }
-+    blockdata_free(crecp->addr.key.keydata);
-   else if ((crecp->flags & F_DS) && !(crecp->flags & F_NEG))
-     blockdata_free(crecp->addr.ds.keydata);
- }
-@@ -369,13 +364,8 @@ static struct crec *cache_scan_free(char *name, struct all_addr *addr, time_t no
-               }
-             
- #ifdef HAVE_DNSSEC
--            /* Deletion has to be class-sensitive for DS, DNSKEY, RRSIG, also 
--               type-covered sensitive for  RRSIG */
--            if ((flags & (F_DNSKEY | F_DS)) &&
--                (flags & (F_DNSKEY | F_DS)) == (crecp->flags & (F_DNSKEY | F_DS)) &&
--                crecp->uid == addr->addr.dnssec.class &&
--                (!((flags & (F_DS | F_DNSKEY)) == (F_DS | F_DNSKEY)) || 
--                 crecp->addr.sig.type_covered == addr->addr.dnssec.type))
-+            /* Deletion has to be class-sensitive for DS and DNSKEY */
-+            if ((flags & crecp->flags & (F_DNSKEY | F_DS)) && crecp->uid == addr->addr.dnssec.class)
-               {
-                 if (crecp->flags & F_CONFIG)
-                   return crecp;
-@@ -532,13 +522,9 @@ struct crec *cache_insert(char *name, struct all_addr *addr,
-           struct all_addr free_addr = new->addr.addr;;
- #ifdef HAVE_DNSSEC
--          /* For DNSSEC records, addr holds class and type_covered for RRSIG */
-+          /* For DNSSEC records, addr holds class. */
-           if (new->flags & (F_DS | F_DNSKEY))
--            {
--              free_addr.addr.dnssec.class = new->uid;
--              if ((new->flags & (F_DS | F_DNSKEY)) == (F_DS | F_DNSKEY))
--                free_addr.addr.dnssec.type = new->addr.sig.type_covered;
--            }
-+            free_addr.addr.dnssec.class = new->uid;
- #endif
-           
-           free_avail = 1; /* Must be free space now. */
-@@ -653,9 +639,6 @@ struct crec *cache_find_by_name(struct crec *crecp, char *name, time_t now, unsi
-         if (!is_expired(now, crecp) && !is_outdated_cname_pointer(crecp))
-           {
-             if ((crecp->flags & F_FORWARD) && 
--#ifdef HAVE_DNSSEC
--                (((crecp->flags & (F_DNSKEY | F_DS)) == (prot & (F_DNSKEY | F_DS))) || (prot & F_NSIGMATCH)) &&
--#endif
-                 (crecp->flags & prot) &&
-                 hostname_isequal(cache_get_name(crecp), name))
-               {
-@@ -713,9 +696,6 @@ struct crec *cache_find_by_name(struct crec *crecp, char *name, time_t now, unsi
-   if (ans && 
-       (ans->flags & F_FORWARD) &&
--#ifdef HAVE_DNSSEC
--      (((ans->flags & (F_DNSKEY | F_DS)) == (prot & (F_DNSKEY | F_DS))) || (prot & F_NSIGMATCH)) &&
--#endif
-       (ans->flags & prot) &&     
-       hostname_isequal(cache_get_name(ans), name))
-     return ans;
-@@ -1472,11 +1452,7 @@ void dump_cache(time_t now)
- #ifdef HAVE_DNSSEC
-           else if (cache->flags & F_DS)
-             {
--              if (cache->flags & F_DNSKEY)
--                /* RRSIG */
--                sprintf(a, "%5u %3u %s", cache->addr.sig.keytag,
--                        cache->addr.sig.algo, querystr("", cache->addr.sig.type_covered));
--              else if (!(cache->flags & F_NEG))
-+              if (!(cache->flags & F_NEG))
-                 sprintf(a, "%5u %3u %3u", cache->addr.ds.keytag,
-                         cache->addr.ds.algo, cache->addr.ds.digest);
-             }
-@@ -1502,8 +1478,6 @@ void dump_cache(time_t now)
-           else if (cache->flags & F_CNAME)
-             t = "C";
- #ifdef HAVE_DNSSEC
--          else if ((cache->flags & (F_DS | F_DNSKEY)) == (F_DS | F_DNSKEY))
--            t = "G"; /* DNSKEY and DS set -> RRISG */
-           else if (cache->flags & F_DS)
-             t = "S";
-           else if (cache->flags & F_DNSKEY)
-diff --git a/src/dnsmasq.h b/src/dnsmasq.h
-index 023a1cf..4344cae 100644
---- a/src/dnsmasq.h
-+++ b/src/dnsmasq.h
-@@ -398,14 +398,9 @@ struct crec {
-       unsigned char algo;
-       unsigned char digest; 
-     } ds; 
--    struct {
--      struct blockdata *keydata;
--      unsigned short keylen, type_covered, keytag;
--      char algo;
--    } sig;
-   } addr;
-   time_t ttd; /* time to die */
--  /* used as class if DNSKEY/DS/RRSIG, index to source for F_HOSTS */
-+  /* used as class if DNSKEY/DS, index to source for F_HOSTS */
-   unsigned int uid; 
-   unsigned short flags;
-   union {
-@@ -445,8 +440,7 @@ struct crec {
- #define F_SECSTAT   (1u<<24)
- #define F_NO_RR     (1u<<25)
- #define F_IPSET     (1u<<26)
--#define F_NSIGMATCH (1u<<27)
--#define F_NOEXTRA   (1u<<28)
-+#define F_NOEXTRA   (1u<<27)
- /* Values of uid in crecs with F_CONFIG bit set. */
- #define SRC_INTERFACE 0
-diff --git a/src/dnssec.c b/src/dnssec.c
-index de7b335..1ae03a6 100644
---- a/src/dnssec.c
-+++ b/src/dnssec.c
-@@ -1004,7 +1004,7 @@ int dnssec_validate_by_ds(time_t now, struct dns_header *header, size_t plen, ch
- {
-   unsigned char *psave, *p = (unsigned char *)(header+1);
-   struct crec *crecp, *recp1;
--  int rc, j, qtype, qclass, ttl, rdlen, flags, algo, valid, keytag, type_covered;
-+  int rc, j, qtype, qclass, ttl, rdlen, flags, algo, valid, keytag;
-   struct blockdata *key;
-   struct all_addr a;
-@@ -1115,7 +1115,7 @@ int dnssec_validate_by_ds(time_t now, struct dns_header *header, size_t plen, ch
-   if (valid)
-     {
--      /* DNSKEY RRset determined to be OK, now cache it and the RRsigs that sign it. */
-+      /* DNSKEY RRset determined to be OK, now cache it. */
-       cache_start_insert();
-       
-       p = skip_questions(header, plen);
-@@ -1155,7 +1155,10 @@ int dnssec_validate_by_ds(time_t now, struct dns_header *header, size_t plen, ch
-                 if ((key = blockdata_alloc((char*)p, rdlen - 4)))
-                   {
-                     if (!(recp1 = cache_insert(name, &a, now, ttl, F_FORWARD | F_DNSKEY | F_DNSSECOK)))
--                      blockdata_free(key);
-+                      {
-+                        blockdata_free(key);
-+                        return STAT_BOGUS;
-+                      }
-                     else
-                       {
-                         a.addr.keytag = keytag;
-@@ -1169,38 +1172,7 @@ int dnssec_validate_by_ds(time_t now, struct dns_header *header, size_t plen, ch
-                       }
-                   }
-               }
--            else if (qtype == T_RRSIG)
--              {
--                /* RRSIG, cache if covers DNSKEY RRset */
--                if (rdlen < 18)
--                  return STAT_BOGUS; /* bad packet */
--                
--                GETSHORT(type_covered, p);
--                
--                if (type_covered == T_DNSKEY)
--                  {
--                    a.addr.dnssec.class = class;
--                    a.addr.dnssec.type = type_covered;
--                    
--                    algo = *p++;
--                    p += 13; /* labels, orig_ttl, expiration, inception */
--                    GETSHORT(keytag, p);      
--                    if ((key = blockdata_alloc((char*)psave, rdlen)))
--                      {
--                        if (!(crecp = cache_insert(name, &a, now, ttl,  F_FORWARD | F_DNSKEY | F_DS)))
--                          blockdata_free(key);
--                        else
--                          {
--                            crecp->addr.sig.keydata = key;
--                            crecp->addr.sig.keylen = rdlen;
--                            crecp->addr.sig.keytag = keytag;
--                            crecp->addr.sig.type_covered = type_covered;
--                            crecp->addr.sig.algo = algo;
--                          }
--                      }
--                  }
--              }
--            
-+                    
-             p = psave;
-           }
-@@ -1326,7 +1298,8 @@ int dnssec_validate_ds(time_t now, struct dns_header *header, size_t plen, char
-         cache_start_insert();
-         
-         a.addr.dnssec.class = class;
--        cache_insert(name, &a, now, ttl, flags);
-+        if (!cache_insert(name, &a, now, ttl, flags))
-+          return STAT_BOGUS;
-         
-         cache_end_insert();  
-         
-@@ -2028,14 +2001,13 @@ int dnssec_validate_reply(time_t now, struct dns_header *header, size_t plen, ch
-         /* Not done, validate now */
-         if (j == i)
-           {
--            int ttl, keytag, algo, digest, type_covered, sigcnt, rrcnt;
-+            int ttl, keytag, algo, digest, sigcnt, rrcnt;
-             unsigned char *psave;
-             struct all_addr a;
-             struct blockdata *key;
-             struct crec *crecp;
-             char *wildname;
--            int have_wildcard = 0;
--
-+            
-             if (!explore_rrset(header, plen, class1, type1, name, keyname, &sigcnt, &rrcnt))
-               return STAT_BOGUS;
-@@ -2096,8 +2068,6 @@ int dnssec_validate_reply(time_t now, struct dns_header *header, size_t plen, ch
-                           
-                 if (rc == STAT_SECURE_WILDCARD)
-                   {
--                    have_wildcard = 1;
--                    
-                     /* An attacker replay a wildcard answer with a different
-                        answer and overlay a genuine RR. To prove this
-                        hasn't happened, the answer must prove that
-@@ -2119,7 +2089,7 @@ int dnssec_validate_reply(time_t now, struct dns_header *header, size_t plen, ch
-                       return rc;
-                   } 
-                 
--                /* Cache RRsigs in answer section, and if we just validated a DS RRset, cache it */
-+                /* If we just validated a DS RRset, cache it */
-                 /* Also note if the RRset is the answer to the question, or the target of a CNAME */
-                 cache_start_insert();
-                 
-@@ -2168,45 +2138,7 @@ int dnssec_validate_reply(time_t now, struct dns_header *header, size_t plen, ch
-                                   } 
-                               }
-                           }
--                        else if (type2 == T_RRSIG)
--                          {
--                            if (rdlen2 < 18)
--                              return STAT_BOGUS; /* bad packet */
--                            
--                            GETSHORT(type_covered, p2);
--                            
--                            if (type_covered == type1 && 
--                                (type_covered == T_A || type_covered == T_AAAA ||
--                                 type_covered == T_CNAME || type_covered == T_DS || 
--                                 type_covered == T_DNSKEY || type_covered == T_PTR)) 
--                              {
--                                a.addr.dnssec.type = type_covered;
--                                a.addr.dnssec.class = class1;
--                                
--                                algo = *p2++;
--                                p2 += 13; /* labels, orig_ttl, expiration, inception */
--                                GETSHORT(keytag, p2);
--                                
--                                /* We don't cache sigs for wildcard answers, because to reproduce the
--                                   answer from the cache will require one or more NSEC/NSEC3 records 
--                                   which we don't cache. The lack of the RRSIG ensures that a query for
--                                   this RRset asking for a secure answer will always be forwarded. */
--                                if (!have_wildcard && (key = blockdata_alloc((char*)psave, rdlen2)))
--                                  {
--                                    if (!(crecp = cache_insert(name, &a, now, ttl,  F_FORWARD | F_DNSKEY | F_DS)))
--                                      blockdata_free(key);
--                                    else
--                                      {
--                                        crecp->addr.sig.keydata = key;
--                                        crecp->addr.sig.keylen = rdlen2;
--                                        crecp->addr.sig.keytag = keytag;
--                                        crecp->addr.sig.type_covered = type_covered;
--                                        crecp->addr.sig.algo = algo;
--                                      }
--                                  }
--                              }
--                          }
--                        
-+
-                         p2 = psave;
-                       }
-                     
-diff --git a/src/rfc1035.c b/src/rfc1035.c
-index 4eb1772..def8fa0 100644
---- a/src/rfc1035.c
-+++ b/src/rfc1035.c
-@@ -1275,11 +1275,9 @@ int check_for_local_domain(char *name, time_t now)
-   struct naptr *naptr;
-   /* Note: the call to cache_find_by_name is intended to find any record which matches
--     ie A, AAAA, CNAME, DS. Because RRSIG records are marked by setting both F_DS and F_DNSKEY,
--     cache_find_by name ordinarily only returns records with an exact match on those bits (ie
--     for the call below, only DS records). The F_NSIGMATCH bit changes this behaviour */
-+     ie A, AAAA, CNAME. */
--  if ((crecp = cache_find_by_name(NULL, name, now, F_IPV4 | F_IPV6 | F_CNAME | F_DS | F_NO_RR | F_NSIGMATCH)) &&
-+  if ((crecp = cache_find_by_name(NULL, name, now, F_IPV4 | F_IPV6 | F_CNAME |F_NO_RR)) &&
-       (crecp->flags & (F_HOSTS | F_DHCP | F_CONFIG)))
-     return 1;
-   
-@@ -1566,9 +1564,11 @@ size_t answer_request(struct dns_header *header, char *limit, size_t qlen,
-       GETSHORT(flags, pheader);
-       
-       if ((sec_reqd = flags & 0x8000))
--      *do_bit = 1;/* do bit */ 
-+      {
-+        *do_bit = 1;/* do bit */ 
-+        *ad_reqd = 1;
-+      }
--      *ad_reqd = 1;
-       dryrun = 1;
-     }
-@@ -1636,98 +1636,6 @@ size_t answer_request(struct dns_header *header, char *limit, size_t qlen,
-           }
-       }
--#ifdef HAVE_DNSSEC
--      if (option_bool(OPT_DNSSEC_VALID) && (qtype == T_DNSKEY || qtype == T_DS))
--      {
--        int gotone = 0;
--        struct blockdata *keydata;
--
--        /* Do we have RRSIG? Can't do DS or DNSKEY otherwise. */
--        if (sec_reqd)
--          {
--            crecp = NULL;
--            while ((crecp = cache_find_by_name(crecp, name, now, F_DNSKEY | F_DS)))
--              if (crecp->uid == qclass && crecp->addr.sig.type_covered == qtype)
--                break;
--          }
--        
--        if (!sec_reqd || crecp)
--          {
--            if (qtype == T_DS)
--              {
--                crecp = NULL;
--                while ((crecp = cache_find_by_name(crecp, name, now, F_DS)))
--                  if (crecp->uid == qclass)
--                    {
--                      gotone = 1; 
--                      if (!dryrun)
--                        {
--                          if (crecp->flags & F_NEG)
--                            {
--                              if (crecp->flags & F_NXDOMAIN)
--                                nxdomain = 1;
--                              log_query(F_UPSTREAM, name, NULL, "no DS");     
--                            }
--                          else if ((keydata = blockdata_retrieve(crecp->addr.ds.keydata, crecp->addr.ds.keylen, NULL)))
--                            {                                               
--                              struct all_addr a;
--                              a.addr.keytag =  crecp->addr.ds.keytag;
--                              log_query(F_KEYTAG | (crecp->flags & F_CONFIG), name, &a, "DS keytag %u");
--                              if (add_resource_record(header, limit, &trunc, nameoffset, &ansp, 
--                                                      crec_ttl(crecp, now), &nameoffset,
--                                                      T_DS, qclass, "sbbt", 
--                                                      crecp->addr.ds.keytag, crecp->addr.ds.algo, 
--                                                      crecp->addr.ds.digest, crecp->addr.ds.keylen, keydata))
--                                anscount++;
--                              
--                            } 
--                        }
--                    }
--              }
--            else /* DNSKEY */
--              {
--                crecp = NULL;
--                while ((crecp = cache_find_by_name(crecp, name, now, F_DNSKEY)))
--                  if (crecp->uid == qclass)
--                    {
--                      gotone = 1;
--                      if (!dryrun && (keydata = blockdata_retrieve(crecp->addr.key.keydata, crecp->addr.key.keylen, NULL)))
--                        {                                                   
--                          struct all_addr a;
--                          a.addr.keytag =  crecp->addr.key.keytag;
--                          log_query(F_KEYTAG | (crecp->flags & F_CONFIG), name, &a, "DNSKEY keytag %u");
--                          if (add_resource_record(header, limit, &trunc, nameoffset, &ansp, 
--                                                  crec_ttl(crecp, now), &nameoffset,
--                                                  T_DNSKEY, qclass, "sbbt", 
--                                                  crecp->addr.key.flags, 3, crecp->addr.key.algo, crecp->addr.key.keylen, keydata))
--                            anscount++;
--                        }
--                    }
--              }
--          }
--        
--        /* Now do RRSIGs */
--        if (gotone)
--          {
--            ans = 1;
--            auth = 0;
--            if (!dryrun && sec_reqd)
--              {
--                crecp = NULL;
--                while ((crecp = cache_find_by_name(crecp, name, now, F_DNSKEY | F_DS)))
--                  if (crecp->uid == qclass && crecp->addr.sig.type_covered == qtype &&
--                      (keydata = blockdata_retrieve(crecp->addr.sig.keydata, crecp->addr.sig.keylen, NULL)))
--                    {
--                      add_resource_record(header, limit, &trunc, nameoffset, &ansp, 
--                                          crec_ttl(crecp, now), &nameoffset,
--                                          T_RRSIG, qclass, "t", crecp->addr.sig.keylen, keydata);
--                      anscount++;
--                    }
--              }
--          }
--      }
--#endif             
--      
-       if (qclass == C_IN)
-       {
-         struct txt_record *t;
-@@ -1736,6 +1644,7 @@ size_t answer_request(struct dns_header *header, char *limit, size_t qlen,
-           if ((t->class == qtype || qtype == T_ANY) && hostname_isequal(name, t->name))
-             {
-               ans = 1;
-+              sec_data = 0;
-               if (!dryrun)
-                 {
-                   log_query(F_CONFIG | F_RRNAME, name, NULL, "<RR>");
-@@ -1792,6 +1701,7 @@ size_t answer_request(struct dns_header *header, char *limit, size_t qlen,
-             
-             if (intr)
-               {
-+                sec_data = 0;
-                 ans = 1;
-                 if (!dryrun)
-                   {
-@@ -1805,6 +1715,7 @@ size_t answer_request(struct dns_header *header, char *limit, size_t qlen,
-             else if (ptr)
-               {
-                 ans = 1;
-+                sec_data = 0;
-                 if (!dryrun)
-                   {
-                     log_query(F_CONFIG | F_RRNAME, name, NULL, "<PTR>");
-@@ -1819,38 +1730,8 @@ size_t answer_request(struct dns_header *header, char *limit, size_t qlen,
-               }
-             else if ((crecp = cache_find_by_addr(NULL, &addr, now, is_arpa)))
-               {
--                if (!(crecp->flags & (F_HOSTS | F_DHCP | F_CONFIG)) && sec_reqd)
--                  {
--                    if (!option_bool(OPT_DNSSEC_VALID) || ((crecp->flags & F_NEG) && (crecp->flags & F_DNSSECOK)))
--                      crecp = NULL;
--#ifdef HAVE_DNSSEC
--                    else if (crecp->flags & F_DNSSECOK)
--                      {
--                        int gotsig = 0;
--                        struct crec *rr_crec = NULL;
--
--                        while ((rr_crec = cache_find_by_name(rr_crec, name, now, F_DS | F_DNSKEY)))
--                          {
--                            if (rr_crec->addr.sig.type_covered == T_PTR && rr_crec->uid == C_IN)
--                              {
--                                char *sigdata = blockdata_retrieve(rr_crec->addr.sig.keydata, rr_crec->addr.sig.keylen, NULL);
--                                gotsig = 1;
--                                
--                                if (!dryrun && 
--                                    add_resource_record(header, limit, &trunc, nameoffset, &ansp, 
--                                                        rr_crec->ttd - now, &nameoffset,
--                                                        T_RRSIG, C_IN, "t", crecp->addr.sig.keylen, sigdata))
--                                  anscount++;
--                              }
--                          } 
--                        
--                        if (!gotsig)
--                          crecp = NULL;
--                      }
--#endif
--                  }
--
--                if (crecp)
-+                /* Don't use cache when DNSSEC data required. */
-+                if ((crecp->flags & (F_HOSTS | F_DHCP | F_CONFIG)) || !sec_reqd || !(crecp->flags & F_DNSSECOK))
-                   {
-                     do 
-                       { 
-@@ -1860,19 +1741,19 @@ size_t answer_request(struct dns_header *header, char *limit, size_t qlen,
-                         
-                         if (!(crecp->flags & F_DNSSECOK))
-                           sec_data = 0;
--                        
-+                         
-+                        ans = 1;
-+                         
-                         if (crecp->flags & F_NEG)
-                           {
--                            ans = 1;
-                             auth = 0;
-                             if (crecp->flags & F_NXDOMAIN)
-                               nxdomain = 1;
-                             if (!dryrun)
-                               log_query(crecp->flags & ~F_FORWARD, name, &addr, NULL);
-                           }
--                        else if ((crecp->flags & (F_HOSTS | F_DHCP)) || !sec_reqd || option_bool(OPT_DNSSEC_VALID))
-+                        else
-                           {
--                            ans = 1;
-                             if (!(crecp->flags & (F_HOSTS | F_DHCP)))
-                               auth = 0;
-                             if (!dryrun)
-@@ -1892,6 +1773,7 @@ size_t answer_request(struct dns_header *header, char *limit, size_t qlen,
-             else if (is_rev_synth(is_arpa, &addr, name))
-               {
-                 ans = 1;
-+                sec_data = 0;
-                 if (!dryrun)
-                   {
-                     log_query(F_CONFIG | F_REVERSE | is_arpa, name, &addr, NULL); 
-@@ -1908,6 +1790,7 @@ size_t answer_request(struct dns_header *header, char *limit, size_t qlen,
-               {
-                 /* if not in cache, enabled and private IPV4 address, return NXDOMAIN */
-                 ans = 1;
-+                sec_data = 0;
-                 nxdomain = 1;
-                 if (!dryrun)
-                   log_query(F_CONFIG | F_REVERSE | F_IPV4 | F_NEG | F_NXDOMAIN, 
-@@ -1955,6 +1838,7 @@ size_t answer_request(struct dns_header *header, char *limit, size_t qlen,
-                 if (i == 4)
-                   {
-                     ans = 1;
-+                    sec_data = 0;
-                     if (!dryrun)
-                       {
-                         addr.addr.addr4.s_addr = htonl(a);
-@@ -1993,6 +1877,7 @@ size_t answer_request(struct dns_header *header, char *limit, size_t qlen,
-                               continue;
- #endif        
-                             ans = 1;  
-+                            sec_data = 0;
-                             if (!dryrun)
-                               {
-                                 gotit = 1;
-@@ -2032,48 +1917,8 @@ size_t answer_request(struct dns_header *header, char *limit, size_t qlen,
-                     crecp = save;
-                   }
--                /* If the client asked for DNSSEC and we can't provide RRSIGs, either
--                   because we've not doing DNSSEC or the cached answer is signed by negative,
--                   don't answer from the cache, forward instead. */
--                if (!(crecp->flags & (F_HOSTS | F_DHCP | F_CONFIG)) && sec_reqd)
--                  {
--                    if (!option_bool(OPT_DNSSEC_VALID) || ((crecp->flags & F_NEG) && (crecp->flags & F_DNSSECOK)))
--                      crecp = NULL;
--#ifdef HAVE_DNSSEC
--                    else if (crecp->flags & F_DNSSECOK)
--                      {
--                        /* We're returning validated data, need to return the RRSIG too. */
--                        struct crec *rr_crec = NULL;
--                        int sigtype = type;
--                        /* The signature may have expired even though the data is still in cache, 
--                           forward instead of answering from cache if so. */
--                        int gotsig = 0;
--                        
--                        if (crecp->flags & F_CNAME)
--                          sigtype = T_CNAME;
--                        
--                        while ((rr_crec = cache_find_by_name(rr_crec, name, now, F_DS | F_DNSKEY)))
--                          {
--                            if (rr_crec->addr.sig.type_covered == sigtype && rr_crec->uid == C_IN)
--                              {
--                                char *sigdata = blockdata_retrieve(rr_crec->addr.sig.keydata, rr_crec->addr.sig.keylen, NULL);
--                                gotsig = 1;
--                                
--                                if (!dryrun && 
--                                    add_resource_record(header, limit, &trunc, nameoffset, &ansp, 
--                                                        rr_crec->ttd - now, &nameoffset,
--                                                        T_RRSIG, C_IN, "t", rr_crec->addr.sig.keylen, sigdata))
--                                  anscount++;
--                              }
--                          }
--                        
--                        if (!gotsig)
--                          crecp = NULL;
--                      }
--#endif
--                  }            
--
--                if (crecp)
-+                /* If the client asked for DNSSEC  don't use cached data. */
-+                if ((crecp->flags & (F_HOSTS | F_DHCP | F_CONFIG)) || !sec_reqd || !(crecp->flags & F_DNSSECOK))
-                   do
-                     { 
-                       /* don't answer wildcard queries with data not from /etc/hosts
--- 
-1.7.10.4
-
diff --git a/src/patches/dnsmasq/018-Move_code_which_caches_DS_records_to_a_more_logical_place.patch b/src/patches/dnsmasq/018-Move_code_which_caches_DS_records_to_a_more_logical_place.patch
deleted file mode 100644 (file)
index ff055f7..0000000
+++ /dev/null
@@ -1,269 +0,0 @@
-From d64c81fff7faf4392b688223ef3a617c5c07e7dc Mon Sep 17 00:00:00 2001
-From: Simon Kelley <simon@thekelleys.org.uk>
-Date: Tue, 15 Dec 2015 16:11:06 +0000
-Subject: [PATCH] Move code which caches DS records to a more logical place.
-
----
- src/dnssec.c |  179 +++++++++++++++++++++++++++++-----------------------------
- 1 file changed, 90 insertions(+), 89 deletions(-)
-
-diff --git a/src/dnssec.c b/src/dnssec.c
-index 1ae03a6..359231f 100644
---- a/src/dnssec.c
-+++ b/src/dnssec.c
-@@ -1204,7 +1204,10 @@ int dnssec_validate_by_ds(time_t now, struct dns_header *header, size_t plen, ch
- int dnssec_validate_ds(time_t now, struct dns_header *header, size_t plen, char *name, char *keyname, int class)
- {
-   unsigned char *p = (unsigned char *)(header+1);
--  int qtype, qclass, val, i, neganswer, nons;
-+  int qtype, qclass, rc, i, neganswer, nons;
-+  int aclass, atype, rdlen;
-+  unsigned long ttl;
-+  struct all_addr a;
-   if (ntohs(header->qdcount) != 1 ||
-       !(p = skip_name(p, header, plen, 4)))
-@@ -1214,40 +1217,100 @@ int dnssec_validate_ds(time_t now, struct dns_header *header, size_t plen, char
-   GETSHORT(qclass, p);
-   if (qtype != T_DS || qclass != class)
--    val = STAT_BOGUS;
-+    rc = STAT_BOGUS;
-   else
--    val = dnssec_validate_reply(now, header, plen, name, keyname, NULL, 0, &neganswer, &nons);
-+    rc = dnssec_validate_reply(now, header, plen, name, keyname, NULL, 0, &neganswer, &nons);
-   /* Note dnssec_validate_reply() will have cached positive answers */
-   
--  if (val == STAT_INSECURE)
--    val = STAT_BOGUS;
--
-+  if (rc == STAT_INSECURE)
-+    rc = STAT_BOGUS;
-+ 
-   p = (unsigned char *)(header+1);
-   extract_name(header, plen, &p, name, 1, 4);
-   p += 4; /* qtype, qclass */
-   
--  if (!(p = skip_section(p, ntohs(header->ancount), header, plen)))
--    val = STAT_BOGUS;
--  
-   /* If the key needed to validate the DS is on the same domain as the DS, we'll
-      loop getting nowhere. Stop that now. This can happen of the DS answer comes
-      from the DS's zone, and not the parent zone. */
--  if (val == STAT_BOGUS || (val == STAT_NEED_KEY && hostname_isequal(name, keyname)))
-+  if (rc == STAT_BOGUS || (rc == STAT_NEED_KEY && hostname_isequal(name, keyname)))
-     {
-       log_query(F_NOEXTRA | F_UPSTREAM, name, NULL, "BOGUS DS");
-       return STAT_BOGUS;
-     }
-   
--  if (val != STAT_SECURE)
--    return val;
--
--  /* By here, the answer is proved secure, and a positive answer has been cached. */
--  if (neganswer)
-+  if (rc != STAT_SECURE)
-+    return rc;
-+   
-+  if (!neganswer)
-     {
--      int rdlen, flags = F_FORWARD | F_DS | F_NEG | F_DNSSECOK;
--      unsigned long ttl, minttl = ULONG_MAX;
--      struct all_addr a;
-+      cache_start_insert();
-+      
-+      for (i = 0; i < ntohs(header->ancount); i++)
-+      {
-+        if (!(rc = extract_name(header, plen, &p, name, 0, 10)))
-+          return STAT_BOGUS; /* bad packet */
-+        
-+        GETSHORT(atype, p);
-+        GETSHORT(aclass, p);
-+        GETLONG(ttl, p);
-+        GETSHORT(rdlen, p);
-+        
-+        if (!CHECK_LEN(header, p, plen, rdlen))
-+          return STAT_BOGUS; /* bad packet */
-+        
-+        if (aclass == class && atype == T_DS && rc == 1)
-+          { 
-+            int algo, digest, keytag;
-+            unsigned char *psave = p;
-+            struct blockdata *key;
-+            struct crec *crecp;
-+            if (rdlen < 4)
-+              return STAT_BOGUS; /* bad packet */
-+            
-+            GETSHORT(keytag, p);
-+            algo = *p++;
-+            digest = *p++;
-+            
-+            /* Cache needs to known class for DNSSEC stuff */
-+            a.addr.dnssec.class = class;
-+            
-+            if ((key = blockdata_alloc((char*)p, rdlen - 4)))
-+              {
-+                if (!(crecp = cache_insert(name, &a, now, ttl, F_FORWARD | F_DS | F_DNSSECOK)))
-+                  {
-+                    blockdata_free(key);
-+                    return STAT_BOGUS;
-+                  }
-+                else
-+                  {
-+                    a.addr.keytag = keytag;
-+                    log_query(F_NOEXTRA | F_KEYTAG | F_UPSTREAM, name, &a, "DS keytag %u");
-+                    crecp->addr.ds.digest = digest;
-+                    crecp->addr.ds.keydata = key;
-+                    crecp->addr.ds.algo = algo;
-+                    crecp->addr.ds.keytag = keytag;
-+                    crecp->addr.ds.keylen = rdlen - 4; 
-+                  } 
-+              }
-+            
-+            p = psave;
-+            
-+            if (!ADD_RDLEN(header, p, plen, rdlen))
-+              return STAT_BOGUS; /* bad packet */
-+          }
-+        
-+        cache_end_insert();
-+      }
-+    }
-+  else
-+    {
-+      int flags = F_FORWARD | F_DS | F_NEG | F_DNSSECOK;
-+      unsigned long minttl = ULONG_MAX;
-+      
-+      if (!(p = skip_section(p, ntohs(header->ancount), header, plen)))
-+      return STAT_BOGUS;
-+      
-       if (RCODE(header) == NXDOMAIN)
-       flags |= F_NXDOMAIN;
-       
-@@ -1261,20 +1324,20 @@ int dnssec_validate_ds(time_t now, struct dns_header *header, size_t plen, char
-         if (!(p = skip_name(p, header, plen, 0)))
-           return STAT_BOGUS;
-         
--        GETSHORT(qtype, p); 
--        GETSHORT(qclass, p);
-+        GETSHORT(atype, p); 
-+        GETSHORT(aclass, p);
-         GETLONG(ttl, p);
-         GETSHORT(rdlen, p);
--
-+        
-         if (!CHECK_LEN(header, p, plen, rdlen))
-           return STAT_BOGUS; /* bad packet */
--          
--        if (qclass != class || qtype != T_SOA)
-+        
-+        if (aclass != class || atype != T_SOA)
-           {
-             p += rdlen;
-             continue;
-           }
--           
-+        
-         if (ttl < minttl)
-           minttl = ttl;
-         
-@@ -1306,7 +1369,7 @@ int dnssec_validate_ds(time_t now, struct dns_header *header, size_t plen, char
-         log_query(F_NOEXTRA | F_UPSTREAM, name, NULL, "no DS");
-       }
-     }
--
-+      
-   return STAT_OK;
- }
-@@ -2001,11 +2064,7 @@ int dnssec_validate_reply(time_t now, struct dns_header *header, size_t plen, ch
-         /* Not done, validate now */
-         if (j == i)
-           {
--            int ttl, keytag, algo, digest, sigcnt, rrcnt;
--            unsigned char *psave;
--            struct all_addr a;
--            struct blockdata *key;
--            struct crec *crecp;
-+            int sigcnt, rrcnt;
-             char *wildname;
-             
-             if (!explore_rrset(header, plen, class1, type1, name, keyname, &sigcnt, &rrcnt))
-@@ -2032,6 +2091,7 @@ int dnssec_validate_reply(time_t now, struct dns_header *header, size_t plen, ch
-                Can't overwrite name here. */
-             strcpy(daemon->workspacename, keyname);
-             rc = zone_status(daemon->workspacename, class1, keyname, now);
-+
-             if (rc != STAT_SECURE)
-               {
-                 /* Zone is insecure, don't need to validate RRset */
-@@ -2088,65 +2148,6 @@ int dnssec_validate_reply(time_t now, struct dns_header *header, size_t plen, ch
-                     if (rc == STAT_BOGUS)
-                       return rc;
-                   } 
--                
--                /* If we just validated a DS RRset, cache it */
--                /* Also note if the RRset is the answer to the question, or the target of a CNAME */
--                cache_start_insert();
--                
--                for (p2 = ans_start, j = 0; j < ntohs(header->ancount); j++)
--                  {
--                    if (!(rc = extract_name(header, plen, &p2, name, 0, 10)))
--                      return STAT_BOGUS; /* bad packet */
--                    
--                    GETSHORT(type2, p2);
--                    GETSHORT(class2, p2);
--                    GETLONG(ttl, p2);
--                    GETSHORT(rdlen2, p2);
--                    
--                    if (!CHECK_LEN(header, p2, plen, rdlen2))
--                      return STAT_BOGUS; /* bad packet */
--                    
--                    if (class2 == class1 && rc == 1)
--                      { 
--                        psave = p2;
--                        
--                        if (type1 == T_DS && type2 == T_DS)
--                          {
--                            if (rdlen2 < 4)
--                              return STAT_BOGUS; /* bad packet */
--                            
--                            GETSHORT(keytag, p2);
--                            algo = *p2++;
--                            digest = *p2++;
--                            
--                            /* Cache needs to known class for DNSSEC stuff */
--                            a.addr.dnssec.class = class2;
--                            
--                            if ((key = blockdata_alloc((char*)p2, rdlen2 - 4)))
--                              {
--                                if (!(crecp = cache_insert(name, &a, now, ttl, F_FORWARD | F_DS | F_DNSSECOK)))
--                                  blockdata_free(key);
--                                else
--                                  {
--                                    a.addr.keytag = keytag;
--                                    log_query(F_NOEXTRA | F_KEYTAG | F_UPSTREAM, name, &a, "DS keytag %u");
--                                    crecp->addr.ds.digest = digest;
--                                    crecp->addr.ds.keydata = key;
--                                    crecp->addr.ds.algo = algo;
--                                    crecp->addr.ds.keytag = keytag;
--                                    crecp->addr.ds.keylen = rdlen2 - 4; 
--                                  } 
--                              }
--                          }
--
--                        p2 = psave;
--                      }
--                    
--                    if (!ADD_RDLEN(header, p2, plen, rdlen2))
--                      return STAT_BOGUS; /* bad packet */
--                  }
--                
--                cache_end_insert();
-               }
-           }
-       }
--- 
-1.7.10.4
-
diff --git a/src/patches/dnsmasq/019-Generalise_RR-filtering_code_for_use_with_EDNS0.patch b/src/patches/dnsmasq/019-Generalise_RR-filtering_code_for_use_with_EDNS0.patch
deleted file mode 100644 (file)
index 0a4942a..0000000
+++ /dev/null
@@ -1,755 +0,0 @@
-From c2bcd1e183bcc5fdd63811c045355fc57e36ecfd Mon Sep 17 00:00:00 2001
-From: Simon Kelley <simon@thekelleys.org.uk>
-Date: Tue, 15 Dec 2015 17:25:21 +0000
-Subject: [PATCH] Generalise RR-filtering code, for use with EDNS0.
-
----
- Makefile       |    3 +-
- bld/Android.mk |    2 +-
- src/dnsmasq.h  |    5 +
- src/dnssec.c   |  307 +-------------------------------------------------
- src/forward.c  |    2 +-
- src/rrfilter.c |  339 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++
- 6 files changed, 349 insertions(+), 309 deletions(-)
- create mode 100644 src/rrfilter.c
-
-diff --git a/Makefile b/Makefile
-index 4c87ea9..b664160 100644
---- a/Makefile
-+++ b/Makefile
-@@ -73,7 +73,8 @@ objs = cache.o rfc1035.o util.o option.o forward.o network.o \
-        dnsmasq.o dhcp.o lease.o rfc2131.o netlink.o dbus.o bpf.o \
-        helper.o tftp.o log.o conntrack.o dhcp6.o rfc3315.o \
-        dhcp-common.o outpacket.o radv.o slaac.o auth.o ipset.o \
--       domain.o dnssec.o blockdata.o tables.o loop.o inotify.o poll.o
-+       domain.o dnssec.o blockdata.o tables.o loop.o inotify.o \
-+       poll.o rrfilter.o
- hdrs = dnsmasq.h config.h dhcp-protocol.h dhcp6-protocol.h \
-        dns-protocol.h radv-protocol.h ip6addr.h
-diff --git a/bld/Android.mk b/bld/Android.mk
-index 5364ee7..67b9c4b 100644
---- a/bld/Android.mk
-+++ b/bld/Android.mk
-@@ -10,7 +10,7 @@ LOCAL_SRC_FILES :=  bpf.c cache.c dbus.c dhcp.c dnsmasq.c \
-                   dhcp6.c rfc3315.c dhcp-common.c outpacket.c \
-                   radv.c slaac.c auth.c ipset.c domain.c \
-                   dnssec.c dnssec-openssl.c blockdata.c tables.c \
--                  loop.c inotify.c poll.c
-+                  loop.c inotify.c poll.c rrfilter.c
- LOCAL_MODULE := dnsmasq
-diff --git a/src/dnsmasq.h b/src/dnsmasq.h
-index 4344cae..39a930c 100644
---- a/src/dnsmasq.h
-+++ b/src/dnsmasq.h
-@@ -1513,3 +1513,8 @@ int poll_check(int fd, short event);
- void poll_listen(int fd, short event);
- int do_poll(int timeout);
-+/* rrfilter.c */
-+size_t rrfilter(struct dns_header *header, size_t plen, int mode);
-+u16 *rrfilter_desc(int type);
-+int expand_workspace(unsigned char ***wkspc, int *szp, int new);
-+
-diff --git a/src/dnssec.c b/src/dnssec.c
-index 359231f..fa3eb81 100644
---- a/src/dnssec.c
-+++ b/src/dnssec.c
-@@ -507,50 +507,6 @@ static int check_date_range(unsigned long date_start, unsigned long date_end)
-     && serial_compare_32(curtime, date_end) == SERIAL_LT;
- }
--static u16 *get_desc(int type)
--{
--  /* List of RRtypes which include domains in the data.
--     0 -> domain
--     integer -> no of plain bytes
--     -1 -> end
--
--     zero is not a valid RRtype, so the final entry is returned for
--     anything which needs no mangling.
--  */
--  
--  static u16 rr_desc[] = 
--    { 
--      T_NS, 0, -1, 
--      T_MD, 0, -1,
--      T_MF, 0, -1,
--      T_CNAME, 0, -1,
--      T_SOA, 0, 0, -1,
--      T_MB, 0, -1,
--      T_MG, 0, -1,
--      T_MR, 0, -1,
--      T_PTR, 0, -1,
--      T_MINFO, 0, 0, -1,
--      T_MX, 2, 0, -1,
--      T_RP, 0, 0, -1,
--      T_AFSDB, 2, 0, -1,
--      T_RT, 2, 0, -1,
--      T_SIG, 18, 0, -1,
--      T_PX, 2, 0, 0, -1,
--      T_NXT, 0, -1,
--      T_KX, 2, 0, -1,
--      T_SRV, 6, 0, -1,
--      T_DNAME, 0, -1,
--      0, -1 /* wildcard/catchall */
--    }; 
--  
--  u16 *p = rr_desc;
--  
--  while (*p != type && *p != 0)
--    while (*p++ != (u16)-1);
--
--  return p+1;
--}
--
- /* Return bytes of canonicalised rdata, when the return value is zero, the remaining 
-    data, pointed to by *p, should be used raw. */
- static int get_rdata(struct dns_header *header, size_t plen, unsigned char *end, char *buff, int bufflen,
-@@ -594,34 +550,6 @@ static int get_rdata(struct dns_header *header, size_t plen, unsigned char *end,
-     }
- }
--static int expand_workspace(unsigned char ***wkspc, int *szp, int new)
--{
--  unsigned char **p;
--  int old = *szp;
--
--  if (old >= new+1)
--    return 1;
--
--  if (new >= 100)
--    return 0;
--
--  new += 5;
--  
--  if (!(p = whine_malloc(new * sizeof(unsigned char **))))
--    return 0;  
--  
--  if (old != 0 && *wkspc)
--    {
--      memcpy(p, *wkspc, old * sizeof(unsigned char **));
--      free(*wkspc);
--    }
--  
--  *wkspc = p;
--  *szp = new;
--
--  return 1;
--}
--
- /* Bubble sort the RRset into the canonical order. 
-    Note that the byte-streams from two RRs may get unsynced: consider 
-    RRs which have two domain-names at the start and then other data.
-@@ -849,7 +777,7 @@ static int validate_rrset(time_t now, struct dns_header *header, size_t plen, in
-   int rdlen, j, name_labels;
-   struct crec *crecp = NULL;
-   int algo, labels, orig_ttl, key_tag;
--  u16 *rr_desc = get_desc(type);
-+  u16 *rr_desc = rrfilter_desc(type);
-  
-   if (wildcard_out)
-     *wildcard_out = NULL;
-@@ -2266,239 +2194,6 @@ size_t dnssec_generate_query(struct dns_header *header, char *end, char *name, i
-   return ret;
- }
--/* Go through a domain name, find "pointers" and fix them up based on how many bytes
--   we've chopped out of the packet, or check they don't point into an elided part.  */
--static int check_name(unsigned char **namep, struct dns_header *header, size_t plen, int fixup, unsigned char **rrs, int rr_count)
--{
--  unsigned char *ansp = *namep;
--
--  while(1)
--    {
--      unsigned int label_type;
--      
--      if (!CHECK_LEN(header, ansp, plen, 1))
--      return 0;
--      
--      label_type = (*ansp) & 0xc0;
--
--      if (label_type == 0xc0)
--      {
--        /* pointer for compression. */
--        unsigned int offset;
--        int i;
--        unsigned char *p;
--        
--        if (!CHECK_LEN(header, ansp, plen, 2))
--          return 0;
--
--        offset = ((*ansp++) & 0x3f) << 8;
--        offset |= *ansp++;
--
--        p = offset + (unsigned char *)header;
--        
--        for (i = 0; i < rr_count; i++)
--          if (p < rrs[i])
--            break;
--          else
--            if (i & 1)
--              offset -= rrs[i] - rrs[i-1];
--
--        /* does the pointer end up in an elided RR? */
--        if (i & 1)
--          return 0;
--
--        /* No, scale the pointer */
--        if (fixup)
--          {
--            ansp -= 2;
--            *ansp++ = (offset >> 8) | 0xc0;
--            *ansp++ = offset & 0xff;
--          }
--        break;
--      }
--      else if (label_type == 0x80)
--      return 0; /* reserved */
--      else if (label_type == 0x40)
--      {
--        /* Extended label type */
--        unsigned int count;
--        
--        if (!CHECK_LEN(header, ansp, plen, 2))
--          return 0;
--        
--        if (((*ansp++) & 0x3f) != 1)
--          return 0; /* we only understand bitstrings */
--        
--        count = *(ansp++); /* Bits in bitstring */
--        
--        if (count == 0) /* count == 0 means 256 bits */
--          ansp += 32;
--        else
--          ansp += ((count-1)>>3)+1;
--      }
--      else
--      { /* label type == 0 Bottom six bits is length */
--        unsigned int len = (*ansp++) & 0x3f;
--        
--        if (!ADD_RDLEN(header, ansp, plen, len))
--          return 0;
--
--        if (len == 0)
--          break; /* zero length label marks the end. */
--      }
--    }
--
--  *namep = ansp;
--
--  return 1;
--}
--
--/* Go through RRs and check or fixup the domain names contained within */
--static int check_rrs(unsigned char *p, struct dns_header *header, size_t plen, int fixup, unsigned char **rrs, int rr_count)
--{
--  int i, type, class, rdlen;
--  unsigned char *pp;
--  
--  for (i = 0; i < ntohs(header->ancount) + ntohs(header->nscount) + ntohs(header->arcount); i++)
--    {
--      pp = p;
--
--      if (!(p = skip_name(p, header, plen, 10)))
--      return 0;
--      
--      GETSHORT(type, p); 
--      GETSHORT(class, p);
--      p += 4; /* TTL */
--      GETSHORT(rdlen, p);
--
--      if (type != T_NSEC && type != T_NSEC3 && type != T_RRSIG)
--      {
--        /* fixup name of RR */
--        if (!check_name(&pp, header, plen, fixup, rrs, rr_count))
--          return 0;
--        
--        if (class == C_IN)
--          {
--            u16 *d;
-- 
--            for (pp = p, d = get_desc(type); *d != (u16)-1; d++)
--              {
--                if (*d != 0)
--                  pp += *d;
--                else if (!check_name(&pp, header, plen, fixup, rrs, rr_count))
--                  return 0;
--              }
--          }
--      }
--      
--      if (!ADD_RDLEN(header, p, plen, rdlen))
--      return 0;
--    }
--  
--  return 1;
--}
--      
--
--size_t filter_rrsigs(struct dns_header *header, size_t plen)
--{
--  static unsigned char **rrs;
--  static int rr_sz = 0;
--  
--  unsigned char *p = (unsigned char *)(header+1);
--  int i, rdlen, qtype, qclass, rr_found, chop_an, chop_ns, chop_ar;
--
--  if (ntohs(header->qdcount) != 1 ||
--      !(p = skip_name(p, header, plen, 4)))
--    return plen;
--  
--  GETSHORT(qtype, p);
--  GETSHORT(qclass, p);
--
--  /* First pass, find pointers to start and end of all the records we wish to elide:
--     records added for DNSSEC, unless explicity queried for */
--  for (rr_found = 0, chop_ns = 0, chop_an = 0, chop_ar = 0, i = 0; 
--       i < ntohs(header->ancount) + ntohs(header->nscount) + ntohs(header->arcount);
--       i++)
--    {
--      unsigned char *pstart = p;
--      int type, class;
--
--      if (!(p = skip_name(p, header, plen, 10)))
--      return plen;
--      
--      GETSHORT(type, p); 
--      GETSHORT(class, p);
--      p += 4; /* TTL */
--      GETSHORT(rdlen, p);
--      
--      if ((type == T_NSEC || type == T_NSEC3 || type == T_RRSIG) && 
--        (type != qtype || class != qclass))
--      {
--        if (!expand_workspace(&rrs, &rr_sz, rr_found + 1))
--          return plen; 
--        
--        rrs[rr_found++] = pstart;
--
--        if (!ADD_RDLEN(header, p, plen, rdlen))
--          return plen;
--        
--        rrs[rr_found++] = p;
--        
--        if (i < ntohs(header->ancount))
--          chop_an++;
--        else if (i < (ntohs(header->nscount) + ntohs(header->ancount)))
--          chop_ns++;
--        else
--          chop_ar++;
--      }
--      else if (!ADD_RDLEN(header, p, plen, rdlen))
--      return plen;
--    }
--  
--  /* Nothing to do. */
--  if (rr_found == 0)
--    return plen;
--
--  /* Second pass, look for pointers in names in the records we're keeping and make sure they don't
--     point to records we're going to elide. This is theoretically possible, but unlikely. If
--     it happens, we give up and leave the answer unchanged. */
--  p = (unsigned char *)(header+1);
--  
--  /* question first */
--  if (!check_name(&p, header, plen, 0, rrs, rr_found))
--    return plen;
--  p += 4; /* qclass, qtype */
--  
--  /* Now answers and NS */
--  if (!check_rrs(p, header, plen, 0, rrs, rr_found))
--    return plen;
--  
--  /* Third pass, elide records */
--  for (p = rrs[0], i = 1; i < rr_found; i += 2)
--    {
--      unsigned char *start = rrs[i];
--      unsigned char *end = (i != rr_found - 1) ? rrs[i+1] : ((unsigned char *)(header+1)) + plen;
--      
--      memmove(p, start, end-start);
--      p += end-start;
--    }
--     
--  plen = p - (unsigned char *)header;
--  header->ancount = htons(ntohs(header->ancount) - chop_an);
--  header->nscount = htons(ntohs(header->nscount) - chop_ns);
--  header->arcount = htons(ntohs(header->arcount) - chop_ar);
--
--  /* Fourth pass, fix up pointers in the remaining records */
--  p = (unsigned char *)(header+1);
--  
--  check_name(&p, header, plen, 1, rrs, rr_found);
--  p += 4; /* qclass, qtype */
--  
--  check_rrs(p, header, plen, 1, rrs, rr_found);
--  
--  return plen;
--}
--
- unsigned char* hash_questions(struct dns_header *header, size_t plen, char *name)
- {
-   int q;
-diff --git a/src/forward.c b/src/forward.c
-index dd22a62..3e801c8 100644
---- a/src/forward.c
-+++ b/src/forward.c
-@@ -662,7 +662,7 @@ static size_t process_reply(struct dns_header *header, time_t now, struct server
-   /* If the requestor didn't set the DO bit, don't return DNSSEC info. */
-   if (!do_bit)
--    n = filter_rrsigs(header, n);
-+    n = rrfilter(header, n, 1);
- #endif
-   /* do this after extract_addresses. Ensure NODATA reply and remove
-diff --git a/src/rrfilter.c b/src/rrfilter.c
-new file mode 100644
-index 0000000..ae12261
---- /dev/null
-+++ b/src/rrfilter.c
-@@ -0,0 +1,339 @@
-+/* dnsmasq is Copyright (c) 2000-2015 Simon Kelley
-+
-+   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; version 2 dated June, 1991, or
-+   (at your option) version 3 dated 29 June, 2007.
-+ 
-+   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, see <http://www.gnu.org/licenses/>.
-+*/
-+
-+/* Code to safely remove RRs from an DNS answer */ 
-+
-+#include "dnsmasq.h"
-+
-+/* Go through a domain name, find "pointers" and fix them up based on how many bytes
-+   we've chopped out of the packet, or check they don't point into an elided part.  */
-+static int check_name(unsigned char **namep, struct dns_header *header, size_t plen, int fixup, unsigned char **rrs, int rr_count)
-+{
-+  unsigned char *ansp = *namep;
-+
-+  while(1)
-+    {
-+      unsigned int label_type;
-+      
-+      if (!CHECK_LEN(header, ansp, plen, 1))
-+      return 0;
-+      
-+      label_type = (*ansp) & 0xc0;
-+
-+      if (label_type == 0xc0)
-+      {
-+        /* pointer for compression. */
-+        unsigned int offset;
-+        int i;
-+        unsigned char *p;
-+        
-+        if (!CHECK_LEN(header, ansp, plen, 2))
-+          return 0;
-+
-+        offset = ((*ansp++) & 0x3f) << 8;
-+        offset |= *ansp++;
-+
-+        p = offset + (unsigned char *)header;
-+        
-+        for (i = 0; i < rr_count; i++)
-+          if (p < rrs[i])
-+            break;
-+          else
-+            if (i & 1)
-+              offset -= rrs[i] - rrs[i-1];
-+
-+        /* does the pointer end up in an elided RR? */
-+        if (i & 1)
-+          return 0;
-+
-+        /* No, scale the pointer */
-+        if (fixup)
-+          {
-+            ansp -= 2;
-+            *ansp++ = (offset >> 8) | 0xc0;
-+            *ansp++ = offset & 0xff;
-+          }
-+        break;
-+      }
-+      else if (label_type == 0x80)
-+      return 0; /* reserved */
-+      else if (label_type == 0x40)
-+      {
-+        /* Extended label type */
-+        unsigned int count;
-+        
-+        if (!CHECK_LEN(header, ansp, plen, 2))
-+          return 0;
-+        
-+        if (((*ansp++) & 0x3f) != 1)
-+          return 0; /* we only understand bitstrings */
-+        
-+        count = *(ansp++); /* Bits in bitstring */
-+        
-+        if (count == 0) /* count == 0 means 256 bits */
-+          ansp += 32;
-+        else
-+          ansp += ((count-1)>>3)+1;
-+      }
-+      else
-+      { /* label type == 0 Bottom six bits is length */
-+        unsigned int len = (*ansp++) & 0x3f;
-+        
-+        if (!ADD_RDLEN(header, ansp, plen, len))
-+          return 0;
-+
-+        if (len == 0)
-+          break; /* zero length label marks the end. */
-+      }
-+    }
-+
-+  *namep = ansp;
-+
-+  return 1;
-+}
-+
-+/* Go through RRs and check or fixup the domain names contained within */
-+static int check_rrs(unsigned char *p, struct dns_header *header, size_t plen, int fixup, unsigned char **rrs, int rr_count)
-+{
-+  int i, j, type, class, rdlen;
-+  unsigned char *pp;
-+  
-+  for (i = 0; i < ntohs(header->ancount) + ntohs(header->nscount) + ntohs(header->arcount); i++)
-+    {
-+      pp = p;
-+
-+      if (!(p = skip_name(p, header, plen, 10)))
-+      return 0;
-+      
-+      GETSHORT(type, p); 
-+      GETSHORT(class, p);
-+      p += 4; /* TTL */
-+      GETSHORT(rdlen, p);
-+
-+      /* If this RR is to be elided, don't fix up its contents */
-+      for (j = 0; j < rr_count; j += 2)
-+      if (rrs[j] == pp)
-+        break;
-+
-+      if (j >= rr_count)
-+      {
-+        /* fixup name of RR */
-+        if (!check_name(&pp, header, plen, fixup, rrs, rr_count))
-+          return 0;
-+        
-+        if (class == C_IN)
-+          {
-+            u16 *d;
-+ 
-+            for (pp = p, d = rrfilter_desc(type); *d != (u16)-1; d++)
-+              {
-+                if (*d != 0)
-+                  pp += *d;
-+                else if (!check_name(&pp, header, plen, fixup, rrs, rr_count))
-+                  return 0;
-+              }
-+          }
-+      }
-+      
-+      if (!ADD_RDLEN(header, p, plen, rdlen))
-+      return 0;
-+    }
-+  
-+  return 1;
-+}
-+      
-+
-+/* mode is 0 to remove EDNS0, 1 to filter DNSSEC RRs */
-+size_t rrfilter(struct dns_header *header, size_t plen, int mode)
-+{
-+  static unsigned char **rrs;
-+  static int rr_sz = 0;
-+
-+  unsigned char *p = (unsigned char *)(header+1);
-+  int i, rdlen, qtype, qclass, rr_found, chop_an, chop_ns, chop_ar;
-+
-+  if (ntohs(header->qdcount) != 1 ||
-+      !(p = skip_name(p, header, plen, 4)))
-+    return plen;
-+  
-+  GETSHORT(qtype, p);
-+  GETSHORT(qclass, p);
-+
-+  /* First pass, find pointers to start and end of all the records we wish to elide:
-+     records added for DNSSEC, unless explicity queried for */
-+  for (rr_found = 0, chop_ns = 0, chop_an = 0, chop_ar = 0, i = 0; 
-+       i < ntohs(header->ancount) + ntohs(header->nscount) + ntohs(header->arcount);
-+       i++)
-+    {
-+      unsigned char *pstart = p;
-+      int type, class;
-+
-+      if (!(p = skip_name(p, header, plen, 10)))
-+      return plen;
-+      
-+      GETSHORT(type, p); 
-+      GETSHORT(class, p);
-+      p += 4; /* TTL */
-+      GETSHORT(rdlen, p);
-+        
-+      if (!ADD_RDLEN(header, p, plen, rdlen))
-+      return plen;
-+
-+      /* Don't remove the answer. */
-+      if (i < ntohs(header->ancount) && type == qtype && class == qclass)
-+      continue;
-+      
-+      if (mode == 0) /* EDNS */
-+      {
-+        /* EDNS mode, remove T_OPT from additional section only */
-+        if (i < (ntohs(header->nscount) + ntohs(header->ancount)) || type != T_OPT)
-+          continue;
-+      }
-+      else if (type != T_NSEC && type != T_NSEC3 && type != T_RRSIG)
-+      /* DNSSEC mode, remove SIGs and NSECs from all three sections. */
-+      continue;
-+      
-+      
-+      if (!expand_workspace(&rrs, &rr_sz, rr_found + 1))
-+      return plen; 
-+      
-+      rrs[rr_found++] = pstart;
-+      rrs[rr_found++] = p;
-+      
-+      if (i < ntohs(header->ancount))
-+      chop_an++;
-+      else if (i < (ntohs(header->nscount) + ntohs(header->ancount)))
-+      chop_ns++;
-+      else
-+      chop_ar++;
-+    }
-+  
-+  /* Nothing to do. */
-+  if (rr_found == 0)
-+    return plen;
-+
-+  /* Second pass, look for pointers in names in the records we're keeping and make sure they don't
-+     point to records we're going to elide. This is theoretically possible, but unlikely. If
-+     it happens, we give up and leave the answer unchanged. */
-+  p = (unsigned char *)(header+1);
-+  
-+  /* question first */
-+  if (!check_name(&p, header, plen, 0, rrs, rr_found))
-+    return plen;
-+  p += 4; /* qclass, qtype */
-+  
-+  /* Now answers and NS */
-+  if (!check_rrs(p, header, plen, 0, rrs, rr_found))
-+    return plen;
-+  
-+  /* Third pass, elide records */
-+  for (p = rrs[0], i = 1; i < rr_found; i += 2)
-+    {
-+      unsigned char *start = rrs[i];
-+      unsigned char *end = (i != rr_found - 1) ? rrs[i+1] : ((unsigned char *)(header+1)) + plen;
-+      
-+      memmove(p, start, end-start);
-+      p += end-start;
-+    }
-+     
-+  plen = p - (unsigned char *)header;
-+  header->ancount = htons(ntohs(header->ancount) - chop_an);
-+  header->nscount = htons(ntohs(header->nscount) - chop_ns);
-+  header->arcount = htons(ntohs(header->arcount) - chop_ar);
-+
-+  /* Fourth pass, fix up pointers in the remaining records */
-+  p = (unsigned char *)(header+1);
-+  
-+  check_name(&p, header, plen, 1, rrs, rr_found);
-+  p += 4; /* qclass, qtype */
-+  
-+  check_rrs(p, header, plen, 1, rrs, rr_found);
-+  
-+  return plen;
-+}
-+
-+/* This is used in the DNSSEC code too, hence it's exported */
-+u16 *rrfilter_desc(int type)
-+{
-+  /* List of RRtypes which include domains in the data.
-+     0 -> domain
-+     integer -> no of plain bytes
-+     -1 -> end
-+
-+     zero is not a valid RRtype, so the final entry is returned for
-+     anything which needs no mangling.
-+  */
-+  
-+  static u16 rr_desc[] = 
-+    { 
-+      T_NS, 0, -1, 
-+      T_MD, 0, -1,
-+      T_MF, 0, -1,
-+      T_CNAME, 0, -1,
-+      T_SOA, 0, 0, -1,
-+      T_MB, 0, -1,
-+      T_MG, 0, -1,
-+      T_MR, 0, -1,
-+      T_PTR, 0, -1,
-+      T_MINFO, 0, 0, -1,
-+      T_MX, 2, 0, -1,
-+      T_RP, 0, 0, -1,
-+      T_AFSDB, 2, 0, -1,
-+      T_RT, 2, 0, -1,
-+      T_SIG, 18, 0, -1,
-+      T_PX, 2, 0, 0, -1,
-+      T_NXT, 0, -1,
-+      T_KX, 2, 0, -1,
-+      T_SRV, 6, 0, -1,
-+      T_DNAME, 0, -1,
-+      0, -1 /* wildcard/catchall */
-+    }; 
-+  
-+  u16 *p = rr_desc;
-+  
-+  while (*p != type && *p != 0)
-+    while (*p++ != (u16)-1);
-+
-+  return p+1;
-+}
-+
-+int expand_workspace(unsigned char ***wkspc, int *szp, int new)
-+{
-+  unsigned char **p;
-+  int old = *szp;
-+
-+  if (old >= new+1)
-+    return 1;
-+
-+  if (new >= 100)
-+    return 0;
-+
-+  new += 5;
-+  
-+  if (!(p = whine_malloc(new * sizeof(unsigned char **))))
-+    return 0;  
-+  
-+  if (old != 0 && *wkspc)
-+    {
-+      memcpy(p, *wkspc, old * sizeof(unsigned char **));
-+      free(*wkspc);
-+    }
-+  
-+  *wkspc = p;
-+  *szp = new;
-+
-+  return 1;
-+}
--- 
-1.7.10.4
-
diff --git a/src/patches/dnsmasq/020-DNSSEC_validation_tweak.patch b/src/patches/dnsmasq/020-DNSSEC_validation_tweak.patch
deleted file mode 100644 (file)
index ffb412b..0000000
+++ /dev/null
@@ -1,134 +0,0 @@
-From 2dbba34b2c1289a108f876c78b84889f2a93115d Mon Sep 17 00:00:00 2001
-From: Simon Kelley <simon@thekelleys.org.uk>
-Date: Wed, 16 Dec 2015 13:41:58 +0000
-Subject: [PATCH] DNSSEC validation tweak.
-
-A zone which has at least one key with an algorithm we don't
-support should be considered as insecure.
----
- src/dnssec.c |   82 ++++++++++++++++++++++++++++++++++++++--------------------
- 1 file changed, 54 insertions(+), 28 deletions(-)
-
-diff --git a/src/dnssec.c b/src/dnssec.c
-index fa3eb81..dc563e0 100644
---- a/src/dnssec.c
-+++ b/src/dnssec.c
-@@ -763,10 +763,10 @@ static int explore_rrset(struct dns_header *header, size_t plen, int class, int
-    STAT_NEED_KEY need DNSKEY to complete validation (name is returned in keyname)
-    STAT_NEED_DS  need DS to complete validation (name is returned in keyname)
--   if key is non-NULL, use that key, which has the algo and tag given in the params of those names,
-+   If key is non-NULL, use that key, which has the algo and tag given in the params of those names,
-    otherwise find the key in the cache.
--   name is unchanged on exit. keyname is used as workspace and trashed.
-+   Name is unchanged on exit. keyname is used as workspace and trashed.
-    Call explore_rrset first to find and count RRs and sigs.
- */
-@@ -919,6 +919,7 @@ static int validate_rrset(time_t now, struct dns_header *header, size_t plen, in
-   return STAT_BOGUS;
- }
-  
-+
- /* The DNS packet is expected to contain the answer to a DNSKEY query.
-    Put all DNSKEYs in the answer which are valid into the cache.
-    return codes:
-@@ -1831,15 +1832,15 @@ static int prove_non_existence_nsec3(struct dns_header *header, size_t plen, uns
- /* Check signing status of name.
-    returns:
--   STAT_SECURE zone is signed.
--   STAT_INSECURE zone proved unsigned.
--   STAT_NEED_DS require DS record of name returned in keyname.
--   
-+   STAT_SECURE      zone is signed.
-+   STAT_INSECURE    zone proved unsigned.
-+   STAT_NEED_DS     require DS record of name returned in keyname.
-+   STAT_NEED_DNSKEY require DNSKEY record of name returned in keyname.
-    name returned unaltered.
- */
- static int zone_status(char *name, int class, char *keyname, time_t now)
- {
--  int name_start = strlen(name);
-+  int secure_ds, name_start = strlen(name);
-   struct crec *crecp;
-   char *p;
-   
-@@ -1850,27 +1851,52 @@ static int zone_status(char *name, int class, char *keyname, time_t now)
-       if (!(crecp = cache_find_by_name(NULL, keyname, now, F_DS)))
-       return STAT_NEED_DS;
-       else
--      do 
--        {
--          if (crecp->uid == (unsigned int)class)
--            {
--              /* F_DNSSECOK misused in DS cache records to non-existance of NS record.
--                 F_NEG && !F_DNSSECOK implies that we've proved there's no DS record here,
--                 but that's because there's no NS record either, ie this isn't the start
--                 of a zone. We only prove that the DNS tree below a node is unsigned when
--                 we prove that we're at a zone cut AND there's no DS record.
--              */        
--              if (crecp->flags & F_NEG)
--                {
--                  if (crecp->flags & F_DNSSECOK)
--                    return STAT_INSECURE; /* proved no DS here */
--                }
--              else if (!ds_digest_name(crecp->addr.ds.digest) || !algo_digest_name(crecp->addr.ds.algo))
--                return STAT_INSECURE; /* algo we can't use - insecure */
--            }
--        }
--      while ((crecp = cache_find_by_name(crecp, keyname, now, F_DS)));
--      
-+      {
-+        secure_ds = 0;
-+        
-+        do 
-+          {
-+            if (crecp->uid == (unsigned int)class)
-+              {
-+                /* F_DNSSECOK misused in DS cache records to non-existance of NS record.
-+                   F_NEG && !F_DNSSECOK implies that we've proved there's no DS record here,
-+                   but that's because there's no NS record either, ie this isn't the start
-+                   of a zone. We only prove that the DNS tree below a node is unsigned when
-+                   we prove that we're at a zone cut AND there's no DS record.
-+                */      
-+                if (crecp->flags & F_NEG)
-+                  {
-+                    if (crecp->flags & F_DNSSECOK)
-+                      return STAT_INSECURE; /* proved no DS here */
-+                  }
-+                else if (!ds_digest_name(crecp->addr.ds.digest) || !algo_digest_name(crecp->addr.ds.algo))
-+                  return STAT_INSECURE; /* algo we can't use - insecure */
-+                else
-+                  secure_ds = 1;
-+              }
-+          }
-+        while ((crecp = cache_find_by_name(crecp, keyname, now, F_DS)));
-+      }
-+
-+      if (secure_ds)
-+      {
-+        /* We've found only DS records that attest to the DNSKEY RRset in the zone, so we believe
-+           that RRset is good. Furthermore the DNSKEY whose hash is proved by the DS record is
-+           one we can use. However the DNSKEY RRset may contain more than one key and
-+           one of the other keys may use an algorithm we don't support. If that's 
-+           the case the zone is insecure for us. */
-+        
-+        if (!(crecp = cache_find_by_name(NULL, keyname, now, F_DNSKEY)))
-+          return STAT_NEED_KEY;
-+
-+        do 
-+          {
-+            if (crecp->uid == (unsigned int)class && !algo_digest_name(crecp->addr.key.algo))
-+              return STAT_INSECURE;
-+          }
-+        while ((crecp = cache_find_by_name(crecp, keyname, now, F_DNSKEY)));
-+      }
-+
-       if (name_start == 0)
-       break;
--- 
-1.7.10.4
-
diff --git a/src/patches/dnsmasq/021-Tweaks_to_EDNS0_handling_in_DNS_replies.patch b/src/patches/dnsmasq/021-Tweaks_to_EDNS0_handling_in_DNS_replies.patch
deleted file mode 100644 (file)
index c3c74cc..0000000
+++ /dev/null
@@ -1,133 +0,0 @@
-From dd4ad9ac7ea6d51dcc34a1f2cd2da14efbb87714 Mon Sep 17 00:00:00 2001
-From: Simon Kelley <simon@thekelleys.org.uk>
-Date: Thu, 17 Dec 2015 10:44:58 +0000
-Subject: [PATCH] Tweaks to EDNS0 handling in DNS replies.
-
----
- src/dnssec.c  |   20 +++++++++-----------
- src/rfc1035.c |   57 +++++++++++++++++++++++++++++++++------------------------
- 2 files changed, 42 insertions(+), 35 deletions(-)
-
-diff --git a/src/dnssec.c b/src/dnssec.c
-index dc563e0..012b2a6 100644
---- a/src/dnssec.c
-+++ b/src/dnssec.c
-@@ -2129,18 +2129,16 @@ int dnssec_validate_reply(time_t now, struct dns_header *header, size_t plen, ch
-           /* Empty DS without NSECS */
-           if (qtype == T_DS)
-             return STAT_BOGUS;
--          else
-+          
-+          rc = zone_status(name, qclass, keyname, now);
-+          if (rc != STAT_SECURE)
-             {
--              rc = zone_status(name, qclass, keyname, now);
--              if (rc != STAT_SECURE)
--                {
--                  if (class)
--                    *class = qclass; /* Class for NEED_DS or NEED_DNSKEY */
--                  return rc;
--                } 
--              
--              return STAT_BOGUS; /* signed zone, no NSECs */
--            }
-+              if (class)
-+                *class = qclass; /* Class for NEED_DS or NEED_DNSKEY */
-+              return rc;
-+            } 
-+          
-+          return STAT_BOGUS; /* signed zone, no NSECs */
-         }
-         if (nsec_type == T_NSEC)
-diff --git a/src/rfc1035.c b/src/rfc1035.c
-index def8fa0..188d05f 100644
---- a/src/rfc1035.c
-+++ b/src/rfc1035.c
-@@ -1539,7 +1539,13 @@ size_t answer_request(struct dns_header *header, char *limit, size_t qlen,
-   int nxdomain = 0, auth = 1, trunc = 0, sec_data = 1;
-   struct mx_srv_record *rec;
-   size_t len;
-- 
-+  
-+  if (ntohs(header->ancount) != 0 ||
-+      ntohs(header->nscount) != 0 ||
-+      ntohs(header->qdcount) == 0 || 
-+      OPCODE(header) != QUERY )
-+    return 0;
-+  
-   /* Don't return AD set if checking disabled. */
-   if (header->hb4 & HB4_CD)
-     sec_data = 0;
-@@ -1548,33 +1554,32 @@ size_t answer_request(struct dns_header *header, char *limit, size_t qlen,
-   *ad_reqd = header->hb4 & HB4_AD;
-   *do_bit = 0;
--  /* If there is an RFC2671 pseudoheader then it will be overwritten by
-+  /* If there is an  additional data section then it will be overwritten by
-      partial replies, so we have to do a dry run to see if we can answer
--     the query. We check to see if the do bit is set, if so we always
--     forward rather than answering from the cache, which doesn't include
--     security information, unless we're in DNSSEC validation mode. */
-+     the query. */
--  if (find_pseudoheader(header, qlen, NULL, &pheader, NULL))
--    { 
--      unsigned short flags;
--      
--      have_pseudoheader = 1;
-+  if (ntohs(header->arcount) != 0)
-+    {
-+      dryrun = 1;
--      pheader += 4; /* udp size, ext_rcode */
--      GETSHORT(flags, pheader);
--      
--      if ((sec_reqd = flags & 0x8000))
--      {
--        *do_bit = 1;/* do bit */ 
--        *ad_reqd = 1;
-+      /* If there's an additional section, there might be an EDNS(0) pseudoheader */
-+      if (find_pseudoheader(header, qlen, NULL, &pheader, NULL))
-+      { 
-+        unsigned short flags;
-+        
-+        have_pseudoheader = 1;
-+        
-+        pheader += 4; /* udp size, ext_rcode */
-+        GETSHORT(flags, pheader);
-+        
-+        if ((sec_reqd = flags & 0x8000))
-+          {
-+            *do_bit = 1;/* do bit */ 
-+            *ad_reqd = 1;
-+          }
-       }
--
--      dryrun = 1;
-     }
--  if (ntohs(header->qdcount) == 0 || OPCODE(header) != QUERY )
--    return 0;
--  
-   for (rec = daemon->mxnames; rec; rec = rec->next)
-     rec->offset = 0;
-   
-@@ -1730,8 +1735,12 @@ size_t answer_request(struct dns_header *header, char *limit, size_t qlen,
-               }
-             else if ((crecp = cache_find_by_addr(NULL, &addr, now, is_arpa)))
-               {
--                /* Don't use cache when DNSSEC data required. */
--                if ((crecp->flags & (F_HOSTS | F_DHCP | F_CONFIG)) || !sec_reqd || !(crecp->flags & F_DNSSECOK))
-+                /* Don't use cache when DNSSEC data required, unless we know that
-+                   the zone is unsigned, which implies that we're doing
-+                   validation. */
-+                if ((crecp->flags & (F_HOSTS | F_DHCP | F_CONFIG)) || 
-+                    !sec_reqd || 
-+                    (option_bool(OPT_DNSSEC_VALID) && !(crecp->flags & F_DNSSECOK)))
-                   {
-                     do 
-                       { 
--- 
-1.7.10.4
-
diff --git a/src/patches/dnsmasq/022-Tidy_up_DNSSEC_non-existence_code_Check_zone_status_is_NSEC_proof_bad.patch b/src/patches/dnsmasq/022-Tidy_up_DNSSEC_non-existence_code_Check_zone_status_is_NSEC_proof_bad.patch
deleted file mode 100644 (file)
index 60503e9..0000000
+++ /dev/null
@@ -1,409 +0,0 @@
-From b40f26c0199235073abc37e1e1d6ed93bed372f5 Mon Sep 17 00:00:00 2001
-From: Simon Kelley <simon@thekelleys.org.uk>
-Date: Thu, 17 Dec 2015 11:57:26 +0000
-Subject: [PATCH] Tidy up DNSSEC non-existence code. Check zone status is NSEC
- proof bad.
-
----
- src/dnssec.c |  207 +++++++++++++++++++++++++---------------------------------
- 1 file changed, 90 insertions(+), 117 deletions(-)
-
-diff --git a/src/dnssec.c b/src/dnssec.c
-index 012b2a6..ddae497 100644
---- a/src/dnssec.c
-+++ b/src/dnssec.c
-@@ -1367,59 +1367,6 @@ static int hostname_cmp(const char *a, const char *b)
-     }
- }
--/* Find all the NSEC or NSEC3 records in a reply.
--   return an array of pointers to them. */
--static int find_nsec_records(struct dns_header *header, size_t plen, unsigned char ***nsecsetp, int *nsecsetl, int class_reqd)
--{
--  static unsigned char **nsecset = NULL;
--  static int nsecset_sz = 0;
--  
--  int type_found = 0;
--  unsigned char *p = skip_questions(header, plen);
--  int type, class, rdlen, i, nsecs_found;
--
--  /* Move to NS section */
--  if (!p || !(p = skip_section(p, ntohs(header->ancount), header, plen)))
--    return 0;
--  
--  for (nsecs_found = 0, i = ntohs(header->nscount); i != 0; i--)
--    {
--      unsigned char *pstart = p;
--      
--      if (!(p = skip_name(p, header, plen, 10)))
--      return 0;
--      
--      GETSHORT(type, p); 
--      GETSHORT(class, p);
--      p += 4; /* TTL */
--      GETSHORT(rdlen, p);
--
--      if (class == class_reqd && (type == T_NSEC || type == T_NSEC3))
--      {
--        /* No mixed NSECing 'round here, thankyouverymuch */
--        if (type_found == T_NSEC && type == T_NSEC3)
--          return 0;
--        if (type_found == T_NSEC3 && type == T_NSEC)
--          return 0;
--
--        type_found = type;
--
--        if (!expand_workspace(&nsecset, &nsecset_sz, nsecs_found))
--          return 0; 
--        
--        nsecset[nsecs_found++] = pstart;
--      }
--      
--      if (!ADD_RDLEN(header, p, plen, rdlen))
--      return 0;
--    }
--  
--  *nsecsetp = nsecset;
--  *nsecsetl = nsecs_found;
--  
--  return type_found;
--}
--
- static int prove_non_existence_nsec(struct dns_header *header, size_t plen, unsigned char **nsecs, int nsec_count,
-                                   char *workspace1, char *workspace2, char *name, int type, int *nons)
- {
-@@ -1436,12 +1383,12 @@ static int prove_non_existence_nsec(struct dns_header *header, size_t plen, unsi
-     {
-       p = nsecs[i];
-       if (!extract_name(header, plen, &p, workspace1, 1, 10))
--      return STAT_BOGUS;
-+      return 0;
-       p += 8; /* class, type, TTL */
-       GETSHORT(rdlen, p);
-       psave = p;
-       if (!extract_name(header, plen, &p, workspace2, 1, 10))
--      return STAT_BOGUS;
-+      return 0;
-       
-       rc = hostname_cmp(workspace1, name);
-       
-@@ -1449,7 +1396,7 @@ static int prove_non_existence_nsec(struct dns_header *header, size_t plen, unsi
-       {
-         /* 4035 para 5.4. Last sentence */
-         if (type == T_NSEC || type == T_RRSIG)
--          return STAT_SECURE;
-+          return 1;
-         /* NSEC with the same name as the RR we're testing, check
-            that the type in question doesn't appear in the type map */
-@@ -1465,24 +1412,24 @@ static int prove_non_existence_nsec(struct dns_header *header, size_t plen, unsi
-             /* A CNAME answer would also be valid, so if there's a CNAME is should 
-                have been returned. */
-             if ((p[2] & (0x80 >> T_CNAME)) != 0)
--              return STAT_BOGUS;
-+              return 0;
-             
-             /* If the SOA bit is set for a DS record, then we have the
-                DS from the wrong side of the delegation. */
-             if (type == T_DS && (p[2] & (0x80 >> T_SOA)) != 0)
--              return STAT_BOGUS;
-+              return 0;
-           }
-         while (rdlen >= 2)
-           {
-             if (!CHECK_LEN(header, p, plen, rdlen))
--              return STAT_BOGUS;
-+              return 0;
-             
-             if (p[0] == type >> 8)
-               {
-                 /* Does the NSEC say our type exists? */
-                 if (offset < p[1] && (p[offset+2] & mask) != 0)
--                  return STAT_BOGUS;
-+                  return 0;
-                 
-                 break; /* finshed checking */
-               }
-@@ -1491,24 +1438,24 @@ static int prove_non_existence_nsec(struct dns_header *header, size_t plen, unsi
-             p +=  p[1];
-           }
-         
--        return STAT_SECURE;
-+        return 1;
-       }
-       else if (rc == -1)
-       {
-         /* Normal case, name falls between NSEC name and next domain name,
-            wrap around case, name falls between NSEC name (rc == -1) and end */
-         if (hostname_cmp(workspace2, name) >= 0 || hostname_cmp(workspace1, workspace2) >= 0)
--          return STAT_SECURE;
-+          return 1;
-       }
-       else 
-       {
-         /* wrap around case, name falls between start and next domain name */
-         if (hostname_cmp(workspace1, workspace2) >= 0 && hostname_cmp(workspace2, name) >=0 )
--          return STAT_SECURE;
-+          return 1;
-       }
-     }
-   
--  return STAT_BOGUS;
-+  return 0;
- }
- /* return digest length, or zero on error */
-@@ -1701,7 +1648,7 @@ static int prove_non_existence_nsec3(struct dns_header *header, size_t plen, uns
-   for (i = 0; i < nsec_count; i++)
-     {
-       if (!(p = skip_name(nsecs[i], header, plen, 15)))
--      return STAT_BOGUS; /* bad packet */
-+      return 0; /* bad packet */
-       
-       p += 10; /* type, class, TTL, rdlen */
-       algo = *p++;
-@@ -1712,14 +1659,14 @@ static int prove_non_existence_nsec3(struct dns_header *header, size_t plen, uns
-   /* No usable NSEC3s */
-   if (i == nsec_count)
--    return STAT_BOGUS;
-+    return 0;
-   p++; /* flags */
-   GETSHORT (iterations, p);
-   salt_len = *p++;
-   salt = p;
-   if (!CHECK_LEN(header, salt, plen, salt_len))
--    return STAT_BOGUS; /* bad packet */
-+    return 0; /* bad packet */
-     
-   /* Now prune so we only have NSEC3 records with same iterations, salt and algo */
-   for (i = 0; i < nsec_count; i++)
-@@ -1730,7 +1677,7 @@ static int prove_non_existence_nsec3(struct dns_header *header, size_t plen, uns
-       nsecs[i] = NULL; /* Speculative, will be restored if OK. */
-       
-       if (!(p = skip_name(nsec3p, header, plen, 15)))
--      return STAT_BOGUS; /* bad packet */
-+      return 0; /* bad packet */
-       
-       p += 10; /* type, class, TTL, rdlen */
-       
-@@ -1747,7 +1694,7 @@ static int prove_non_existence_nsec3(struct dns_header *header, size_t plen, uns
-       continue;
-       
-       if (!CHECK_LEN(header, p, plen, salt_len))
--      return STAT_BOGUS; /* bad packet */
-+      return 0; /* bad packet */
-       if (memcmp(p, salt, salt_len) != 0)
-       continue;
-@@ -1758,13 +1705,13 @@ static int prove_non_existence_nsec3(struct dns_header *header, size_t plen, uns
-   /* Algo is checked as 1 above */
-   if (!(hash = hash_find("sha1")))
--    return STAT_BOGUS;
-+    return 0;
-   if ((digest_len = hash_name(name, &digest, hash, salt, salt_len, iterations)) == 0)
--    return STAT_BOGUS;
-+    return 0;
-   
-   if (check_nsec3_coverage(header, plen, digest_len, digest, type, workspace1, workspace2, nsecs, nsec_count, nons))
--    return STAT_SECURE;
-+    return 1;
-   /* Can't find an NSEC3 which covers the name directly, we need the "closest encloser NSEC3" 
-      or an answer inferred from a wildcard record. */
-@@ -1780,14 +1727,14 @@ static int prove_non_existence_nsec3(struct dns_header *header, size_t plen, uns
-       break;
-       if ((digest_len = hash_name(closest_encloser, &digest, hash, salt, salt_len, iterations)) == 0)
--      return STAT_BOGUS;
-+      return 0;
-       
-       for (i = 0; i < nsec_count; i++)
-       if ((p = nsecs[i]))
-         {
-           if (!extract_name(header, plen, &p, workspace1, 1, 0) ||
-               !(base32_len = base32_decode(workspace1, (unsigned char *)workspace2)))
--            return STAT_BOGUS;
-+            return 0;
-         
-           if (digest_len == base32_len &&
-               memcmp(digest, workspace2, digest_len) == 0)
-@@ -1802,32 +1749,81 @@ static int prove_non_existence_nsec3(struct dns_header *header, size_t plen, uns
-   while ((closest_encloser = strchr(closest_encloser, '.')));
-   
-   if (!closest_encloser)
--    return STAT_BOGUS;
-+    return 0;
-   
-   /* Look for NSEC3 that proves the non-existence of the next-closest encloser */
-   if ((digest_len = hash_name(next_closest, &digest, hash, salt, salt_len, iterations)) == 0)
--    return STAT_BOGUS;
-+    return 0;
-   if (!check_nsec3_coverage(header, plen, digest_len, digest, type, workspace1, workspace2, nsecs, nsec_count, NULL))
--    return STAT_BOGUS;
-+    return 0;
-   
-   /* Finally, check that there's no seat of wildcard synthesis */
-   if (!wildname)
-     {
-       if (!(wildcard = strchr(next_closest, '.')) || wildcard == next_closest)
--      return STAT_BOGUS;
-+      return 0;
-       
-       wildcard--;
-       *wildcard = '*';
-       
-       if ((digest_len = hash_name(wildcard, &digest, hash, salt, salt_len, iterations)) == 0)
--      return STAT_BOGUS;
-+      return 0;
-       
-       if (!check_nsec3_coverage(header, plen, digest_len, digest, type, workspace1, workspace2, nsecs, nsec_count, NULL))
--      return STAT_BOGUS;
-+      return 0;
-     }
-   
--  return STAT_SECURE;
-+  return 1;
-+}
-+
-+static int prove_non_existence(struct dns_header *header, size_t plen, char *keyname, char *name, int qtype, int qclass, char *wildname, int *nons)
-+{
-+  static unsigned char **nsecset = NULL;
-+  static int nsecset_sz = 0;
-+  
-+  int type_found = 0;
-+  unsigned char *p = skip_questions(header, plen);
-+  int type, class, rdlen, i, nsecs_found;
-+  
-+  /* Move to NS section */
-+  if (!p || !(p = skip_section(p, ntohs(header->ancount), header, plen)))
-+    return 0;
-+  
-+  for (nsecs_found = 0, i = ntohs(header->nscount); i != 0; i--)
-+    {
-+      unsigned char *pstart = p;
-+      
-+      if (!(p = skip_name(p, header, plen, 10)))
-+      return 0;
-+      
-+      GETSHORT(type, p); 
-+      GETSHORT(class, p);
-+      p += 4; /* TTL */
-+      GETSHORT(rdlen, p);
-+
-+      if (class == qclass && (type == T_NSEC || type == T_NSEC3))
-+      {
-+        /* No mixed NSECing 'round here, thankyouverymuch */
-+        if (type_found != 0 && type_found != type)
-+          return 0;
-+
-+        type_found = type;
-+
-+        if (!expand_workspace(&nsecset, &nsecset_sz, nsecs_found))
-+          return 0; 
-+        
-+        nsecset[nsecs_found++] = pstart;
-+      }
-+      
-+      if (!ADD_RDLEN(header, p, plen, rdlen))
-+      return 0;
-+    }
-+  
-+  if (type_found == T_NSEC)
-+    return prove_non_existence_nsec(header, plen, nsecset, nsecs_found, daemon->workspacename, keyname, name, qtype, nons);
-+  else
-+    return prove_non_existence_nsec3(header, plen, nsecset, nsecs_found, daemon->workspacename, keyname, name, qtype, wildname, nons);
- }
- /* Check signing status of name.
-@@ -1925,10 +1921,9 @@ int dnssec_validate_reply(time_t now, struct dns_header *header, size_t plen, ch
-   static unsigned char **targets = NULL;
-   static int target_sz = 0;
--  unsigned char *ans_start, *p1, *p2, **nsecs;
-+  unsigned char *ans_start, *p1, *p2;
-   int type1, class1, rdlen1, type2, class2, rdlen2, qclass, qtype, targetidx;
--  int i, j, rc, nsec_count;
--  int nsec_type;
-+  int i, j, rc;
-   if (neganswer)
-     *neganswer = 0;
-@@ -2080,28 +2075,15 @@ int dnssec_validate_reply(time_t now, struct dns_header *header, size_t plen, ch
-                         targets[j] = NULL;
-                     }
-                           
--                if (rc == STAT_SECURE_WILDCARD)
--                  {
--                    /* An attacker replay a wildcard answer with a different
--                       answer and overlay a genuine RR. To prove this
--                       hasn't happened, the answer must prove that
--                       the gennuine record doesn't exist. Check that here. */
--                    if (!(nsec_type = find_nsec_records(header, plen, &nsecs, &nsec_count, class1)))
--                      return STAT_BOGUS; /* No NSECs or bad packet */
--                    
--                    /* Note that we may not yet have validated the NSEC/NSEC3 RRsets. Since the check
--                       below returns either SECURE or BOGUS, that's not a problem. If the RRsets later fail
--                       we'll return BOGUS then. */
--
--                    if (nsec_type == T_NSEC)
--                      rc = prove_non_existence_nsec(header, plen, nsecs, nsec_count, daemon->workspacename, keyname, name, type1, NULL);
--                    else
--                      rc = prove_non_existence_nsec3(header, plen, nsecs, nsec_count, daemon->workspacename, 
--                                                     keyname, name, type1, wildname, NULL);
--                    
--                    if (rc == STAT_BOGUS)
--                      return rc;
--                  } 
-+                 /* An attacker replay a wildcard answer with a different
-+                    answer and overlay a genuine RR. To prove this
-+                    hasn't happened, the answer must prove that
-+                    the gennuine record doesn't exist. Check that here. 
-+                    Note that we may not yet have validated the NSEC/NSEC3 RRsets. 
-+                    That's not a problem since if the RRsets later fail
-+                    we'll return BOGUS then. */
-+                if (rc == STAT_SECURE_WILDCARD && !prove_non_existence(header, plen, keyname, name, type1, class1, wildname, NULL))
-+                  return STAT_BOGUS;
-               }
-           }
-       }
-@@ -2124,14 +2106,13 @@ int dnssec_validate_reply(time_t now, struct dns_header *header, size_t plen, ch
-       /* For anything other than a DS record, this situation is OK if either
-          the answer is in an unsigned zone, or there's a NSEC records. */
--      if (!(nsec_type = find_nsec_records(header, plen, &nsecs, &nsec_count, qclass)))
-+      if (!prove_non_existence(header, plen, keyname, name, qtype, qclass, NULL, nons))
-         {
-           /* Empty DS without NSECS */
-           if (qtype == T_DS)
-             return STAT_BOGUS;
-           
--          rc = zone_status(name, qclass, keyname, now);
--          if (rc != STAT_SECURE)
-+          if ((rc = zone_status(name, qclass, keyname, now)) != STAT_SECURE)
-             {
-               if (class)
-                 *class = qclass; /* Class for NEED_DS or NEED_DNSKEY */
-@@ -2140,14 +2121,6 @@ int dnssec_validate_reply(time_t now, struct dns_header *header, size_t plen, ch
-           
-           return STAT_BOGUS; /* signed zone, no NSECs */
-         }
--
--        if (nsec_type == T_NSEC)
--        rc = prove_non_existence_nsec(header, plen, nsecs, nsec_count, daemon->workspacename, keyname, name, qtype, nons);
--      else
--        rc = prove_non_existence_nsec3(header, plen, nsecs, nsec_count, daemon->workspacename, keyname, name, qtype, NULL, nons);
--
--      if (rc != STAT_SECURE)
--        return rc;
-       }
-   
-   return STAT_SECURE;
--- 
-1.7.10.4
-
diff --git a/src/patches/dnsmasq/023-Fix_brace_botch_in_dnssec_validate_ds.patch b/src/patches/dnsmasq/023-Fix_brace_botch_in_dnssec_validate_ds.patch
deleted file mode 100644 (file)
index eda6fbd..0000000
+++ /dev/null
@@ -1,98 +0,0 @@
-From 3b799c826db05fc2da1c6d15cbe372e394209d27 Mon Sep 17 00:00:00 2001
-From: Simon Kelley <simon@thekelleys.org.uk>
-Date: Thu, 17 Dec 2015 16:58:04 +0000
-Subject: [PATCH] Fix brace botch in dnssec_validate_ds()
-MIME-Version: 1.0
-Content-Type: text/plain; charset=utf8
-Content-Transfer-Encoding: 8bit
-
-Thanks to MichaÃ…\82 KÄ\99pieÃ…\84 for spotting this.
----
- src/dnssec.c |   34 +++++++++++++++++-----------------
- 1 file changed, 17 insertions(+), 17 deletions(-)
-
-diff --git a/src/dnssec.c b/src/dnssec.c
-index ddae497..1f8c954 100644
---- a/src/dnssec.c
-+++ b/src/dnssec.c
-@@ -923,11 +923,11 @@ static int validate_rrset(time_t now, struct dns_header *header, size_t plen, in
- /* The DNS packet is expected to contain the answer to a DNSKEY query.
-    Put all DNSKEYs in the answer which are valid into the cache.
-    return codes:
--         STAT_OK           Done, key(s) in cache.
--       STAT_BOGUS        No DNSKEYs found, which  can be validated with DS,
--                         or self-sign for DNSKEY RRset is not valid, bad packet.
--       STAT_NEED_DS      DS records to validate a key not found, name in keyname 
--       STAT_NEED_DNSKEY  DNSKEY records to validate a key not found, name in keyname 
-+         STAT_OK        Done, key(s) in cache.
-+       STAT_BOGUS     No DNSKEYs found, which  can be validated with DS,
-+                      or self-sign for DNSKEY RRset is not valid, bad packet.
-+       STAT_NEED_DS   DS records to validate a key not found, name in keyname 
-+       STAT_NEED_KEY  DNSKEY records to validate a key not found, name in keyname 
- */
- int dnssec_validate_by_ds(time_t now, struct dns_header *header, size_t plen, char *name, char *keyname, int class)
- {
-@@ -1224,13 +1224,13 @@ int dnssec_validate_ds(time_t now, struct dns_header *header, size_t plen, char
-               }
-             
-             p = psave;
--            
--            if (!ADD_RDLEN(header, p, plen, rdlen))
--              return STAT_BOGUS; /* bad packet */
-           }
--        
--        cache_end_insert();
-+        if (!ADD_RDLEN(header, p, plen, rdlen))
-+          return STAT_BOGUS; /* bad packet */
-       }
-+
-+      cache_end_insert();
-+
-     }
-   else
-     {
-@@ -1828,10 +1828,10 @@ static int prove_non_existence(struct dns_header *header, size_t plen, char *key
- /* Check signing status of name.
-    returns:
--   STAT_SECURE      zone is signed.
--   STAT_INSECURE    zone proved unsigned.
--   STAT_NEED_DS     require DS record of name returned in keyname.
--   STAT_NEED_DNSKEY require DNSKEY record of name returned in keyname.
-+   STAT_SECURE   zone is signed.
-+   STAT_INSECURE zone proved unsigned.
-+   STAT_NEED_DS  require DS record of name returned in keyname.
-+   STAT_NEED_KEY require DNSKEY record of name returned in keyname.
-    name returned unaltered.
- */
- static int zone_status(char *name, int class, char *keyname, time_t now)
-@@ -2028,7 +2028,7 @@ int dnssec_validate_reply(time_t now, struct dns_header *header, size_t plen, ch
-                     if (rc == STAT_SECURE)
-                       rc = STAT_BOGUS;
-                      if (class)
--                       *class = class1; /* Class for NEED_DS or NEED_DNSKEY */
-+                       *class = class1; /* Class for NEED_DS or NEED_KEY */
-                   }
-                 else 
-                   rc = STAT_INSECURE; 
-@@ -2045,7 +2045,7 @@ int dnssec_validate_reply(time_t now, struct dns_header *header, size_t plen, ch
-               {
-                 /* Zone is insecure, don't need to validate RRset */
-                 if (class)
--                  *class = class1; /* Class for NEED_DS or NEED_DNSKEY */
-+                  *class = class1; /* Class for NEED_DS or NEED_KEY */
-                 return rc;
-               } 
-             
-@@ -2115,7 +2115,7 @@ int dnssec_validate_reply(time_t now, struct dns_header *header, size_t plen, ch
-           if ((rc = zone_status(name, qclass, keyname, now)) != STAT_SECURE)
-             {
-               if (class)
--                *class = qclass; /* Class for NEED_DS or NEED_DNSKEY */
-+                *class = qclass; /* Class for NEED_DS or NEED_KEY */
-               return rc;
-             } 
-           
--- 
-1.7.10.4
-
diff --git a/src/patches/dnsmasq/024-Do_a_better_job_of_determining_which_DNSSEC_sig_algos_are_supported.patch b/src/patches/dnsmasq/024-Do_a_better_job_of_determining_which_DNSSEC_sig_algos_are_supported.patch
deleted file mode 100644 (file)
index abcae5c..0000000
+++ /dev/null
@@ -1,145 +0,0 @@
-From 14a4ae883d51130d33da7133287e8867c64bab65 Mon Sep 17 00:00:00 2001
-From: Simon Kelley <simon@thekelleys.org.uk>
-Date: Thu, 17 Dec 2015 17:23:03 +0000
-Subject: [PATCH] Do a better job of determining which DNSSEC sig algos are
- supported.
-
----
- src/dnssec.c |   52 +++++++++++++++++++++++++++++++++++++---------------
- 1 file changed, 37 insertions(+), 15 deletions(-)
-
-diff --git a/src/dnssec.c b/src/dnssec.c
-index 1f8c954..82394ee 100644
---- a/src/dnssec.c
-+++ b/src/dnssec.c
-@@ -65,10 +65,9 @@ static char *algo_digest_name(int algo)
-     case 8: return "sha256";
-     case 10: return "sha512";
-     case 12: return "gosthash94";
--#ifndef NO_NETTLE_ECC
-     case 13: return "sha256";
-     case 14: return "sha384";
--#endif
-+
-     default: return NULL;
-     }
- }
-@@ -129,13 +128,15 @@ static int hash_init(const struct nettle_hash *hash, void **ctxp, unsigned char
- }
-   
- static int dnsmasq_rsa_verify(struct blockdata *key_data, unsigned int key_len, unsigned char *sig, size_t sig_len,
--                            unsigned char *digest, int algo)
-+                            unsigned char *digest, size_t digest_len, int algo)
- {
-   unsigned char *p;
-   size_t exp_len;
-   
-   static struct rsa_public_key *key = NULL;
-   static mpz_t sig_mpz;
-+
-+  (void)digest_len;
-   
-   if (key == NULL)
-     {
-@@ -181,7 +182,7 @@ static int dnsmasq_rsa_verify(struct blockdata *key_data, unsigned int key_len,
- }  
- static int dnsmasq_dsa_verify(struct blockdata *key_data, unsigned int key_len, unsigned char *sig, size_t sig_len,
--                            unsigned char *digest, int algo)
-+                            unsigned char *digest, size_t digest_len, int algo)
- {
-   unsigned char *p;
-   unsigned int t;
-@@ -189,6 +190,8 @@ static int dnsmasq_dsa_verify(struct blockdata *key_data, unsigned int key_len,
-   static struct dsa_public_key *key = NULL;
-   static struct dsa_signature *sig_struct;
-   
-+  (void)digest_len;
-+
-   if (key == NULL)
-     {
-       if (!(sig_struct = whine_malloc(sizeof(struct dsa_signature))) || 
-@@ -292,26 +295,45 @@ static int dnsmasq_ecdsa_verify(struct blockdata *key_data, unsigned int key_len
- } 
- #endif 
--static int verify(struct blockdata *key_data, unsigned int key_len, unsigned char *sig, size_t sig_len,
--                unsigned char *digest, size_t digest_len, int algo)
-+static int (*verify_func(int algo))(struct blockdata *key_data, unsigned int key_len, unsigned char *sig, size_t sig_len,
-+                                  unsigned char *digest, size_t digest_len, int algo)
- {
--  (void)digest_len;
--
-+    
-+  /* Enure at runtime that we have support for this digest */
-+  if (!hash_find(algo_digest_name(algo)))
-+    return NULL;
-+  
-+  /* This switch defines which sig algorithms we support, can't introspect Nettle for that. */
-   switch (algo)
-     {
-     case 1: case 5: case 7: case 8: case 10:
--      return dnsmasq_rsa_verify(key_data, key_len, sig, sig_len, digest, algo);
-+      return dnsmasq_rsa_verify;
-       
-     case 3: case 6: 
--      return dnsmasq_dsa_verify(key_data, key_len, sig, sig_len, digest, algo);
-+      return dnsmasq_dsa_verify;
-  
- #ifndef NO_NETTLE_ECC   
-     case 13: case 14:
--      return dnsmasq_ecdsa_verify(key_data, key_len, sig, sig_len, digest, digest_len, algo);
-+      return dnsmasq_ecdsa_verify;
- #endif
-     }
-   
--  return 0;
-+  return NULL;
-+}
-+
-+static int verify(struct blockdata *key_data, unsigned int key_len, unsigned char *sig, size_t sig_len,
-+                unsigned char *digest, size_t digest_len, int algo)
-+{
-+
-+  int (*func)(struct blockdata *key_data, unsigned int key_len, unsigned char *sig, size_t sig_len,
-+            unsigned char *digest, size_t digest_len, int algo);
-+  
-+  func = verify_func(algo);
-+  
-+  if (!func)
-+    return 0;
-+
-+  return (*func)(key_data, key_len, sig, sig_len, digest, digest_len, algo);
- }
- /* Convert from presentation format to wire format, in place.
-@@ -732,7 +754,7 @@ static int explore_rrset(struct dns_header *header, size_t plen, int class, int
-             if (check_date_range(sig_inception, sig_expiration) &&
-                 labels <= name_labels &&
-                 type_covered == type && 
--                algo_digest_name(algo))
-+                verify_func(algo))
-               {
-                 if (!expand_workspace(&sigs, &sig_sz, sigidx))
-                   return 0; 
-@@ -1865,7 +1887,7 @@ static int zone_status(char *name, int class, char *keyname, time_t now)
-                     if (crecp->flags & F_DNSSECOK)
-                       return STAT_INSECURE; /* proved no DS here */
-                   }
--                else if (!ds_digest_name(crecp->addr.ds.digest) || !algo_digest_name(crecp->addr.ds.algo))
-+                else if (!hash_find(ds_digest_name(crecp->addr.ds.digest)) || !verify_func(crecp->addr.ds.algo))
-                   return STAT_INSECURE; /* algo we can't use - insecure */
-                 else
-                   secure_ds = 1;
-@@ -1887,7 +1909,7 @@ static int zone_status(char *name, int class, char *keyname, time_t now)
-         do 
-           {
--            if (crecp->uid == (unsigned int)class && !algo_digest_name(crecp->addr.key.algo))
-+            if (crecp->uid == (unsigned int)class && !verify_func(crecp->addr.key.algo))
-               return STAT_INSECURE;
-           }
-         while ((crecp = cache_find_by_name(crecp, keyname, now, F_DNSKEY)));
--- 
-1.7.10.4
-
diff --git a/src/patches/gcc/gcc-fix-inlining-issues.patch b/src/patches/gcc/gcc-fix-inlining-issues.patch
new file mode 100644 (file)
index 0000000..3c638e2
--- /dev/null
@@ -0,0 +1,1064 @@
+From: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61164
+
+--- trunk/libitm/local_atomic  2015/08/20 17:43:55     227039
++++ trunk/libitm/local_atomic  2015/08/20 17:55:24     227040
+@@ -41,8 +41,7 @@
+ #ifndef _GLIBCXX_ATOMIC
+ #define _GLIBCXX_ATOMIC 1
+-#undef  __always_inline
+-#define __always_inline __attribute__((always_inline))
++#define __libitm_always_inline __attribute__((always_inline))
+ // #pragma GCC system_header
+@@ -74,7 +73,7 @@
+       memory_order_seq_cst
+     } memory_order;
+-  inline __always_inline memory_order
++  inline __libitm_always_inline memory_order
+   __calculate_memory_order(memory_order __m) noexcept
+   {
+     const bool __cond1 = __m == memory_order_release;
+@@ -84,13 +83,13 @@
+     return __mo2;
+   }
+-  inline __always_inline void
++  inline __libitm_always_inline void
+   atomic_thread_fence(memory_order __m) noexcept
+   {
+     __atomic_thread_fence (__m);
+   }
+-  inline __always_inline void
++  inline __libitm_always_inline void
+   atomic_signal_fence(memory_order __m) noexcept
+   {
+     __atomic_thread_fence (__m);
+@@ -280,19 +279,19 @@
+     // Conversion to ATOMIC_FLAG_INIT.
+     atomic_flag(bool __i) noexcept : __atomic_flag_base({ __i }) { }
+-    __always_inline bool
++    __libitm_always_inline bool
+     test_and_set(memory_order __m = memory_order_seq_cst) noexcept
+     {
+       return __atomic_test_and_set (&_M_i, __m);
+     }
+-    __always_inline bool
++    __libitm_always_inline bool
+     test_and_set(memory_order __m = memory_order_seq_cst) volatile noexcept
+     {
+       return __atomic_test_and_set (&_M_i, __m);
+     }
+-    __always_inline void
++    __libitm_always_inline void
+     clear(memory_order __m = memory_order_seq_cst) noexcept
+     {
+       // __glibcxx_assert(__m != memory_order_consume);
+@@ -302,7 +301,7 @@
+       __atomic_clear (&_M_i, __m);
+     }
+-    __always_inline void
++    __libitm_always_inline void
+     clear(memory_order __m = memory_order_seq_cst) volatile noexcept
+     {
+       // __glibcxx_assert(__m != memory_order_consume);
+@@ -455,7 +454,7 @@
+       is_lock_free() const volatile noexcept
+       { return __atomic_is_lock_free (sizeof (_M_i), &_M_i); }
+-      __always_inline void
++      __libitm_always_inline void
+       store(__int_type __i, memory_order __m = memory_order_seq_cst) noexcept
+       {
+       // __glibcxx_assert(__m != memory_order_acquire);
+@@ -465,7 +464,7 @@
+       __atomic_store_n(&_M_i, __i, __m);
+       }
+-      __always_inline void
++      __libitm_always_inline void
+       store(__int_type __i,
+           memory_order __m = memory_order_seq_cst) volatile noexcept
+       {
+@@ -476,7 +475,7 @@
+       __atomic_store_n(&_M_i, __i, __m);
+       }
+-      __always_inline __int_type
++      __libitm_always_inline __int_type
+       load(memory_order __m = memory_order_seq_cst) const noexcept
+       {
+       // __glibcxx_assert(__m != memory_order_release);
+@@ -485,7 +484,7 @@
+       return __atomic_load_n(&_M_i, __m);
+       }
+-      __always_inline __int_type
++      __libitm_always_inline __int_type
+       load(memory_order __m = memory_order_seq_cst) const volatile noexcept
+       {
+       // __glibcxx_assert(__m != memory_order_release);
+@@ -494,21 +493,21 @@
+       return __atomic_load_n(&_M_i, __m);
+       }
+-      __always_inline __int_type
++      __libitm_always_inline __int_type
+       exchange(__int_type __i,
+              memory_order __m = memory_order_seq_cst) noexcept
+       {
+       return __atomic_exchange_n(&_M_i, __i, __m);
+       }
+-      __always_inline __int_type
++      __libitm_always_inline __int_type
+       exchange(__int_type __i,
+              memory_order __m = memory_order_seq_cst) volatile noexcept
+       {
+       return __atomic_exchange_n(&_M_i, __i, __m);
+       }
+-      __always_inline bool
++      __libitm_always_inline bool
+       compare_exchange_weak(__int_type& __i1, __int_type __i2,
+                           memory_order __m1, memory_order __m2) noexcept
+       {
+@@ -519,7 +518,7 @@
+       return __atomic_compare_exchange_n(&_M_i, &__i1, __i2, 1, __m1, __m2);
+       }
+-      __always_inline bool
++      __libitm_always_inline bool
+       compare_exchange_weak(__int_type& __i1, __int_type __i2,
+                           memory_order __m1,
+                           memory_order __m2) volatile noexcept
+@@ -531,7 +530,7 @@
+       return __atomic_compare_exchange_n(&_M_i, &__i1, __i2, 1, __m1, __m2);
+       }
+-      __always_inline bool
++      __libitm_always_inline bool
+       compare_exchange_weak(__int_type& __i1, __int_type __i2,
+                           memory_order __m = memory_order_seq_cst) noexcept
+       {
+@@ -539,7 +538,7 @@
+                                    __calculate_memory_order(__m));
+       }
+-      __always_inline bool
++      __libitm_always_inline bool
+       compare_exchange_weak(__int_type& __i1, __int_type __i2,
+                  memory_order __m = memory_order_seq_cst) volatile noexcept
+       {
+@@ -547,7 +546,7 @@
+                                    __calculate_memory_order(__m));
+       }
+-      __always_inline bool
++      __libitm_always_inline bool
+       compare_exchange_strong(__int_type& __i1, __int_type __i2,
+                             memory_order __m1, memory_order __m2) noexcept
+       {
+@@ -558,7 +557,7 @@
+       return __atomic_compare_exchange_n(&_M_i, &__i1, __i2, 0, __m1, __m2);
+       }
+-      __always_inline bool
++      __libitm_always_inline bool
+       compare_exchange_strong(__int_type& __i1, __int_type __i2,
+                             memory_order __m1,
+                             memory_order __m2) volatile noexcept
+@@ -570,7 +569,7 @@
+       return __atomic_compare_exchange_n(&_M_i, &__i1, __i2, 0, __m1, __m2);
+       }
+-      __always_inline bool
++      __libitm_always_inline bool
+       compare_exchange_strong(__int_type& __i1, __int_type __i2,
+                             memory_order __m = memory_order_seq_cst) noexcept
+       {
+@@ -578,7 +577,7 @@
+                                      __calculate_memory_order(__m));
+       }
+-      __always_inline bool
++      __libitm_always_inline bool
+       compare_exchange_strong(__int_type& __i1, __int_type __i2,
+                memory_order __m = memory_order_seq_cst) volatile noexcept
+       {
+@@ -586,52 +585,52 @@
+                                      __calculate_memory_order(__m));
+       }
+-      __always_inline __int_type
++      __libitm_always_inline __int_type
+       fetch_add(__int_type __i,
+               memory_order __m = memory_order_seq_cst) noexcept
+       { return __atomic_fetch_add(&_M_i, __i, __m); }
+-      __always_inline __int_type
++      __libitm_always_inline __int_type
+       fetch_add(__int_type __i,
+               memory_order __m = memory_order_seq_cst) volatile noexcept
+       { return __atomic_fetch_add(&_M_i, __i, __m); }
+-      __always_inline __int_type
++      __libitm_always_inline __int_type
+       fetch_sub(__int_type __i,
+               memory_order __m = memory_order_seq_cst) noexcept
+       { return __atomic_fetch_sub(&_M_i, __i, __m); }
+-      __always_inline __int_type
++      __libitm_always_inline __int_type
+       fetch_sub(__int_type __i,
+               memory_order __m = memory_order_seq_cst) volatile noexcept
+       { return __atomic_fetch_sub(&_M_i, __i, __m); }
+-      __always_inline __int_type
++      __libitm_always_inline __int_type
+       fetch_and(__int_type __i,
+               memory_order __m = memory_order_seq_cst) noexcept
+       { return __atomic_fetch_and(&_M_i, __i, __m); }
+-      __always_inline __int_type
++      __libitm_always_inline __int_type
+       fetch_and(__int_type __i,
+               memory_order __m = memory_order_seq_cst) volatile noexcept
+       { return __atomic_fetch_and(&_M_i, __i, __m); }
+-      __always_inline __int_type
++      __libitm_always_inline __int_type
+       fetch_or(__int_type __i,
+              memory_order __m = memory_order_seq_cst) noexcept
+       { return __atomic_fetch_or(&_M_i, __i, __m); }
+-      __always_inline __int_type
++      __libitm_always_inline __int_type
+       fetch_or(__int_type __i,
+              memory_order __m = memory_order_seq_cst) volatile noexcept
+       { return __atomic_fetch_or(&_M_i, __i, __m); }
+-      __always_inline __int_type
++      __libitm_always_inline __int_type
+       fetch_xor(__int_type __i,
+               memory_order __m = memory_order_seq_cst) noexcept
+       { return __atomic_fetch_xor(&_M_i, __i, __m); }
+-      __always_inline __int_type
++      __libitm_always_inline __int_type
+       fetch_xor(__int_type __i,
+               memory_order __m = memory_order_seq_cst) volatile noexcept
+       { return __atomic_fetch_xor(&_M_i, __i, __m); }
+@@ -733,7 +732,7 @@
+       is_lock_free() const volatile noexcept
+       { return __atomic_is_lock_free (sizeof (_M_p), &_M_p); }
+-      __always_inline void
++      __libitm_always_inline void
+       store(__pointer_type __p,
+           memory_order __m = memory_order_seq_cst) noexcept
+       {
+@@ -744,7 +743,7 @@
+       __atomic_store_n(&_M_p, __p, __m);
+       }
+-      __always_inline void
++      __libitm_always_inline void
+       store(__pointer_type __p,
+           memory_order __m = memory_order_seq_cst) volatile noexcept
+       {
+@@ -755,7 +754,7 @@
+       __atomic_store_n(&_M_p, __p, __m);
+       }
+-      __always_inline __pointer_type
++      __libitm_always_inline __pointer_type
+       load(memory_order __m = memory_order_seq_cst) const noexcept
+       {
+       // __glibcxx_assert(__m != memory_order_release);
+@@ -764,7 +763,7 @@
+       return __atomic_load_n(&_M_p, __m);
+       }
+-      __always_inline __pointer_type
++      __libitm_always_inline __pointer_type
+       load(memory_order __m = memory_order_seq_cst) const volatile noexcept
+       {
+       // __glibcxx_assert(__m != memory_order_release);
+@@ -773,21 +772,21 @@
+       return __atomic_load_n(&_M_p, __m);
+       }
+-      __always_inline __pointer_type
++      __libitm_always_inline __pointer_type
+       exchange(__pointer_type __p,
+              memory_order __m = memory_order_seq_cst) noexcept
+       {
+       return __atomic_exchange_n(&_M_p, __p, __m);
+       }
+-      __always_inline __pointer_type
++      __libitm_always_inline __pointer_type
+       exchange(__pointer_type __p,
+              memory_order __m = memory_order_seq_cst) volatile noexcept
+       {
+       return __atomic_exchange_n(&_M_p, __p, __m);
+       }
+-      __always_inline bool
++      __libitm_always_inline bool
+       compare_exchange_strong(__pointer_type& __p1, __pointer_type __p2,
+                             memory_order __m1,
+                             memory_order __m2) noexcept
+@@ -799,7 +798,7 @@
+       return __atomic_compare_exchange_n(&_M_p, &__p1, __p2, 0, __m1, __m2);
+       }
+-      __always_inline bool
++      __libitm_always_inline bool
+       compare_exchange_strong(__pointer_type& __p1, __pointer_type __p2,
+                             memory_order __m1,
+                             memory_order __m2) volatile noexcept
+@@ -811,22 +810,22 @@
+       return __atomic_compare_exchange_n(&_M_p, &__p1, __p2, 0, __m1, __m2);
+       }
+-      __always_inline __pointer_type
++      __libitm_always_inline __pointer_type
+       fetch_add(ptrdiff_t __d,
+               memory_order __m = memory_order_seq_cst) noexcept
+       { return __atomic_fetch_add(&_M_p, __d, __m); }
+-      __always_inline __pointer_type
++      __libitm_always_inline __pointer_type
+       fetch_add(ptrdiff_t __d,
+               memory_order __m = memory_order_seq_cst) volatile noexcept
+       { return __atomic_fetch_add(&_M_p, __d, __m); }
+-      __always_inline __pointer_type
++      __libitm_always_inline __pointer_type
+       fetch_sub(ptrdiff_t __d,
+               memory_order __m = memory_order_seq_cst) noexcept
+       { return __atomic_fetch_sub(&_M_p, __d, __m); }
+-      __always_inline __pointer_type
++      __libitm_always_inline __pointer_type
+       fetch_sub(ptrdiff_t __d,
+               memory_order __m = memory_order_seq_cst) volatile noexcept
+       { return __atomic_fetch_sub(&_M_p, __d, __m); }
+@@ -870,67 +869,67 @@
+     bool
+     is_lock_free() const volatile noexcept { return _M_base.is_lock_free(); }
+-    __always_inline void
++    __libitm_always_inline void
+     store(bool __i, memory_order __m = memory_order_seq_cst) noexcept
+     { _M_base.store(__i, __m); }
+-    __always_inline void
++    __libitm_always_inline void
+     store(bool __i, memory_order __m = memory_order_seq_cst) volatile noexcept
+     { _M_base.store(__i, __m); }
+-    __always_inline bool
++    __libitm_always_inline bool
+     load(memory_order __m = memory_order_seq_cst) const noexcept
+     { return _M_base.load(__m); }
+-    __always_inline bool
++    __libitm_always_inline bool
+     load(memory_order __m = memory_order_seq_cst) const volatile noexcept
+     { return _M_base.load(__m); }
+-    __always_inline bool
++    __libitm_always_inline bool
+     exchange(bool __i, memory_order __m = memory_order_seq_cst) noexcept
+     { return _M_base.exchange(__i, __m); }
+-    __always_inline bool
++    __libitm_always_inline bool
+     exchange(bool __i,
+            memory_order __m = memory_order_seq_cst) volatile noexcept
+     { return _M_base.exchange(__i, __m); }
+-    __always_inline bool
++    __libitm_always_inline bool
+     compare_exchange_weak(bool& __i1, bool __i2, memory_order __m1,
+                         memory_order __m2) noexcept
+     { return _M_base.compare_exchange_weak(__i1, __i2, __m1, __m2); }
+-    __always_inline bool
++    __libitm_always_inline bool
+     compare_exchange_weak(bool& __i1, bool __i2, memory_order __m1,
+                         memory_order __m2) volatile noexcept
+     { return _M_base.compare_exchange_weak(__i1, __i2, __m1, __m2); }
+-    __always_inline bool
++    __libitm_always_inline bool
+     compare_exchange_weak(bool& __i1, bool __i2,
+                         memory_order __m = memory_order_seq_cst) noexcept
+     { return _M_base.compare_exchange_weak(__i1, __i2, __m); }
+-    __always_inline bool
++    __libitm_always_inline bool
+     compare_exchange_weak(bool& __i1, bool __i2,
+                    memory_order __m = memory_order_seq_cst) volatile noexcept
+     { return _M_base.compare_exchange_weak(__i1, __i2, __m); }
+-    __always_inline bool
++    __libitm_always_inline bool
+     compare_exchange_strong(bool& __i1, bool __i2, memory_order __m1,
+                           memory_order __m2) noexcept
+     { return _M_base.compare_exchange_strong(__i1, __i2, __m1, __m2); }
+-    __always_inline bool
++    __libitm_always_inline bool
+     compare_exchange_strong(bool& __i1, bool __i2, memory_order __m1,
+                           memory_order __m2) volatile noexcept
+     { return _M_base.compare_exchange_strong(__i1, __i2, __m1, __m2); }
+-    __always_inline bool
++    __libitm_always_inline bool
+     compare_exchange_strong(bool& __i1, bool __i2,
+                           memory_order __m = memory_order_seq_cst) noexcept
+     { return _M_base.compare_exchange_strong(__i1, __i2, __m); }
+-    __always_inline bool
++    __libitm_always_inline bool
+     compare_exchange_strong(bool& __i1, bool __i2,
+                   memory_order __m = memory_order_seq_cst) volatile noexcept
+     { return _M_base.compare_exchange_strong(__i1, __i2, __m); }
+@@ -980,11 +979,11 @@
+       store(_Tp __i, memory_order _m = memory_order_seq_cst) noexcept
+       { __atomic_store(&_M_i, &__i, _m); }
+-      __always_inline void
++      __libitm_always_inline void
+       store(_Tp __i, memory_order _m = memory_order_seq_cst) volatile noexcept
+       { __atomic_store(&_M_i, &__i, _m); }
+-      __always_inline _Tp
++      __libitm_always_inline _Tp
+       load(memory_order _m = memory_order_seq_cst) const noexcept
+       { 
+         _Tp tmp;
+@@ -992,7 +991,7 @@
+       return tmp;
+       }
+-      __always_inline _Tp
++      __libitm_always_inline _Tp
+       load(memory_order _m = memory_order_seq_cst) const volatile noexcept
+       { 
+         _Tp tmp;
+@@ -1000,7 +999,7 @@
+       return tmp;
+       }
+-      __always_inline _Tp
++      __libitm_always_inline _Tp
+       exchange(_Tp __i, memory_order _m = memory_order_seq_cst) noexcept
+       { 
+         _Tp tmp;
+@@ -1008,7 +1007,7 @@
+       return tmp;
+       }
+-      __always_inline _Tp
++      __libitm_always_inline _Tp
+       exchange(_Tp __i, 
+              memory_order _m = memory_order_seq_cst) volatile noexcept
+       { 
+@@ -1017,50 +1016,50 @@
+       return tmp;
+       }
+-      __always_inline bool
++      __libitm_always_inline bool
+       compare_exchange_weak(_Tp& __e, _Tp __i, memory_order __s, 
+                           memory_order __f) noexcept
+       {
+       return __atomic_compare_exchange(&_M_i, &__e, &__i, true, __s, __f); 
+       }
+-      __always_inline bool
++      __libitm_always_inline bool
+       compare_exchange_weak(_Tp& __e, _Tp __i, memory_order __s, 
+                           memory_order __f) volatile noexcept
+       {
+       return __atomic_compare_exchange(&_M_i, &__e, &__i, true, __s, __f); 
+       }
+-      __always_inline bool
++      __libitm_always_inline bool
+       compare_exchange_weak(_Tp& __e, _Tp __i,
+                           memory_order __m = memory_order_seq_cst) noexcept
+       { return compare_exchange_weak(__e, __i, __m, __m); }
+-      __always_inline bool
++      __libitm_always_inline bool
+       compare_exchange_weak(_Tp& __e, _Tp __i,
+                    memory_order __m = memory_order_seq_cst) volatile noexcept
+       { return compare_exchange_weak(__e, __i, __m, __m); }
+-      __always_inline bool
++      __libitm_always_inline bool
+       compare_exchange_strong(_Tp& __e, _Tp __i, memory_order __s, 
+                             memory_order __f) noexcept
+       {
+       return __atomic_compare_exchange(&_M_i, &__e, &__i, false, __s, __f); 
+       }
+-      __always_inline bool
++      __libitm_always_inline bool
+       compare_exchange_strong(_Tp& __e, _Tp __i, memory_order __s, 
+                             memory_order __f) volatile noexcept
+       {
+       return __atomic_compare_exchange(&_M_i, &__e, &__i, false, __s, __f); 
+       }
+-      __always_inline bool
++      __libitm_always_inline bool
+       compare_exchange_strong(_Tp& __e, _Tp __i,
+                              memory_order __m = memory_order_seq_cst) noexcept
+       { return compare_exchange_strong(__e, __i, __m, __m); }
+-      __always_inline bool
++      __libitm_always_inline bool
+       compare_exchange_strong(_Tp& __e, _Tp __i,
+                    memory_order __m = memory_order_seq_cst) volatile noexcept
+       { return compare_exchange_strong(__e, __i, __m, __m); }
+@@ -1153,46 +1152,46 @@
+       is_lock_free() const volatile noexcept
+       { return _M_b.is_lock_free(); }
+-      __always_inline void
++      __libitm_always_inline void
+       store(__pointer_type __p,
+           memory_order __m = memory_order_seq_cst) noexcept
+       { return _M_b.store(__p, __m); }
+-      __always_inline void
++      __libitm_always_inline void
+       store(__pointer_type __p,
+           memory_order __m = memory_order_seq_cst) volatile noexcept
+       { return _M_b.store(__p, __m); }
+-      __always_inline __pointer_type
++      __libitm_always_inline __pointer_type
+       load(memory_order __m = memory_order_seq_cst) const noexcept
+       { return _M_b.load(__m); }
+-      __always_inline __pointer_type
++      __libitm_always_inline __pointer_type
+       load(memory_order __m = memory_order_seq_cst) const volatile noexcept
+       { return _M_b.load(__m); }
+-      __always_inline __pointer_type
++      __libitm_always_inline __pointer_type
+       exchange(__pointer_type __p,
+              memory_order __m = memory_order_seq_cst) noexcept
+       { return _M_b.exchange(__p, __m); }
+-      __always_inline __pointer_type
++      __libitm_always_inline __pointer_type
+       exchange(__pointer_type __p,
+              memory_order __m = memory_order_seq_cst) volatile noexcept
+       { return _M_b.exchange(__p, __m); }
+-      __always_inline bool
++      __libitm_always_inline bool
+       compare_exchange_weak(__pointer_type& __p1, __pointer_type __p2,
+                           memory_order __m1, memory_order __m2) noexcept
+       { return _M_b.compare_exchange_strong(__p1, __p2, __m1, __m2); }
+-      __always_inline bool
++      __libitm_always_inline bool
+       compare_exchange_weak(__pointer_type& __p1, __pointer_type __p2,
+                           memory_order __m1,
+                           memory_order __m2) volatile noexcept
+       { return _M_b.compare_exchange_strong(__p1, __p2, __m1, __m2); }
+-      __always_inline bool
++      __libitm_always_inline bool
+       compare_exchange_weak(__pointer_type& __p1, __pointer_type __p2,
+                           memory_order __m = memory_order_seq_cst) noexcept
+       {
+@@ -1200,7 +1199,7 @@
+                                    __calculate_memory_order(__m));
+       }
+-      __always_inline bool
++      __libitm_always_inline bool
+       compare_exchange_weak(__pointer_type& __p1, __pointer_type __p2,
+                   memory_order __m = memory_order_seq_cst) volatile noexcept
+       {
+@@ -1208,18 +1207,18 @@
+                                    __calculate_memory_order(__m));
+       }
+-      __always_inline bool
++      __libitm_always_inline bool
+       compare_exchange_strong(__pointer_type& __p1, __pointer_type __p2,
+                             memory_order __m1, memory_order __m2) noexcept
+       { return _M_b.compare_exchange_strong(__p1, __p2, __m1, __m2); }
+-      __always_inline bool
++      __libitm_always_inline bool
+       compare_exchange_strong(__pointer_type& __p1, __pointer_type __p2,
+                             memory_order __m1,
+                             memory_order __m2) volatile noexcept
+       { return _M_b.compare_exchange_strong(__p1, __p2, __m1, __m2); }
+-      __always_inline bool
++      __libitm_always_inline bool
+       compare_exchange_strong(__pointer_type& __p1, __pointer_type __p2,
+                             memory_order __m = memory_order_seq_cst) noexcept
+       {
+@@ -1227,7 +1226,7 @@
+                                           __calculate_memory_order(__m));
+       }
+-      __always_inline bool
++      __libitm_always_inline bool
+       compare_exchange_strong(__pointer_type& __p1, __pointer_type __p2,
+                   memory_order __m = memory_order_seq_cst) volatile noexcept
+       {
+@@ -1235,22 +1234,22 @@
+                                           __calculate_memory_order(__m));
+       }
+-      __always_inline __pointer_type
++      __libitm_always_inline __pointer_type
+       fetch_add(ptrdiff_t __d,
+               memory_order __m = memory_order_seq_cst) noexcept
+       { return _M_b.fetch_add(__d, __m); }
+-      __always_inline __pointer_type
++      __libitm_always_inline __pointer_type
+       fetch_add(ptrdiff_t __d,
+               memory_order __m = memory_order_seq_cst) volatile noexcept
+       { return _M_b.fetch_add(__d, __m); }
+-      __always_inline __pointer_type
++      __libitm_always_inline __pointer_type
+       fetch_sub(ptrdiff_t __d,
+               memory_order __m = memory_order_seq_cst) noexcept
+       { return _M_b.fetch_sub(__d, __m); }
+-      __always_inline __pointer_type
++      __libitm_always_inline __pointer_type
+       fetch_sub(ptrdiff_t __d,
+               memory_order __m = memory_order_seq_cst) volatile noexcept
+       { return _M_b.fetch_sub(__d, __m); }
+@@ -1544,98 +1543,98 @@
+   // Function definitions, atomic_flag operations.
+-  inline __always_inline bool
++  inline __libitm_always_inline bool
+   atomic_flag_test_and_set_explicit(atomic_flag* __a,
+                                   memory_order __m) noexcept
+   { return __a->test_and_set(__m); }
+-  inline __always_inline bool
++  inline __libitm_always_inline bool
+   atomic_flag_test_and_set_explicit(volatile atomic_flag* __a,
+                                   memory_order __m) noexcept
+   { return __a->test_and_set(__m); }
+-  inline __always_inline void
++  inline __libitm_always_inline void
+   atomic_flag_clear_explicit(atomic_flag* __a, memory_order __m) noexcept
+   { __a->clear(__m); }
+-  inline __always_inline void
++  inline __libitm_always_inline void
+   atomic_flag_clear_explicit(volatile atomic_flag* __a,
+                            memory_order __m) noexcept
+   { __a->clear(__m); }
+-  inline __always_inline bool
++  inline __libitm_always_inline bool
+   atomic_flag_test_and_set(atomic_flag* __a) noexcept
+   { return atomic_flag_test_and_set_explicit(__a, memory_order_seq_cst); }
+-  inline __always_inline bool
++  inline __libitm_always_inline bool
+   atomic_flag_test_and_set(volatile atomic_flag* __a) noexcept
+   { return atomic_flag_test_and_set_explicit(__a, memory_order_seq_cst); }
+-  inline __always_inline void
++  inline __libitm_always_inline void
+   atomic_flag_clear(atomic_flag* __a) noexcept
+   { atomic_flag_clear_explicit(__a, memory_order_seq_cst); }
+-  inline __always_inline void
++  inline __libitm_always_inline void
+   atomic_flag_clear(volatile atomic_flag* __a) noexcept
+   { atomic_flag_clear_explicit(__a, memory_order_seq_cst); }
+   // Function templates generally applicable to atomic types.
+   template<typename _ITp>
+-    __always_inline bool
++    __libitm_always_inline bool
+     atomic_is_lock_free(const atomic<_ITp>* __a) noexcept
+     { return __a->is_lock_free(); }
+   template<typename _ITp>
+-    __always_inline bool
++    __libitm_always_inline bool
+     atomic_is_lock_free(const volatile atomic<_ITp>* __a) noexcept
+     { return __a->is_lock_free(); }
+   template<typename _ITp>
+-    __always_inline void
++    __libitm_always_inline void
+     atomic_init(atomic<_ITp>* __a, _ITp __i) noexcept;
+   template<typename _ITp>
+-    __always_inline void
++    __libitm_always_inline void
+     atomic_init(volatile atomic<_ITp>* __a, _ITp __i) noexcept;
+   template<typename _ITp>
+-    __always_inline void
++    __libitm_always_inline void
+     atomic_store_explicit(atomic<_ITp>* __a, _ITp __i,
+                         memory_order __m) noexcept
+     { __a->store(__i, __m); }
+   template<typename _ITp>
+-    __always_inline void
++    __libitm_always_inline void
+     atomic_store_explicit(volatile atomic<_ITp>* __a, _ITp __i,
+                         memory_order __m) noexcept
+     { __a->store(__i, __m); }
+   template<typename _ITp>
+-    __always_inline _ITp
++    __libitm_always_inline _ITp
+     atomic_load_explicit(const atomic<_ITp>* __a, memory_order __m) noexcept
+     { return __a->load(__m); }
+   template<typename _ITp>
+-    __always_inline _ITp
++    __libitm_always_inline _ITp
+     atomic_load_explicit(const volatile atomic<_ITp>* __a,
+                        memory_order __m) noexcept
+     { return __a->load(__m); }
+   template<typename _ITp>
+-    __always_inline _ITp
++    __libitm_always_inline _ITp
+     atomic_exchange_explicit(atomic<_ITp>* __a, _ITp __i,
+                            memory_order __m) noexcept
+     { return __a->exchange(__i, __m); }
+   template<typename _ITp>
+-    __always_inline _ITp
++    __libitm_always_inline _ITp
+     atomic_exchange_explicit(volatile atomic<_ITp>* __a, _ITp __i,
+                            memory_order __m) noexcept
+     { return __a->exchange(__i, __m); }
+   template<typename _ITp>
+-    __always_inline bool
++    __libitm_always_inline bool
+     atomic_compare_exchange_weak_explicit(atomic<_ITp>* __a,
+                                         _ITp* __i1, _ITp __i2,
+                                         memory_order __m1,
+@@ -1643,7 +1642,7 @@
+     { return __a->compare_exchange_weak(*__i1, __i2, __m1, __m2); }
+   template<typename _ITp>
+-    __always_inline bool
++    __libitm_always_inline bool
+     atomic_compare_exchange_weak_explicit(volatile atomic<_ITp>* __a,
+                                         _ITp* __i1, _ITp __i2,
+                                         memory_order __m1,
+@@ -1651,7 +1650,7 @@
+     { return __a->compare_exchange_weak(*__i1, __i2, __m1, __m2); }
+   template<typename _ITp>
+-    __always_inline bool
++    __libitm_always_inline bool
+     atomic_compare_exchange_strong_explicit(atomic<_ITp>* __a,
+                                           _ITp* __i1, _ITp __i2,
+                                           memory_order __m1,
+@@ -1659,7 +1658,7 @@
+     { return __a->compare_exchange_strong(*__i1, __i2, __m1, __m2); }
+   template<typename _ITp>
+-    __always_inline bool
++    __libitm_always_inline bool
+     atomic_compare_exchange_strong_explicit(volatile atomic<_ITp>* __a,
+                                           _ITp* __i1, _ITp __i2,
+                                           memory_order __m1,
+@@ -1668,37 +1667,37 @@
+   template<typename _ITp>
+-    __always_inline void
++    __libitm_always_inline void
+     atomic_store(atomic<_ITp>* __a, _ITp __i) noexcept
+     { atomic_store_explicit(__a, __i, memory_order_seq_cst); }
+   template<typename _ITp>
+-    __always_inline void
++    __libitm_always_inline void
+     atomic_store(volatile atomic<_ITp>* __a, _ITp __i) noexcept
+     { atomic_store_explicit(__a, __i, memory_order_seq_cst); }
+   template<typename _ITp>
+-    __always_inline _ITp
++    __libitm_always_inline _ITp
+     atomic_load(const atomic<_ITp>* __a) noexcept
+     { return atomic_load_explicit(__a, memory_order_seq_cst); }
+   template<typename _ITp>
+-    __always_inline _ITp
++    __libitm_always_inline _ITp
+     atomic_load(const volatile atomic<_ITp>* __a) noexcept
+     { return atomic_load_explicit(__a, memory_order_seq_cst); }
+   template<typename _ITp>
+-    __always_inline _ITp
++    __libitm_always_inline _ITp
+     atomic_exchange(atomic<_ITp>* __a, _ITp __i) noexcept
+     { return atomic_exchange_explicit(__a, __i, memory_order_seq_cst); }
+   template<typename _ITp>
+-    __always_inline _ITp
++    __libitm_always_inline _ITp
+     atomic_exchange(volatile atomic<_ITp>* __a, _ITp __i) noexcept
+     { return atomic_exchange_explicit(__a, __i, memory_order_seq_cst); }
+   template<typename _ITp>
+-    __always_inline bool
++    __libitm_always_inline bool
+     atomic_compare_exchange_weak(atomic<_ITp>* __a,
+                                _ITp* __i1, _ITp __i2) noexcept
+     {
+@@ -1708,7 +1707,7 @@
+     }
+   template<typename _ITp>
+-    __always_inline bool
++    __libitm_always_inline bool
+     atomic_compare_exchange_weak(volatile atomic<_ITp>* __a,
+                                _ITp* __i1, _ITp __i2) noexcept
+     {
+@@ -1718,7 +1717,7 @@
+     }
+   template<typename _ITp>
+-    __always_inline bool
++    __libitm_always_inline bool
+     atomic_compare_exchange_strong(atomic<_ITp>* __a,
+                                  _ITp* __i1, _ITp __i2) noexcept
+     {
+@@ -1728,7 +1727,7 @@
+     }
+   template<typename _ITp>
+-    __always_inline bool
++    __libitm_always_inline bool
+     atomic_compare_exchange_strong(volatile atomic<_ITp>* __a,
+                                  _ITp* __i1, _ITp __i2) noexcept
+     {
+@@ -1742,158 +1741,158 @@
+   // intergral types as specified in the standard, excluding address
+   // types.
+   template<typename _ITp>
+-    __always_inline _ITp
++    __libitm_always_inline _ITp
+     atomic_fetch_add_explicit(__atomic_base<_ITp>* __a, _ITp __i,
+                             memory_order __m) noexcept
+     { return __a->fetch_add(__i, __m); }
+   template<typename _ITp>
+-    __always_inline _ITp
++    __libitm_always_inline _ITp
+     atomic_fetch_add_explicit(volatile __atomic_base<_ITp>* __a, _ITp __i,
+                             memory_order __m) noexcept
+     { return __a->fetch_add(__i, __m); }
+   template<typename _ITp>
+-    __always_inline _ITp
++    __libitm_always_inline _ITp
+     atomic_fetch_sub_explicit(__atomic_base<_ITp>* __a, _ITp __i,
+                             memory_order __m) noexcept
+     { return __a->fetch_sub(__i, __m); }
+   template<typename _ITp>
+-    __always_inline _ITp
++    __libitm_always_inline _ITp
+     atomic_fetch_sub_explicit(volatile __atomic_base<_ITp>* __a, _ITp __i,
+                             memory_order __m) noexcept
+     { return __a->fetch_sub(__i, __m); }
+   template<typename _ITp>
+-    __always_inline _ITp
++    __libitm_always_inline _ITp
+     atomic_fetch_and_explicit(__atomic_base<_ITp>* __a, _ITp __i,
+                             memory_order __m) noexcept
+     { return __a->fetch_and(__i, __m); }
+   template<typename _ITp>
+-    __always_inline _ITp
++    __libitm_always_inline _ITp
+     atomic_fetch_and_explicit(volatile __atomic_base<_ITp>* __a, _ITp __i,
+                             memory_order __m) noexcept
+     { return __a->fetch_and(__i, __m); }
+   template<typename _ITp>
+-    __always_inline _ITp
++    __libitm_always_inline _ITp
+     atomic_fetch_or_explicit(__atomic_base<_ITp>* __a, _ITp __i,
+                            memory_order __m) noexcept
+     { return __a->fetch_or(__i, __m); }
+   template<typename _ITp>
+-    __always_inline _ITp
++    __libitm_always_inline _ITp
+     atomic_fetch_or_explicit(volatile __atomic_base<_ITp>* __a, _ITp __i,
+                            memory_order __m) noexcept
+     { return __a->fetch_or(__i, __m); }
+   template<typename _ITp>
+-    __always_inline _ITp
++    __libitm_always_inline _ITp
+     atomic_fetch_xor_explicit(__atomic_base<_ITp>* __a, _ITp __i,
+                             memory_order __m) noexcept
+     { return __a->fetch_xor(__i, __m); }
+   template<typename _ITp>
+-    __always_inline _ITp
++    __libitm_always_inline _ITp
+     atomic_fetch_xor_explicit(volatile __atomic_base<_ITp>* __a, _ITp __i,
+                             memory_order __m) noexcept
+     { return __a->fetch_xor(__i, __m); }
+   template<typename _ITp>
+-    __always_inline _ITp
++    __libitm_always_inline _ITp
+     atomic_fetch_add(__atomic_base<_ITp>* __a, _ITp __i) noexcept
+     { return atomic_fetch_add_explicit(__a, __i, memory_order_seq_cst); }
+   template<typename _ITp>
+-    __always_inline _ITp
++    __libitm_always_inline _ITp
+     atomic_fetch_add(volatile __atomic_base<_ITp>* __a, _ITp __i) noexcept
+     { return atomic_fetch_add_explicit(__a, __i, memory_order_seq_cst); }
+   template<typename _ITp>
+-    __always_inline _ITp
++    __libitm_always_inline _ITp
+     atomic_fetch_sub(__atomic_base<_ITp>* __a, _ITp __i) noexcept
+     { return atomic_fetch_sub_explicit(__a, __i, memory_order_seq_cst); }
+   template<typename _ITp>
+-    __always_inline _ITp
++    __libitm_always_inline _ITp
+     atomic_fetch_sub(volatile __atomic_base<_ITp>* __a, _ITp __i) noexcept
+     { return atomic_fetch_sub_explicit(__a, __i, memory_order_seq_cst); }
+   template<typename _ITp>
+-    __always_inline _ITp
++    __libitm_always_inline _ITp
+     atomic_fetch_and(__atomic_base<_ITp>* __a, _ITp __i) noexcept
+     { return atomic_fetch_and_explicit(__a, __i, memory_order_seq_cst); }
+   template<typename _ITp>
+-    __always_inline _ITp
++    __libitm_always_inline _ITp
+     atomic_fetch_and(volatile __atomic_base<_ITp>* __a, _ITp __i) noexcept
+     { return atomic_fetch_and_explicit(__a, __i, memory_order_seq_cst); }
+   template<typename _ITp>
+-    __always_inline _ITp
++    __libitm_always_inline _ITp
+     atomic_fetch_or(__atomic_base<_ITp>* __a, _ITp __i) noexcept
+     { return atomic_fetch_or_explicit(__a, __i, memory_order_seq_cst); }
+   template<typename _ITp>
+-    __always_inline _ITp
++    __libitm_always_inline _ITp
+     atomic_fetch_or(volatile __atomic_base<_ITp>* __a, _ITp __i) noexcept
+     { return atomic_fetch_or_explicit(__a, __i, memory_order_seq_cst); }
+   template<typename _ITp>
+-    __always_inline _ITp
++    __libitm_always_inline _ITp
+     atomic_fetch_xor(__atomic_base<_ITp>* __a, _ITp __i) noexcept
+     { return atomic_fetch_xor_explicit(__a, __i, memory_order_seq_cst); }
+   template<typename _ITp>
+-    __always_inline _ITp
++    __libitm_always_inline _ITp
+     atomic_fetch_xor(volatile __atomic_base<_ITp>* __a, _ITp __i) noexcept
+     { return atomic_fetch_xor_explicit(__a, __i, memory_order_seq_cst); }
+   // Partial specializations for pointers.
+   template<typename _ITp>
+-    __always_inline _ITp*
++    __libitm_always_inline _ITp*
+     atomic_fetch_add_explicit(atomic<_ITp*>* __a, ptrdiff_t __d,
+                             memory_order __m) noexcept
+     { return __a->fetch_add(__d, __m); }
+   template<typename _ITp>
+-    __always_inline _ITp*
++    __libitm_always_inline _ITp*
+     atomic_fetch_add_explicit(volatile atomic<_ITp*>* __a, ptrdiff_t __d,
+                             memory_order __m) noexcept
+     { return __a->fetch_add(__d, __m); }
+   template<typename _ITp>
+-    __always_inline _ITp*
++    __libitm_always_inline _ITp*
+     atomic_fetch_add(volatile atomic<_ITp*>* __a, ptrdiff_t __d) noexcept
+     { return __a->fetch_add(__d); }
+   template<typename _ITp>
+-    __always_inline _ITp*
++    __libitm_always_inline _ITp*
+     atomic_fetch_add(atomic<_ITp*>* __a, ptrdiff_t __d) noexcept
+     { return __a->fetch_add(__d); }
+   template<typename _ITp>
+-    __always_inline _ITp*
++    __libitm_always_inline _ITp*
+     atomic_fetch_sub_explicit(volatile atomic<_ITp*>* __a,
+                             ptrdiff_t __d, memory_order __m) noexcept
+     { return __a->fetch_sub(__d, __m); }
+   template<typename _ITp>
+-    __always_inline _ITp*
++    __libitm_always_inline _ITp*
+     atomic_fetch_sub_explicit(atomic<_ITp*>* __a, ptrdiff_t __d,
+                             memory_order __m) noexcept
+     { return __a->fetch_sub(__d, __m); }
+   template<typename _ITp>
+-    __always_inline _ITp*
++    __libitm_always_inline _ITp*
+     atomic_fetch_sub(volatile atomic<_ITp*>* __a, ptrdiff_t __d) noexcept
+     { return __a->fetch_sub(__d); }
+   template<typename _ITp>
+-    __always_inline _ITp*
++    __libitm_always_inline _ITp*
+     atomic_fetch_sub(atomic<_ITp*>* __a, ptrdiff_t __d) noexcept
+     { return __a->fetch_sub(__d); }
+   // @} group atomics
diff --git a/src/patches/gcc/gcc44-build-id.patch b/src/patches/gcc/gcc44-build-id.patch
deleted file mode 100644 (file)
index f76f939..0000000
+++ /dev/null
@@ -1,52 +0,0 @@
-2007-07-22  Roland McGrath  <roland@redhat.com>
-
-       * config/rs6000/sysv4.h (LINK_EH_SPEC): Add --build-id for
-       non-relocatable link.
-       * config/linux.h (LINK_EH_SPEC): Likewise.
-       * config/alpha/elf.h (LINK_EH_SPEC): Likewise.
-       * config/ia64/linux.h (LINK_EH_SPEC): Likewise.
-
---- gcc/config/rs6000/sysv4.h.~1~
-+++ gcc/config/rs6000/sysv4.h
-@@ -906,7 +906,7 @@ extern int fixuplabelno;
-   %{!dynamic-linker:-dynamic-linker " LINUX_DYNAMIC_LINKER "}}}"
- #if defined(HAVE_LD_EH_FRAME_HDR)
--# define LINK_EH_SPEC "%{!static:--eh-frame-hdr} "
-+# define LINK_EH_SPEC "%{!static:--eh-frame-hdr} %{!r:--build-id} "
- #endif
- #define CPP_OS_LINUX_SPEC "-D__unix__ -D__gnu_linux__ -D__linux__ \
---- gcc/config/linux.h.~1~
-+++ gcc/config/linux.h
-@@ -85,7 +85,7 @@ Boston, MA 02110-1301, USA.  */
-     } while (0)
- #if defined(HAVE_LD_EH_FRAME_HDR)
--#define LINK_EH_SPEC "%{!static:--eh-frame-hdr} "
-+#define LINK_EH_SPEC "%{!static:--eh-frame-hdr} %{!r:--build-id} "
- #endif
- /* Define this so we can compile MS code for use with WINE.  */
---- gcc/config/alpha/elf.h.~1~
-+++ gcc/config/alpha/elf.h
-@@ -421,7 +421,7 @@ extern int alpha_this_gpdisp_sequence_nu
-    I imagine that other systems will catch up.  In the meantime, it
-    doesn't harm to make sure that the data exists to be used later.  */
- #if defined(HAVE_LD_EH_FRAME_HDR)
--#define LINK_EH_SPEC "%{!static:--eh-frame-hdr} "
-+#define LINK_EH_SPEC "%{!static:--eh-frame-hdr} %{!r:--build-id} "
- #endif
- /* A C statement (sans semicolon) to output to the stdio stream STREAM
---- gcc/config/ia64/linux.h.~1~
-+++ gcc/config/ia64/linux.h
-@@ -56,7 +56,7 @@ do {                                         \
-    Signalize that because we have fde-glibc, we don't need all C shared libs
-    linked against -lgcc_s.  */
- #undef LINK_EH_SPEC
--#define LINK_EH_SPEC ""
-+#define LINK_EH_SPEC "%{!r:--build-id} "
- #define MD_UNWIND_SUPPORT "config/ia64/linux-unwind.h"
diff --git a/src/patches/gcc/gcc44-c++-builtin-redecl.patch b/src/patches/gcc/gcc44-c++-builtin-redecl.patch
deleted file mode 100644 (file)
index 1f36f1f..0000000
+++ /dev/null
@@ -1,102 +0,0 @@
-2007-10-02  Jakub Jelinek  <jakub@redhat.com>
-
-       * decl.c (duplicate_decls): When redeclaring a builtin function,
-       keep the merged decl builtin whenever types match, even if new
-       decl defines a function.
-
-       * gcc.dg/builtins-65.c: New test.
-       * g++.dg/ext/builtin10.C: New test.
-
---- gcc/cp/decl.c.jj   2007-10-01 22:11:09.000000000 +0200
-+++ gcc/cp/decl.c      2007-10-02 11:39:46.000000000 +0200
-@@ -2001,23 +2001,21 @@ duplicate_decls (tree newdecl, tree oldd
-         DECL_ARGUMENTS (olddecl) = DECL_ARGUMENTS (newdecl);
-         DECL_RESULT (olddecl) = DECL_RESULT (newdecl);
-       }
-+      /* If redeclaring a builtin function, it stays built in.  */
-+      if (types_match && DECL_BUILT_IN (olddecl))
-+      {
-+        DECL_BUILT_IN_CLASS (newdecl) = DECL_BUILT_IN_CLASS (olddecl);
-+        DECL_FUNCTION_CODE (newdecl) = DECL_FUNCTION_CODE (olddecl);
-+        /* If we're keeping the built-in definition, keep the rtl,
-+           regardless of declaration matches.  */
-+        COPY_DECL_RTL (olddecl, newdecl);
-+      }
-       if (new_defines_function)
-       /* If defining a function declared with other language
-          linkage, use the previously declared language linkage.  */
-       SET_DECL_LANGUAGE (newdecl, DECL_LANGUAGE (olddecl));
-       else if (types_match)
-       {
--        /* If redeclaring a builtin function, and not a definition,
--           it stays built in.  */
--        if (DECL_BUILT_IN (olddecl))
--          {
--            DECL_BUILT_IN_CLASS (newdecl) = DECL_BUILT_IN_CLASS (olddecl);
--            DECL_FUNCTION_CODE (newdecl) = DECL_FUNCTION_CODE (olddecl);
--            /* If we're keeping the built-in definition, keep the rtl,
--               regardless of declaration matches.  */
--            COPY_DECL_RTL (olddecl, newdecl);
--          }
--
-         DECL_RESULT (newdecl) = DECL_RESULT (olddecl);
-         /* Don't clear out the arguments if we're just redeclaring a
-            function.  */
---- gcc/testsuite/gcc.dg/builtins-65.c.jj      2007-10-02 11:23:51.000000000 +0200
-+++ gcc/testsuite/gcc.dg/builtins-65.c 2007-10-02 11:24:12.000000000 +0200
-@@ -0,0 +1,25 @@
-+/* { dg-do compile } */
-+/* { dg-options "-O2" } */
-+
-+typedef __SIZE_TYPE__ size_t;
-+extern void __chk_fail (void);
-+extern int snprintf (char *, size_t, const char *, ...);
-+extern inline __attribute__((gnu_inline, always_inline)) int snprintf (char *a, size_t b, const char *fmt, ...)
-+{
-+  if (__builtin_object_size (a, 0) != -1UL && __builtin_object_size (a, 0) < b)
-+    __chk_fail ();
-+  return __builtin_snprintf (a, b, fmt, __builtin_va_arg_pack ());
-+}
-+extern int snprintf (char *, size_t, const char *, ...) __asm ("mysnprintf");
-+
-+char buf[10];
-+
-+int
-+main (void)
-+{
-+  snprintf (buf, 10, "%d%d\n", 10, 10);
-+  return 0;
-+}
-+
-+/* { dg-final { scan-assembler "mysnprintf" } } */
-+/* { dg-final { scan-assembler-not "__chk_fail" } } */
---- gcc/testsuite/g++.dg/ext/builtin10.C.jj    2007-10-02 11:19:45.000000000 +0200
-+++ gcc/testsuite/g++.dg/ext/builtin10.C       2007-10-02 11:23:26.000000000 +0200
-@@ -0,0 +1,27 @@
-+// { dg-do compile }
-+// { dg-options "-O2" }
-+
-+typedef __SIZE_TYPE__ size_t;
-+extern "C" {
-+extern void __chk_fail (void);
-+extern int snprintf (char *, size_t, const char *, ...);
-+extern inline __attribute__((gnu_inline, always_inline)) int snprintf (char *a, size_t b, const char *fmt, ...)
-+{
-+  if (__builtin_object_size (a, 0) != -1UL && __builtin_object_size (a, 0) < b)
-+    __chk_fail ();
-+  return __builtin_snprintf (a, b, fmt, __builtin_va_arg_pack ());
-+}
-+extern int snprintf (char *, size_t, const char *, ...) __asm ("mysnprintf");
-+}
-+
-+char buf[10];
-+
-+int
-+main (void)
-+{
-+  snprintf (buf, 10, "%d%d\n", 10, 10);
-+  return 0;
-+}
-+
-+// { dg-final { scan-assembler "mysnprintf" } }
-+// { dg-final { scan-assembler-not "__chk_fail" } }
diff --git a/src/patches/gcc/gcc44-i386-libgomp.patch b/src/patches/gcc/gcc44-i386-libgomp.patch
deleted file mode 100644 (file)
index 5d1eea8..0000000
+++ /dev/null
@@ -1,61 +0,0 @@
-Build i386.rpm libgomp and libsupc++.a(guard.o) as i486+, pre-i486
-hardware isn't supported because NPTL doesn't support it anyway.
-
---- libgomp/configure.tgt.jj   2008-01-10 20:53:48.000000000 +0100
-+++ libgomp/configure.tgt      2008-03-27 12:44:51.000000000 +0100
-@@ -44,14 +44,14 @@ if test $enable_linux_futex = yes; then
-       ;;
-     # Note that bare i386 is not included here.  We need cmpxchg.
--    i[456]86-*-linux*)
-+    i[3456]86-*-linux*)
-       config_path="linux/x86 linux posix"
-       case " ${CC} ${CFLAGS} " in
-         *" -m64 "*)
-           ;;
-         *)
-           if test -z "$with_arch"; then
--            XCFLAGS="${XCFLAGS} -march=i486 -mtune=${target_cpu}"
-+            XCFLAGS="${XCFLAGS} -march=i486 -mtune=generic"
-           fi
-       esac
-       ;;
-@@ -63,7 +63,7 @@ if test $enable_linux_futex = yes; then
-       config_path="linux/x86 linux posix"
-       case " ${CC} ${CFLAGS} " in
-         *" -m32 "*)
--          XCFLAGS="${XCFLAGS} -march=i486 -mtune=i686"
-+          XCFLAGS="${XCFLAGS} -march=i486 -mtune=generic"
-           ;;
-       esac
-       ;;
---- libstdc++-v3/libsupc++/guard.cc.jj 2008-03-01 00:58:24.000000000 +0100
-+++ libstdc++-v3/libsupc++/guard.cc    2008-03-27 14:08:44.000000000 +0100
-@@ -35,6 +35,27 @@
- #include <new>
- #include <ext/atomicity.h>
- #include <ext/concurrence.h>
-+#if defined __i386__ && !defined _GLIBCXX_ATOMIC_BUILTINS_4
-+# define _GLIBCXX_ATOMIC_BUILTINS_4 1
-+# define __sync_val_compare_and_swap(a, b, c) \
-+  ({                                                          \
-+     typedef char sltast[sizeof (*a) == sizeof (int) ? 1 : -1];       \
-+     int sltas;                                                       \
-+     __asm __volatile ("lock; cmpxchgl %3, (%1)"              \
-+                     : "=a" (sltas)                           \
-+                     : "r" (a), "0" (b), "r" (c) : "memory"); \
-+     sltas;                                                   \
-+   })
-+# define __sync_lock_test_and_set(a, b) \
-+  ({                                                          \
-+     typedef char sltast[sizeof (*a) == sizeof (int) ? 1 : -1];       \
-+     int sltas;                                                       \
-+     __asm __volatile ("xchgl (%1), %0"                               \
-+                     : "=r" (sltas)                           \
-+                     : "r" (a), "0" (b) : "memory");          \
-+     sltas;                                                   \
-+   })
-+#endif
- #if defined(__GTHREADS) && defined(__GTHREAD_HAS_COND) \
-     && defined(_GLIBCXX_ATOMIC_BUILTINS_4) && defined(_GLIBCXX_HAVE_LINUX_FUTEX)
- # include <climits>
diff --git a/src/patches/gcc/gcc44-no-add-needed.patch b/src/patches/gcc/gcc44-no-add-needed.patch
deleted file mode 100644 (file)
index 4570c0c..0000000
+++ /dev/null
@@ -1,52 +0,0 @@
-2010-02-08  Roland McGrath  <roland@redhat.com>
-
-       * config/rs6000/sysv4.h (LINK_EH_SPEC): Pass --no-add-needed to the
-       linker.
-       * config/linux.h (LINK_EH_SPEC): Likewise.
-       * config/alpha/elf.h (LINK_EH_SPEC): Likewise.
-       * config/ia64/linux.h (LINK_EH_SPEC): Likewise.
-
---- gcc/config/alpha/elf.h.~1~
-+++ gcc/config/alpha/elf.h
-@@ -421,7 +421,7 @@ extern int alpha_this_gpdisp_sequence_nu
-    I imagine that other systems will catch up.  In the meantime, it
-    doesn't harm to make sure that the data exists to be used later.  */
- #if defined(HAVE_LD_EH_FRAME_HDR)
--#define LINK_EH_SPEC "%{!static:--eh-frame-hdr} %{!r:--build-id} "
-+#define LINK_EH_SPEC "--no-add-needed %{!static:--eh-frame-hdr} %{!r:--build-id} "
- #endif
- /* A C statement (sans semicolon) to output to the stdio stream STREAM
---- gcc/config/ia64/linux.h.~1~
-+++ gcc/config/ia64/linux.h
-@@ -58,7 +58,7 @@ do {                                         \
-    Signalize that because we have fde-glibc, we don't need all C shared libs
-    linked against -lgcc_s.  */
- #undef LINK_EH_SPEC
--#define LINK_EH_SPEC "%{!r:--build-id} "
-+#define LINK_EH_SPEC "--no-add-needed %{!r:--build-id} "
- #define MD_UNWIND_SUPPORT "config/ia64/linux-unwind.h"
---- gcc/config/linux.h.~1~
-+++ gcc/config/linux.h
-@@ -89,7 +89,7 @@ see the files COPYING3 and COPYING.RUNTI
-     } while (0)
- #if defined(HAVE_LD_EH_FRAME_HDR)
--#define LINK_EH_SPEC "%{!static:--eh-frame-hdr} %{!r:--build-id} "
-+#define LINK_EH_SPEC "--no-add-needed %{!static:--eh-frame-hdr} %{!r:--build-id} "
- #endif
- /* Define this so we can compile MS code for use with WINE.  */
---- gcc/config/rs6000/sysv4.h.~1~
-+++ gcc/config/rs6000/sysv4.h
-@@ -917,7 +917,7 @@ SVR4_ASM_SPEC \
-   %{!dynamic-linker:-dynamic-linker " LINUX_DYNAMIC_LINKER "}}}"
- #if defined(HAVE_LD_EH_FRAME_HDR)
--# define LINK_EH_SPEC "%{!static:--eh-frame-hdr} %{!r:--build-id} "
-+# define LINK_EH_SPEC "--no-add-needed %{!static:--eh-frame-hdr} %{!r:--build-id} "
- #endif
- #define CPP_OS_LINUX_SPEC "-D__unix__ -D__gnu_linux__ -D__linux__ \
diff --git a/src/patches/gcc/gcc44-pr33763.patch b/src/patches/gcc/gcc44-pr33763.patch
deleted file mode 100644 (file)
index 86c8ac7..0000000
+++ /dev/null
@@ -1,153 +0,0 @@
-2007-11-06  Jakub Jelinek  <jakub@redhat.com>
-
-       PR tree-optimization/33763
-       * gcc.dg/pr33763.c: New test.
-       * g++.dg/opt/inline13.C: New test.
-
-2007-11-06  Jan Hubicka  <jh@suse.cz>
-
-       PR tree-optimization/33763
-       * tree-inline.c (expand_call_inline): Silently ignore always_inline
-       attribute for redefined extern inline functions.
-
---- gcc/tree-inline.c.jj       2007-11-06 09:29:04.000000000 +0100
-+++ gcc/tree-inline.c  2007-11-06 16:19:12.000000000 +0100
-@@ -3157,6 +3157,12 @@ expand_call_inline (basic_block bb, gimp
-       goto egress;
-       if (lookup_attribute ("always_inline", DECL_ATTRIBUTES (fn))
-+      /* For extern inline functions that get redefined we always
-+         silently ignored alway_inline flag. Better behaviour would
-+         be to be able to keep both bodies and use extern inline body
-+         for inlining, but we can't do that because frontends overwrite
-+         the body.  */
-+        && !cg_edge->callee->local.redefined_extern_inline
-         /* Avoid warnings during early inline pass. */
-         && cgraph_global_info_ready)
-       {
---- gcc/testsuite/gcc.dg/pr33763.c.jj  2007-11-06 16:19:12.000000000 +0100
-+++ gcc/testsuite/gcc.dg/pr33763.c     2007-11-06 16:19:12.000000000 +0100
-@@ -0,0 +1,60 @@
-+/* PR tree-optimization/33763 */
-+/* { dg-do compile } */
-+/* { dg-options "-O2" } */
-+
-+typedef struct
-+{
-+  void *a;
-+  void *b;
-+} T;
-+extern void *foo (const char *, const char *);
-+extern void *bar (void *, const char *, T);
-+extern int baz (const char *, int);
-+
-+extern inline __attribute__ ((always_inline, gnu_inline)) int
-+baz (const char *x, int y)
-+{
-+  return 2;
-+}
-+
-+int
-+baz (const char *x, int y)
-+{
-+  return 1;
-+}
-+
-+int xa, xb;
-+
-+static void *
-+inl (const char *x, const char *y)
-+{
-+  T t = { &xa, &xb };
-+  int *f = (int *) __builtin_malloc (sizeof (int));
-+  const char *z;
-+  int o = 0;
-+  void *r = 0;
-+
-+  for (z = y; *z; z++)
-+    {
-+      if (*z == 'r')
-+      o |= 1;
-+      if (*z == 'w')
-+      o |= 2;
-+    }
-+  if (o == 1)
-+    *f = baz (x, 0);
-+  if (o == 2)
-+    *f = baz (x, 1);
-+  if (o == 3)
-+    *f = baz (x, 2);
-+
-+  if (o && *f > 0)
-+    r = bar (f, "w", t);
-+  return r;
-+}
-+
-+void *
-+foo (const char *x, const char *y)
-+{
-+  return inl (x, y);
-+}
---- gcc/testsuite/g++.dg/opt/inline13.C.jj     2007-11-06 16:20:20.000000000 +0100
-+++ gcc/testsuite/g++.dg/opt/inline13.C        2007-11-06 16:21:30.000000000 +0100
-@@ -0,0 +1,60 @@
-+// PR tree-optimization/33763
-+// { dg-do compile }
-+// { dg-options "-O2" }
-+
-+typedef struct
-+{
-+  void *a;
-+  void *b;
-+} T;
-+extern void *foo (const char *, const char *);
-+extern void *bar (void *, const char *, T);
-+extern int baz (const char *, int);
-+
-+extern inline __attribute__ ((always_inline, gnu_inline)) int
-+baz (const char *x, int y)
-+{
-+  return 2;
-+}
-+
-+int
-+baz (const char *x, int y)
-+{
-+  return 1;
-+}
-+
-+int xa, xb;
-+
-+static void *
-+inl (const char *x, const char *y)
-+{
-+  T t = { &xa, &xb };
-+  int *f = (int *) __builtin_malloc (sizeof (int));
-+  const char *z;
-+  int o = 0;
-+  void *r = 0;
-+
-+  for (z = y; *z; z++)
-+    {
-+      if (*z == 'r')
-+      o |= 1;
-+      if (*z == 'w')
-+      o |= 2;
-+    }
-+  if (o == 1)
-+    *f = baz (x, 0);
-+  if (o == 2)
-+    *f = baz (x, 1);
-+  if (o == 3)
-+    *f = baz (x, 2);
-+
-+  if (o && *f > 0)
-+    r = bar (f, "w", t);
-+  return r;
-+}
-+
-+void *
-+foo (const char *x, const char *y)
-+{
-+  return inl (x, y);
-+}
diff --git a/src/patches/gcc/gcc44-rh330771.patch b/src/patches/gcc/gcc44-rh330771.patch
deleted file mode 100644 (file)
index f7c365d..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
-2007-10-16  Jakub Jelinek  <jakub@redhat.com>
-
-       * Makefile.am (libgcj_tools_la_LIBADD): Add.
-       * Makefile.in: Regenerated.
-
---- libjava/Makefile.am.jj     2009-05-06 08:14:50.000000000 +0200
-+++ libjava/Makefile.am        2009-05-06 10:26:43.000000000 +0200
-@@ -314,6 +314,8 @@ libgcj_tools_la_SOURCES = classpath/tool
- libgcj_tools_la_GCJFLAGS = $(AM_GCJFLAGS) -findirect-dispatch \
-  -fno-bootstrap-classes -fno-indirect-classes \
-  -fsource-filename=$(here)/classpath/tools/all-classes.lst
-+## See jv_convert_LDADD.
-+libgcj_tools_la_LIBADD = -L$(here)/.libs libgcj.la
- libgcj_tools_la_LDFLAGS = -rpath $(toolexeclibdir) \
-  -version-info `grep -v '^\#' $(srcdir)/libtool-version` \
-  $(LIBGCJ_LD_SYMBOLIC_FUNCTIONS)
---- libjava/Makefile.in.jj     2009-05-06 08:14:49.000000000 +0200
-+++ libjava/Makefile.in        2009-05-06 10:27:18.000000000 +0200
-@@ -160,7 +160,6 @@ am__objects_1 = gnu/gcj/xlib/lib_gnu_awt
- am_lib_gnu_awt_xlib_la_OBJECTS = $(am__objects_1)
- lib_gnu_awt_xlib_la_OBJECTS = $(am_lib_gnu_awt_xlib_la_OBJECTS)
- @XLIB_AWT_TRUE@am_lib_gnu_awt_xlib_la_rpath = -rpath $(toolexeclibdir)
--libgcj_tools_la_LIBADD =
- am_libgcj_tools_la_OBJECTS = classpath/tools/libgcj_tools_la-tools.lo
- libgcj_tools_la_OBJECTS = $(am_libgcj_tools_la_OBJECTS)
- @INTERPRETER_TRUE@am__DEPENDENCIES_1 = gnu/classpath/jdwp.lo \
-@@ -1041,6 +1040,7 @@ libgcj_tools_la_GCJFLAGS = $(AM_GCJFLAGS
-  -fno-bootstrap-classes -fno-indirect-classes \
-  -fsource-filename=$(here)/classpath/tools/all-classes.lst
-+libgcj_tools_la_LIBADD = -L$(here)/.libs libgcj.la
- libgcj_tools_la_LDFLAGS = -rpath $(toolexeclibdir) \
-  -version-info `grep -v '^\#' $(srcdir)/libtool-version` \
-  $(LIBGCJ_LD_SYMBOLIC_FUNCTIONS)
diff --git a/src/patches/gcc/gcc44-rh533181.patch b/src/patches/gcc/gcc44-rh533181.patch
deleted file mode 100644 (file)
index 76326e2..0000000
+++ /dev/null
@@ -1,153 +0,0 @@
-2010-07-22  Jakub Jelinek  <jakub@redhat.com>
-
-       * gimplify.c (enum gimplify_omp_var_data): Add
-       GOVD_THREADPRIVATE_WARNED.
-       (gimplify_bind_expr): Add GOVD_LOCAL | GOVD_SEEN even for global vars.
-       (omp_notice_threadprivate_variable): Note used threadprivate vars
-       with current function's context in shared clauses.
-       (gimplify_adjust_omp_clauses_1): Allow globals with current function's
-       context in taskreg shared clause.
-       * omp-low.c (lower_rec_input_clauses): For function-local is_global_var
-       VAR_DECLs in shared clauses add a decl copy with DECL_VALUE_EXPR
-       pointing to the original.
-
-       * trans-openmp.c (gfc_omp_private_debug_clause): Return false for
-       threadprivate decls.
-
-       * gcc.dg/gomp/tls-3.c: New test.
-
---- gcc/fortran/trans-openmp.c.jj      2010-06-24 21:47:09.908230044 +0200
-+++ gcc/fortran/trans-openmp.c 2010-07-26 10:45:15.830229443 +0200
-@@ -351,6 +351,18 @@ gfc_omp_disregard_value_expr (tree decl,
- bool
- gfc_omp_private_debug_clause (tree decl, bool shared)
- {
-+  if (TREE_STATIC (decl) || DECL_EXTERNAL (decl))
-+    {
-+      if (DECL_THREAD_LOCAL_P (decl))
-+      return false;
-+      if (DECL_HAS_VALUE_EXPR_P (decl))
-+      {
-+        tree value = get_base_address (DECL_VALUE_EXPR (decl));
-+        if (value && DECL_P (value) && DECL_THREAD_LOCAL_P (value))
-+          return false;
-+      }
-+    }
-+
-   if (GFC_DECL_CRAY_POINTEE (decl))
-     return true;
---- gcc/gimplify.c.jj  2010-07-09 09:01:37.049604412 +0200
-+++ gcc/gimplify.c     2010-07-26 10:50:05.646291216 +0200
-@@ -66,6 +66,7 @@ enum gimplify_omp_var_data
-   GOVD_LOCAL = 128,
-   GOVD_DEBUG_PRIVATE = 256,
-   GOVD_PRIVATE_OUTER_REF = 512,
-+  GOVD_THREADPRIVATE_WARNED = 1024,
-   GOVD_DATA_SHARE_CLASS = (GOVD_SHARED | GOVD_PRIVATE | GOVD_FIRSTPRIVATE
-                          | GOVD_LASTPRIVATE | GOVD_REDUCTION | GOVD_LOCAL)
- };
-@@ -1234,7 +1235,7 @@ gimplify_bind_expr (tree *expr_p, gimple
-         struct gimplify_omp_ctx *ctx = gimplify_omp_ctxp;
-         /* Mark variable as local.  */
--        if (ctx && !is_global_var (t)
-+        if (ctx
-             && (! DECL_SEEN_IN_BIND_EXPR_P (t)
-                 || splay_tree_lookup (ctx->variables,
-                                       (splay_tree_key) t) == NULL))
-@@ -5339,18 +5340,36 @@ omp_notice_threadprivate_variable (struc
- {
-   splay_tree_node n;
--  if (ctx->region_type != ORT_UNTIED_TASK)
-+  while (ctx && ctx->region_type == ORT_WORKSHARE)
-+    {
-+      n = splay_tree_lookup (ctx->variables, (splay_tree_key)decl);
-+      if (n != NULL)
-+      {
-+        gcc_assert (n->value & GOVD_LOCAL);
-+        return false;
-+      }
-+      ctx = ctx->outer_context;
-+    }
-+  if (ctx == NULL)
-     return false;
-+
-   n = splay_tree_lookup (ctx->variables, (splay_tree_key)decl);
-   if (n == NULL)
-+    n = splay_tree_insert (ctx->variables, (splay_tree_key)decl,
-+                         DECL_CONTEXT (decl) == current_function_decl
-+                         ? GOVD_SHARED | GOVD_SEEN : 0);
-+  if (ctx->region_type == ORT_UNTIED_TASK
-+      && (n->value & GOVD_THREADPRIVATE_WARNED) == 0)
-     {
-       error ("threadprivate variable %qs used in untied task",
-            IDENTIFIER_POINTER (DECL_NAME (decl)));
-       error ("%Henclosing task", &ctx->location);
--      splay_tree_insert (ctx->variables, (splay_tree_key)decl, 0);
-+      n->value |= GOVD_THREADPRIVATE_WARNED;
-     }
-   if (decl2)
--    splay_tree_insert (ctx->variables, (splay_tree_key)decl2, 0);
-+    splay_tree_insert (ctx->variables, (splay_tree_key)decl2,
-+                     DECL_CONTEXT (decl2) == current_function_decl
-+                     ? GOVD_SHARED | GOVD_SEEN : 0);
-   return false;
- }
-@@ -5779,7 +5798,9 @@ gimplify_adjust_omp_clauses_1 (splay_tre
-               break;
-             ctx = ctx->outer_context;
-           }
--        if (ctx == NULL)
-+        if (ctx == NULL
-+            && (DECL_CONTEXT (decl) != current_function_decl
-+                || gimplify_omp_ctxp->region_type == ORT_WORKSHARE))
-           return 0;
-       }
-       code = OMP_CLAUSE_SHARED;
---- gcc/omp-low.c.jj   2010-06-11 11:06:00.913659301 +0200
-+++ gcc/omp-low.c      2010-07-26 10:45:15.866229447 +0200
-@@ -2222,6 +2222,17 @@ lower_rec_input_clauses (tree clauses, g
-               continue;
-             break;
-           case OMP_CLAUSE_SHARED:
-+            if (pass == 0
-+                && is_global_var (OMP_CLAUSE_DECL (c))
-+                && (DECL_CONTEXT (OMP_CLAUSE_DECL (c))
-+                    == current_function_decl)
-+                && is_taskreg_ctx (ctx)
-+                && !DECL_IGNORED_P (OMP_CLAUSE_DECL (c)))
-+              {
-+                new_var = omp_copy_decl_1 (OMP_CLAUSE_DECL (c), ctx);
-+                SET_DECL_VALUE_EXPR (new_var, OMP_CLAUSE_DECL (c));
-+                DECL_HAS_VALUE_EXPR_P (new_var) = 1;
-+              }
-             if (maybe_lookup_decl (OMP_CLAUSE_DECL (c), ctx) == NULL)
-               {
-                 gcc_assert (is_global_var (OMP_CLAUSE_DECL (c)));
---- gcc/testsuite/gcc.dg/gomp/tls-3.c.jj       2010-07-26 10:45:15.868228753 +0200
-+++ gcc/testsuite/gcc.dg/gomp/tls-3.c  2010-07-26 10:45:15.868228753 +0200
-@@ -0,0 +1,21 @@
-+/* { dg-do compile } */
-+/* { dg-require-effective-target tls_native } */
-+
-+int thr;
-+#pragma omp threadprivate(thr)
-+
-+void
-+foo (void)
-+{
-+  #pragma omp task untied     /* { dg-error "enclosing task" } */
-+  {
-+    static int thr2;
-+    #pragma omp threadprivate(thr2)
-+    static int thr3;
-+    #pragma omp threadprivate(thr3)
-+    thr++;    /* { dg-error "used in untied task" } */
-+    thr2++;   /* { dg-error "used in untied task" } */
-+    thr++;
-+    thr2++;
-+  }
-+}
diff --git a/src/patches/gcc/gcc44-rh610785.patch b/src/patches/gcc/gcc44-rh610785.patch
deleted file mode 100644 (file)
index 91d0934..0000000
+++ /dev/null
@@ -1,74 +0,0 @@
-2010-07-07  Jakub Jelinek  <jakub@redhat.com>
-
-       * tree-sra.c (sra_build_assignment): Don't add BIT_XOR_EXPR/MINUS_EXPR
-       of signbit if signbit is the most significant bit of utype already.
-
-       * gcc.c-torture/execute/20100707-1.c: New test.
-
---- gcc/tree-sra.c.jj  2010-05-13 13:08:52.000000000 +0200
-+++ gcc/tree-sra.c     2010-07-06 19:50:09.000000000 +0200
-@@ -2211,7 +2211,10 @@ sra_build_assignment (tree dst, tree src
-       /* Perform sign extension, if required.
-        ???  This should never be necessary.  */
--      if (!unsignedp)
-+      if (!unsignedp
-+        && (TREE_INT_CST_LOW (width) != TYPE_PRECISION (utype)
-+            || (TREE_INT_CST_LOW (width)
-+                != GET_MODE_BITSIZE (TYPE_MODE (utype)))))
-       {
-         tree signbit = int_const_binop (LSHIFT_EXPR,
-                                         build_int_cst_wide (utype, 1, 0),
---- gcc/testsuite/gcc.c-torture/execute/20100707-1.c   2010-05-27 15:41:40.446237053 +0200
-+++ gcc/testsuite/gcc.c-torture/execute/20100707-1.c   2010-07-06 13:55:35.000000000 +0200
-@@ -0,0 +1,50 @@
-+struct S { int s; };
-+struct T { int w; int h; };
-+int vr;
-+
-+inline struct T
-+bar (const struct S * x)
-+{
-+  struct T t;
-+  t.w = vr;
-+  t.h = x->s;
-+  return t;
-+}
-+
-+__attribute__ ((noinline))
-+void foo (struct S * w, unsigned char *x, int y, int *z[2])
-+{
-+  struct T t;
-+  int i, j, k;
-+  t = bar (w);
-+  k = t.w + 2;
-+  for (i = 0; i <= t.h; i++)
-+    {
-+      int *u = z[i > 0] + 1;
-+      unsigned char *v;
-+      int q = 0;
-+      v = x + k * i + 1;
-+      for (j = 0; j < t.w; j++)
-+      {
-+        int m = u[j];
-+        if (m > y && !q && v[j - k] != 2)
-+          v[j] = 0;
-+      }
-+    }
-+}
-+
-+unsigned char b[64];
-+
-+int
-+main (void)
-+{
-+  int v[32], *z[2];
-+  struct S s;
-+  __builtin_memset (v, 0, sizeof (v));
-+  vr = 16;
-+  s.s = 16;
-+  z[0] = v;
-+  z[1] = v;
-+  foo (&s, b + 32, -1, z);
-+  return 0;
-+}
diff --git a/src/patches/gcc/gcc44-unwind-debug-hook.patch b/src/patches/gcc/gcc44-unwind-debug-hook.patch
deleted file mode 100644 (file)
index 9b7c59e..0000000
+++ /dev/null
@@ -1,51 +0,0 @@
-2010-04-27  Jakub Jelinek  <jakub@redhat.com>
-
-       * unwind-dw2.c (_Unwind_DebugHook): Add used attribute.
-
-2009-05-27  Tom Tromey  <tromey@redhat.com>
-
-       * unwind-dw2.c (_Unwind_DebugHook): New function.
-       (uw_install_context): Call _Unwind_DebugHook.
-
---- gcc/unwind-dw2.c   (revision 147933)
-+++ gcc/unwind-dw2.c   (revision 147934)
-@@ -1473,18 +1473,32 @@ uw_init_context_1 (struct _Unwind_Contex
-   context->ra = __builtin_extract_return_addr (outer_ra);
- }
-+static void _Unwind_DebugHook (void *, void *)
-+  __attribute__ ((__noinline__, __used__));
-+
-+/* This function is called during unwinding.  It is intended as a hook
-+   for a debugger to intercept exceptions.  CFA is the CFA of the
-+   target frame.  HANDLER is the PC to which control will be
-+   transferred.  */
-+static void
-+_Unwind_DebugHook (void *cfa __attribute__ ((__unused__)),
-+                 void *handler __attribute__ ((__unused__)))
-+{
-+  asm ("");
-+}
- /* Install TARGET into CURRENT so that we can return to it.  This is a
-    macro because __builtin_eh_return must be invoked in the context of
-    our caller.  */
--#define uw_install_context(CURRENT, TARGET)                            \
--  do                                                                   \
--    {                                                                  \
--      long offset = uw_install_context_1 ((CURRENT), (TARGET));                \
--      void *handler = __builtin_frob_return_addr ((TARGET)->ra);       \
--      __builtin_eh_return (offset, handler);                           \
--    }                                                                  \
-+#define uw_install_context(CURRENT, TARGET)                           \
-+  do                                                                  \
-+    {                                                                 \
-+      long offset = uw_install_context_1 ((CURRENT), (TARGET));               \
-+      void *handler = __builtin_frob_return_addr ((TARGET)->ra);      \
-+      _Unwind_DebugHook ((TARGET)->cfa, handler);                     \
-+      __builtin_eh_return (offset, handler);                          \
-+    }                                                                 \
-   while (0)
- static long
diff --git a/src/patches/gcc/gcc49-i386-libgomp.patch b/src/patches/gcc/gcc49-i386-libgomp.patch
new file mode 100644 (file)
index 0000000..520561e
--- /dev/null
@@ -0,0 +1,11 @@
+--- libgomp/configure.tgt.jj   2008-01-10 20:53:48.000000000 +0100
++++ libgomp/configure.tgt      2008-03-27 12:44:51.000000000 +0100
+@@ -67,7 +67,7 @@ if test $enable_linux_futex = yes; then
+           ;;
+         *)
+           if test -z "$with_arch"; then
+-            XCFLAGS="${XCFLAGS} -march=i486 -mtune=${target_cpu}"
++            XCFLAGS="${XCFLAGS} -march=i486 -mtune=generic"
+           fi
+       esac
+       ;;
diff --git a/src/patches/gcc/gcc49-no-add-needed.patch b/src/patches/gcc/gcc49-no-add-needed.patch
new file mode 100644 (file)
index 0000000..b6ca777
--- /dev/null
@@ -0,0 +1,50 @@
+2010-02-08  Roland McGrath  <roland@redhat.com>
+
+       * config/rs6000/sysv4.h (LINK_EH_SPEC): Pass --no-add-needed to the
+       linker.
+       * config/gnu-user.h (LINK_EH_SPEC): Likewise.
+       * config/alpha/elf.h (LINK_EH_SPEC): Likewise.
+       * config/ia64/linux.h (LINK_EH_SPEC): Likewise.
+
+--- gcc/config/alpha/elf.h.jj  2011-01-03 12:52:31.118056764 +0100
++++ gcc/config/alpha/elf.h     2011-01-04 18:14:10.931874160 +0100
+@@ -165,5 +165,5 @@ extern int alpha_this_gpdisp_sequence_nu
+    I imagine that other systems will catch up.  In the meantime, it
+    doesn't harm to make sure that the data exists to be used later.  */
+ #if defined(HAVE_LD_EH_FRAME_HDR)
+-#define LINK_EH_SPEC "%{!static:--eh-frame-hdr} "
++#define LINK_EH_SPEC "--no-add-needed %{!static:--eh-frame-hdr} "
+ #endif
+--- gcc/config/ia64/linux.h.jj 2011-01-03 13:02:11.462994522 +0100
++++ gcc/config/ia64/linux.h    2011-01-04 18:14:10.931874160 +0100
+@@ -77,7 +77,7 @@ do {                                         \
+    Signalize that because we have fde-glibc, we don't need all C shared libs
+    linked against -lgcc_s.  */
+ #undef LINK_EH_SPEC
+-#define LINK_EH_SPEC ""
++#define LINK_EH_SPEC "--no-add-needed "
+ /* Put all *tf routines in libgcc.  */
+ #undef LIBGCC2_HAS_TF_MODE
+--- gcc/config/gnu-user.h.jj   2011-01-03 12:53:03.739057299 +0100
++++ gcc/config/gnu-user.h      2011-01-04 18:14:10.932814884 +0100
+@@ -82,7 +82,7 @@ see the files COPYING3 and COPYING.RUNTI
+ #define LIB_SPEC GNU_USER_TARGET_LIB_SPEC
+ #if defined(HAVE_LD_EH_FRAME_HDR)
+-#define LINK_EH_SPEC "%{!static:--eh-frame-hdr} "
++#define LINK_EH_SPEC "--no-add-needed %{!static:--eh-frame-hdr} "
+ #endif
+ #undef LINK_GCC_C_SEQUENCE_SPEC
+--- gcc/config/rs6000/sysv4.h.jj       2011-01-03 13:02:18.255994215 +0100
++++ gcc/config/rs6000/sysv4.h  2011-01-04 18:14:10.933888871 +0100
+@@ -820,7 +820,7 @@ extern int fixuplabelno;
+   -dynamic-linker " GNU_USER_DYNAMIC_LINKER "}}"
+ #if defined(HAVE_LD_EH_FRAME_HDR)
+-# define LINK_EH_SPEC "%{!static:--eh-frame-hdr} "
++# define LINK_EH_SPEC "--no-add-needed %{!static:--eh-frame-hdr} "
+ #endif
+ #define CPP_OS_LINUX_SPEC "-D__unix__ -D__gnu_linux__ -D__linux__ \
diff --git a/src/patches/gcc/gcc49-pr38757.patch b/src/patches/gcc/gcc49-pr38757.patch
new file mode 100644 (file)
index 0000000..4206584
--- /dev/null
@@ -0,0 +1,106 @@
+2009-03-18  Jakub Jelinek  <jakub@redhat.com>
+
+       PR debug/38757
+       * langhooks.h (struct lang_hooks): Add source_language langhook.
+       * langhooks-def.h (LANG_HOOKS_SOURCE_LANGUAGE): Define to NULL.
+       (LANG_HOOKS_INITIALIZER): Add LANG_HOOKS_SOURCE_LANGUAGE.
+       * dwarf2out.c (add_prototyped_attribute): Add DW_AT_prototype
+       also for DW_LANG_{C,C99,ObjC}.
+       (gen_compile_unit_die): Use lang_hooks.source_language () to
+       determine if DW_LANG_C99 or DW_LANG_C89 should be returned.
+c/
+       * c-lang.c (c_source_language): New function.
+       (LANG_HOOKS_SOURCE_LANGUAGE): Define.
+
+--- gcc/langhooks.h.jj 2011-01-03 12:53:05.125745450 +0100
++++ gcc/langhooks.h    2011-01-04 17:59:43.166744926 +0100
+@@ -467,6 +467,10 @@ struct lang_hooks
+      gimplification.  */
+   bool deep_unsharing;
++  /* Return year of the source language standard version if the FE supports
++     multiple versions of the standard.  */
++  int (*source_language) (void);
++
+   /* Whenever you add entries here, make sure you adjust langhooks-def.h
+      and langhooks.c accordingly.  */
+ };
+--- gcc/langhooks-def.h.jj     2011-01-03 12:53:05.000000000 +0100
++++ gcc/langhooks-def.h        2011-01-04 18:00:44.858851030 +0100
+@@ -118,6 +118,7 @@ extern void lhd_omp_firstprivatize_type_
+ #define LANG_HOOKS_BLOCK_MAY_FALLTHRU hook_bool_const_tree_true
+ #define LANG_HOOKS_EH_USE_CXA_END_CLEANUP     false
+ #define LANG_HOOKS_DEEP_UNSHARING     false
++#define LANG_HOOKS_SOURCE_LANGUAGE    NULL
+ /* Attribute hooks.  */
+ #define LANG_HOOKS_ATTRIBUTE_TABLE            NULL
+@@ -303,7 +304,8 @@ extern void lhd_end_section (void);
+   LANG_HOOKS_EH_PROTECT_CLEANUP_ACTIONS, \
+   LANG_HOOKS_BLOCK_MAY_FALLTHRU, \
+   LANG_HOOKS_EH_USE_CXA_END_CLEANUP, \
+-  LANG_HOOKS_DEEP_UNSHARING \
++  LANG_HOOKS_DEEP_UNSHARING, \
++  LANG_HOOKS_SOURCE_LANGUAGE \
+ }
+ #endif /* GCC_LANG_HOOKS_DEF_H */
+--- gcc/c/c-lang.c.jj  2011-01-03 12:53:05.376056936 +0100
++++ gcc/c/c-lang.c     2011-01-04 17:59:43.167743798 +0100
+@@ -36,6 +36,12 @@ along with GCC; see the file COPYING3.
+ enum c_language_kind c_language = clk_c;
++static int
++c_source_language (void)
++{
++  return flag_isoc99 ? 1999 : 1989;
++}
++
+ /* Lang hooks common to C and ObjC are declared in c-objc-common.h;
+    consequently, there should be very few hooks below.  */
+@@ -45,6 +51,8 @@ enum c_language_kind c_language = clk_c;
+ #define LANG_HOOKS_INIT c_objc_common_init
+ #undef LANG_HOOKS_INIT_TS
+ #define LANG_HOOKS_INIT_TS c_common_init_ts
++#undef LANG_HOOKS_SOURCE_LANGUAGE
++#define LANG_HOOKS_SOURCE_LANGUAGE c_source_language
+ /* Each front end provides its own lang hook initializer.  */
+ struct lang_hooks lang_hooks = LANG_HOOKS_INITIALIZER;
+--- gcc/dwarf2out.c.jj 2011-01-03 12:53:05.102056475 +0100
++++ gcc/dwarf2out.c    2011-01-04 18:03:14.534151763 +0100
+@@ -16109,9 +16109,18 @@ add_bit_size_attribute (dw_die_ref die,
+ static inline void
+ add_prototyped_attribute (dw_die_ref die, tree func_type)
+ {
+-  if (get_AT_unsigned (comp_unit_die (), DW_AT_language) == DW_LANG_C89
+-      && prototype_p (func_type))
+-    add_AT_flag (die, DW_AT_prototyped, 1);
++  switch (get_AT_unsigned (comp_unit_die (), DW_AT_language))
++    {
++    case DW_LANG_C:
++    case DW_LANG_C89:
++    case DW_LANG_C99:
++    case DW_LANG_ObjC:
++      if (prototype_p (func_type))
++      add_AT_flag (die, DW_AT_prototyped, 1);
++      break;
++    default:
++      break;
++    }
+ }
+ /* Add an 'abstract_origin' attribute below a given DIE.  The DIE is found
+@@ -18915,6 +18924,10 @@ gen_compile_unit_die (const char *filena
+         if (strcmp (language_string, "GNU Go") == 0)
+           language = DW_LANG_Go;
+       }
++      else if (strcmp (language_string, "GNU C") == 0
++             && lang_hooks.source_language
++             && lang_hooks.source_language () >= 1999)
++      language = DW_LANG_C99;
+     }
+   /* Use a degraded Fortran setting in strict DWARF2 so is_fortran works.  */
+   else if (strcmp (language_string, "GNU Fortran") == 0)
diff --git a/src/patches/gcc/gcc49-pr64336.patch b/src/patches/gcc/gcc49-pr64336.patch
new file mode 100644 (file)
index 0000000..86fddd5
--- /dev/null
@@ -0,0 +1,17 @@
+2014-12-17  Jakub Jelinek  <jakub@redhat.com>
+
+       PR sanitizer/64336
+       * tsan.c (instrument_expr): Ignore TREE_READONLY bit
+       on MEM_REFs.
+
+--- gcc/tsan.c.jj      2014-12-17 10:53:30.000000000 +0100
++++ gcc/tsan.c 2014-12-17 11:55:12.793058159 +0100
+@@ -138,7 +138,7 @@ instrument_expr (gimple_stmt_iterator gs
+       return false;
+     }
+-  if (TREE_READONLY (base)
++  if ((TREE_READONLY (base) && TREE_CODE (base) != MEM_REF)
+       || (TREE_CODE (base) == VAR_DECL
+         && DECL_HARD_REGISTER (base)))
+     return false;
diff --git a/src/patches/glibc/glibc-mq_open.patch b/src/patches/glibc/glibc-mq_open.patch
new file mode 100644 (file)
index 0000000..a7a0f11
--- /dev/null
@@ -0,0 +1,34 @@
+From: https://sourceware.org/bugzilla/show_bug.cgi?id=12841
+
+--- libc/rt/bits/mqueue2.h     2009-05-16 19:23:37.000000000 +0200
++++ libc/rt/bits/mqueue2.h     2011-06-04 19:05:38.322333773 +0200
+@@ -1,5 +1,5 @@ 
+ /* Checking macros for mq functions.
+-   Copyright (C) 2007 Free Software Foundation, Inc.
++   Copyright (C) 2007, 2011 Free Software Foundation, Inc.
+    This file is part of the GNU C Library.
+    The GNU C Library is free software; you can redistribute it and/or
+@@ -25,16 +25,18 @@ 
+    parameter.  */
+ extern mqd_t mq_open (__const char *__name, int __oflag, ...)
+      __THROW __nonnull ((1));
+-extern mqd_t __mq_open_2 (__const char *__name, int __oflag) __nonnull ((1));
+-extern mqd_t __REDIRECT (__mq_open_alias, (__const char *__name, int __oflag, ...),
+-                       mq_open) __nonnull ((1));
++extern mqd_t __mq_open_2 (__const char *__name, int __oflag)
++     __THROW __nonnull ((1));
++extern mqd_t __REDIRECT_NTH (__mq_open_alias, (__const char *__name,
++                                             int __oflag, ...), mq_open)
++     __nonnull ((1));
+ __errordecl (__mq_open_wrong_number_of_args,
+            "mq_open can be called either with 2 or 4 arguments");
+ __errordecl (__mq_open_missing_mode_and_attr,
+            "mq_open with O_CREAT in second argument needs 4 arguments");
+ __extern_always_inline mqd_t
+-mq_open (__const char *__name, int __oflag, ...)
++__NTH (mq_open (__const char *__name, int __oflag, ...))
+ {
+   if (__va_arg_pack_len () != 0 && __va_arg_pack_len () != 2)
+     __mq_open_wrong_number_of_args ();
diff --git a/src/patches/linux-3.10-dvb_tevi_s482.patch b/src/patches/linux-3.10-dvb_tevi_s482.patch
deleted file mode 100644 (file)
index fed875d..0000000
+++ /dev/null
@@ -1,240 +0,0 @@
-diff --git a/drivers/media/usb/dvb-usb/dw2102.c b/drivers/media/usb/dvb-usb/dw2102.c
-index 1a3df10..82d35c6 100644
---- a/drivers/media/usb/dvb-usb/dw2102.c
-+++ b/drivers/media/usb/dvb-usb/dw2102.c
-@@ -31,6 +31,9 @@
- #include "m88rs2000.h"
- #include "tda18271.h"
- #include "cxd2820r.h"
-+#include "m88ds3103.h"
-+#include "m88ts2022.h"
-+
- /* Max transfer size done by I2C transfer functions */
- #define MAX_XFER_SIZE  64
-@@ -71,6 +74,14 @@
- #define USB_PID_TEVII_S480_2 0xd482
- #endif
-+#ifndef USB_PID_TEVII_S482_1
-+#define USB_PID_TEVII_S482_1 0xd483
-+#endif
-+
-+#ifndef USB_PID_TEVII_S482_2
-+#define USB_PID_TEVII_S482_2 0xd484
-+#endif
-+
- #ifndef USB_PID_PROF_1100
- #define USB_PID_PROF_1100 0xb012
- #endif
-@@ -1117,6 +1128,19 @@ static struct tda18271_config tda18271_config = {
-       .gate = TDA18271_GATE_DIGITAL,
- };
-+static const struct m88ds3103_config s482_m88ds3103_config = {
-+      .i2c_addr = 0x68,
-+      .clock = 27000000,
-+      .i2c_wr_max = 33,
-+      .clock_out = 0,
-+      .ts_mode = M88DS3103_TS_CI,
-+      .ts_clk = 16000,
-+      .ts_clk_pol = 0,
-+      .agc = 0x99,
-+      .lnb_hv_pol = 1,
-+      .lnb_en_pol = 1,
-+       };
-+
- static u8 m88rs2000_inittab[] = {
-       DEMOD_WRITE, 0x9a, 0x30,
-       DEMOD_WRITE, 0x00, 0x01,
-@@ -1386,6 +1410,83 @@ static int su3000_frontend_attach(struct dvb_usb_adapter *d)
-       return -EIO;
- }
-+static int m88ds3103_frontend_attach(struct dvb_usb_adapter *d)
-+{
-+      u8 obuf[3] = { 0xe, 0x80, 0 };
-+      u8 ibuf[] = { 0 };
-+
-+      /* demod I2C adapter */
-+      struct i2c_adapter *i2c_adapter;
-+      struct i2c_client *client;
-+      struct i2c_board_info info;
-+      struct m88ts2022_config m88ts2022_config = {
-+              .clock = 27000000,
-+               };
-+      memset(&info, 0, sizeof(struct i2c_board_info));
-+      if (dvb_usb_generic_rw(d->dev, obuf, 3, ibuf, 1, 0) < 0)
-+              err("command 0x0e transfer failed.");
-+
-+      obuf[0] = 0xe;
-+      obuf[1] = 0x02;
-+      obuf[2] = 1;
-+
-+      if (dvb_usb_generic_rw(d->dev, obuf, 3, ibuf, 1, 0) < 0)
-+              err("command 0x0e transfer failed.");
-+      msleep(300);
-+
-+      obuf[0] = 0xe;
-+      obuf[1] = 0x83;
-+      obuf[2] = 0;
-+
-+      if (dvb_usb_generic_rw(d->dev, obuf, 3, ibuf, 1, 0) < 0)
-+              err("command 0x0e transfer failed.");
-+
-+      obuf[0] = 0xe;
-+      obuf[1] = 0x83;
-+      obuf[2] = 1;
-+
-+      if (dvb_usb_generic_rw(d->dev, obuf, 3, ibuf, 1, 0) < 0)
-+              err("command 0x0e transfer failed.");
-+
-+      obuf[0] = 0x51;
-+
-+      if (dvb_usb_generic_rw(d->dev, obuf, 1, ibuf, 1, 0) < 0)
-+              err("command 0x51 transfer failed.");
-+      d->fe_adap[0].fe = dvb_attach(m88ds3103_attach,
-+              &s482_m88ds3103_config,
-+              &d->dev->i2c_adap,
-+              &i2c_adapter);
-+      if (d->fe_adap[0].fe == NULL)
-+              return -EIO;
-+      /* attach tuner */
-+      m88ts2022_config.fe = d->fe_adap[0].fe;
-+      strlcpy(info.type, "m88ts2022", I2C_NAME_SIZE);
-+      info.addr = 0x60;
-+      info.platform_data = &m88ts2022_config;
-+      request_module("m88ts2022");
-+      client = i2c_new_device(i2c_adapter, &info);
-+      if (client == NULL || client->dev.driver == NULL) {
-+              dvb_frontend_detach(d->fe_adap[0].fe);
-+              goto fail_attach;
-+      }
-+      if (!try_module_get(client->dev.driver->owner)) {
-+                      i2c_unregister_device(client);
-+                              dvb_frontend_detach(d->fe_adap[0].fe);
-+                      goto fail_attach;
-+      }
-+      info("attached m88ds3103/m88ts2022!\n");
-+
-+      /* delegate signal strength measurement to tuner */
-+
-+      d->fe_adap[0].fe->ops.read_signal_strength =
-+              d->fe_adap[0].fe->ops.tuner_ops.get_rf_strength;
-+
-+      return 0;
-+fail_attach:
-+      info("Failed to attach m88ds3103/m88ts2022!\n");
-+      return -EIO;
-+}
-+
- static int t220_frontend_attach(struct dvb_usb_adapter *d)
- {
-       u8 obuf[3] = { 0xe, 0x87, 0 };
-@@ -1557,6 +1658,8 @@ enum dw2102_table_entry {
-       TEVII_S480_2,
-       X3M_SPC1400HD,
-       TEVII_S421,
-+      TEVII_S482_1,
-+      TEVII_S482_2,
-       TEVII_S632,
-       TERRATEC_CINERGY_S2_R2,
-       GOTVIEW_SAT_HD,
-@@ -1580,7 +1683,9 @@ static struct usb_device_id dw2102_table[] = {
-       [TEVII_S480_2] = {USB_DEVICE(0x9022, USB_PID_TEVII_S480_2)},
-       [X3M_SPC1400HD] = {USB_DEVICE(0x1f4d, 0x3100)},
-       [TEVII_S421] = {USB_DEVICE(0x9022, USB_PID_TEVII_S421)},
--      [TEVII_S632] = {USB_DEVICE(0x9022, USB_PID_TEVII_S632)},
-+      [TEVII_S482_1] = { USB_DEVICE(0x9022, USB_PID_TEVII_S482_1) },
-+      [TEVII_S482_2] = { USB_DEVICE(0x9022, USB_PID_TEVII_S482_2) },
-+      [TEVII_S632] = { USB_DEVICE(0x9022, USB_PID_TEVII_S632) },
-       [TERRATEC_CINERGY_S2_R2] = {USB_DEVICE(USB_VID_TERRATEC, 0x00b0)},
-       [GOTVIEW_SAT_HD] = {USB_DEVICE(0x1FE1, USB_PID_GOTVIEW_SAT_HD)},
-       [GENIATECH_T220] = {USB_DEVICE(0x1f4d, 0xD220)},
-@@ -2012,6 +2117,59 @@ static struct dvb_usb_device_properties su3000_properties = {
-       }
- };
-+static struct dvb_usb_device_properties m88ds3103_properties = {
-+      .caps = DVB_USB_IS_AN_I2C_ADAPTER,
-+      .usb_ctrl = DEVICE_SPECIFIC,
-+      .size_of_priv = sizeof(struct su3000_state),
-+      .power_ctrl = su3000_power_ctrl,
-+      .num_adapters = 1,
-+      .identify_state = su3000_identify_state,
-+      .i2c_algo = &su3000_i2c_algo,
-+
-+      .rc.core = {
-+              .rc_interval = 150,
-+              .rc_codes = RC_MAP_TEVII_NEC,
-+              .module_name = "dw2102",
-+              .allowed_protos = RC_BIT_NEC,
-+              .rc_query = dw2102_rc_query,
-+      },
-+
-+      .read_mac_address = su3000_read_mac_address,
-+
-+      .generic_bulk_ctrl_endpoint = 0x01,
-+
-+      .adapter = {
-+              {
-+                      .num_frontends = 1,
-+                      .fe = { {
-+                                      .streaming_ctrl = su3000_streaming_ctrl,
-+                                      .frontend_attach = m88ds3103_frontend_attach,
-+                                      .stream = {
-+                                              .type = USB_BULK,
-+                                              .count = 8,
-+                                              .endpoint = 0x82,
-+                                              .u = {
-+                                                      .bulk = {
-+                                                              .buffersize = 4096,
-+                                                      }
-+                                              }
-+                                      }
-+                              } },
-+              }
-+              },
-+              .num_device_descs = 2,
-+              .devices = {
-+                      { "TeVii S482.1 USB",
-+                      { &dw2102_table[TEVII_S482_1], NULL },
-+                      { NULL },
-+                      },
-+                      { "TeVii S482.2 USB",
-+                      { &dw2102_table[TEVII_S482_2], NULL },
-+                      { NULL },
-+                      },
-+                      }
-+};
-+
- static struct dvb_usb_device_properties t220_properties = {
-       .caps = DVB_USB_IS_AN_I2C_ADAPTER,
-       .usb_ctrl = DEVICE_SPECIFIC,
-@@ -2131,11 +2289,13 @@ static int dw2102_probe(struct usb_interface *intf,
-           0 == dvb_usb_device_init(intf, p7500,
-                       THIS_MODULE, NULL, adapter_nr) ||
-           0 == dvb_usb_device_init(intf, s421,
--                      THIS_MODULE, NULL, adapter_nr) ||
--          0 == dvb_usb_device_init(intf, &su3000_properties,
--                       THIS_MODULE, NULL, adapter_nr) ||
-+                      THIS_MODULE, NULL, adapter_nr)  ||
-           0 == dvb_usb_device_init(intf, &t220_properties,
--                       THIS_MODULE, NULL, adapter_nr))
-+                      THIS_MODULE, NULL, adapter_nr) ||
-+              0 == dvb_usb_device_init(intf, &m88ds3103_properties,
-+                      THIS_MODULE, NULL, adapter_nr) ||
-+              0 == dvb_usb_device_init(intf, &su3000_properties,
-+                      THIS_MODULE, NULL, adapter_nr))
-               return 0;
-       return -ENODEV;
-@@ -2153,7 +2313,7 @@ module_usb_driver(dw2102_driver);
- MODULE_AUTHOR("Igor M. Liplianin (c) liplianin@me.by");
- MODULE_DESCRIPTION("Driver for DVBWorld DVB-S 2101, 2102, DVB-S2 2104,"
-                       " DVB-C 3101 USB2.0,"
--                      " TeVii S600, S630, S650, S660, S480, S421, S632"
-+                      " TeVii S600, S630, S650, S660, S480, S482, S421, S632"
-                       " Prof 1100, 7500 USB2.0,"
-                       " Geniatech SU3000, T220 devices");
- MODULE_VERSION("0.1");
diff --git a/src/patches/linux/0001-Drivers-net-hyperv-Get-rid-of-the-rndis_filter_packe.patch b/src/patches/linux/0001-Drivers-net-hyperv-Get-rid-of-the-rndis_filter_packe.patch
new file mode 100644 (file)
index 0000000..2e00392
--- /dev/null
@@ -0,0 +1,129 @@
+From f3f885fa684ff18fa4d223dc22b782f5e5d32560 Mon Sep 17 00:00:00 2001
+From: KY Srinivasan <kys@microsoft.com>
+Date: Sun, 16 Feb 2014 16:38:43 -0800
+Subject: [PATCH 01/25] Drivers: net: hyperv: Get rid of the
+ rndis_filter_packet structure
+
+This structure is redundant; get rid of it make the code little more efficient -
+get rid of the unnecessary indirection.
+
+Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
+Reviewed-by: Haiyang Zhang <haiyangz@microsoft.com>
+Signed-off-by: David S. Miller <davem@davemloft.net>
+---
+ drivers/net/hyperv/hyperv_net.h   |  6 ------
+ drivers/net/hyperv/netvsc_drv.c   |  2 +-
+ drivers/net/hyperv/rndis_filter.c | 41 +++------------------------------------
+ 3 files changed, 4 insertions(+), 45 deletions(-)
+
+diff --git a/drivers/net/hyperv/hyperv_net.h b/drivers/net/hyperv/hyperv_net.h
+index 7b594ce3f21d..7645ba38bde8 100644
+--- a/drivers/net/hyperv/hyperv_net.h
++++ b/drivers/net/hyperv/hyperv_net.h
+@@ -846,12 +846,6 @@ struct rndis_message {
+ };
+-struct rndis_filter_packet {
+-      void *completion_ctx;
+-      void (*completion)(void *context);
+-      struct rndis_message msg;
+-};
+-
+ /* Handy macros */
+ /* get the size of an RNDIS message. Pass in the message type, */
+diff --git a/drivers/net/hyperv/netvsc_drv.c b/drivers/net/hyperv/netvsc_drv.c
+index 3c1c33ceffba..28020f83ba6f 100644
+--- a/drivers/net/hyperv/netvsc_drv.c
++++ b/drivers/net/hyperv/netvsc_drv.c
+@@ -156,7 +156,7 @@ static int netvsc_start_xmit(struct sk_buff *skb, struct net_device *net)
+       /* Allocate a netvsc packet based on # of frags. */
+       packet = kzalloc(sizeof(struct hv_netvsc_packet) +
+                        (num_pages * sizeof(struct hv_page_buffer)) +
+-                       sizeof(struct rndis_filter_packet) +
++                       sizeof(struct rndis_message) +
+                        NDIS_VLAN_PPI_SIZE, GFP_ATOMIC);
+       if (!packet) {
+               /* out of memory, drop packet */
+diff --git a/drivers/net/hyperv/rndis_filter.c b/drivers/net/hyperv/rndis_filter.c
+index b54fd257652b..6a9f6021f09c 100644
+--- a/drivers/net/hyperv/rndis_filter.c
++++ b/drivers/net/hyperv/rndis_filter.c
+@@ -58,9 +58,6 @@ struct rndis_request {
+       u8 request_ext[RNDIS_EXT_LEN];
+ };
+-static void rndis_filter_send_completion(void *ctx);
+-
+-
+ static struct rndis_device *get_rndis_device(void)
+ {
+       struct rndis_device *device;
+@@ -297,7 +294,7 @@ static void rndis_filter_receive_response(struct rndis_device *dev,
+                               "rndis response buffer overflow "
+                               "detected (size %u max %zu)\n",
+                               resp->msg_len,
+-                              sizeof(struct rndis_filter_packet));
++                              sizeof(struct rndis_message));
+                       if (resp->ndis_msg_type ==
+                           RNDIS_MSG_RESET_C) {
+@@ -917,17 +914,14 @@ int rndis_filter_close(struct hv_device *dev)
+ int rndis_filter_send(struct hv_device *dev,
+                            struct hv_netvsc_packet *pkt)
+ {
+-      int ret;
+-      struct rndis_filter_packet *filter_pkt;
+       struct rndis_message *rndis_msg;
+       struct rndis_packet *rndis_pkt;
+       u32 rndis_msg_size;
+       bool isvlan = pkt->vlan_tci & VLAN_TAG_PRESENT;
+       /* Add the rndis header */
+-      filter_pkt = (struct rndis_filter_packet *)pkt->extension;
++      rndis_msg = (struct rndis_message *)pkt->extension;
+-      rndis_msg = &filter_pkt->msg;
+       rndis_msg_size = RNDIS_MESSAGE_SIZE(struct rndis_packet);
+       if (isvlan)
+               rndis_msg_size += NDIS_VLAN_PPI_SIZE;
+@@ -980,34 +974,5 @@ int rndis_filter_send(struct hv_device *dev,
+               pkt->page_buf[1].len = rndis_msg_size - pkt->page_buf[0].len;
+       }
+-      /* Save the packet send completion and context */
+-      filter_pkt->completion = pkt->completion.send.send_completion;
+-      filter_pkt->completion_ctx =
+-                              pkt->completion.send.send_completion_ctx;
+-
+-      /* Use ours */
+-      pkt->completion.send.send_completion = rndis_filter_send_completion;
+-      pkt->completion.send.send_completion_ctx = filter_pkt;
+-
+-      ret = netvsc_send(dev, pkt);
+-      if (ret != 0) {
+-              /*
+-               * Reset the completion to originals to allow retries from
+-               * above
+-               */
+-              pkt->completion.send.send_completion =
+-                              filter_pkt->completion;
+-              pkt->completion.send.send_completion_ctx =
+-                              filter_pkt->completion_ctx;
+-      }
+-
+-      return ret;
+-}
+-
+-static void rndis_filter_send_completion(void *ctx)
+-{
+-      struct rndis_filter_packet *filter_pkt = ctx;
+-
+-      /* Pass it back to the original handler */
+-      filter_pkt->completion(filter_pkt->completion_ctx);
++      return netvsc_send(dev, pkt);
+ }
+-- 
+2.4.3
+
diff --git a/src/patches/linux/0001-hyperv-Add-support-for-virtual-Receive-Side-Scaling-.patch b/src/patches/linux/0001-hyperv-Add-support-for-virtual-Receive-Side-Scaling-.patch
new file mode 100644 (file)
index 0000000..52c4da6
--- /dev/null
@@ -0,0 +1,917 @@
+From 5b54dac856cb5bd6f33f4159012773e4a33704f7 Mon Sep 17 00:00:00 2001
+From: Haiyang Zhang <haiyangz@microsoft.com>
+Date: Mon, 21 Apr 2014 10:20:28 -0700
+Subject: [PATCH 01/11] hyperv: Add support for virtual Receive Side Scaling
+ (vRSS)
+
+This feature allows multiple channels to be used by each virtual NIC.
+It is available on Hyper-V host 2012 R2.
+
+Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
+Reviewed-by: K. Y. Srinivasan <kys@microsoft.com>
+Signed-off-by: David S. Miller <davem@davemloft.net>
+---
+ drivers/net/hyperv/hyperv_net.h   | 110 +++++++++++++++++++++-
+ drivers/net/hyperv/netvsc.c       | 136 +++++++++++++++++++++------
+ drivers/net/hyperv/netvsc_drv.c   | 103 ++++++++++++++++++++-
+ drivers/net/hyperv/rndis_filter.c | 189 +++++++++++++++++++++++++++++++++++++-
+ 4 files changed, 504 insertions(+), 34 deletions(-)
+
+diff --git a/drivers/net/hyperv/hyperv_net.h b/drivers/net/hyperv/hyperv_net.h
+index d18f711d0b0c..57eb3f906d64 100644
+--- a/drivers/net/hyperv/hyperv_net.h
++++ b/drivers/net/hyperv/hyperv_net.h
+@@ -28,6 +28,96 @@
+ #include <linux/hyperv.h>
+ #include <linux/rndis.h>
++/* RSS related */
++#define OID_GEN_RECEIVE_SCALE_CAPABILITIES 0x00010203  /* query only */
++#define OID_GEN_RECEIVE_SCALE_PARAMETERS 0x00010204  /* query and set */
++
++#define NDIS_OBJECT_TYPE_RSS_CAPABILITIES 0x88
++#define NDIS_OBJECT_TYPE_RSS_PARAMETERS 0x89
++
++#define NDIS_RECEIVE_SCALE_CAPABILITIES_REVISION_2 2
++#define NDIS_RECEIVE_SCALE_PARAMETERS_REVISION_2 2
++
++struct ndis_obj_header {
++      u8 type;
++      u8 rev;
++      u16 size;
++} __packed;
++
++/* ndis_recv_scale_cap/cap_flag */
++#define NDIS_RSS_CAPS_MESSAGE_SIGNALED_INTERRUPTS 0x01000000
++#define NDIS_RSS_CAPS_CLASSIFICATION_AT_ISR       0x02000000
++#define NDIS_RSS_CAPS_CLASSIFICATION_AT_DPC       0x04000000
++#define NDIS_RSS_CAPS_USING_MSI_X                 0x08000000
++#define NDIS_RSS_CAPS_RSS_AVAILABLE_ON_PORTS      0x10000000
++#define NDIS_RSS_CAPS_SUPPORTS_MSI_X              0x20000000
++#define NDIS_RSS_CAPS_HASH_TYPE_TCP_IPV4          0x00000100
++#define NDIS_RSS_CAPS_HASH_TYPE_TCP_IPV6          0x00000200
++#define NDIS_RSS_CAPS_HASH_TYPE_TCP_IPV6_EX       0x00000400
++
++struct ndis_recv_scale_cap { /* NDIS_RECEIVE_SCALE_CAPABILITIES */
++      struct ndis_obj_header hdr;
++      u32 cap_flag;
++      u32 num_int_msg;
++      u32 num_recv_que;
++      u16 num_indirect_tabent;
++} __packed;
++
++
++/* ndis_recv_scale_param flags */
++#define NDIS_RSS_PARAM_FLAG_BASE_CPU_UNCHANGED     0x0001
++#define NDIS_RSS_PARAM_FLAG_HASH_INFO_UNCHANGED    0x0002
++#define NDIS_RSS_PARAM_FLAG_ITABLE_UNCHANGED       0x0004
++#define NDIS_RSS_PARAM_FLAG_HASH_KEY_UNCHANGED     0x0008
++#define NDIS_RSS_PARAM_FLAG_DISABLE_RSS            0x0010
++
++/* Hash info bits */
++#define NDIS_HASH_FUNC_TOEPLITZ 0x00000001
++#define NDIS_HASH_IPV4          0x00000100
++#define NDIS_HASH_TCP_IPV4      0x00000200
++#define NDIS_HASH_IPV6          0x00000400
++#define NDIS_HASH_IPV6_EX       0x00000800
++#define NDIS_HASH_TCP_IPV6      0x00001000
++#define NDIS_HASH_TCP_IPV6_EX   0x00002000
++
++#define NDIS_RSS_INDIRECTION_TABLE_MAX_SIZE_REVISION_2 (128 * 4)
++#define NDIS_RSS_HASH_SECRET_KEY_MAX_SIZE_REVISION_2   40
++
++#define ITAB_NUM 128
++#define HASH_KEYLEN NDIS_RSS_HASH_SECRET_KEY_MAX_SIZE_REVISION_2
++extern u8 netvsc_hash_key[];
++
++struct ndis_recv_scale_param { /* NDIS_RECEIVE_SCALE_PARAMETERS */
++      struct ndis_obj_header hdr;
++
++      /* Qualifies the rest of the information */
++      u16 flag;
++
++      /* The base CPU number to do receive processing. not used */
++      u16 base_cpu_number;
++
++      /* This describes the hash function and type being enabled */
++      u32 hashinfo;
++
++      /* The size of indirection table array */
++      u16 indirect_tabsize;
++
++      /* The offset of the indirection table from the beginning of this
++       * structure
++       */
++      u32 indirect_taboffset;
++
++      /* The size of the hash secret key */
++      u16 hashkey_size;
++
++      /* The offset of the secret key from the beginning of this structure */
++      u32 kashkey_offset;
++
++      u32 processor_masks_offset;
++      u32 num_processor_masks;
++      u32 processor_masks_entry_size;
++};
++
+ /* Fwd declaration */
+ struct hv_netvsc_packet;
+ struct ndis_tcp_ip_checksum_info;
+@@ -39,6 +129,8 @@ struct xferpage_packet {
+       /* # of netvsc packets this xfer packet contains */
+       u32 count;
++
++      struct vmbus_channel *channel;
+ };
+ /*
+@@ -54,6 +146,9 @@ struct hv_netvsc_packet {
+       bool is_data_pkt;
+       u16 vlan_tci;
++      u16 q_idx;
++      struct vmbus_channel *channel;
++
+       /*
+        * Valid only for receives when we break a xfer page packet
+        * into multiple netvsc packets
+@@ -120,6 +215,7 @@ void netvsc_linkstatus_callback(struct hv_device *device_obj,
+ int netvsc_recv_callback(struct hv_device *device_obj,
+                       struct hv_netvsc_packet *packet,
+                       struct ndis_tcp_ip_checksum_info *csum_info);
++void netvsc_channel_cb(void *context);
+ int rndis_filter_open(struct hv_device *dev);
+ int rndis_filter_close(struct hv_device *dev);
+ int rndis_filter_device_add(struct hv_device *dev,
+@@ -522,6 +618,8 @@ struct nvsp_message {
+ #define NETVSC_PACKET_SIZE                      2048
++#define VRSS_SEND_TAB_SIZE 16
++
+ /* Per netvsc channel-specific */
+ struct netvsc_device {
+       struct hv_device *dev;
+@@ -555,10 +653,20 @@ struct netvsc_device {
+       struct net_device *ndev;
++      struct vmbus_channel *chn_table[NR_CPUS];
++      u32 send_table[VRSS_SEND_TAB_SIZE];
++      u32 num_chn;
++      atomic_t queue_sends[NR_CPUS];
++
+       /* Holds rndis device info */
+       void *extension;
+-      /* The recive buffer for this device */
++
++      int ring_size;
++
++      /* The primary channel callback buffer */
+       unsigned char cb_buffer[NETVSC_PACKET_SIZE];
++      /* The sub channel callback buffer */
++      unsigned char *sub_cb_buf;
+ };
+ /* NdisInitialize message */
+diff --git a/drivers/net/hyperv/netvsc.c b/drivers/net/hyperv/netvsc.c
+index f7629ecefa84..e7e77f12bc38 100644
+--- a/drivers/net/hyperv/netvsc.c
++++ b/drivers/net/hyperv/netvsc.c
+@@ -422,6 +422,9 @@ int netvsc_device_remove(struct hv_device *device)
+               kfree(netvsc_packet);
+       }
++      if (net_device->sub_cb_buf)
++              vfree(net_device->sub_cb_buf);
++
+       kfree(net_device);
+       return 0;
+ }
+@@ -461,7 +464,9 @@ static void netvsc_send_completion(struct netvsc_device *net_device,
+           (nvsp_packet->hdr.msg_type ==
+            NVSP_MSG1_TYPE_SEND_RECV_BUF_COMPLETE) ||
+           (nvsp_packet->hdr.msg_type ==
+-           NVSP_MSG1_TYPE_SEND_SEND_BUF_COMPLETE)) {
++           NVSP_MSG1_TYPE_SEND_SEND_BUF_COMPLETE) ||
++          (nvsp_packet->hdr.msg_type ==
++           NVSP_MSG5_TYPE_SUBCHANNEL)) {
+               /* Copy the response back */
+               memcpy(&net_device->channel_init_pkt, nvsp_packet,
+                      sizeof(struct nvsp_message));
+@@ -469,28 +474,37 @@ static void netvsc_send_completion(struct netvsc_device *net_device,
+       } else if (nvsp_packet->hdr.msg_type ==
+                  NVSP_MSG1_TYPE_SEND_RNDIS_PKT_COMPLETE) {
+               int num_outstanding_sends;
++              u16 q_idx = 0;
++              struct vmbus_channel *channel = device->channel;
++              int queue_sends;
+               /* Get the send context */
+               nvsc_packet = (struct hv_netvsc_packet *)(unsigned long)
+                       packet->trans_id;
+               /* Notify the layer above us */
+-              if (nvsc_packet)
++              if (nvsc_packet) {
++                      q_idx = nvsc_packet->q_idx;
++                      channel = nvsc_packet->channel;
+                       nvsc_packet->completion.send.send_completion(
+                               nvsc_packet->completion.send.
+                               send_completion_ctx);
++              }
+               num_outstanding_sends =
+                       atomic_dec_return(&net_device->num_outstanding_sends);
++              queue_sends = atomic_dec_return(&net_device->
++                                              queue_sends[q_idx]);
+               if (net_device->destroy && num_outstanding_sends == 0)
+                       wake_up(&net_device->wait_drain);
+-              if (netif_queue_stopped(ndev) && !net_device->start_remove &&
+-                      (hv_ringbuf_avail_percent(&device->channel->outbound)
+-                      > RING_AVAIL_PERCENT_HIWATER ||
+-                      num_outstanding_sends < 1))
+-                              netif_wake_queue(ndev);
++              if (netif_tx_queue_stopped(netdev_get_tx_queue(ndev, q_idx)) &&
++                  !net_device->start_remove &&
++                  (hv_ringbuf_avail_percent(&channel->outbound) >
++                   RING_AVAIL_PERCENT_HIWATER || queue_sends < 1))
++                              netif_tx_wake_queue(netdev_get_tx_queue(
++                                                  ndev, q_idx));
+       } else {
+               netdev_err(ndev, "Unknown send completion packet type- "
+                          "%d received!!\n", nvsp_packet->hdr.msg_type);
+@@ -505,6 +519,7 @@ int netvsc_send(struct hv_device *device,
+       int ret = 0;
+       struct nvsp_message sendMessage;
+       struct net_device *ndev;
++      struct vmbus_channel *out_channel = NULL;
+       u64 req_id;
+       net_device = get_outbound_net_device(device);
+@@ -531,15 +546,20 @@ int netvsc_send(struct hv_device *device,
+       else
+               req_id = 0;
++      out_channel = net_device->chn_table[packet->q_idx];
++      if (out_channel == NULL)
++              out_channel = device->channel;
++      packet->channel = out_channel;
++
+       if (packet->page_buf_cnt) {
+-              ret = vmbus_sendpacket_pagebuffer(device->channel,
++              ret = vmbus_sendpacket_pagebuffer(out_channel,
+                                                 packet->page_buf,
+                                                 packet->page_buf_cnt,
+                                                 &sendMessage,
+                                                 sizeof(struct nvsp_message),
+                                                 req_id);
+       } else {
+-              ret = vmbus_sendpacket(device->channel, &sendMessage,
++              ret = vmbus_sendpacket(out_channel, &sendMessage,
+                               sizeof(struct nvsp_message),
+                               req_id,
+                               VM_PKT_DATA_INBAND,
+@@ -548,17 +568,24 @@ int netvsc_send(struct hv_device *device,
+       if (ret == 0) {
+               atomic_inc(&net_device->num_outstanding_sends);
+-              if (hv_ringbuf_avail_percent(&device->channel->outbound) <
++              atomic_inc(&net_device->queue_sends[packet->q_idx]);
++
++              if (hv_ringbuf_avail_percent(&out_channel->outbound) <
+                       RING_AVAIL_PERCENT_LOWATER) {
+-                      netif_stop_queue(ndev);
++                      netif_tx_stop_queue(netdev_get_tx_queue(
++                                          ndev, packet->q_idx));
++
+                       if (atomic_read(&net_device->
+-                              num_outstanding_sends) < 1)
+-                              netif_wake_queue(ndev);
++                              queue_sends[packet->q_idx]) < 1)
++                              netif_tx_wake_queue(netdev_get_tx_queue(
++                                                  ndev, packet->q_idx));
+               }
+       } else if (ret == -EAGAIN) {
+-              netif_stop_queue(ndev);
+-              if (atomic_read(&net_device->num_outstanding_sends) < 1) {
+-                      netif_wake_queue(ndev);
++              netif_tx_stop_queue(netdev_get_tx_queue(
++                                  ndev, packet->q_idx));
++              if (atomic_read(&net_device->queue_sends[packet->q_idx]) < 1) {
++                      netif_tx_wake_queue(netdev_get_tx_queue(
++                                          ndev, packet->q_idx));
+                       ret = -ENOSPC;
+               }
+       } else {
+@@ -570,6 +597,7 @@ int netvsc_send(struct hv_device *device,
+ }
+ static void netvsc_send_recv_completion(struct hv_device *device,
++                                      struct vmbus_channel *channel,
+                                       struct netvsc_device *net_device,
+                                       u64 transaction_id, u32 status)
+ {
+@@ -587,7 +615,7 @@ static void netvsc_send_recv_completion(struct hv_device *device,
+ retry_send_cmplt:
+       /* Send the completion */
+-      ret = vmbus_sendpacket(device->channel, &recvcompMessage,
++      ret = vmbus_sendpacket(channel, &recvcompMessage,
+                              sizeof(struct nvsp_message), transaction_id,
+                              VM_PKT_COMP, 0);
+       if (ret == 0) {
+@@ -618,6 +646,7 @@ static void netvsc_receive_completion(void *context)
+ {
+       struct hv_netvsc_packet *packet = context;
+       struct hv_device *device = packet->device;
++      struct vmbus_channel *channel;
+       struct netvsc_device *net_device;
+       u64 transaction_id = 0;
+       bool fsend_receive_comp = false;
+@@ -649,6 +678,7 @@ static void netvsc_receive_completion(void *context)
+        */
+       if (packet->xfer_page_pkt->count == 0) {
+               fsend_receive_comp = true;
++              channel = packet->xfer_page_pkt->channel;
+               transaction_id = packet->completion.recv.recv_completion_tid;
+               status = packet->xfer_page_pkt->status;
+               list_add_tail(&packet->xfer_page_pkt->list_ent,
+@@ -662,12 +692,13 @@ static void netvsc_receive_completion(void *context)
+       /* Send a receive completion for the xfer page packet */
+       if (fsend_receive_comp)
+-              netvsc_send_recv_completion(device, net_device, transaction_id,
+-                                      status);
++              netvsc_send_recv_completion(device, channel, net_device,
++                                          transaction_id, status);
+ }
+ static void netvsc_receive(struct netvsc_device *net_device,
++                      struct vmbus_channel *channel,
+                       struct hv_device *device,
+                       struct vmpacket_descriptor *packet)
+ {
+@@ -748,7 +779,7 @@ static void netvsc_receive(struct netvsc_device *net_device,
+               spin_unlock_irqrestore(&net_device->recv_pkt_list_lock,
+                                      flags);
+-              netvsc_send_recv_completion(device, net_device,
++              netvsc_send_recv_completion(device, channel, net_device,
+                                           vmxferpage_packet->d.trans_id,
+                                           NVSP_STAT_FAIL);
+@@ -759,6 +790,7 @@ static void netvsc_receive(struct netvsc_device *net_device,
+       xferpage_packet = (struct xferpage_packet *)listHead.next;
+       list_del(&xferpage_packet->list_ent);
+       xferpage_packet->status = NVSP_STAT_SUCCESS;
++      xferpage_packet->channel = channel;
+       /* This is how much we can satisfy */
+       xferpage_packet->count = count - 1;
+@@ -800,10 +832,45 @@ static void netvsc_receive(struct netvsc_device *net_device,
+ }
+-static void netvsc_channel_cb(void *context)
++
++static void netvsc_send_table(struct hv_device *hdev,
++                            struct vmpacket_descriptor *vmpkt)
++{
++      struct netvsc_device *nvscdev;
++      struct net_device *ndev;
++      struct nvsp_message *nvmsg;
++      int i;
++      u32 count, *tab;
++
++      nvscdev = get_outbound_net_device(hdev);
++      if (!nvscdev)
++              return;
++      ndev = nvscdev->ndev;
++
++      nvmsg = (struct nvsp_message *)((unsigned long)vmpkt +
++                                      (vmpkt->offset8 << 3));
++
++      if (nvmsg->hdr.msg_type != NVSP_MSG5_TYPE_SEND_INDIRECTION_TABLE)
++              return;
++
++      count = nvmsg->msg.v5_msg.send_table.count;
++      if (count != VRSS_SEND_TAB_SIZE) {
++              netdev_err(ndev, "Received wrong send-table size:%u\n", count);
++              return;
++      }
++
++      tab = (u32 *)((unsigned long)&nvmsg->msg.v5_msg.send_table +
++                    nvmsg->msg.v5_msg.send_table.offset);
++
++      for (i = 0; i < count; i++)
++              nvscdev->send_table[i] = tab[i];
++}
++
++void netvsc_channel_cb(void *context)
+ {
+       int ret;
+-      struct hv_device *device = context;
++      struct vmbus_channel *channel = (struct vmbus_channel *)context;
++      struct hv_device *device;
+       struct netvsc_device *net_device;
+       u32 bytes_recvd;
+       u64 request_id;
+@@ -812,14 +879,19 @@ static void netvsc_channel_cb(void *context)
+       int bufferlen = NETVSC_PACKET_SIZE;
+       struct net_device *ndev;
++      if (channel->primary_channel != NULL)
++              device = channel->primary_channel->device_obj;
++      else
++              device = channel->device_obj;
++
+       net_device = get_inbound_net_device(device);
+       if (!net_device)
+               return;
+       ndev = net_device->ndev;
+-      buffer = net_device->cb_buffer;
++      buffer = get_per_channel_state(channel);
+       do {
+-              ret = vmbus_recvpacket_raw(device->channel, buffer, bufferlen,
++              ret = vmbus_recvpacket_raw(channel, buffer, bufferlen,
+                                          &bytes_recvd, &request_id);
+               if (ret == 0) {
+                       if (bytes_recvd > 0) {
+@@ -831,8 +903,12 @@ static void netvsc_channel_cb(void *context)
+                                       break;
+                               case VM_PKT_DATA_USING_XFER_PAGES:
+-                                      netvsc_receive(net_device,
+-                                                      device, desc);
++                                      netvsc_receive(net_device, channel,
++                                                     device, desc);
++                                      break;
++
++                              case VM_PKT_DATA_INBAND:
++                                      netvsc_send_table(device, desc);
+                                       break;
+                               default:
+@@ -893,6 +969,8 @@ int netvsc_device_add(struct hv_device *device, void *additional_info)
+               goto cleanup;
+       }
++      net_device->ring_size = ring_size;
++
+       /*
+        * Coming into this function, struct net_device * is
+        * registered as the driver private data.
+@@ -917,10 +995,12 @@ int netvsc_device_add(struct hv_device *device, void *additional_info)
+       }
+       init_completion(&net_device->channel_init_wait);
++      set_per_channel_state(device->channel, net_device->cb_buffer);
++
+       /* Open the channel */
+       ret = vmbus_open(device->channel, ring_size * PAGE_SIZE,
+                        ring_size * PAGE_SIZE, NULL, 0,
+-                       netvsc_channel_cb, device);
++                       netvsc_channel_cb, device->channel);
+       if (ret != 0) {
+               netdev_err(ndev, "unable to open channel: %d\n", ret);
+@@ -930,6 +1010,8 @@ int netvsc_device_add(struct hv_device *device, void *additional_info)
+       /* Channel is opened */
+       pr_info("hv_netvsc channel opened successfully\n");
++      net_device->chn_table[0] = device->channel;
++
+       /* Connect with the NetVsp */
+       ret = netvsc_connect_vsp(device);
+       if (ret != 0) {
+diff --git a/drivers/net/hyperv/netvsc_drv.c b/drivers/net/hyperv/netvsc_drv.c
+index 31e55fba7cad..093cf3fc46b8 100644
+--- a/drivers/net/hyperv/netvsc_drv.c
++++ b/drivers/net/hyperv/netvsc_drv.c
+@@ -101,7 +101,7 @@ static int netvsc_open(struct net_device *net)
+               return ret;
+       }
+-      netif_start_queue(net);
++      netif_tx_start_all_queues(net);
+       nvdev = hv_get_drvdata(device_obj);
+       rdev = nvdev->extension;
+@@ -149,6 +149,88 @@ static void *init_ppi_data(struct rndis_message *msg, u32 ppi_size,
+       return ppi;
+ }
++union sub_key {
++      u64 k;
++      struct {
++              u8 pad[3];
++              u8 kb;
++              u32 ka;
++      };
++};
++
++/* Toeplitz hash function
++ * data: network byte order
++ * return: host byte order
++ */
++static u32 comp_hash(u8 *key, int klen, u8 *data, int dlen)
++{
++      union sub_key subk;
++      int k_next = 4;
++      u8 dt;
++      int i, j;
++      u32 ret = 0;
++
++      subk.k = 0;
++      subk.ka = ntohl(*(u32 *)key);
++
++      for (i = 0; i < dlen; i++) {
++              subk.kb = key[k_next];
++              k_next = (k_next + 1) % klen;
++              dt = data[i];
++              for (j = 0; j < 8; j++) {
++                      if (dt & 0x80)
++                              ret ^= subk.ka;
++                      dt <<= 1;
++                      subk.k <<= 1;
++              }
++      }
++
++      return ret;
++}
++
++static bool netvsc_set_hash(u32 *hash, struct sk_buff *skb)
++{
++      struct iphdr *iphdr;
++      int data_len;
++      bool ret = false;
++
++      if (eth_hdr(skb)->h_proto != htons(ETH_P_IP))
++              return false;
++
++      iphdr = ip_hdr(skb);
++
++      if (iphdr->version == 4) {
++              if (iphdr->protocol == IPPROTO_TCP)
++                      data_len = 12;
++              else
++                      data_len = 8;
++              *hash = comp_hash(netvsc_hash_key, HASH_KEYLEN,
++                                (u8 *)&iphdr->saddr, data_len);
++              ret = true;
++      }
++
++      return ret;
++}
++
++static u16 netvsc_select_queue(struct net_device *ndev, struct sk_buff *skb,
++                      void *accel_priv, select_queue_fallback_t fallback)
++{
++      struct net_device_context *net_device_ctx = netdev_priv(ndev);
++      struct hv_device *hdev =  net_device_ctx->device_ctx;
++      struct netvsc_device *nvsc_dev = hv_get_drvdata(hdev);
++      u32 hash;
++      u16 q_idx = 0;
++
++      if (nvsc_dev == NULL || ndev->real_num_tx_queues <= 1)
++              return 0;
++
++      if (netvsc_set_hash(&hash, skb))
++              q_idx = nvsc_dev->send_table[hash % VRSS_SEND_TAB_SIZE] %
++                      ndev->real_num_tx_queues;
++
++      return q_idx;
++}
++
+ static void netvsc_xmit_completion(void *context)
+ {
+       struct hv_netvsc_packet *packet = (struct hv_netvsc_packet *)context;
+@@ -333,6 +415,8 @@ static int netvsc_start_xmit(struct sk_buff *skb, struct net_device *net)
+       packet->vlan_tci = skb->vlan_tci;
++      packet->q_idx = skb_get_queue_mapping(skb);
++
+       packet->is_data_pkt = true;
+       packet->total_data_buflen = skb->len;
+@@ -554,6 +638,10 @@ int netvsc_recv_callback(struct hv_device *device_obj,
+               __vlan_hwaccel_put_tag(skb, htons(ETH_P_8021Q),
+                                      packet->vlan_tci);
++      skb_record_rx_queue(skb, packet->xfer_page_pkt->channel->
++                          offermsg.offer.sub_channel_index %
++                          net->real_num_rx_queues);
++
+       net->stats.rx_packets++;
+       net->stats.rx_bytes += packet->total_data_buflen;
+@@ -602,7 +690,7 @@ static int netvsc_change_mtu(struct net_device *ndev, int mtu)
+       hv_set_drvdata(hdev, ndev);
+       device_info.ring_size = ring_size;
+       rndis_filter_device_add(hdev, &device_info);
+-      netif_wake_queue(ndev);
++      netif_tx_wake_all_queues(ndev);
+       return 0;
+ }
+@@ -648,6 +736,7 @@ static const struct net_device_ops device_ops = {
+       .ndo_change_mtu =               netvsc_change_mtu,
+       .ndo_validate_addr =            eth_validate_addr,
+       .ndo_set_mac_address =          netvsc_set_mac_addr,
++      .ndo_select_queue =             netvsc_select_queue,
+ };
+ /*
+@@ -694,9 +783,11 @@ static int netvsc_probe(struct hv_device *dev,
+       struct net_device *net = NULL;
+       struct net_device_context *net_device_ctx;
+       struct netvsc_device_info device_info;
++      struct netvsc_device *nvdev;
+       int ret;
+-      net = alloc_etherdev(sizeof(struct net_device_context));
++      net = alloc_etherdev_mq(sizeof(struct net_device_context),
++                              num_online_cpus());
+       if (!net)
+               return -ENOMEM;
+@@ -729,6 +820,12 @@ static int netvsc_probe(struct hv_device *dev,
+       }
+       memcpy(net->dev_addr, device_info.mac_adr, ETH_ALEN);
++      nvdev = hv_get_drvdata(dev);
++      netif_set_real_num_tx_queues(net, nvdev->num_chn);
++      netif_set_real_num_rx_queues(net, nvdev->num_chn);
++      dev_info(&dev->device, "real num tx,rx queues:%u, %u\n",
++               net->real_num_tx_queues, net->real_num_rx_queues);
++
+       ret = register_netdev(net);
+       if (ret != 0) {
+               pr_err("Unable to register netdev.\n");
+diff --git a/drivers/net/hyperv/rndis_filter.c b/drivers/net/hyperv/rndis_filter.c
+index 143a98caf618..d92cfbe43410 100644
+--- a/drivers/net/hyperv/rndis_filter.c
++++ b/drivers/net/hyperv/rndis_filter.c
+@@ -31,7 +31,7 @@
+ #include "hyperv_net.h"
+-#define RNDIS_EXT_LEN 100
++#define RNDIS_EXT_LEN PAGE_SIZE
+ struct rndis_request {
+       struct list_head list_ent;
+       struct completion  wait_event;
+@@ -94,6 +94,8 @@ static struct rndis_request *get_rndis_request(struct rndis_device *dev,
+       rndis_msg->ndis_msg_type = msg_type;
+       rndis_msg->msg_len = msg_len;
++      request->pkt.q_idx = 0;
++
+       /*
+        * Set the request id. This field is always after the rndis header for
+        * request/response packet types so we just used the SetRequest as a
+@@ -509,6 +511,19 @@ static int rndis_filter_query_device(struct rndis_device *dev, u32 oid,
+       query->info_buflen = 0;
+       query->dev_vc_handle = 0;
++      if (oid == OID_GEN_RECEIVE_SCALE_CAPABILITIES) {
++              struct ndis_recv_scale_cap *cap;
++
++              request->request_msg.msg_len +=
++                      sizeof(struct ndis_recv_scale_cap);
++              query->info_buflen = sizeof(struct ndis_recv_scale_cap);
++              cap = (struct ndis_recv_scale_cap *)((unsigned long)query +
++                                                   query->info_buf_offset);
++              cap->hdr.type = NDIS_OBJECT_TYPE_RSS_CAPABILITIES;
++              cap->hdr.rev = NDIS_RECEIVE_SCALE_CAPABILITIES_REVISION_2;
++              cap->hdr.size = sizeof(struct ndis_recv_scale_cap);
++      }
++
+       ret = rndis_filter_send_request(dev, request);
+       if (ret != 0)
+               goto cleanup;
+@@ -695,6 +710,89 @@ cleanup:
+       return ret;
+ }
++u8 netvsc_hash_key[HASH_KEYLEN] = {
++      0x6d, 0x5a, 0x56, 0xda, 0x25, 0x5b, 0x0e, 0xc2,
++      0x41, 0x67, 0x25, 0x3d, 0x43, 0xa3, 0x8f, 0xb0,
++      0xd0, 0xca, 0x2b, 0xcb, 0xae, 0x7b, 0x30, 0xb4,
++      0x77, 0xcb, 0x2d, 0xa3, 0x80, 0x30, 0xf2, 0x0c,
++      0x6a, 0x42, 0xb7, 0x3b, 0xbe, 0xac, 0x01, 0xfa
++};
++
++int rndis_filter_set_rss_param(struct rndis_device *rdev, int num_queue)
++{
++      struct net_device *ndev = rdev->net_dev->ndev;
++      struct rndis_request *request;
++      struct rndis_set_request *set;
++      struct rndis_set_complete *set_complete;
++      u32 extlen = sizeof(struct ndis_recv_scale_param) +
++                   4*ITAB_NUM + HASH_KEYLEN;
++      struct ndis_recv_scale_param *rssp;
++      u32 *itab;
++      u8 *keyp;
++      int i, t, ret;
++
++      request = get_rndis_request(
++                      rdev, RNDIS_MSG_SET,
++                      RNDIS_MESSAGE_SIZE(struct rndis_set_request) + extlen);
++      if (!request)
++              return -ENOMEM;
++
++      set = &request->request_msg.msg.set_req;
++      set->oid = OID_GEN_RECEIVE_SCALE_PARAMETERS;
++      set->info_buflen = extlen;
++      set->info_buf_offset = sizeof(struct rndis_set_request);
++      set->dev_vc_handle = 0;
++
++      rssp = (struct ndis_recv_scale_param *)(set + 1);
++      rssp->hdr.type = NDIS_OBJECT_TYPE_RSS_PARAMETERS;
++      rssp->hdr.rev = NDIS_RECEIVE_SCALE_PARAMETERS_REVISION_2;
++      rssp->hdr.size = sizeof(struct ndis_recv_scale_param);
++      rssp->flag = 0;
++      rssp->hashinfo = NDIS_HASH_FUNC_TOEPLITZ | NDIS_HASH_IPV4 |
++                       NDIS_HASH_TCP_IPV4;
++      rssp->indirect_tabsize = 4*ITAB_NUM;
++      rssp->indirect_taboffset = sizeof(struct ndis_recv_scale_param);
++      rssp->hashkey_size = HASH_KEYLEN;
++      rssp->kashkey_offset = rssp->indirect_taboffset +
++                             rssp->indirect_tabsize;
++
++      /* Set indirection table entries */
++      itab = (u32 *)(rssp + 1);
++      for (i = 0; i < ITAB_NUM; i++)
++              itab[i] = i % num_queue;
++
++      /* Set hask key values */
++      keyp = (u8 *)((unsigned long)rssp + rssp->kashkey_offset);
++      for (i = 0; i < HASH_KEYLEN; i++)
++              keyp[i] = netvsc_hash_key[i];
++
++
++      ret = rndis_filter_send_request(rdev, request);
++      if (ret != 0)
++              goto cleanup;
++
++      t = wait_for_completion_timeout(&request->wait_event, 5*HZ);
++      if (t == 0) {
++              netdev_err(ndev, "timeout before we got a set response...\n");
++              /* can't put_rndis_request, since we may still receive a
++               * send-completion.
++               */
++              return -ETIMEDOUT;
++      } else {
++              set_complete = &request->response_msg.msg.set_complete;
++              if (set_complete->status != RNDIS_STATUS_SUCCESS) {
++                      netdev_err(ndev, "Fail to set RSS parameters:0x%x\n",
++                                 set_complete->status);
++                      ret = -EINVAL;
++              }
++      }
++
++cleanup:
++      put_rndis_request(rdev, request);
++      return ret;
++}
++
++
+ static int rndis_filter_query_device_link_status(struct rndis_device *dev)
+ {
+       u32 size = sizeof(u32);
+@@ -886,6 +984,28 @@ static int rndis_filter_close_device(struct rndis_device *dev)
+       return ret;
+ }
++static void netvsc_sc_open(struct vmbus_channel *new_sc)
++{
++      struct netvsc_device *nvscdev;
++      u16 chn_index = new_sc->offermsg.offer.sub_channel_index;
++      int ret;
++
++      nvscdev = hv_get_drvdata(new_sc->primary_channel->device_obj);
++
++      if (chn_index >= nvscdev->num_chn)
++              return;
++
++      set_per_channel_state(new_sc, nvscdev->sub_cb_buf + (chn_index - 1) *
++                            NETVSC_PACKET_SIZE);
++
++      ret = vmbus_open(new_sc, nvscdev->ring_size * PAGE_SIZE,
++                       nvscdev->ring_size * PAGE_SIZE, NULL, 0,
++                       netvsc_channel_cb, new_sc);
++
++      if (ret == 0)
++              nvscdev->chn_table[chn_index] = new_sc;
++}
++
+ int rndis_filter_device_add(struct hv_device *dev,
+                                 void *additional_info)
+ {
+@@ -894,6 +1014,10 @@ int rndis_filter_device_add(struct hv_device *dev,
+       struct rndis_device *rndis_device;
+       struct netvsc_device_info *device_info = additional_info;
+       struct ndis_offload_params offloads;
++      struct nvsp_message *init_packet;
++      int t;
++      struct ndis_recv_scale_cap rsscap;
++      u32 rsscap_size = sizeof(struct ndis_recv_scale_cap);
+       rndis_device = get_rndis_device();
+       if (!rndis_device)
+@@ -913,6 +1037,7 @@ int rndis_filter_device_add(struct hv_device *dev,
+       /* Initialize the rndis device */
+       net_device = hv_get_drvdata(dev);
++      net_device->num_chn = 1;
+       net_device->extension = rndis_device;
+       rndis_device->net_dev = net_device;
+@@ -952,7 +1077,6 @@ int rndis_filter_device_add(struct hv_device *dev,
+       if (ret)
+               goto err_dev_remv;
+-
+       rndis_filter_query_device_link_status(rndis_device);
+       device_info->link_state = rndis_device->link_state;
+@@ -961,7 +1085,66 @@ int rndis_filter_device_add(struct hv_device *dev,
+                rndis_device->hw_mac_adr,
+                device_info->link_state ? "down" : "up");
+-      return ret;
++      if (net_device->nvsp_version < NVSP_PROTOCOL_VERSION_5)
++              return 0;
++
++      /* vRSS setup */
++      memset(&rsscap, 0, rsscap_size);
++      ret = rndis_filter_query_device(rndis_device,
++                                      OID_GEN_RECEIVE_SCALE_CAPABILITIES,
++                                      &rsscap, &rsscap_size);
++      if (ret || rsscap.num_recv_que < 2)
++              goto out;
++
++      net_device->num_chn = (num_online_cpus() < rsscap.num_recv_que) ?
++                             num_online_cpus() : rsscap.num_recv_que;
++      if (net_device->num_chn == 1)
++              goto out;
++
++      net_device->sub_cb_buf = vzalloc((net_device->num_chn - 1) *
++                                       NETVSC_PACKET_SIZE);
++      if (!net_device->sub_cb_buf) {
++              net_device->num_chn = 1;
++              dev_info(&dev->device, "No memory for subchannels.\n");
++              goto out;
++      }
++
++      vmbus_set_sc_create_callback(dev->channel, netvsc_sc_open);
++
++      init_packet = &net_device->channel_init_pkt;
++      memset(init_packet, 0, sizeof(struct nvsp_message));
++      init_packet->hdr.msg_type = NVSP_MSG5_TYPE_SUBCHANNEL;
++      init_packet->msg.v5_msg.subchn_req.op = NVSP_SUBCHANNEL_ALLOCATE;
++      init_packet->msg.v5_msg.subchn_req.num_subchannels =
++                                              net_device->num_chn - 1;
++      ret = vmbus_sendpacket(dev->channel, init_packet,
++                             sizeof(struct nvsp_message),
++                             (unsigned long)init_packet,
++                             VM_PKT_DATA_INBAND,
++                             VMBUS_DATA_PACKET_FLAG_COMPLETION_REQUESTED);
++      if (ret)
++              goto out;
++      t = wait_for_completion_timeout(&net_device->channel_init_wait, 5*HZ);
++      if (t == 0) {
++              ret = -ETIMEDOUT;
++              goto out;
++      }
++      if (init_packet->msg.v5_msg.subchn_comp.status !=
++          NVSP_STAT_SUCCESS) {
++              ret = -ENODEV;
++              goto out;
++      }
++      net_device->num_chn = 1 +
++              init_packet->msg.v5_msg.subchn_comp.num_subchannels;
++
++      vmbus_are_subchannels_present(dev->channel);
++
++      ret = rndis_filter_set_rss_param(rndis_device, net_device->num_chn);
++
++out:
++      if (ret)
++              net_device->num_chn = 1;
++      return 0; /* return 0 because primary channel can be used alone */
+ err_dev_remv:
+       rndis_filter_device_remove(dev);
+-- 
+2.4.3
+
diff --git a/src/patches/linux/0002-Drivers-net-hyperv-Cleanup-the-receive-path.patch b/src/patches/linux/0002-Drivers-net-hyperv-Cleanup-the-receive-path.patch
new file mode 100644 (file)
index 0000000..79485b3
--- /dev/null
@@ -0,0 +1,112 @@
+From 348a5d691d84759dda8cdd3cbf9f071115c1240e Mon Sep 17 00:00:00 2001
+From: KY Srinivasan <kys@microsoft.com>
+Date: Sun, 16 Feb 2014 16:38:44 -0800
+Subject: [PATCH 02/25] Drivers: net: hyperv: Cleanup the receive path
+
+Make the receive path a little more efficient by parameterizing the
+required state rather than re-establishing that state.
+
+Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
+Reviewed-by: Haiyang Zhang <haiyangz@microsoft.com>
+Signed-off-by: David S. Miller <davem@davemloft.net>
+---
+ drivers/net/hyperv/netvsc.c | 29 +++++++++++++----------------
+ 1 file changed, 13 insertions(+), 16 deletions(-)
+
+diff --git a/drivers/net/hyperv/netvsc.c b/drivers/net/hyperv/netvsc.c
+index 03a2c6e17158..7fa2bbade327 100644
+--- a/drivers/net/hyperv/netvsc.c
++++ b/drivers/net/hyperv/netvsc.c
+@@ -432,17 +432,14 @@ static inline u32 hv_ringbuf_avail_percent(
+       return avail_write * 100 / ring_info->ring_datasize;
+ }
+-static void netvsc_send_completion(struct hv_device *device,
++static void netvsc_send_completion(struct netvsc_device *net_device,
++                                 struct hv_device *device,
+                                  struct vmpacket_descriptor *packet)
+ {
+-      struct netvsc_device *net_device;
+       struct nvsp_message *nvsp_packet;
+       struct hv_netvsc_packet *nvsc_packet;
+       struct net_device *ndev;
+-      net_device = get_inbound_net_device(device);
+-      if (!net_device)
+-              return;
+       ndev = net_device->ndev;
+       nvsp_packet = (struct nvsp_message *)((unsigned long)packet +
+@@ -561,13 +558,13 @@ int netvsc_send(struct hv_device *device,
+ }
+ static void netvsc_send_recv_completion(struct hv_device *device,
++                                      struct netvsc_device *net_device,
+                                       u64 transaction_id, u32 status)
+ {
+       struct nvsp_message recvcompMessage;
+       int retries = 0;
+       int ret;
+       struct net_device *ndev;
+-      struct netvsc_device *net_device = hv_get_drvdata(device);
+       ndev = net_device->ndev;
+@@ -653,14 +650,15 @@ static void netvsc_receive_completion(void *context)
+       /* Send a receive completion for the xfer page packet */
+       if (fsend_receive_comp)
+-              netvsc_send_recv_completion(device, transaction_id, status);
++              netvsc_send_recv_completion(device, net_device, transaction_id,
++                                      status);
+ }
+-static void netvsc_receive(struct hv_device *device,
+-                          struct vmpacket_descriptor *packet)
++static void netvsc_receive(struct netvsc_device *net_device,
++                      struct hv_device *device,
++                      struct vmpacket_descriptor *packet)
+ {
+-      struct netvsc_device *net_device;
+       struct vmtransfer_page_packet_header *vmxferpage_packet;
+       struct nvsp_message *nvsp_packet;
+       struct hv_netvsc_packet *netvsc_packet = NULL;
+@@ -673,9 +671,6 @@ static void netvsc_receive(struct hv_device *device,
+       LIST_HEAD(listHead);
+-      net_device = get_inbound_net_device(device);
+-      if (!net_device)
+-              return;
+       ndev = net_device->ndev;
+       /*
+@@ -741,7 +736,7 @@ static void netvsc_receive(struct hv_device *device,
+               spin_unlock_irqrestore(&net_device->recv_pkt_list_lock,
+                                      flags);
+-              netvsc_send_recv_completion(device,
++              netvsc_send_recv_completion(device, net_device,
+                                           vmxferpage_packet->d.trans_id,
+                                           NVSP_STAT_FAIL);
+@@ -825,11 +820,13 @@ static void netvsc_channel_cb(void *context)
+                               desc = (struct vmpacket_descriptor *)buffer;
+                               switch (desc->type) {
+                               case VM_PKT_COMP:
+-                                      netvsc_send_completion(device, desc);
++                                      netvsc_send_completion(net_device,
++                                                              device, desc);
+                                       break;
+                               case VM_PKT_DATA_USING_XFER_PAGES:
+-                                      netvsc_receive(device, desc);
++                                      netvsc_receive(net_device,
++                                                      device, desc);
+                                       break;
+                               default:
+-- 
+2.4.3
+
diff --git a/src/patches/linux/0002-hyperv-Remove-recv_pkt_list-and-lock.patch b/src/patches/linux/0002-hyperv-Remove-recv_pkt_list-and-lock.patch
new file mode 100644 (file)
index 0000000..bbe0e52
--- /dev/null
@@ -0,0 +1,384 @@
+From 4baab26129e0540746744232022110dbe9e011e7 Mon Sep 17 00:00:00 2001
+From: Haiyang Zhang <haiyangz@microsoft.com>
+Date: Mon, 21 Apr 2014 14:54:43 -0700
+Subject: [PATCH 02/11] hyperv: Remove recv_pkt_list and lock
+
+Removed recv_pkt_list and lock, and updated related code, so that
+the locking overhead is reduced especially when multiple channels
+are in use.
+
+The recv_pkt_list isn't actually necessary because the packets are
+processed sequentially in each channel. It has been replaced by a
+local variable, and the related lock for this list is also removed.
+The is_data_pkt field is not used in receive path, so its assignment
+is cleaned up.
+
+Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
+Reviewed-by: K. Y. Srinivasan <kys@microsoft.com>
+Signed-off-by: David S. Miller <davem@davemloft.net>
+---
+ drivers/net/hyperv/hyperv_net.h   |  33 --------
+ drivers/net/hyperv/netvsc.c       | 174 +++-----------------------------------
+ drivers/net/hyperv/netvsc_drv.c   |   2 +-
+ drivers/net/hyperv/rndis_filter.c |   2 -
+ 4 files changed, 13 insertions(+), 198 deletions(-)
+
+diff --git a/drivers/net/hyperv/hyperv_net.h b/drivers/net/hyperv/hyperv_net.h
+index 57eb3f906d64..a1af0f7711e2 100644
+--- a/drivers/net/hyperv/hyperv_net.h
++++ b/drivers/net/hyperv/hyperv_net.h
+@@ -119,27 +119,14 @@ struct ndis_recv_scale_param { /* NDIS_RECEIVE_SCALE_PARAMETERS */
+ };
+ /* Fwd declaration */
+-struct hv_netvsc_packet;
+ struct ndis_tcp_ip_checksum_info;
+-/* Represent the xfer page packet which contains 1 or more netvsc packet */
+-struct xferpage_packet {
+-      struct list_head list_ent;
+-      u32 status;
+-
+-      /* # of netvsc packets this xfer packet contains */
+-      u32 count;
+-
+-      struct vmbus_channel *channel;
+-};
+-
+ /*
+  * Represent netvsc packet which contains 1 RNDIS and 1 ethernet frame
+  * within the RNDIS
+  */
+ struct hv_netvsc_packet {
+       /* Bookkeeping stuff */
+-      struct list_head list_ent;
+       u32 status;
+       struct hv_device *device;
+@@ -149,19 +136,8 @@ struct hv_netvsc_packet {
+       u16 q_idx;
+       struct vmbus_channel *channel;
+-      /*
+-       * Valid only for receives when we break a xfer page packet
+-       * into multiple netvsc packets
+-       */
+-      struct xferpage_packet *xfer_page_pkt;
+-
+       union {
+               struct {
+-                      u64 recv_completion_tid;
+-                      void *recv_completion_ctx;
+-                      void (*recv_completion)(void *context);
+-              } recv;
+-              struct {
+                       u64 send_completion_tid;
+                       void *send_completion_ctx;
+                       void (*send_completion)(void *context);
+@@ -613,9 +589,6 @@ struct nvsp_message {
+ #define NETVSC_RECEIVE_BUFFER_ID              0xcafe
+-/* Preallocated receive packets */
+-#define NETVSC_RECEIVE_PACKETLIST_COUNT               256
+-
+ #define NETVSC_PACKET_SIZE                      2048
+ #define VRSS_SEND_TAB_SIZE 16
+@@ -630,12 +603,6 @@ struct netvsc_device {
+       wait_queue_head_t wait_drain;
+       bool start_remove;
+       bool destroy;
+-      /*
+-       * List of free preallocated hv_netvsc_packet to represent receive
+-       * packet
+-       */
+-      struct list_head recv_pkt_list;
+-      spinlock_t recv_pkt_list_lock;
+       /* Receive buffer allocated by us but manages by NetVSP */
+       void *recv_buf;
+diff --git a/drivers/net/hyperv/netvsc.c b/drivers/net/hyperv/netvsc.c
+index e7e77f12bc38..b10334773b32 100644
+--- a/drivers/net/hyperv/netvsc.c
++++ b/drivers/net/hyperv/netvsc.c
+@@ -387,7 +387,6 @@ static void netvsc_disconnect_vsp(struct netvsc_device *net_device)
+ int netvsc_device_remove(struct hv_device *device)
+ {
+       struct netvsc_device *net_device;
+-      struct hv_netvsc_packet *netvsc_packet, *pos;
+       unsigned long flags;
+       net_device = hv_get_drvdata(device);
+@@ -416,12 +415,6 @@ int netvsc_device_remove(struct hv_device *device)
+       vmbus_close(device->channel);
+       /* Release all resources */
+-      list_for_each_entry_safe(netvsc_packet, pos,
+-                               &net_device->recv_pkt_list, list_ent) {
+-              list_del(&netvsc_packet->list_ent);
+-              kfree(netvsc_packet);
+-      }
+-
+       if (net_device->sub_cb_buf)
+               vfree(net_device->sub_cb_buf);
+@@ -641,62 +634,6 @@ retry_send_cmplt:
+       }
+ }
+-/* Send a receive completion packet to RNDIS device (ie NetVsp) */
+-static void netvsc_receive_completion(void *context)
+-{
+-      struct hv_netvsc_packet *packet = context;
+-      struct hv_device *device = packet->device;
+-      struct vmbus_channel *channel;
+-      struct netvsc_device *net_device;
+-      u64 transaction_id = 0;
+-      bool fsend_receive_comp = false;
+-      unsigned long flags;
+-      struct net_device *ndev;
+-      u32 status = NVSP_STAT_NONE;
+-
+-      /*
+-       * Even though it seems logical to do a GetOutboundNetDevice() here to
+-       * send out receive completion, we are using GetInboundNetDevice()
+-       * since we may have disable outbound traffic already.
+-       */
+-      net_device = get_inbound_net_device(device);
+-      if (!net_device)
+-              return;
+-      ndev = net_device->ndev;
+-
+-      /* Overloading use of the lock. */
+-      spin_lock_irqsave(&net_device->recv_pkt_list_lock, flags);
+-
+-      if (packet->status != NVSP_STAT_SUCCESS)
+-              packet->xfer_page_pkt->status = NVSP_STAT_FAIL;
+-
+-      packet->xfer_page_pkt->count--;
+-
+-      /*
+-       * Last one in the line that represent 1 xfer page packet.
+-       * Return the xfer page packet itself to the freelist
+-       */
+-      if (packet->xfer_page_pkt->count == 0) {
+-              fsend_receive_comp = true;
+-              channel = packet->xfer_page_pkt->channel;
+-              transaction_id = packet->completion.recv.recv_completion_tid;
+-              status = packet->xfer_page_pkt->status;
+-              list_add_tail(&packet->xfer_page_pkt->list_ent,
+-                            &net_device->recv_pkt_list);
+-
+-      }
+-
+-      /* Put the packet back */
+-      list_add_tail(&packet->list_ent, &net_device->recv_pkt_list);
+-      spin_unlock_irqrestore(&net_device->recv_pkt_list_lock, flags);
+-
+-      /* Send a receive completion for the xfer page packet */
+-      if (fsend_receive_comp)
+-              netvsc_send_recv_completion(device, channel, net_device,
+-                                          transaction_id, status);
+-
+-}
+-
+ static void netvsc_receive(struct netvsc_device *net_device,
+                       struct vmbus_channel *channel,
+                       struct hv_device *device,
+@@ -704,16 +641,13 @@ static void netvsc_receive(struct netvsc_device *net_device,
+ {
+       struct vmtransfer_page_packet_header *vmxferpage_packet;
+       struct nvsp_message *nvsp_packet;
+-      struct hv_netvsc_packet *netvsc_packet = NULL;
+-      /* struct netvsc_driver *netvscDriver; */
+-      struct xferpage_packet *xferpage_packet = NULL;
++      struct hv_netvsc_packet nv_pkt;
++      struct hv_netvsc_packet *netvsc_packet = &nv_pkt;
++      u32 status = NVSP_STAT_SUCCESS;
+       int i;
+       int count = 0;
+-      unsigned long flags;
+       struct net_device *ndev;
+-      LIST_HEAD(listHead);
+-
+       ndev = net_device->ndev;
+       /*
+@@ -746,78 +680,14 @@ static void netvsc_receive(struct netvsc_device *net_device,
+               return;
+       }
+-      /*
+-       * Grab free packets (range count + 1) to represent this xfer
+-       * page packet. +1 to represent the xfer page packet itself.
+-       * We grab it here so that we know exactly how many we can
+-       * fulfil
+-       */
+-      spin_lock_irqsave(&net_device->recv_pkt_list_lock, flags);
+-      while (!list_empty(&net_device->recv_pkt_list)) {
+-              list_move_tail(net_device->recv_pkt_list.next, &listHead);
+-              if (++count == vmxferpage_packet->range_cnt + 1)
+-                      break;
+-      }
+-      spin_unlock_irqrestore(&net_device->recv_pkt_list_lock, flags);
+-
+-      /*
+-       * We need at least 2 netvsc pkts (1 to represent the xfer
+-       * page and at least 1 for the range) i.e. we can handled
+-       * some of the xfer page packet ranges...
+-       */
+-      if (count < 2) {
+-              netdev_err(ndev, "Got only %d netvsc pkt...needed "
+-                      "%d pkts. Dropping this xfer page packet completely!\n",
+-                      count, vmxferpage_packet->range_cnt + 1);
+-
+-              /* Return it to the freelist */
+-              spin_lock_irqsave(&net_device->recv_pkt_list_lock, flags);
+-              for (i = count; i != 0; i--) {
+-                      list_move_tail(listHead.next,
+-                                     &net_device->recv_pkt_list);
+-              }
+-              spin_unlock_irqrestore(&net_device->recv_pkt_list_lock,
+-                                     flags);
+-
+-              netvsc_send_recv_completion(device, channel, net_device,
+-                                          vmxferpage_packet->d.trans_id,
+-                                          NVSP_STAT_FAIL);
+-
+-              return;
+-      }
+-
+-      /* Remove the 1st packet to represent the xfer page packet itself */
+-      xferpage_packet = (struct xferpage_packet *)listHead.next;
+-      list_del(&xferpage_packet->list_ent);
+-      xferpage_packet->status = NVSP_STAT_SUCCESS;
+-      xferpage_packet->channel = channel;
+-
+-      /* This is how much we can satisfy */
+-      xferpage_packet->count = count - 1;
+-
+-      if (xferpage_packet->count != vmxferpage_packet->range_cnt) {
+-              netdev_err(ndev, "Needed %d netvsc pkts to satisfy "
+-                      "this xfer page...got %d\n",
+-                      vmxferpage_packet->range_cnt, xferpage_packet->count);
+-      }
++      count = vmxferpage_packet->range_cnt;
++      netvsc_packet->device = device;
++      netvsc_packet->channel = channel;
+       /* Each range represents 1 RNDIS pkt that contains 1 ethernet frame */
+-      for (i = 0; i < (count - 1); i++) {
+-              netvsc_packet = (struct hv_netvsc_packet *)listHead.next;
+-              list_del(&netvsc_packet->list_ent);
+-
++      for (i = 0; i < count; i++) {
+               /* Initialize the netvsc packet */
+               netvsc_packet->status = NVSP_STAT_SUCCESS;
+-              netvsc_packet->xfer_page_pkt = xferpage_packet;
+-              netvsc_packet->completion.recv.recv_completion =
+-                                      netvsc_receive_completion;
+-              netvsc_packet->completion.recv.recv_completion_ctx =
+-                                      netvsc_packet;
+-              netvsc_packet->device = device;
+-              /* Save this so that we can send it back */
+-              netvsc_packet->completion.recv.recv_completion_tid =
+-                                      vmxferpage_packet->d.trans_id;
+-
+               netvsc_packet->data = (void *)((unsigned long)net_device->
+                       recv_buf + vmxferpage_packet->ranges[i].byte_offset);
+               netvsc_packet->total_data_buflen =
+@@ -826,10 +696,12 @@ static void netvsc_receive(struct netvsc_device *net_device,
+               /* Pass it to the upper layer */
+               rndis_filter_receive(device, netvsc_packet);
+-              netvsc_receive_completion(netvsc_packet->
+-                              completion.recv.recv_completion_ctx);
++              if (netvsc_packet->status != NVSP_STAT_SUCCESS)
++                      status = NVSP_STAT_FAIL;
+       }
++      netvsc_send_recv_completion(device, channel, net_device,
++                                  vmxferpage_packet->d.trans_id, status);
+ }
+@@ -956,11 +828,9 @@ void netvsc_channel_cb(void *context)
+ int netvsc_device_add(struct hv_device *device, void *additional_info)
+ {
+       int ret = 0;
+-      int i;
+       int ring_size =
+       ((struct netvsc_device_info *)additional_info)->ring_size;
+       struct netvsc_device *net_device;
+-      struct hv_netvsc_packet *packet, *pos;
+       struct net_device *ndev;
+       net_device = alloc_net_device(device);
+@@ -981,18 +851,6 @@ int netvsc_device_add(struct hv_device *device, void *additional_info)
+       ndev = net_device->ndev;
+       /* Initialize the NetVSC channel extension */
+-      spin_lock_init(&net_device->recv_pkt_list_lock);
+-
+-      INIT_LIST_HEAD(&net_device->recv_pkt_list);
+-
+-      for (i = 0; i < NETVSC_RECEIVE_PACKETLIST_COUNT; i++) {
+-              packet = kzalloc(sizeof(struct hv_netvsc_packet), GFP_KERNEL);
+-              if (!packet)
+-                      break;
+-
+-              list_add_tail(&packet->list_ent,
+-                            &net_device->recv_pkt_list);
+-      }
+       init_completion(&net_device->channel_init_wait);
+       set_per_channel_state(device->channel, net_device->cb_buffer);
+@@ -1028,16 +886,8 @@ close:
+ cleanup:
+-      if (net_device) {
+-              list_for_each_entry_safe(packet, pos,
+-                                       &net_device->recv_pkt_list,
+-                                       list_ent) {
+-                      list_del(&packet->list_ent);
+-                      kfree(packet);
+-              }
+-
++      if (net_device)
+               kfree(net_device);
+-      }
+       return ret;
+ }
+diff --git a/drivers/net/hyperv/netvsc_drv.c b/drivers/net/hyperv/netvsc_drv.c
+index 093cf3fc46b8..8f6d53a2ed95 100644
+--- a/drivers/net/hyperv/netvsc_drv.c
++++ b/drivers/net/hyperv/netvsc_drv.c
+@@ -638,7 +638,7 @@ int netvsc_recv_callback(struct hv_device *device_obj,
+               __vlan_hwaccel_put_tag(skb, htons(ETH_P_8021Q),
+                                      packet->vlan_tci);
+-      skb_record_rx_queue(skb, packet->xfer_page_pkt->channel->
++      skb_record_rx_queue(skb, packet->channel->
+                           offermsg.offer.sub_channel_index %
+                           net->real_num_rx_queues);
+diff --git a/drivers/net/hyperv/rndis_filter.c b/drivers/net/hyperv/rndis_filter.c
+index d92cfbe43410..48f5a0fbd674 100644
+--- a/drivers/net/hyperv/rndis_filter.c
++++ b/drivers/net/hyperv/rndis_filter.c
+@@ -401,8 +401,6 @@ static void rndis_filter_receive_data(struct rndis_device *dev,
+       pkt->total_data_buflen = rndis_pkt->data_len;
+       pkt->data = (void *)((unsigned long)pkt->data + data_offset);
+-      pkt->is_data_pkt = true;
+-
+       vlan = rndis_get_ppi(rndis_pkt, IEEE_8021Q_INFO);
+       if (vlan) {
+               pkt->vlan_tci = VLAN_TAG_PRESENT | vlan->vlanid |
+-- 
+2.4.3
+
diff --git a/src/patches/linux/0003-Drivers-net-hyperv-Cleanup-the-netvsc-receive-callba.patch b/src/patches/linux/0003-Drivers-net-hyperv-Cleanup-the-netvsc-receive-callba.patch
new file mode 100644 (file)
index 0000000..e0b82ea
--- /dev/null
@@ -0,0 +1,101 @@
+From c9f2db35ac4f789930522d9d36200cb71b442bed Mon Sep 17 00:00:00 2001
+From: KY Srinivasan <kys@microsoft.com>
+Date: Sun, 16 Feb 2014 16:38:45 -0800
+Subject: [PATCH 03/25] Drivers: net: hyperv: Cleanup the netvsc receive
+ callback functio
+
+Get rid of the buffer allocation in the receive path for normal packets.
+
+Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
+Signed-off-by: David S. Miller <davem@davemloft.net>
+---
+ drivers/net/hyperv/hyperv_net.h |  2 ++
+ drivers/net/hyperv/netvsc.c     | 33 ++++++++++-----------------------
+ 2 files changed, 12 insertions(+), 23 deletions(-)
+
+diff --git a/drivers/net/hyperv/hyperv_net.h b/drivers/net/hyperv/hyperv_net.h
+index 7645ba38bde8..01a16ea77a5a 100644
+--- a/drivers/net/hyperv/hyperv_net.h
++++ b/drivers/net/hyperv/hyperv_net.h
+@@ -506,6 +506,8 @@ struct netvsc_device {
+       /* Holds rndis device info */
+       void *extension;
++      /* The recive buffer for this device */
++      unsigned char cb_buffer[NETVSC_PACKET_SIZE];
+ };
+ /* NdisInitialize message */
+diff --git a/drivers/net/hyperv/netvsc.c b/drivers/net/hyperv/netvsc.c
+index 7fa2bbade327..9a0e9c6f1414 100644
+--- a/drivers/net/hyperv/netvsc.c
++++ b/drivers/net/hyperv/netvsc.c
+@@ -795,22 +795,16 @@ static void netvsc_channel_cb(void *context)
+       struct netvsc_device *net_device;
+       u32 bytes_recvd;
+       u64 request_id;
+-      unsigned char *packet;
+       struct vmpacket_descriptor *desc;
+       unsigned char *buffer;
+       int bufferlen = NETVSC_PACKET_SIZE;
+       struct net_device *ndev;
+-      packet = kzalloc(NETVSC_PACKET_SIZE * sizeof(unsigned char),
+-                       GFP_ATOMIC);
+-      if (!packet)
+-              return;
+-      buffer = packet;
+-
+       net_device = get_inbound_net_device(device);
+       if (!net_device)
+-              goto out;
++              return;
+       ndev = net_device->ndev;
++      buffer = net_device->cb_buffer;
+       do {
+               ret = vmbus_recvpacket_raw(device->channel, buffer, bufferlen,
+@@ -838,23 +832,16 @@ static void netvsc_channel_cb(void *context)
+                                       break;
+                               }
+-                              /* reset */
+-                              if (bufferlen > NETVSC_PACKET_SIZE) {
+-                                      kfree(buffer);
+-                                      buffer = packet;
+-                                      bufferlen = NETVSC_PACKET_SIZE;
+-                              }
+                       } else {
+-                              /* reset */
+-                              if (bufferlen > NETVSC_PACKET_SIZE) {
+-                                      kfree(buffer);
+-                                      buffer = packet;
+-                                      bufferlen = NETVSC_PACKET_SIZE;
+-                              }
+-
++                              /*
++                               * We are done for this pass.
++                               */
+                               break;
+                       }
++
+               } else if (ret == -ENOBUFS) {
++                      if (bufferlen > NETVSC_PACKET_SIZE)
++                              kfree(buffer);
+                       /* Handle large packet */
+                       buffer = kmalloc(bytes_recvd, GFP_ATOMIC);
+                       if (buffer == NULL) {
+@@ -869,8 +856,8 @@ static void netvsc_channel_cb(void *context)
+               }
+       } while (1);
+-out:
+-      kfree(buffer);
++      if (bufferlen > NETVSC_PACKET_SIZE)
++              kfree(buffer);
+       return;
+ }
+-- 
+2.4.3
+
diff --git a/src/patches/linux/0003-hyperv-Simplify-the-send_completion-variables.patch b/src/patches/linux/0003-hyperv-Simplify-the-send_completion-variables.patch
new file mode 100644 (file)
index 0000000..dcab56f
--- /dev/null
@@ -0,0 +1,105 @@
+From 893f66277799cd46bdf97429cc5d16a815a51273 Mon Sep 17 00:00:00 2001
+From: Haiyang Zhang <haiyangz@microsoft.com>
+Date: Mon, 21 Apr 2014 14:54:44 -0700
+Subject: [PATCH 03/11] hyperv: Simplify the send_completion variables
+
+The union contains only one member now, so we use the variables in it directly.
+
+Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
+Reviewed-by: K. Y. Srinivasan <kys@microsoft.com>
+Signed-off-by: David S. Miller <davem@davemloft.net>
+---
+ drivers/net/hyperv/hyperv_net.h   | 10 +++-------
+ drivers/net/hyperv/netvsc.c       |  7 +++----
+ drivers/net/hyperv/netvsc_drv.c   |  8 ++++----
+ drivers/net/hyperv/rndis_filter.c |  2 +-
+ 4 files changed, 11 insertions(+), 16 deletions(-)
+
+diff --git a/drivers/net/hyperv/hyperv_net.h b/drivers/net/hyperv/hyperv_net.h
+index a1af0f7711e2..d1f7826aa75f 100644
+--- a/drivers/net/hyperv/hyperv_net.h
++++ b/drivers/net/hyperv/hyperv_net.h
+@@ -136,13 +136,9 @@ struct hv_netvsc_packet {
+       u16 q_idx;
+       struct vmbus_channel *channel;
+-      union {
+-              struct {
+-                      u64 send_completion_tid;
+-                      void *send_completion_ctx;
+-                      void (*send_completion)(void *context);
+-              } send;
+-      } completion;
++      u64 send_completion_tid;
++      void *send_completion_ctx;
++      void (*send_completion)(void *context);
+       /* This points to the memory after page_buf */
+       struct rndis_message *rndis_msg;
+diff --git a/drivers/net/hyperv/netvsc.c b/drivers/net/hyperv/netvsc.c
+index b10334773b32..bbee44635035 100644
+--- a/drivers/net/hyperv/netvsc.c
++++ b/drivers/net/hyperv/netvsc.c
+@@ -479,9 +479,8 @@ static void netvsc_send_completion(struct netvsc_device *net_device,
+               if (nvsc_packet) {
+                       q_idx = nvsc_packet->q_idx;
+                       channel = nvsc_packet->channel;
+-                      nvsc_packet->completion.send.send_completion(
+-                              nvsc_packet->completion.send.
+-                              send_completion_ctx);
++                      nvsc_packet->send_completion(nvsc_packet->
++                                                   send_completion_ctx);
+               }
+               num_outstanding_sends =
+@@ -534,7 +533,7 @@ int netvsc_send(struct hv_device *device,
+               0xFFFFFFFF;
+       sendMessage.msg.v1_msg.send_rndis_pkt.send_buf_section_size = 0;
+-      if (packet->completion.send.send_completion)
++      if (packet->send_completion)
+               req_id = (ulong)packet;
+       else
+               req_id = 0;
+diff --git a/drivers/net/hyperv/netvsc_drv.c b/drivers/net/hyperv/netvsc_drv.c
+index 8f6d53a2ed95..c76b66515e92 100644
+--- a/drivers/net/hyperv/netvsc_drv.c
++++ b/drivers/net/hyperv/netvsc_drv.c
+@@ -235,7 +235,7 @@ static void netvsc_xmit_completion(void *context)
+ {
+       struct hv_netvsc_packet *packet = (struct hv_netvsc_packet *)context;
+       struct sk_buff *skb = (struct sk_buff *)
+-              (unsigned long)packet->completion.send.send_completion_tid;
++              (unsigned long)packet->send_completion_tid;
+       kfree(packet);
+@@ -425,9 +425,9 @@ static int netvsc_start_xmit(struct sk_buff *skb, struct net_device *net)
+                               (num_data_pgs * sizeof(struct hv_page_buffer)));
+       /* Set the completion routine */
+-      packet->completion.send.send_completion = netvsc_xmit_completion;
+-      packet->completion.send.send_completion_ctx = packet;
+-      packet->completion.send.send_completion_tid = (unsigned long)skb;
++      packet->send_completion = netvsc_xmit_completion;
++      packet->send_completion_ctx = packet;
++      packet->send_completion_tid = (unsigned long)skb;
+       isvlan = packet->vlan_tci & VLAN_TAG_PRESENT;
+diff --git a/drivers/net/hyperv/rndis_filter.c b/drivers/net/hyperv/rndis_filter.c
+index 48f5a0fbd674..99c527adae5b 100644
+--- a/drivers/net/hyperv/rndis_filter.c
++++ b/drivers/net/hyperv/rndis_filter.c
+@@ -236,7 +236,7 @@ static int rndis_filter_send_request(struct rndis_device *dev,
+                       packet->page_buf[0].len;
+       }
+-      packet->completion.send.send_completion = NULL;
++      packet->send_completion = NULL;
+       ret = netvsc_send(dev->net_dev->dev, packet);
+       return ret;
+-- 
+2.4.3
+
diff --git a/src/patches/linux/0004-hyperv-Add-latest-NetVSP-versions-to-auto-negotiatio.patch b/src/patches/linux/0004-hyperv-Add-latest-NetVSP-versions-to-auto-negotiatio.patch
new file mode 100644 (file)
index 0000000..f9cd827
--- /dev/null
@@ -0,0 +1,171 @@
+From 3c2a271d9681cc017947c5e027acc64707c30dee Mon Sep 17 00:00:00 2001
+From: Haiyang Zhang <haiyangz@microsoft.com>
+Date: Wed, 19 Feb 2014 15:49:45 -0800
+Subject: [PATCH 04/25] hyperv: Add latest NetVSP versions to auto negotiation
+
+It auto negotiates the highest NetVSP version supported by both guest and host.
+
+Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
+Reviewed-by: K. Y. Srinivasan <kys@microsoft.com>
+Signed-off-by: David S. Miller <davem@davemloft.net>
+---
+ drivers/net/hyperv/hyperv_net.h | 53 +++++++++++++++++++++++++++++++++++++++++
+ drivers/net/hyperv/netvsc.c     | 25 ++++++++++++-------
+ drivers/net/hyperv/netvsc_drv.c |  2 +-
+ 3 files changed, 70 insertions(+), 10 deletions(-)
+
+diff --git a/drivers/net/hyperv/hyperv_net.h b/drivers/net/hyperv/hyperv_net.h
+index 01a16ea77a5a..39fc230f5c20 100644
+--- a/drivers/net/hyperv/hyperv_net.h
++++ b/drivers/net/hyperv/hyperv_net.h
+@@ -139,6 +139,8 @@ int rndis_filter_set_device_mac(struct hv_device *hdev, char *mac);
+ #define NVSP_PROTOCOL_VERSION_1               2
+ #define NVSP_PROTOCOL_VERSION_2               0x30002
++#define NVSP_PROTOCOL_VERSION_4               0x40000
++#define NVSP_PROTOCOL_VERSION_5               0x50000
+ enum {
+       NVSP_MSG_TYPE_NONE = 0,
+@@ -193,6 +195,23 @@ enum {
+       NVSP_MSG2_TYPE_ALLOC_CHIMNEY_HANDLE,
+       NVSP_MSG2_TYPE_ALLOC_CHIMNEY_HANDLE_COMP,
++
++      NVSP_MSG2_MAX = NVSP_MSG2_TYPE_ALLOC_CHIMNEY_HANDLE_COMP,
++
++      /* Version 4 messages */
++      NVSP_MSG4_TYPE_SEND_VF_ASSOCIATION,
++      NVSP_MSG4_TYPE_SWITCH_DATA_PATH,
++      NVSP_MSG4_TYPE_UPLINK_CONNECT_STATE_DEPRECATED,
++
++      NVSP_MSG4_MAX = NVSP_MSG4_TYPE_UPLINK_CONNECT_STATE_DEPRECATED,
++
++      /* Version 5 messages */
++      NVSP_MSG5_TYPE_OID_QUERY_EX,
++      NVSP_MSG5_TYPE_OID_QUERY_EX_COMP,
++      NVSP_MSG5_TYPE_SUBCHANNEL,
++      NVSP_MSG5_TYPE_SEND_INDIRECTION_TABLE,
++
++      NVSP_MSG5_MAX = NVSP_MSG5_TYPE_SEND_INDIRECTION_TABLE,
+ };
+ enum {
+@@ -447,10 +466,44 @@ union nvsp_2_message_uber {
+       struct nvsp_2_free_rxbuf free_rxbuf;
+ } __packed;
++enum nvsp_subchannel_operation {
++      NVSP_SUBCHANNEL_NONE = 0,
++      NVSP_SUBCHANNEL_ALLOCATE,
++      NVSP_SUBCHANNEL_MAX
++};
++
++struct nvsp_5_subchannel_request {
++      u32 op;
++      u32 num_subchannels;
++} __packed;
++
++struct nvsp_5_subchannel_complete {
++      u32 status;
++      u32 num_subchannels; /* Actual number of subchannels allocated */
++} __packed;
++
++struct nvsp_5_send_indirect_table {
++      /* The number of entries in the send indirection table */
++      u32 count;
++
++      /* The offset of the send indireciton table from top of this struct.
++       * The send indirection table tells which channel to put the send
++       * traffic on. Each entry is a channel number.
++       */
++      u32 offset;
++} __packed;
++
++union nvsp_5_message_uber {
++      struct nvsp_5_subchannel_request subchn_req;
++      struct nvsp_5_subchannel_complete subchn_comp;
++      struct nvsp_5_send_indirect_table send_table;
++} __packed;
++
+ union nvsp_all_messages {
+       union nvsp_message_init_uber init_msg;
+       union nvsp_1_message_uber v1_msg;
+       union nvsp_2_message_uber v2_msg;
++      union nvsp_5_message_uber v5_msg;
+ } __packed;
+ /* ALL Messages */
+diff --git a/drivers/net/hyperv/netvsc.c b/drivers/net/hyperv/netvsc.c
+index 9a0e9c6f1414..1a0280dcba7e 100644
+--- a/drivers/net/hyperv/netvsc.c
++++ b/drivers/net/hyperv/netvsc.c
+@@ -290,7 +290,7 @@ static int negotiate_nvsp_ver(struct hv_device *device,
+           NVSP_STAT_SUCCESS)
+               return -EINVAL;
+-      if (nvsp_ver != NVSP_PROTOCOL_VERSION_2)
++      if (nvsp_ver == NVSP_PROTOCOL_VERSION_1)
+               return 0;
+       /* NVSPv2 only: Send NDIS config */
+@@ -314,6 +314,9 @@ static int netvsc_connect_vsp(struct hv_device *device)
+       struct nvsp_message *init_packet;
+       int ndis_version;
+       struct net_device *ndev;
++      u32 ver_list[] = { NVSP_PROTOCOL_VERSION_1, NVSP_PROTOCOL_VERSION_2,
++              NVSP_PROTOCOL_VERSION_4, NVSP_PROTOCOL_VERSION_5 };
++      int i, num_ver = 4; /* number of different NVSP versions */
+       net_device = get_outbound_net_device(device);
+       if (!net_device)
+@@ -323,13 +326,14 @@ static int netvsc_connect_vsp(struct hv_device *device)
+       init_packet = &net_device->channel_init_pkt;
+       /* Negotiate the latest NVSP protocol supported */
+-      if (negotiate_nvsp_ver(device, net_device, init_packet,
+-                             NVSP_PROTOCOL_VERSION_2) == 0) {
+-              net_device->nvsp_version = NVSP_PROTOCOL_VERSION_2;
+-      } else if (negotiate_nvsp_ver(device, net_device, init_packet,
+-                                  NVSP_PROTOCOL_VERSION_1) == 0) {
+-              net_device->nvsp_version = NVSP_PROTOCOL_VERSION_1;
+-      } else {
++      for (i = num_ver - 1; i >= 0; i--)
++              if (negotiate_nvsp_ver(device, net_device, init_packet,
++                                     ver_list[i])  == 0) {
++                      net_device->nvsp_version = ver_list[i];
++                      break;
++              }
++
++      if (i < 0) {
+               ret = -EPROTO;
+               goto cleanup;
+       }
+@@ -339,7 +343,10 @@ static int netvsc_connect_vsp(struct hv_device *device)
+       /* Send the ndis version */
+       memset(init_packet, 0, sizeof(struct nvsp_message));
+-      ndis_version = 0x00050001;
++      if (net_device->nvsp_version <= NVSP_PROTOCOL_VERSION_4)
++              ndis_version = 0x00050001;
++      else
++              ndis_version = 0x0006001e;
+       init_packet->hdr.msg_type = NVSP_MSG1_TYPE_SEND_NDIS_VER;
+       init_packet->msg.v1_msg.
+diff --git a/drivers/net/hyperv/netvsc_drv.c b/drivers/net/hyperv/netvsc_drv.c
+index 28020f83ba6f..8e3a0b00099b 100644
+--- a/drivers/net/hyperv/netvsc_drv.c
++++ b/drivers/net/hyperv/netvsc_drv.c
+@@ -328,7 +328,7 @@ static int netvsc_change_mtu(struct net_device *ndev, int mtu)
+       if (nvdev == NULL || nvdev->destroy)
+               return -ENODEV;
+-      if (nvdev->nvsp_version == NVSP_PROTOCOL_VERSION_2)
++      if (nvdev->nvsp_version >= NVSP_PROTOCOL_VERSION_2)
+               limit = NETVSC_MTU;
+       if (mtu < 68 || mtu > limit)
+-- 
+2.4.3
+
diff --git a/src/patches/linux/0004-hyperv-Enable-sendbuf-mechanism-on-the-send-path.patch b/src/patches/linux/0004-hyperv-Enable-sendbuf-mechanism-on-the-send-path.patch
new file mode 100644 (file)
index 0000000..bc09122
--- /dev/null
@@ -0,0 +1,407 @@
+From c25aaf814a63f9d9c4e45416f13d70ef0aa0be2e Mon Sep 17 00:00:00 2001
+From: KY Srinivasan <kys@microsoft.com>
+Date: Wed, 30 Apr 2014 10:14:31 -0700
+Subject: [PATCH 04/11] hyperv: Enable sendbuf mechanism on the send path
+
+We send packets using a copy-free mechanism (this is the Guest to Host transport
+via VMBUS). While this is obviously optimal for large packets,
+it may not be optimal for small packets. Hyper-V host supports
+a second mechanism for sending packets that is "copy based". We implement that
+mechanism in this patch.
+
+In this version of the patch I have addressed a comment from David Miller.
+
+With this patch (and all of the other offload and VRSS patches), we are now able
+to almost saturate a 10G interface between Linux VMs on Hyper-V
+on different hosts - close to  9 Gbps as measured via iperf.
+
+Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
+Reviewed-by: Haiyang Zhang <haiyangz@microsoft.com>
+Signed-off-by: David S. Miller <davem@davemloft.net>
+---
+ drivers/net/hyperv/hyperv_net.h |  14 +++
+ drivers/net/hyperv/netvsc.c     | 226 ++++++++++++++++++++++++++++++++++++++--
+ drivers/net/hyperv/netvsc_drv.c |   3 +-
+ 3 files changed, 234 insertions(+), 9 deletions(-)
+
+diff --git a/drivers/net/hyperv/hyperv_net.h b/drivers/net/hyperv/hyperv_net.h
+index d1f7826aa75f..4b7df5a5c966 100644
+--- a/drivers/net/hyperv/hyperv_net.h
++++ b/drivers/net/hyperv/hyperv_net.h
+@@ -140,6 +140,8 @@ struct hv_netvsc_packet {
+       void *send_completion_ctx;
+       void (*send_completion)(void *context);
++      u32 send_buf_index;
++
+       /* This points to the memory after page_buf */
+       struct rndis_message *rndis_msg;
+@@ -582,6 +584,9 @@ struct nvsp_message {
+ #define NETVSC_RECEIVE_BUFFER_SIZE            (1024*1024*16)  /* 16MB */
+ #define NETVSC_RECEIVE_BUFFER_SIZE_LEGACY     (1024*1024*15)  /* 15MB */
++#define NETVSC_SEND_BUFFER_SIZE                       (1024 * 1024)   /* 1MB */
++#define NETVSC_INVALID_INDEX                  -1
++
+ #define NETVSC_RECEIVE_BUFFER_ID              0xcafe
+@@ -607,6 +612,15 @@ struct netvsc_device {
+       u32 recv_section_cnt;
+       struct nvsp_1_receive_buffer_section *recv_section;
++      /* Send buffer allocated by us */
++      void *send_buf;
++      u32 send_buf_size;
++      u32 send_buf_gpadl_handle;
++      u32 send_section_cnt;
++      u32 send_section_size;
++      unsigned long *send_section_map;
++      int map_words;
++
+       /* Used for NetVSP initialization protocol */
+       struct completion channel_init_wait;
+       struct nvsp_message channel_init_pkt;
+diff --git a/drivers/net/hyperv/netvsc.c b/drivers/net/hyperv/netvsc.c
+index bbee44635035..c041f63a6d30 100644
+--- a/drivers/net/hyperv/netvsc.c
++++ b/drivers/net/hyperv/netvsc.c
+@@ -28,6 +28,7 @@
+ #include <linux/slab.h>
+ #include <linux/netdevice.h>
+ #include <linux/if_ether.h>
++#include <asm/sync_bitops.h>
+ #include "hyperv_net.h"
+@@ -80,7 +81,7 @@ get_in_err:
+ }
+-static int netvsc_destroy_recv_buf(struct netvsc_device *net_device)
++static int netvsc_destroy_buf(struct netvsc_device *net_device)
+ {
+       struct nvsp_message *revoke_packet;
+       int ret = 0;
+@@ -146,10 +147,62 @@ static int netvsc_destroy_recv_buf(struct netvsc_device *net_device)
+               net_device->recv_section = NULL;
+       }
++      /* Deal with the send buffer we may have setup.
++       * If we got a  send section size, it means we received a
++       * SendsendBufferComplete msg (ie sent
++       * NvspMessage1TypeSendReceiveBuffer msg) therefore, we need
++       * to send a revoke msg here
++       */
++      if (net_device->send_section_size) {
++              /* Send the revoke receive buffer */
++              revoke_packet = &net_device->revoke_packet;
++              memset(revoke_packet, 0, sizeof(struct nvsp_message));
++
++              revoke_packet->hdr.msg_type =
++                      NVSP_MSG1_TYPE_REVOKE_SEND_BUF;
++              revoke_packet->msg.v1_msg.revoke_recv_buf.id = 0;
++
++              ret = vmbus_sendpacket(net_device->dev->channel,
++                                     revoke_packet,
++                                     sizeof(struct nvsp_message),
++                                     (unsigned long)revoke_packet,
++                                     VM_PKT_DATA_INBAND, 0);
++              /* If we failed here, we might as well return and
++               * have a leak rather than continue and a bugchk
++               */
++              if (ret != 0) {
++                      netdev_err(ndev, "unable to send "
++                                 "revoke send buffer to netvsp\n");
++                      return ret;
++              }
++      }
++      /* Teardown the gpadl on the vsp end */
++      if (net_device->send_buf_gpadl_handle) {
++              ret = vmbus_teardown_gpadl(net_device->dev->channel,
++                                         net_device->send_buf_gpadl_handle);
++
++              /* If we failed here, we might as well return and have a leak
++               * rather than continue and a bugchk
++               */
++              if (ret != 0) {
++                      netdev_err(ndev,
++                                 "unable to teardown send buffer's gpadl\n");
++                      return ret;
++              }
++              net_device->recv_buf_gpadl_handle = 0;
++      }
++      if (net_device->send_buf) {
++              /* Free up the receive buffer */
++              free_pages((unsigned long)net_device->send_buf,
++                         get_order(net_device->send_buf_size));
++              net_device->send_buf = NULL;
++      }
++      kfree(net_device->send_section_map);
++
+       return ret;
+ }
+-static int netvsc_init_recv_buf(struct hv_device *device)
++static int netvsc_init_buf(struct hv_device *device)
+ {
+       int ret = 0;
+       int t;
+@@ -248,10 +301,90 @@ static int netvsc_init_recv_buf(struct hv_device *device)
+               goto cleanup;
+       }
++      /* Now setup the send buffer.
++       */
++      net_device->send_buf =
++              (void *)__get_free_pages(GFP_KERNEL|__GFP_ZERO,
++                                       get_order(net_device->send_buf_size));
++      if (!net_device->send_buf) {
++              netdev_err(ndev, "unable to allocate send "
++                         "buffer of size %d\n", net_device->send_buf_size);
++              ret = -ENOMEM;
++              goto cleanup;
++      }
++
++      /* Establish the gpadl handle for this buffer on this
++       * channel.  Note: This call uses the vmbus connection rather
++       * than the channel to establish the gpadl handle.
++       */
++      ret = vmbus_establish_gpadl(device->channel, net_device->send_buf,
++                                  net_device->send_buf_size,
++                                  &net_device->send_buf_gpadl_handle);
++      if (ret != 0) {
++              netdev_err(ndev,
++                         "unable to establish send buffer's gpadl\n");
++              goto cleanup;
++      }
++
++      /* Notify the NetVsp of the gpadl handle */
++      init_packet = &net_device->channel_init_pkt;
++      memset(init_packet, 0, sizeof(struct nvsp_message));
++      init_packet->hdr.msg_type = NVSP_MSG1_TYPE_SEND_SEND_BUF;
++      init_packet->msg.v1_msg.send_recv_buf.gpadl_handle =
++              net_device->send_buf_gpadl_handle;
++      init_packet->msg.v1_msg.send_recv_buf.id = 0;
++
++      /* Send the gpadl notification request */
++      ret = vmbus_sendpacket(device->channel, init_packet,
++                             sizeof(struct nvsp_message),
++                             (unsigned long)init_packet,
++                             VM_PKT_DATA_INBAND,
++                             VMBUS_DATA_PACKET_FLAG_COMPLETION_REQUESTED);
++      if (ret != 0) {
++              netdev_err(ndev,
++                         "unable to send send buffer's gpadl to netvsp\n");
++              goto cleanup;
++      }
++
++      t = wait_for_completion_timeout(&net_device->channel_init_wait, 5*HZ);
++      BUG_ON(t == 0);
++
++      /* Check the response */
++      if (init_packet->msg.v1_msg.
++          send_send_buf_complete.status != NVSP_STAT_SUCCESS) {
++              netdev_err(ndev, "Unable to complete send buffer "
++                         "initialization with NetVsp - status %d\n",
++                         init_packet->msg.v1_msg.
++                         send_recv_buf_complete.status);
++              ret = -EINVAL;
++              goto cleanup;
++      }
++
++      /* Parse the response */
++      net_device->send_section_size = init_packet->msg.
++                              v1_msg.send_send_buf_complete.section_size;
++
++      /* Section count is simply the size divided by the section size.
++       */
++      net_device->send_section_cnt =
++              net_device->send_buf_size/net_device->send_section_size;
++
++      dev_info(&device->device, "Send section size: %d, Section count:%d\n",
++               net_device->send_section_size, net_device->send_section_cnt);
++
++      /* Setup state for managing the send buffer. */
++      net_device->map_words = DIV_ROUND_UP(net_device->send_section_cnt,
++                                           BITS_PER_LONG);
++
++      net_device->send_section_map =
++              kzalloc(net_device->map_words * sizeof(ulong), GFP_KERNEL);
++      if (net_device->send_section_map == NULL)
++              goto cleanup;
++
+       goto exit;
+ cleanup:
+-      netvsc_destroy_recv_buf(net_device);
++      netvsc_destroy_buf(net_device);
+ exit:
+       return ret;
+@@ -369,8 +502,9 @@ static int netvsc_connect_vsp(struct hv_device *device)
+               net_device->recv_buf_size = NETVSC_RECEIVE_BUFFER_SIZE_LEGACY;
+       else
+               net_device->recv_buf_size = NETVSC_RECEIVE_BUFFER_SIZE;
++      net_device->send_buf_size = NETVSC_SEND_BUFFER_SIZE;
+-      ret = netvsc_init_recv_buf(device);
++      ret = netvsc_init_buf(device);
+ cleanup:
+       return ret;
+@@ -378,7 +512,7 @@ cleanup:
+ static void netvsc_disconnect_vsp(struct netvsc_device *net_device)
+ {
+-      netvsc_destroy_recv_buf(net_device);
++      netvsc_destroy_buf(net_device);
+ }
+ /*
+@@ -440,6 +574,12 @@ static inline u32 hv_ringbuf_avail_percent(
+       return avail_write * 100 / ring_info->ring_datasize;
+ }
++static inline void netvsc_free_send_slot(struct netvsc_device *net_device,
++                                       u32 index)
++{
++      sync_change_bit(index, net_device->send_section_map);
++}
++
+ static void netvsc_send_completion(struct netvsc_device *net_device,
+                                  struct hv_device *device,
+                                  struct vmpacket_descriptor *packet)
+@@ -447,6 +587,7 @@ static void netvsc_send_completion(struct netvsc_device *net_device,
+       struct nvsp_message *nvsp_packet;
+       struct hv_netvsc_packet *nvsc_packet;
+       struct net_device *ndev;
++      u32 send_index;
+       ndev = net_device->ndev;
+@@ -477,6 +618,9 @@ static void netvsc_send_completion(struct netvsc_device *net_device,
+               /* Notify the layer above us */
+               if (nvsc_packet) {
++                      send_index = nvsc_packet->send_buf_index;
++                      if (send_index != NETVSC_INVALID_INDEX)
++                              netvsc_free_send_slot(net_device, send_index);
+                       q_idx = nvsc_packet->q_idx;
+                       channel = nvsc_packet->channel;
+                       nvsc_packet->send_completion(nvsc_packet->
+@@ -504,6 +648,52 @@ static void netvsc_send_completion(struct netvsc_device *net_device,
+ }
++static u32 netvsc_get_next_send_section(struct netvsc_device *net_device)
++{
++      unsigned long index;
++      u32 max_words = net_device->map_words;
++      unsigned long *map_addr = (unsigned long *)net_device->send_section_map;
++      u32 section_cnt = net_device->send_section_cnt;
++      int ret_val = NETVSC_INVALID_INDEX;
++      int i;
++      int prev_val;
++
++      for (i = 0; i < max_words; i++) {
++              if (!~(map_addr[i]))
++                      continue;
++              index = ffz(map_addr[i]);
++              prev_val = sync_test_and_set_bit(index, &map_addr[i]);
++              if (prev_val)
++                      continue;
++              if ((index + (i * BITS_PER_LONG)) >= section_cnt)
++                      break;
++              ret_val = (index + (i * BITS_PER_LONG));
++              break;
++      }
++      return ret_val;
++}
++
++u32 netvsc_copy_to_send_buf(struct netvsc_device *net_device,
++                          unsigned int section_index,
++                          struct hv_netvsc_packet *packet)
++{
++      char *start = net_device->send_buf;
++      char *dest = (start + (section_index * net_device->send_section_size));
++      int i;
++      u32 msg_size = 0;
++
++      for (i = 0; i < packet->page_buf_cnt; i++) {
++              char *src = phys_to_virt(packet->page_buf[i].pfn << PAGE_SHIFT);
++              u32 offset = packet->page_buf[i].offset;
++              u32 len = packet->page_buf[i].len;
++
++              memcpy(dest, (src + offset), len);
++              msg_size += len;
++              dest += len;
++      }
++      return msg_size;
++}
++
+ int netvsc_send(struct hv_device *device,
+                       struct hv_netvsc_packet *packet)
+ {
+@@ -513,6 +703,10 @@ int netvsc_send(struct hv_device *device,
+       struct net_device *ndev;
+       struct vmbus_channel *out_channel = NULL;
+       u64 req_id;
++      unsigned int section_index = NETVSC_INVALID_INDEX;
++      u32 msg_size = 0;
++      struct sk_buff *skb;
++
+       net_device = get_outbound_net_device(device);
+       if (!net_device)
+@@ -528,10 +722,26 @@ int netvsc_send(struct hv_device *device,
+               sendMessage.msg.v1_msg.send_rndis_pkt.channel_type = 1;
+       }
+-      /* Not using send buffer section */
++      /* Attempt to send via sendbuf */
++      if (packet->total_data_buflen < net_device->send_section_size) {
++              section_index = netvsc_get_next_send_section(net_device);
++              if (section_index != NETVSC_INVALID_INDEX) {
++                      msg_size = netvsc_copy_to_send_buf(net_device,
++                                                         section_index,
++                                                         packet);
++                      skb = (struct sk_buff *)
++                            (unsigned long)packet->send_completion_tid;
++                      if (skb)
++                              dev_kfree_skb_any(skb);
++                      packet->page_buf_cnt = 0;
++              }
++      }
++      packet->send_buf_index = section_index;
++
++
+       sendMessage.msg.v1_msg.send_rndis_pkt.send_buf_section_index =
+-              0xFFFFFFFF;
+-      sendMessage.msg.v1_msg.send_rndis_pkt.send_buf_section_size = 0;
++              section_index;
++      sendMessage.msg.v1_msg.send_rndis_pkt.send_buf_section_size = msg_size;
+       if (packet->send_completion)
+               req_id = (ulong)packet;
+diff --git a/drivers/net/hyperv/netvsc_drv.c b/drivers/net/hyperv/netvsc_drv.c
+index c76b66515e92..939e3af60ec4 100644
+--- a/drivers/net/hyperv/netvsc_drv.c
++++ b/drivers/net/hyperv/netvsc_drv.c
+@@ -236,10 +236,11 @@ static void netvsc_xmit_completion(void *context)
+       struct hv_netvsc_packet *packet = (struct hv_netvsc_packet *)context;
+       struct sk_buff *skb = (struct sk_buff *)
+               (unsigned long)packet->send_completion_tid;
++      u32 index = packet->send_buf_index;
+       kfree(packet);
+-      if (skb)
++      if (skb && (index == NETVSC_INVALID_INDEX))
+               dev_kfree_skb_any(skb);
+ }
+-- 
+2.4.3
+
diff --git a/src/patches/linux/0005-Add-support-for-netvsc-build-without-CONFIG_SYSFS-fl.patch b/src/patches/linux/0005-Add-support-for-netvsc-build-without-CONFIG_SYSFS-fl.patch
new file mode 100644 (file)
index 0000000..4d00ad2
--- /dev/null
@@ -0,0 +1,42 @@
+From e565e803d437b36c4fb4ced5e346827981183284 Mon Sep 17 00:00:00 2001
+From: Haiyang Zhang <haiyangz@microsoft.com>
+Date: Thu, 8 May 2014 15:14:10 -0700
+Subject: [PATCH 05/11] Add support for netvsc build without CONFIG_SYSFS flag
+
+This change ensures the driver can be built successfully without the
+CONFIG_SYSFS flag.
+MS-TFS: 182270
+
+Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
+Reviewed-by: K. Y. Srinivasan <kys@microsoft.com>
+Signed-off-by: David S. Miller <davem@davemloft.net>
+---
+ drivers/net/hyperv/netvsc_drv.c | 5 +----
+ 1 file changed, 1 insertion(+), 4 deletions(-)
+
+diff --git a/drivers/net/hyperv/netvsc_drv.c b/drivers/net/hyperv/netvsc_drv.c
+index 939e3af60ec4..083d084396d3 100644
+--- a/drivers/net/hyperv/netvsc_drv.c
++++ b/drivers/net/hyperv/netvsc_drv.c
+@@ -640,8 +640,7 @@ int netvsc_recv_callback(struct hv_device *device_obj,
+                                      packet->vlan_tci);
+       skb_record_rx_queue(skb, packet->channel->
+-                          offermsg.offer.sub_channel_index %
+-                          net->real_num_rx_queues);
++                          offermsg.offer.sub_channel_index);
+       net->stats.rx_packets++;
+       net->stats.rx_bytes += packet->total_data_buflen;
+@@ -824,8 +823,6 @@ static int netvsc_probe(struct hv_device *dev,
+       nvdev = hv_get_drvdata(dev);
+       netif_set_real_num_tx_queues(net, nvdev->num_chn);
+       netif_set_real_num_rx_queues(net, nvdev->num_chn);
+-      dev_info(&dev->device, "real num tx,rx queues:%u, %u\n",
+-               net->real_num_tx_queues, net->real_num_rx_queues);
+       ret = register_netdev(net);
+       if (ret != 0) {
+-- 
+2.4.3
+
diff --git a/src/patches/linux/0005-Drivers-net-hyperv-Enable-scatter-gather-I-O.patch b/src/patches/linux/0005-Drivers-net-hyperv-Enable-scatter-gather-I-O.patch
new file mode 100644 (file)
index 0000000..27fb2d9
--- /dev/null
@@ -0,0 +1,212 @@
+From 4c06034001e20ff9f6e2a1a3dfa155bf3f31440c Mon Sep 17 00:00:00 2001
+From: KY Srinivasan <kys@microsoft.com>
+Date: Sat, 8 Mar 2014 19:23:13 -0800
+Subject: [PATCH 05/25] Drivers: net: hyperv: Enable scatter gather I/O
+
+Cleanup the code and enable scatter gather I/O.
+
+Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
+Reviewed-by: Haiyang Zhang <haiyangz@microsoft.com>
+Signed-off-by: David S. Miller <davem@davemloft.net>
+---
+ drivers/net/hyperv/netvsc_drv.c | 153 ++++++++++++++++++++++++++++++----------
+ 1 file changed, 114 insertions(+), 39 deletions(-)
+
+diff --git a/drivers/net/hyperv/netvsc_drv.c b/drivers/net/hyperv/netvsc_drv.c
+index 8e3a0b00099b..72961741be54 100644
+--- a/drivers/net/hyperv/netvsc_drv.c
++++ b/drivers/net/hyperv/netvsc_drv.c
+@@ -140,22 +140,124 @@ static void netvsc_xmit_completion(void *context)
+               dev_kfree_skb_any(skb);
+ }
++static u32 fill_pg_buf(struct page *page, u32 offset, u32 len,
++                      struct hv_page_buffer *pb)
++{
++      int j = 0;
++
++      /* Deal with compund pages by ignoring unused part
++       * of the page.
++       */
++      page += (offset >> PAGE_SHIFT);
++      offset &= ~PAGE_MASK;
++
++      while (len > 0) {
++              unsigned long bytes;
++
++              bytes = PAGE_SIZE - offset;
++              if (bytes > len)
++                      bytes = len;
++              pb[j].pfn = page_to_pfn(page);
++              pb[j].offset = offset;
++              pb[j].len = bytes;
++
++              offset += bytes;
++              len -= bytes;
++
++              if (offset == PAGE_SIZE && len) {
++                      page++;
++                      offset = 0;
++                      j++;
++              }
++      }
++
++      return j + 1;
++}
++
++static void init_page_array(void *hdr, u32 len, struct sk_buff *skb,
++                          struct hv_page_buffer *pb)
++{
++      u32 slots_used = 0;
++      char *data = skb->data;
++      int frags = skb_shinfo(skb)->nr_frags;
++      int i;
++
++      /* The packet is laid out thus:
++       * 1. hdr
++       * 2. skb linear data
++       * 3. skb fragment data
++       */
++      if (hdr != NULL)
++              slots_used += fill_pg_buf(virt_to_page(hdr),
++                                      offset_in_page(hdr),
++                                      len, &pb[slots_used]);
++
++      slots_used += fill_pg_buf(virt_to_page(data),
++                              offset_in_page(data),
++                              skb_headlen(skb), &pb[slots_used]);
++
++      for (i = 0; i < frags; i++) {
++              skb_frag_t *frag = skb_shinfo(skb)->frags + i;
++
++              slots_used += fill_pg_buf(skb_frag_page(frag),
++                                      frag->page_offset,
++                                      skb_frag_size(frag), &pb[slots_used]);
++      }
++}
++
++static int count_skb_frag_slots(struct sk_buff *skb)
++{
++      int i, frags = skb_shinfo(skb)->nr_frags;
++      int pages = 0;
++
++      for (i = 0; i < frags; i++) {
++              skb_frag_t *frag = skb_shinfo(skb)->frags + i;
++              unsigned long size = skb_frag_size(frag);
++              unsigned long offset = frag->page_offset;
++
++              /* Skip unused frames from start of page */
++              offset &= ~PAGE_MASK;
++              pages += PFN_UP(offset + size);
++      }
++      return pages;
++}
++
++static int netvsc_get_slots(struct sk_buff *skb)
++{
++      char *data = skb->data;
++      unsigned int offset = offset_in_page(data);
++      unsigned int len = skb_headlen(skb);
++      int slots;
++      int frag_slots;
++
++      slots = DIV_ROUND_UP(offset + len, PAGE_SIZE);
++      frag_slots = count_skb_frag_slots(skb);
++      return slots + frag_slots;
++}
++
+ static int netvsc_start_xmit(struct sk_buff *skb, struct net_device *net)
+ {
+       struct net_device_context *net_device_ctx = netdev_priv(net);
+       struct hv_netvsc_packet *packet;
+       int ret;
+-      unsigned int i, num_pages, npg_data;
++      unsigned int num_data_pages;
+       u32 skb_length = skb->len;
+-      /* Add multipages for skb->data and additional 2 for RNDIS */
+-      npg_data = (((unsigned long)skb->data + skb_headlen(skb) - 1)
+-              >> PAGE_SHIFT) - ((unsigned long)skb->data >> PAGE_SHIFT) + 1;
+-      num_pages = skb_shinfo(skb)->nr_frags + npg_data + 2;
++      /* We will atmost need two pages to describe the rndis
++       * header. We can only transmit MAX_PAGE_BUFFER_COUNT number
++       * of pages in a single packet.
++       */
++      num_data_pages = netvsc_get_slots(skb) + 2;
++      if (num_data_pages > MAX_PAGE_BUFFER_COUNT) {
++              netdev_err(net, "Packet too big: %u\n", skb->len);
++              dev_kfree_skb(skb);
++              net->stats.tx_dropped++;
++              return NETDEV_TX_OK;
++      }
+       /* Allocate a netvsc packet based on # of frags. */
+       packet = kzalloc(sizeof(struct hv_netvsc_packet) +
+-                       (num_pages * sizeof(struct hv_page_buffer)) +
++                       (num_data_pages * sizeof(struct hv_page_buffer)) +
+                        sizeof(struct rndis_message) +
+                        NDIS_VLAN_PPI_SIZE, GFP_ATOMIC);
+       if (!packet) {
+@@ -170,44 +272,17 @@ static int netvsc_start_xmit(struct sk_buff *skb, struct net_device *net)
+       packet->vlan_tci = skb->vlan_tci;
+       packet->extension = (void *)(unsigned long)packet +
+-                              sizeof(struct hv_netvsc_packet) +
+-                                  (num_pages * sizeof(struct hv_page_buffer));
++                      sizeof(struct hv_netvsc_packet) +
++                      (num_data_pages * sizeof(struct hv_page_buffer));
+       /* If the rndis msg goes beyond 1 page, we will add 1 later */
+-      packet->page_buf_cnt = num_pages - 1;
++      packet->page_buf_cnt = num_data_pages - 1;
+       /* Initialize it from the skb */
+       packet->total_data_buflen = skb->len;
+       /* Start filling in the page buffers starting after RNDIS buffer. */
+-      packet->page_buf[1].pfn = virt_to_phys(skb->data) >> PAGE_SHIFT;
+-      packet->page_buf[1].offset
+-              = (unsigned long)skb->data & (PAGE_SIZE - 1);
+-      if (npg_data == 1)
+-              packet->page_buf[1].len = skb_headlen(skb);
+-      else
+-              packet->page_buf[1].len = PAGE_SIZE
+-                      - packet->page_buf[1].offset;
+-
+-      for (i = 2; i <= npg_data; i++) {
+-              packet->page_buf[i].pfn = virt_to_phys(skb->data
+-                      + PAGE_SIZE * (i-1)) >> PAGE_SHIFT;
+-              packet->page_buf[i].offset = 0;
+-              packet->page_buf[i].len = PAGE_SIZE;
+-      }
+-      if (npg_data > 1)
+-              packet->page_buf[npg_data].len = (((unsigned long)skb->data
+-                      + skb_headlen(skb) - 1) & (PAGE_SIZE - 1)) + 1;
+-
+-      /* Additional fragments are after SKB data */
+-      for (i = 0; i < skb_shinfo(skb)->nr_frags; i++) {
+-              const skb_frag_t *f = &skb_shinfo(skb)->frags[i];
+-
+-              packet->page_buf[i+npg_data+1].pfn =
+-                      page_to_pfn(skb_frag_page(f));
+-              packet->page_buf[i+npg_data+1].offset = f->page_offset;
+-              packet->page_buf[i+npg_data+1].len = skb_frag_size(f);
+-      }
++      init_page_array(NULL, 0, skb, &packet->page_buf[1]);
+       /* Set the completion routine */
+       packet->completion.send.send_completion = netvsc_xmit_completion;
+@@ -454,8 +529,8 @@ static int netvsc_probe(struct hv_device *dev,
+       net->netdev_ops = &device_ops;
+       /* TODO: Add GSO and Checksum offload */
+-      net->hw_features = 0;
+-      net->features = NETIF_F_HW_VLAN_CTAG_TX;
++      net->hw_features = NETIF_F_SG;
++      net->features = NETIF_F_HW_VLAN_CTAG_TX | NETIF_F_SG;
+       SET_ETHTOOL_OPS(net, &ethtool_ops);
+       SET_NETDEV_DEV(net, &dev->device);
+-- 
+2.4.3
+
diff --git a/src/patches/linux/0006-Drivers-net-hyperv-Cleanup-the-send-path.patch b/src/patches/linux/0006-Drivers-net-hyperv-Cleanup-the-send-path.patch
new file mode 100644 (file)
index 0000000..20fcb3f
--- /dev/null
@@ -0,0 +1,266 @@
+From d972eb71fb95660fe74616901b55b0d7a336daed Mon Sep 17 00:00:00 2001
+From: KY Srinivasan <kys@microsoft.com>
+Date: Sat, 8 Mar 2014 19:23:14 -0800
+Subject: [PATCH 06/25] Drivers: net: hyperv: Cleanup the send path
+
+In preparation for enabling offloads, cleanup the send path.
+
+Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
+Reviewed-by: Haiyang Zhang <haiyangz@microsoft.com>
+Signed-off-by: David S. Miller <davem@davemloft.net>
+---
+ drivers/net/hyperv/hyperv_net.h   |  7 +---
+ drivers/net/hyperv/netvsc_drv.c   | 88 +++++++++++++++++++++++++++++++--------
+ drivers/net/hyperv/rndis_filter.c | 66 -----------------------------
+ 3 files changed, 71 insertions(+), 90 deletions(-)
+
+diff --git a/drivers/net/hyperv/hyperv_net.h b/drivers/net/hyperv/hyperv_net.h
+index 39fc230f5c20..694bf7cada90 100644
+--- a/drivers/net/hyperv/hyperv_net.h
++++ b/drivers/net/hyperv/hyperv_net.h
+@@ -73,7 +73,7 @@ struct hv_netvsc_packet {
+       } completion;
+       /* This points to the memory after page_buf */
+-      void *extension;
++      struct rndis_message *rndis_msg;
+       u32 total_data_buflen;
+       /* Points to the send/receive buffer where the ethernet frame is */
+@@ -126,11 +126,6 @@ void rndis_filter_device_remove(struct hv_device *dev);
+ int rndis_filter_receive(struct hv_device *dev,
+                       struct hv_netvsc_packet *pkt);
+-
+-
+-int rndis_filter_send(struct hv_device *dev,
+-                      struct hv_netvsc_packet *pkt);
+-
+ int rndis_filter_set_packet_filter(struct rndis_device *dev, u32 new_filter);
+ int rndis_filter_set_device_mac(struct hv_device *hdev, char *mac);
+diff --git a/drivers/net/hyperv/netvsc_drv.c b/drivers/net/hyperv/netvsc_drv.c
+index 72961741be54..87293a15e470 100644
+--- a/drivers/net/hyperv/netvsc_drv.c
++++ b/drivers/net/hyperv/netvsc_drv.c
+@@ -128,6 +128,27 @@ static int netvsc_close(struct net_device *net)
+       return ret;
+ }
++static void *init_ppi_data(struct rndis_message *msg, u32 ppi_size,
++                              int pkt_type)
++{
++      struct rndis_packet *rndis_pkt;
++      struct rndis_per_packet_info *ppi;
++
++      rndis_pkt = &msg->msg.pkt;
++      rndis_pkt->data_offset += ppi_size;
++
++      ppi = (struct rndis_per_packet_info *)((void *)rndis_pkt +
++              rndis_pkt->per_pkt_info_offset + rndis_pkt->per_pkt_info_len);
++
++      ppi->size = ppi_size;
++      ppi->type = pkt_type;
++      ppi->ppi_offset = sizeof(struct rndis_per_packet_info);
++
++      rndis_pkt->per_pkt_info_len += ppi_size;
++
++      return ppi;
++}
++
+ static void netvsc_xmit_completion(void *context)
+ {
+       struct hv_netvsc_packet *packet = (struct hv_netvsc_packet *)context;
+@@ -174,8 +195,8 @@ static u32 fill_pg_buf(struct page *page, u32 offset, u32 len,
+       return j + 1;
+ }
+-static void init_page_array(void *hdr, u32 len, struct sk_buff *skb,
+-                          struct hv_page_buffer *pb)
++static u32 init_page_array(void *hdr, u32 len, struct sk_buff *skb,
++                         struct hv_page_buffer *pb)
+ {
+       u32 slots_used = 0;
+       char *data = skb->data;
+@@ -203,6 +224,7 @@ static void init_page_array(void *hdr, u32 len, struct sk_buff *skb,
+                                       frag->page_offset,
+                                       skb_frag_size(frag), &pb[slots_used]);
+       }
++      return slots_used;
+ }
+ static int count_skb_frag_slots(struct sk_buff *skb)
+@@ -240,15 +262,20 @@ static int netvsc_start_xmit(struct sk_buff *skb, struct net_device *net)
+       struct net_device_context *net_device_ctx = netdev_priv(net);
+       struct hv_netvsc_packet *packet;
+       int ret;
+-      unsigned int num_data_pages;
+       u32 skb_length = skb->len;
++      unsigned int num_data_pgs;
++      struct rndis_message *rndis_msg;
++      struct rndis_packet *rndis_pkt;
++      u32 rndis_msg_size;
++      bool isvlan;
++      struct rndis_per_packet_info *ppi;
+       /* We will atmost need two pages to describe the rndis
+        * header. We can only transmit MAX_PAGE_BUFFER_COUNT number
+        * of pages in a single packet.
+        */
+-      num_data_pages = netvsc_get_slots(skb) + 2;
+-      if (num_data_pages > MAX_PAGE_BUFFER_COUNT) {
++      num_data_pgs = netvsc_get_slots(skb) + 2;
++      if (num_data_pgs > MAX_PAGE_BUFFER_COUNT) {
+               netdev_err(net, "Packet too big: %u\n", skb->len);
+               dev_kfree_skb(skb);
+               net->stats.tx_dropped++;
+@@ -257,7 +284,7 @@ static int netvsc_start_xmit(struct sk_buff *skb, struct net_device *net)
+       /* Allocate a netvsc packet based on # of frags. */
+       packet = kzalloc(sizeof(struct hv_netvsc_packet) +
+-                       (num_data_pages * sizeof(struct hv_page_buffer)) +
++                       (num_data_pgs * sizeof(struct hv_page_buffer)) +
+                        sizeof(struct rndis_message) +
+                        NDIS_VLAN_PPI_SIZE, GFP_ATOMIC);
+       if (!packet) {
+@@ -271,26 +298,51 @@ static int netvsc_start_xmit(struct sk_buff *skb, struct net_device *net)
+       packet->vlan_tci = skb->vlan_tci;
+-      packet->extension = (void *)(unsigned long)packet +
+-                      sizeof(struct hv_netvsc_packet) +
+-                      (num_data_pages * sizeof(struct hv_page_buffer));
+-
+-      /* If the rndis msg goes beyond 1 page, we will add 1 later */
+-      packet->page_buf_cnt = num_data_pages - 1;
+-
+-      /* Initialize it from the skb */
++      packet->is_data_pkt = true;
+       packet->total_data_buflen = skb->len;
+-      /* Start filling in the page buffers starting after RNDIS buffer. */
+-      init_page_array(NULL, 0, skb, &packet->page_buf[1]);
++      packet->rndis_msg = (struct rndis_message *)((unsigned long)packet +
++                              sizeof(struct hv_netvsc_packet) +
++                              (num_data_pgs * sizeof(struct hv_page_buffer)));
+       /* Set the completion routine */
+       packet->completion.send.send_completion = netvsc_xmit_completion;
+       packet->completion.send.send_completion_ctx = packet;
+       packet->completion.send.send_completion_tid = (unsigned long)skb;
+-      ret = rndis_filter_send(net_device_ctx->device_ctx,
+-                                packet);
++      isvlan = packet->vlan_tci & VLAN_TAG_PRESENT;
++
++      /* Add the rndis header */
++      rndis_msg = packet->rndis_msg;
++      rndis_msg->ndis_msg_type = RNDIS_MSG_PACKET;
++      rndis_msg->msg_len = packet->total_data_buflen;
++      rndis_pkt = &rndis_msg->msg.pkt;
++      rndis_pkt->data_offset = sizeof(struct rndis_packet);
++      rndis_pkt->data_len = packet->total_data_buflen;
++      rndis_pkt->per_pkt_info_offset = sizeof(struct rndis_packet);
++
++      rndis_msg_size = RNDIS_MESSAGE_SIZE(struct rndis_packet);
++
++      if (isvlan) {
++              struct ndis_pkt_8021q_info *vlan;
++
++              rndis_msg_size += NDIS_VLAN_PPI_SIZE;
++              ppi = init_ppi_data(rndis_msg, NDIS_VLAN_PPI_SIZE,
++                                      IEEE_8021Q_INFO);
++              vlan = (struct ndis_pkt_8021q_info *)((void *)ppi +
++                                              ppi->ppi_offset);
++              vlan->vlanid = packet->vlan_tci & VLAN_VID_MASK;
++              vlan->pri = (packet->vlan_tci & VLAN_PRIO_MASK) >>
++                              VLAN_PRIO_SHIFT;
++      }
++
++      /* Start filling in the page buffers with the rndis hdr */
++      rndis_msg->msg_len += rndis_msg_size;
++      packet->page_buf_cnt = init_page_array(rndis_msg, rndis_msg_size,
++                                      skb, &packet->page_buf[0]);
++
++      ret = netvsc_send(net_device_ctx->device_ctx, packet);
++
+       if (ret == 0) {
+               net->stats.tx_bytes += skb_length;
+               net->stats.tx_packets++;
+diff --git a/drivers/net/hyperv/rndis_filter.c b/drivers/net/hyperv/rndis_filter.c
+index 6a9f6021f09c..dcbf144ea7da 100644
+--- a/drivers/net/hyperv/rndis_filter.c
++++ b/drivers/net/hyperv/rndis_filter.c
+@@ -910,69 +910,3 @@ int rndis_filter_close(struct hv_device *dev)
+       return rndis_filter_close_device(nvdev->extension);
+ }
+-
+-int rndis_filter_send(struct hv_device *dev,
+-                           struct hv_netvsc_packet *pkt)
+-{
+-      struct rndis_message *rndis_msg;
+-      struct rndis_packet *rndis_pkt;
+-      u32 rndis_msg_size;
+-      bool isvlan = pkt->vlan_tci & VLAN_TAG_PRESENT;
+-
+-      /* Add the rndis header */
+-      rndis_msg = (struct rndis_message *)pkt->extension;
+-
+-      rndis_msg_size = RNDIS_MESSAGE_SIZE(struct rndis_packet);
+-      if (isvlan)
+-              rndis_msg_size += NDIS_VLAN_PPI_SIZE;
+-
+-      rndis_msg->ndis_msg_type = RNDIS_MSG_PACKET;
+-      rndis_msg->msg_len = pkt->total_data_buflen +
+-                                    rndis_msg_size;
+-
+-      rndis_pkt = &rndis_msg->msg.pkt;
+-      rndis_pkt->data_offset = sizeof(struct rndis_packet);
+-      if (isvlan)
+-              rndis_pkt->data_offset += NDIS_VLAN_PPI_SIZE;
+-      rndis_pkt->data_len = pkt->total_data_buflen;
+-
+-      if (isvlan) {
+-              struct rndis_per_packet_info *ppi;
+-              struct ndis_pkt_8021q_info *vlan;
+-
+-              rndis_pkt->per_pkt_info_offset = sizeof(struct rndis_packet);
+-              rndis_pkt->per_pkt_info_len = NDIS_VLAN_PPI_SIZE;
+-
+-              ppi = (struct rndis_per_packet_info *)((ulong)rndis_pkt +
+-                      rndis_pkt->per_pkt_info_offset);
+-              ppi->size = NDIS_VLAN_PPI_SIZE;
+-              ppi->type = IEEE_8021Q_INFO;
+-              ppi->ppi_offset = sizeof(struct rndis_per_packet_info);
+-
+-              vlan = (struct ndis_pkt_8021q_info *)((ulong)ppi +
+-                      ppi->ppi_offset);
+-              vlan->vlanid = pkt->vlan_tci & VLAN_VID_MASK;
+-              vlan->pri = (pkt->vlan_tci & VLAN_PRIO_MASK) >> VLAN_PRIO_SHIFT;
+-      }
+-
+-      pkt->is_data_pkt = true;
+-      pkt->page_buf[0].pfn = virt_to_phys(rndis_msg) >> PAGE_SHIFT;
+-      pkt->page_buf[0].offset =
+-                      (unsigned long)rndis_msg & (PAGE_SIZE-1);
+-      pkt->page_buf[0].len = rndis_msg_size;
+-
+-      /* Add one page_buf if the rndis msg goes beyond page boundary */
+-      if (pkt->page_buf[0].offset + rndis_msg_size > PAGE_SIZE) {
+-              int i;
+-              for (i = pkt->page_buf_cnt; i > 1; i--)
+-                      pkt->page_buf[i] = pkt->page_buf[i-1];
+-              pkt->page_buf_cnt++;
+-              pkt->page_buf[0].len = PAGE_SIZE - pkt->page_buf[0].offset;
+-              pkt->page_buf[1].pfn = virt_to_phys((void *)((ulong)
+-                      rndis_msg + pkt->page_buf[0].len)) >> PAGE_SHIFT;
+-              pkt->page_buf[1].offset = 0;
+-              pkt->page_buf[1].len = rndis_msg_size - pkt->page_buf[0].len;
+-      }
+-
+-      return netvsc_send(dev, pkt);
+-}
+-- 
+2.4.3
+
diff --git a/src/patches/linux/0006-net-get-rid-of-SET_ETHTOOL_OPS.patch b/src/patches/linux/0006-net-get-rid-of-SET_ETHTOOL_OPS.patch
new file mode 100644 (file)
index 0000000..e4a7a46
--- /dev/null
@@ -0,0 +1,44 @@
+From 7ad24ea4bf620a32631d7b3069c3e30c078b0c3e Mon Sep 17 00:00:00 2001
+From: Wilfried Klaebe <w-lkml@lebenslange-mailadresse.de>
+Date: Sun, 11 May 2014 00:12:32 +0000
+Subject: [PATCH 06/11] net: get rid of SET_ETHTOOL_OPS
+
+net: get rid of SET_ETHTOOL_OPS
+
+Dave Miller mentioned he'd like to see SET_ETHTOOL_OPS gone.
+This does that.
+
+Mostly done via coccinelle script:
+@@
+struct ethtool_ops *ops;
+struct net_device *dev;
+@@
+-       SET_ETHTOOL_OPS(dev, ops);
++       dev->ethtool_ops = ops;
+
+Compile tested only, but I'd seriously wonder if this broke anything.
+
+Suggested-by: Dave Miller <davem@davemloft.net>
+Signed-off-by: Wilfried Klaebe <w-lkml@lebenslange-mailadresse.de>
+Acked-by: Felipe Balbi <balbi@ti.com>
+Signed-off-by: David S. Miller <davem@davemloft.net>
+---
+ drivers/net/hyperv/netvsc_drv.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/drivers/net/hyperv/netvsc_drv.c b/drivers/net/hyperv/netvsc_drv.c
+index 1de3ef5dd5d2..2e967a7bdb33 100644
+--- a/drivers/net/hyperv/netvsc_drv.c
++++ b/drivers/net/hyperv/netvsc_drv.c
+@@ -810,7 +810,7 @@ static int netvsc_probe(struct hv_device *dev,
+       net->features = NETIF_F_HW_VLAN_CTAG_TX | NETIF_F_SG | NETIF_F_RXCSUM |
+                       NETIF_F_IP_CSUM | NETIF_F_TSO;
+-      SET_ETHTOOL_OPS(net, &ethtool_ops);
++      net->ethtool_ops = &ethtool_ops;
+       SET_NETDEV_DEV(net, &dev->device);
+       /* Notify the netvsc driver of the new device */
+-- 
+2.4.3
+
diff --git a/src/patches/linux/0007-Drivers-net-hyperv-Enable-offloads-on-the-host.patch b/src/patches/linux/0007-Drivers-net-hyperv-Enable-offloads-on-the-host.patch
new file mode 100644 (file)
index 0000000..a109f04
--- /dev/null
@@ -0,0 +1,196 @@
+From 6b15b5f37e976a5f3840c7ea59560e10c6251250 Mon Sep 17 00:00:00 2001
+From: KY Srinivasan <kys@microsoft.com>
+Date: Sat, 8 Mar 2014 19:23:15 -0800
+Subject: [PATCH 07/25] Drivers: net: hyperv: Enable offloads on the host
+
+Prior to enabling guest side offloads, enable the offloads on the host.
+
+Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
+Reviewed-by: Haiyang Zhang <haiyangz@microsoft.com>
+Signed-off-by: David S. Miller <davem@davemloft.net>
+---
+ drivers/net/hyperv/hyperv_net.h   | 55 +++++++++++++++++++++++++++
+ drivers/net/hyperv/rndis_filter.c | 80 +++++++++++++++++++++++++++++++++++++++
+ 2 files changed, 135 insertions(+)
+
+diff --git a/drivers/net/hyperv/hyperv_net.h b/drivers/net/hyperv/hyperv_net.h
+index 694bf7cada90..8bc4e766589b 100644
+--- a/drivers/net/hyperv/hyperv_net.h
++++ b/drivers/net/hyperv/hyperv_net.h
+@@ -721,6 +721,61 @@ struct ndis_pkt_8021q_info {
+       };
+ };
++struct ndis_oject_header {
++      u8 type;
++      u8 revision;
++      u16 size;
++};
++
++#define NDIS_OBJECT_TYPE_DEFAULT      0x80
++#define NDIS_OFFLOAD_PARAMETERS_REVISION_3 3
++#define NDIS_OFFLOAD_PARAMETERS_NO_CHANGE 0
++#define NDIS_OFFLOAD_PARAMETERS_LSOV2_DISABLED 1
++#define NDIS_OFFLOAD_PARAMETERS_LSOV2_ENABLED  2
++#define NDIS_OFFLOAD_PARAMETERS_LSOV1_ENABLED  2
++#define NDIS_OFFLOAD_PARAMETERS_RSC_DISABLED 1
++#define NDIS_OFFLOAD_PARAMETERS_RSC_ENABLED 2
++#define NDIS_OFFLOAD_PARAMETERS_TX_RX_DISABLED 1
++#define NDIS_OFFLOAD_PARAMETERS_TX_ENABLED_RX_DISABLED 2
++#define NDIS_OFFLOAD_PARAMETERS_RX_ENABLED_TX_DISABLED 3
++#define NDIS_OFFLOAD_PARAMETERS_TX_RX_ENABLED 4
++
++/*
++ * New offload OIDs for NDIS 6
++ */
++#define OID_TCP_OFFLOAD_CURRENT_CONFIG 0xFC01020B /* query only */
++#define OID_TCP_OFFLOAD_PARAMETERS 0xFC01020C         /* set only */
++#define OID_TCP_OFFLOAD_HARDWARE_CAPABILITIES 0xFC01020D/* query only */
++#define OID_TCP_CONNECTION_OFFLOAD_CURRENT_CONFIG 0xFC01020E /* query only */
++#define OID_TCP_CONNECTION_OFFLOAD_HARDWARE_CAPABILITIES 0xFC01020F /* query */
++#define OID_OFFLOAD_ENCAPSULATION 0x0101010A /* set/query */
++
++struct ndis_offload_params {
++      struct ndis_oject_header header;
++      u8 ip_v4_csum;
++      u8 tcp_ip_v4_csum;
++      u8 udp_ip_v4_csum;
++      u8 tcp_ip_v6_csum;
++      u8 udp_ip_v6_csum;
++      u8 lso_v1;
++      u8 ip_sec_v1;
++      u8 lso_v2_ipv4;
++      u8 lso_v2_ipv6;
++      u8 tcp_connection_ip_v4;
++      u8 tcp_connection_ip_v6;
++      u32 flags;
++      u8 ip_sec_v2;
++      u8 ip_sec_v2_ip_v4;
++      struct {
++              u8 rsc_ip_v4;
++              u8 rsc_ip_v6;
++      };
++      struct {
++              u8 encapsulated_packet_task_offload;
++              u8 encapsulation_types;
++      };
++};
++
+ #define NDIS_VLAN_PPI_SIZE (sizeof(struct rndis_per_packet_info) + \
+               sizeof(struct ndis_pkt_8021q_info))
+diff --git a/drivers/net/hyperv/rndis_filter.c b/drivers/net/hyperv/rndis_filter.c
+index dcbf144ea7da..9b02f21097a7 100644
+--- a/drivers/net/hyperv/rndis_filter.c
++++ b/drivers/net/hyperv/rndis_filter.c
+@@ -627,6 +627,61 @@ cleanup:
+       return ret;
+ }
++int rndis_filter_set_offload_params(struct hv_device *hdev,
++                              struct ndis_offload_params *req_offloads)
++{
++      struct netvsc_device *nvdev = hv_get_drvdata(hdev);
++      struct rndis_device *rdev = nvdev->extension;
++      struct net_device *ndev = nvdev->ndev;
++      struct rndis_request *request;
++      struct rndis_set_request *set;
++      struct ndis_offload_params *offload_params;
++      struct rndis_set_complete *set_complete;
++      u32 extlen = sizeof(struct ndis_offload_params);
++      int ret, t;
++
++      request = get_rndis_request(rdev, RNDIS_MSG_SET,
++              RNDIS_MESSAGE_SIZE(struct rndis_set_request) + extlen);
++      if (!request)
++              return -ENOMEM;
++
++      set = &request->request_msg.msg.set_req;
++      set->oid = OID_TCP_OFFLOAD_PARAMETERS;
++      set->info_buflen = extlen;
++      set->info_buf_offset = sizeof(struct rndis_set_request);
++      set->dev_vc_handle = 0;
++
++      offload_params = (struct ndis_offload_params *)((ulong)set +
++                              set->info_buf_offset);
++      *offload_params = *req_offloads;
++      offload_params->header.type = NDIS_OBJECT_TYPE_DEFAULT;
++      offload_params->header.revision = NDIS_OFFLOAD_PARAMETERS_REVISION_3;
++      offload_params->header.size = extlen;
++
++      ret = rndis_filter_send_request(rdev, request);
++      if (ret != 0)
++              goto cleanup;
++
++      t = wait_for_completion_timeout(&request->wait_event, 5*HZ);
++      if (t == 0) {
++              netdev_err(ndev, "timeout before we got aOFFLOAD set response...\n");
++              /* can't put_rndis_request, since we may still receive a
++               * send-completion.
++               */
++              return -EBUSY;
++      } else {
++              set_complete = &request->response_msg.msg.set_complete;
++              if (set_complete->status != RNDIS_STATUS_SUCCESS) {
++                      netdev_err(ndev, "Fail to set MAC on host side:0x%x\n",
++                                 set_complete->status);
++                      ret = -EINVAL;
++              }
++      }
++
++cleanup:
++      put_rndis_request(rdev, request);
++      return ret;
++}
+ static int rndis_filter_query_device_link_status(struct rndis_device *dev)
+ {
+@@ -826,6 +881,7 @@ int rndis_filter_device_add(struct hv_device *dev,
+       struct netvsc_device *net_device;
+       struct rndis_device *rndis_device;
+       struct netvsc_device_info *device_info = additional_info;
++      struct ndis_offload_params offloads;
+       rndis_device = get_rndis_device();
+       if (!rndis_device)
+@@ -865,6 +921,26 @@ int rndis_filter_device_add(struct hv_device *dev,
+       memcpy(device_info->mac_adr, rndis_device->hw_mac_adr, ETH_ALEN);
++      /* Turn on the offloads; the host supports all of the relevant
++       * offloads.
++       */
++      memset(&offloads, 0, sizeof(struct ndis_offload_params));
++      /* A value of zero means "no change"; now turn on what we
++       * want.
++       */
++      offloads.ip_v4_csum = NDIS_OFFLOAD_PARAMETERS_TX_RX_ENABLED;
++      offloads.tcp_ip_v4_csum = NDIS_OFFLOAD_PARAMETERS_TX_RX_ENABLED;
++      offloads.udp_ip_v4_csum = NDIS_OFFLOAD_PARAMETERS_TX_RX_ENABLED;
++      offloads.tcp_ip_v6_csum = NDIS_OFFLOAD_PARAMETERS_TX_RX_ENABLED;
++      offloads.udp_ip_v6_csum = NDIS_OFFLOAD_PARAMETERS_TX_RX_ENABLED;
++      offloads.lso_v2_ipv4 = NDIS_OFFLOAD_PARAMETERS_LSOV2_ENABLED;
++
++
++      ret = rndis_filter_set_offload_params(dev, &offloads);
++      if (ret)
++              goto err_dev_remv;
++
++
+       rndis_filter_query_device_link_status(rndis_device);
+       device_info->link_state = rndis_device->link_state;
+@@ -874,6 +950,10 @@ int rndis_filter_device_add(struct hv_device *dev,
+                device_info->link_state ? "down" : "up");
+       return ret;
++
++err_dev_remv:
++      rndis_filter_device_remove(dev);
++      return ret;
+ }
+ void rndis_filter_device_remove(struct hv_device *dev)
+-- 
+2.4.3
+
diff --git a/src/patches/linux/0007-hyperv-Add-hash-value-into-RNDIS-Per-packet-info.patch b/src/patches/linux/0007-hyperv-Add-hash-value-into-RNDIS-Per-packet-info.patch
new file mode 100644 (file)
index 0000000..0db5f72
--- /dev/null
@@ -0,0 +1,93 @@
+From 307f099520b66504cf6c5638f3f404c48b9fb45b Mon Sep 17 00:00:00 2001
+From: Haiyang Zhang <haiyangz@microsoft.com>
+Date: Wed, 21 May 2014 12:55:39 -0700
+Subject: [PATCH 07/11] hyperv: Add hash value into RNDIS Per-packet info
+
+It passes the hash value as the RNDIS Per-packet info to the Hyper-V host,
+so that the send completion notices can be spread across multiple channels.
+MS-TFS: 140273
+
+Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
+Signed-off-by: David S. Miller <davem@davemloft.net>
+---
+ drivers/net/hyperv/hyperv_net.h |  4 ++++
+ drivers/net/hyperv/netvsc_drv.c | 18 ++++++++++++++----
+ 2 files changed, 18 insertions(+), 4 deletions(-)
+
+diff --git a/drivers/net/hyperv/hyperv_net.h b/drivers/net/hyperv/hyperv_net.h
+index 4b7df5a5c966..6cc37c15e0bf 100644
+--- a/drivers/net/hyperv/hyperv_net.h
++++ b/drivers/net/hyperv/hyperv_net.h
+@@ -791,6 +791,7 @@ enum ndis_per_pkt_info_type {
+       IEEE_8021Q_INFO,
+       ORIGINAL_PKTINFO,
+       PACKET_CANCEL_ID,
++      NBL_HASH_VALUE = PACKET_CANCEL_ID,
+       ORIGINAL_NET_BUFLIST,
+       CACHED_NET_BUFLIST,
+       SHORT_PKT_PADINFO,
+@@ -937,6 +938,9 @@ struct ndis_tcp_lso_info {
+ #define NDIS_LSO_PPI_SIZE (sizeof(struct rndis_per_packet_info) + \
+               sizeof(struct ndis_tcp_lso_info))
++#define NDIS_HASH_PPI_SIZE (sizeof(struct rndis_per_packet_info) + \
++              sizeof(u32))
++
+ /* Format of Information buffer passed in a SetRequest for the OID */
+ /* OID_GEN_RNDIS_CONFIG_PARAMETER. */
+ struct rndis_config_parameter_info {
+diff --git a/drivers/net/hyperv/netvsc_drv.c b/drivers/net/hyperv/netvsc_drv.c
+index 2e967a7bdb33..4fd71b75e666 100644
+--- a/drivers/net/hyperv/netvsc_drv.c
++++ b/drivers/net/hyperv/netvsc_drv.c
+@@ -224,9 +224,11 @@ static u16 netvsc_select_queue(struct net_device *ndev, struct sk_buff *skb,
+       if (nvsc_dev == NULL || ndev->real_num_tx_queues <= 1)
+               return 0;
+-      if (netvsc_set_hash(&hash, skb))
++      if (netvsc_set_hash(&hash, skb)) {
+               q_idx = nvsc_dev->send_table[hash % VRSS_SEND_TAB_SIZE] %
+                       ndev->real_num_tx_queues;
++              skb_set_hash(skb, hash, PKT_HASH_TYPE_L3);
++      }
+       return q_idx;
+ }
+@@ -384,6 +386,7 @@ static int netvsc_start_xmit(struct sk_buff *skb, struct net_device *net)
+       struct ndis_tcp_lso_info *lso_info;
+       int  hdr_offset;
+       u32 net_trans_info;
++      u32 hash;
+       /* We will atmost need two pages to describe the rndis
+@@ -402,9 +405,8 @@ static int netvsc_start_xmit(struct sk_buff *skb, struct net_device *net)
+       packet = kzalloc(sizeof(struct hv_netvsc_packet) +
+                        (num_data_pgs * sizeof(struct hv_page_buffer)) +
+                        sizeof(struct rndis_message) +
+-                       NDIS_VLAN_PPI_SIZE +
+-                       NDIS_CSUM_PPI_SIZE +
+-                       NDIS_LSO_PPI_SIZE, GFP_ATOMIC);
++                       NDIS_VLAN_PPI_SIZE + NDIS_CSUM_PPI_SIZE +
++                       NDIS_LSO_PPI_SIZE + NDIS_HASH_PPI_SIZE, GFP_ATOMIC);
+       if (!packet) {
+               /* out of memory, drop packet */
+               netdev_err(net, "unable to allocate hv_netvsc_packet\n");
+@@ -443,6 +445,14 @@ static int netvsc_start_xmit(struct sk_buff *skb, struct net_device *net)
+       rndis_msg_size = RNDIS_MESSAGE_SIZE(struct rndis_packet);
++      hash = skb_get_hash_raw(skb);
++      if (hash != 0 && net->real_num_tx_queues > 1) {
++              rndis_msg_size += NDIS_HASH_PPI_SIZE;
++              ppi = init_ppi_data(rndis_msg, NDIS_HASH_PPI_SIZE,
++                                  NBL_HASH_VALUE);
++              *(u32 *)((void *)ppi + ppi->ppi_offset) = hash;
++      }
++
+       if (isvlan) {
+               struct ndis_pkt_8021q_info *vlan;
+-- 
+2.4.3
+
diff --git a/src/patches/linux/0008-Drivers-net-hyperv-Enable-receive-side-IP-checksum-o.patch b/src/patches/linux/0008-Drivers-net-hyperv-Enable-receive-side-IP-checksum-o.patch
new file mode 100644 (file)
index 0000000..e77e9f2
--- /dev/null
@@ -0,0 +1,147 @@
+From 59e0c70c618668522a9431686f7e3a69ef396dff Mon Sep 17 00:00:00 2001
+From: KY Srinivasan <kys@microsoft.com>
+Date: Sat, 8 Mar 2014 19:23:16 -0800
+Subject: [PATCH 08/25] Drivers: net: hyperv: Enable receive side IP checksum
+ offload
+
+Enable receive side checksum offload.
+
+Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
+Reviewed-by: Haiyang Zhang <haiyangz@microsoft.com>
+Signed-off-by: David S. Miller <davem@davemloft.net>
+---
+ drivers/net/hyperv/hyperv_net.h   | 33 ++++++++++++++++++++++++++++++++-
+ drivers/net/hyperv/netvsc_drv.c   | 19 +++++++++++++++----
+ drivers/net/hyperv/rndis_filter.c |  4 +++-
+ 3 files changed, 50 insertions(+), 6 deletions(-)
+
+diff --git a/drivers/net/hyperv/hyperv_net.h b/drivers/net/hyperv/hyperv_net.h
+index 8bc4e766589b..faeb74623fbd 100644
+--- a/drivers/net/hyperv/hyperv_net.h
++++ b/drivers/net/hyperv/hyperv_net.h
+@@ -30,6 +30,7 @@
+ /* Fwd declaration */
+ struct hv_netvsc_packet;
++struct ndis_tcp_ip_checksum_info;
+ /* Represent the xfer page packet which contains 1 or more netvsc packet */
+ struct xferpage_packet {
+@@ -117,7 +118,8 @@ int netvsc_send(struct hv_device *device,
+ void netvsc_linkstatus_callback(struct hv_device *device_obj,
+                               unsigned int status);
+ int netvsc_recv_callback(struct hv_device *device_obj,
+-                      struct hv_netvsc_packet *packet);
++                      struct hv_netvsc_packet *packet,
++                      struct ndis_tcp_ip_checksum_info *csum_info);
+ int rndis_filter_open(struct hv_device *dev);
+ int rndis_filter_close(struct hv_device *dev);
+ int rndis_filter_device_add(struct hv_device *dev,
+@@ -776,9 +778,38 @@ struct ndis_offload_params {
+       };
+ };
++struct ndis_tcp_ip_checksum_info {
++      union {
++              struct {
++                      u32 is_ipv4:1;
++                      u32 is_ipv6:1;
++                      u32 tcp_checksum:1;
++                      u32 udp_checksum:1;
++                      u32 ip_header_checksum:1;
++                      u32 reserved:11;
++                      u32 tcp_header_offset:10;
++              } transmit;
++              struct {
++                      u32 tcp_checksum_failed:1;
++                      u32 udp_checksum_failed:1;
++                      u32 ip_checksum_failed:1;
++                      u32 tcp_checksum_succeeded:1;
++                      u32 udp_checksum_succeeded:1;
++                      u32 ip_checksum_succeeded:1;
++                      u32 loopback:1;
++                      u32 tcp_checksum_value_invalid:1;
++                      u32 ip_checksum_value_invalid:1;
++              } receive;
++              u32  value;
++      };
++};
++
+ #define NDIS_VLAN_PPI_SIZE (sizeof(struct rndis_per_packet_info) + \
+               sizeof(struct ndis_pkt_8021q_info))
++#define NDIS_CSUM_PPI_SIZE (sizeof(struct rndis_per_packet_info) + \
++              sizeof(struct ndis_tcp_ip_checksum_info))
++
+ /* Format of Information buffer passed in a SetRequest for the OID */
+ /* OID_GEN_RNDIS_CONFIG_PARAMETER. */
+ struct rndis_config_parameter_info {
+diff --git a/drivers/net/hyperv/netvsc_drv.c b/drivers/net/hyperv/netvsc_drv.c
+index 87293a15e470..7438360b7a02 100644
+--- a/drivers/net/hyperv/netvsc_drv.c
++++ b/drivers/net/hyperv/netvsc_drv.c
+@@ -392,7 +392,8 @@ void netvsc_linkstatus_callback(struct hv_device *device_obj,
+  * "wire" on the specified device.
+  */
+ int netvsc_recv_callback(struct hv_device *device_obj,
+-                              struct hv_netvsc_packet *packet)
++                              struct hv_netvsc_packet *packet,
++                              struct ndis_tcp_ip_checksum_info *csum_info)
+ {
+       struct net_device *net;
+       struct sk_buff *skb;
+@@ -419,7 +420,17 @@ int netvsc_recv_callback(struct hv_device *device_obj,
+               packet->total_data_buflen);
+       skb->protocol = eth_type_trans(skb, net);
+-      skb->ip_summed = CHECKSUM_NONE;
++      if (csum_info) {
++              /* We only look at the IP checksum here.
++               * Should we be dropping the packet if checksum
++               * failed? How do we deal with other checksums - TCP/UDP?
++               */
++              if (csum_info->receive.ip_checksum_succeeded)
++                      skb->ip_summed = CHECKSUM_UNNECESSARY;
++              else
++                      skb->ip_summed = CHECKSUM_NONE;
++      }
++
+       if (packet->vlan_tci & VLAN_TAG_PRESENT)
+               __vlan_hwaccel_put_tag(skb, htons(ETH_P_8021Q),
+                                      packet->vlan_tci);
+@@ -581,8 +592,8 @@ static int netvsc_probe(struct hv_device *dev,
+       net->netdev_ops = &device_ops;
+       /* TODO: Add GSO and Checksum offload */
+-      net->hw_features = NETIF_F_SG;
+-      net->features = NETIF_F_HW_VLAN_CTAG_TX | NETIF_F_SG;
++      net->hw_features = NETIF_F_RXCSUM | NETIF_F_SG;
++      net->features = NETIF_F_HW_VLAN_CTAG_TX | NETIF_F_SG | NETIF_F_RXCSUM;
+       SET_ETHTOOL_OPS(net, &ethtool_ops);
+       SET_NETDEV_DEV(net, &dev->device);
+diff --git a/drivers/net/hyperv/rndis_filter.c b/drivers/net/hyperv/rndis_filter.c
+index 9b02f21097a7..4a37e3db9e32 100644
+--- a/drivers/net/hyperv/rndis_filter.c
++++ b/drivers/net/hyperv/rndis_filter.c
+@@ -370,6 +370,7 @@ static void rndis_filter_receive_data(struct rndis_device *dev,
+       struct rndis_packet *rndis_pkt;
+       u32 data_offset;
+       struct ndis_pkt_8021q_info *vlan;
++      struct ndis_tcp_ip_checksum_info *csum_info;
+       rndis_pkt = &msg->msg.pkt;
+@@ -408,7 +409,8 @@ static void rndis_filter_receive_data(struct rndis_device *dev,
+               pkt->vlan_tci = 0;
+       }
+-      netvsc_recv_callback(dev->net_dev->dev, pkt);
++      csum_info = rndis_get_ppi(rndis_pkt, TCPIP_CHKSUM_PKTINFO);
++      netvsc_recv_callback(dev->net_dev->dev, pkt, csum_info);
+ }
+ int rndis_filter_receive(struct hv_device *dev,
+-- 
+2.4.3
+
diff --git a/src/patches/linux/0008-hyperv-fix-apparent-cut-n-paste-error-in-send-path-t.patch b/src/patches/linux/0008-hyperv-fix-apparent-cut-n-paste-error-in-send-path-t.patch
new file mode 100644 (file)
index 0000000..b774f81
--- /dev/null
@@ -0,0 +1,32 @@
+From 2f18423d7ebf8044a9edaca840be5ae199fb32f6 Mon Sep 17 00:00:00 2001
+From: Dave Jones <davej@redhat.com>
+Date: Mon, 16 Jun 2014 16:59:02 -0400
+Subject: [PATCH 08/11] hyperv: fix apparent cut-n-paste error in send path
+ teardown
+
+c25aaf814a63: "hyperv: Enable sendbuf mechanism on the send path" added
+some teardown code that looks like it was copied from the recieve path
+above, but missed a variable name replacement.
+
+Signed-off-by: Dave Jones <davej@redhat.com>
+Signed-off-by: David S. Miller <davem@davemloft.net>
+---
+ drivers/net/hyperv/netvsc.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/drivers/net/hyperv/netvsc.c b/drivers/net/hyperv/netvsc.c
+index c041f63a6d30..4ed38eaecea8 100644
+--- a/drivers/net/hyperv/netvsc.c
++++ b/drivers/net/hyperv/netvsc.c
+@@ -189,7 +189,7 @@ static int netvsc_destroy_buf(struct netvsc_device *net_device)
+                                  "unable to teardown send buffer's gpadl\n");
+                       return ret;
+               }
+-              net_device->recv_buf_gpadl_handle = 0;
++              net_device->send_buf_gpadl_handle = 0;
+       }
+       if (net_device->send_buf) {
+               /* Free up the receive buffer */
+-- 
+2.4.3
+
diff --git a/src/patches/linux/0009-Drivers-net-hyperv-Enable-send-side-checksum-offload.patch b/src/patches/linux/0009-Drivers-net-hyperv-Enable-send-side-checksum-offload.patch
new file mode 100644 (file)
index 0000000..db42108
--- /dev/null
@@ -0,0 +1,140 @@
+From d2a0be7f4263eb669af84240c5424a72cce4cdb4 Mon Sep 17 00:00:00 2001
+From: KY Srinivasan <kys@microsoft.com>
+Date: Sat, 8 Mar 2014 19:23:17 -0800
+Subject: [PATCH 09/25] Drivers: net: hyperv: Enable send side checksum offload
+
+Enable send side checksum offload.
+
+Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
+Reviewed-by: Haiyang Zhang <haiyangz@microsoft.com>
+Signed-off-by: David S. Miller <davem@davemloft.net>
+---
+ drivers/net/hyperv/hyperv_net.h | 10 ++++++
+ drivers/net/hyperv/netvsc_drv.c | 69 +++++++++++++++++++++++++++++++++++++++--
+ 2 files changed, 77 insertions(+), 2 deletions(-)
+
+diff --git a/drivers/net/hyperv/hyperv_net.h b/drivers/net/hyperv/hyperv_net.h
+index faeb74623fbd..4cf238234321 100644
+--- a/drivers/net/hyperv/hyperv_net.h
++++ b/drivers/net/hyperv/hyperv_net.h
+@@ -1035,6 +1035,16 @@ struct rndis_message {
+ #define NDIS_PACKET_TYPE_FUNCTIONAL   0x00000400
+ #define NDIS_PACKET_TYPE_MAC_FRAME    0x00000800
++#define INFO_IPV4       2
++#define INFO_IPV6       4
++#define INFO_TCP        2
++#define INFO_UDP        4
++
++#define TRANSPORT_INFO_NOT_IP   0
++#define TRANSPORT_INFO_IPV4_TCP ((INFO_IPV4 << 16) | INFO_TCP)
++#define TRANSPORT_INFO_IPV4_UDP ((INFO_IPV4 << 16) | INFO_UDP)
++#define TRANSPORT_INFO_IPV6_TCP ((INFO_IPV6 << 16) | INFO_TCP)
++#define TRANSPORT_INFO_IPV6_UDP ((INFO_IPV6 << 16) | INFO_UDP)
+ #endif /* _HYPERV_NET_H */
+diff --git a/drivers/net/hyperv/netvsc_drv.c b/drivers/net/hyperv/netvsc_drv.c
+index 7438360b7a02..2fab69ac61ef 100644
+--- a/drivers/net/hyperv/netvsc_drv.c
++++ b/drivers/net/hyperv/netvsc_drv.c
+@@ -257,6 +257,35 @@ static int netvsc_get_slots(struct sk_buff *skb)
+       return slots + frag_slots;
+ }
++static u32 get_net_transport_info(struct sk_buff *skb, u32 *trans_off)
++{
++      u32 ret_val = TRANSPORT_INFO_NOT_IP;
++
++      if ((eth_hdr(skb)->h_proto != htons(ETH_P_IP)) &&
++              (eth_hdr(skb)->h_proto != htons(ETH_P_IPV6))) {
++              goto not_ip;
++      }
++
++      *trans_off = skb_transport_offset(skb);
++
++      if ((eth_hdr(skb)->h_proto == htons(ETH_P_IP))) {
++              struct iphdr *iphdr = ip_hdr(skb);
++
++              if (iphdr->protocol == IPPROTO_TCP)
++                      ret_val = TRANSPORT_INFO_IPV4_TCP;
++              else if (iphdr->protocol == IPPROTO_UDP)
++                      ret_val = TRANSPORT_INFO_IPV4_UDP;
++      } else {
++              if (ipv6_hdr(skb)->nexthdr == IPPROTO_TCP)
++                      ret_val = TRANSPORT_INFO_IPV6_TCP;
++              else if (ipv6_hdr(skb)->nexthdr == IPPROTO_UDP)
++                      ret_val = TRANSPORT_INFO_IPV6_UDP;
++      }
++
++not_ip:
++      return ret_val;
++}
++
+ static int netvsc_start_xmit(struct sk_buff *skb, struct net_device *net)
+ {
+       struct net_device_context *net_device_ctx = netdev_priv(net);
+@@ -269,6 +298,10 @@ static int netvsc_start_xmit(struct sk_buff *skb, struct net_device *net)
+       u32 rndis_msg_size;
+       bool isvlan;
+       struct rndis_per_packet_info *ppi;
++      struct ndis_tcp_ip_checksum_info *csum_info;
++      int  hdr_offset;
++      u32 net_trans_info;
++
+       /* We will atmost need two pages to describe the rndis
+        * header. We can only transmit MAX_PAGE_BUFFER_COUNT number
+@@ -336,6 +369,37 @@ static int netvsc_start_xmit(struct sk_buff *skb, struct net_device *net)
+                               VLAN_PRIO_SHIFT;
+       }
++      net_trans_info = get_net_transport_info(skb, &hdr_offset);
++      if (net_trans_info == TRANSPORT_INFO_NOT_IP)
++              goto do_send;
++
++      /*
++       * Setup the sendside checksum offload only if this is not a
++       * GSO packet.
++       */
++      if (skb_is_gso(skb))
++              goto do_send;
++
++      rndis_msg_size += NDIS_CSUM_PPI_SIZE;
++      ppi = init_ppi_data(rndis_msg, NDIS_CSUM_PPI_SIZE,
++                          TCPIP_CHKSUM_PKTINFO);
++
++      csum_info = (struct ndis_tcp_ip_checksum_info *)((void *)ppi +
++                      ppi->ppi_offset);
++
++      if (net_trans_info & (INFO_IPV4 << 16))
++              csum_info->transmit.is_ipv4 = 1;
++      else
++              csum_info->transmit.is_ipv6 = 1;
++
++      if (net_trans_info & INFO_TCP) {
++              csum_info->transmit.tcp_checksum = 1;
++              csum_info->transmit.tcp_header_offset = hdr_offset;
++      } else if (net_trans_info & INFO_UDP) {
++              csum_info->transmit.udp_checksum = 1;
++      }
++
++do_send:
+       /* Start filling in the page buffers with the rndis hdr */
+       rndis_msg->msg_len += rndis_msg_size;
+       packet->page_buf_cnt = init_page_array(rndis_msg, rndis_msg_size,
+@@ -592,8 +656,9 @@ static int netvsc_probe(struct hv_device *dev,
+       net->netdev_ops = &device_ops;
+       /* TODO: Add GSO and Checksum offload */
+-      net->hw_features = NETIF_F_RXCSUM | NETIF_F_SG;
+-      net->features = NETIF_F_HW_VLAN_CTAG_TX | NETIF_F_SG | NETIF_F_RXCSUM;
++      net->hw_features = NETIF_F_RXCSUM | NETIF_F_SG | NETIF_F_IP_CSUM;
++      net->features = NETIF_F_HW_VLAN_CTAG_TX | NETIF_F_SG | NETIF_F_RXCSUM |
++                      NETIF_F_IP_CSUM;
+       SET_ETHTOOL_OPS(net, &ethtool_ops);
+       SET_NETDEV_DEV(net, &dev->device);
+-- 
+2.4.3
+
diff --git a/src/patches/linux/0009-hyperv-Fix-error-return-code-in-netvsc_init_buf.patch b/src/patches/linux/0009-hyperv-Fix-error-return-code-in-netvsc_init_buf.patch
new file mode 100644 (file)
index 0000000..fcae531
--- /dev/null
@@ -0,0 +1,34 @@
+From dd1d3f8f9920926aa426589e542eed6bf58b7354 Mon Sep 17 00:00:00 2001
+From: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
+Date: Wed, 23 Jul 2014 09:00:35 +0800
+Subject: [PATCH 09/11] hyperv: Fix error return code in netvsc_init_buf()
+
+Fix to return -ENOMEM from the kalloc error handling
+case instead of 0.
+
+Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
+Reviewed-by: Haiyang Zhang <haiyangz@microsoft.com>
+Signed-off-by: David S. Miller <davem@davemloft.net>
+---
+ drivers/net/hyperv/netvsc.c | 4 +++-
+ 1 file changed, 3 insertions(+), 1 deletion(-)
+
+diff --git a/drivers/net/hyperv/netvsc.c b/drivers/net/hyperv/netvsc.c
+index 4ed38eaecea8..d97d5f39a04e 100644
+--- a/drivers/net/hyperv/netvsc.c
++++ b/drivers/net/hyperv/netvsc.c
+@@ -378,8 +378,10 @@ static int netvsc_init_buf(struct hv_device *device)
+       net_device->send_section_map =
+               kzalloc(net_device->map_words * sizeof(ulong), GFP_KERNEL);
+-      if (net_device->send_section_map == NULL)
++      if (net_device->send_section_map == NULL) {
++              ret = -ENOMEM;
+               goto cleanup;
++      }
+       goto exit;
+-- 
+2.4.3
+
diff --git a/src/patches/linux/0010-Drivers-net-hyperv-Enable-large-send-offload.patch b/src/patches/linux/0010-Drivers-net-hyperv-Enable-large-send-offload.patch
new file mode 100644 (file)
index 0000000..36be2a8
--- /dev/null
@@ -0,0 +1,153 @@
+From a4ec4f58017b456281ee17c35fb82dfe4eab2193 Mon Sep 17 00:00:00 2001
+From: KY Srinivasan <kys@microsoft.com>
+Date: Sat, 8 Mar 2014 19:23:18 -0800
+Subject: [PATCH 10/25] Drivers: net: hyperv: Enable large send offload
+
+Enable segmentation offload.
+
+Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
+Reviewed-by: Haiyang Zhang <haiyangz@microsoft.com>
+Signed-off-by: David S. Miller <davem@davemloft.net>
+---
+ drivers/net/hyperv/hyperv_net.h | 40 ++++++++++++++++++++++++++++++++++++++++
+ drivers/net/hyperv/netvsc_drv.c | 38 ++++++++++++++++++++++++++++++++++----
+ 2 files changed, 74 insertions(+), 4 deletions(-)
+
+diff --git a/drivers/net/hyperv/hyperv_net.h b/drivers/net/hyperv/hyperv_net.h
+index 4cf238234321..7d06b4959383 100644
+--- a/drivers/net/hyperv/hyperv_net.h
++++ b/drivers/net/hyperv/hyperv_net.h
+@@ -742,6 +742,10 @@ struct ndis_oject_header {
+ #define NDIS_OFFLOAD_PARAMETERS_RX_ENABLED_TX_DISABLED 3
+ #define NDIS_OFFLOAD_PARAMETERS_TX_RX_ENABLED 4
++#define NDIS_TCP_LARGE_SEND_OFFLOAD_V2_TYPE   1
++#define NDIS_TCP_LARGE_SEND_OFFLOAD_IPV4      0
++#define NDIS_TCP_LARGE_SEND_OFFLOAD_IPV6      1
++
+ /*
+  * New offload OIDs for NDIS 6
+  */
+@@ -804,12 +808,48 @@ struct ndis_tcp_ip_checksum_info {
+       };
+ };
++struct ndis_tcp_lso_info {
++      union {
++              struct {
++                      u32 unused:30;
++                      u32 type:1;
++                      u32 reserved2:1;
++              } transmit;
++              struct {
++                      u32 mss:20;
++                      u32 tcp_header_offset:10;
++                      u32 type:1;
++                      u32 reserved2:1;
++              } lso_v1_transmit;
++              struct {
++                      u32 tcp_payload:30;
++                      u32 type:1;
++                      u32 reserved2:1;
++              } lso_v1_transmit_complete;
++              struct {
++                      u32 mss:20;
++                      u32 tcp_header_offset:10;
++                      u32 type:1;
++                      u32 ip_version:1;
++              } lso_v2_transmit;
++              struct {
++                      u32 reserved:30;
++                      u32 type:1;
++                      u32 reserved2:1;
++              } lso_v2_transmit_complete;
++              u32  value;
++      };
++};
++
+ #define NDIS_VLAN_PPI_SIZE (sizeof(struct rndis_per_packet_info) + \
+               sizeof(struct ndis_pkt_8021q_info))
+ #define NDIS_CSUM_PPI_SIZE (sizeof(struct rndis_per_packet_info) + \
+               sizeof(struct ndis_tcp_ip_checksum_info))
++#define NDIS_LSO_PPI_SIZE (sizeof(struct rndis_per_packet_info) + \
++              sizeof(struct ndis_tcp_lso_info))
++
+ /* Format of Information buffer passed in a SetRequest for the OID */
+ /* OID_GEN_RNDIS_CONFIG_PARAMETER. */
+ struct rndis_config_parameter_info {
+diff --git a/drivers/net/hyperv/netvsc_drv.c b/drivers/net/hyperv/netvsc_drv.c
+index 2fab69ac61ef..5baa1fa7e692 100644
+--- a/drivers/net/hyperv/netvsc_drv.c
++++ b/drivers/net/hyperv/netvsc_drv.c
+@@ -299,6 +299,7 @@ static int netvsc_start_xmit(struct sk_buff *skb, struct net_device *net)
+       bool isvlan;
+       struct rndis_per_packet_info *ppi;
+       struct ndis_tcp_ip_checksum_info *csum_info;
++      struct ndis_tcp_lso_info *lso_info;
+       int  hdr_offset;
+       u32 net_trans_info;
+@@ -378,7 +379,7 @@ static int netvsc_start_xmit(struct sk_buff *skb, struct net_device *net)
+        * GSO packet.
+        */
+       if (skb_is_gso(skb))
+-              goto do_send;
++              goto do_lso;
+       rndis_msg_size += NDIS_CSUM_PPI_SIZE;
+       ppi = init_ppi_data(rndis_msg, NDIS_CSUM_PPI_SIZE,
+@@ -398,6 +399,35 @@ static int netvsc_start_xmit(struct sk_buff *skb, struct net_device *net)
+       } else if (net_trans_info & INFO_UDP) {
+               csum_info->transmit.udp_checksum = 1;
+       }
++      goto do_send;
++
++do_lso:
++      rndis_msg_size += NDIS_LSO_PPI_SIZE;
++      ppi = init_ppi_data(rndis_msg, NDIS_LSO_PPI_SIZE,
++                          TCP_LARGESEND_PKTINFO);
++
++      lso_info = (struct ndis_tcp_lso_info *)((void *)ppi +
++                      ppi->ppi_offset);
++
++      lso_info->lso_v2_transmit.type = NDIS_TCP_LARGE_SEND_OFFLOAD_V2_TYPE;
++      if (net_trans_info & (INFO_IPV4 << 16)) {
++              lso_info->lso_v2_transmit.ip_version =
++                      NDIS_TCP_LARGE_SEND_OFFLOAD_IPV4;
++              ip_hdr(skb)->tot_len = 0;
++              ip_hdr(skb)->check = 0;
++              tcp_hdr(skb)->check =
++              ~csum_tcpudp_magic(ip_hdr(skb)->saddr,
++                                 ip_hdr(skb)->daddr, 0, IPPROTO_TCP, 0);
++      } else {
++              lso_info->lso_v2_transmit.ip_version =
++                      NDIS_TCP_LARGE_SEND_OFFLOAD_IPV6;
++              ipv6_hdr(skb)->payload_len = 0;
++              tcp_hdr(skb)->check =
++              ~csum_ipv6_magic(&ipv6_hdr(skb)->saddr,
++                              &ipv6_hdr(skb)->daddr, 0, IPPROTO_TCP, 0);
++      }
++      lso_info->lso_v2_transmit.tcp_header_offset = hdr_offset;
++      lso_info->lso_v2_transmit.mss = skb_shinfo(skb)->gso_size;
+ do_send:
+       /* Start filling in the page buffers with the rndis hdr */
+@@ -655,10 +685,10 @@ static int netvsc_probe(struct hv_device *dev,
+       net->netdev_ops = &device_ops;
+-      /* TODO: Add GSO and Checksum offload */
+-      net->hw_features = NETIF_F_RXCSUM | NETIF_F_SG | NETIF_F_IP_CSUM;
++      net->hw_features = NETIF_F_RXCSUM | NETIF_F_SG | NETIF_F_IP_CSUM |
++                              NETIF_F_TSO;
+       net->features = NETIF_F_HW_VLAN_CTAG_TX | NETIF_F_SG | NETIF_F_RXCSUM |
+-                      NETIF_F_IP_CSUM;
++                      NETIF_F_IP_CSUM | NETIF_F_TSO;
+       SET_ETHTOOL_OPS(net, &ethtool_ops);
+       SET_NETDEV_DEV(net, &dev->device);
+-- 
+2.4.3
+
diff --git a/src/patches/linux/0010-hyperv-Fix-a-bug-in-netvsc_start_xmit.patch b/src/patches/linux/0010-hyperv-Fix-a-bug-in-netvsc_start_xmit.patch
new file mode 100644 (file)
index 0000000..5e08805
--- /dev/null
@@ -0,0 +1,47 @@
+From b3e774263908a834c1c0d5abf3a7658280e42fc7 Mon Sep 17 00:00:00 2001
+From: KY Srinivasan <kys@microsoft.com>
+Date: Sun, 28 Sep 2014 22:16:43 -0700
+Subject: [PATCH 10/11] hyperv: Fix a bug in netvsc_start_xmit()
+
+[ Upstream commit dedb845ded56ded1c62f5398a94ffa8615d4592d ]
+
+After the packet is successfully sent, we should not touch the skb
+as it may have been freed. This patch is based on the work done by
+Long Li <longli@microsoft.com>.
+
+In this version of the patch I have fixed issues pointed out by David.
+David, please queue this up for stable.
+
+Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
+Tested-by: Long Li <longli@microsoft.com>
+Tested-by: Sitsofe Wheeler <sitsofe@yahoo.com>
+Signed-off-by: David S. Miller <davem@davemloft.net>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ drivers/net/hyperv/netvsc_drv.c | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+diff --git a/drivers/net/hyperv/netvsc_drv.c b/drivers/net/hyperv/netvsc_drv.c
+index 4fd71b75e666..f15297201777 100644
+--- a/drivers/net/hyperv/netvsc_drv.c
++++ b/drivers/net/hyperv/netvsc_drv.c
+@@ -387,6 +387,7 @@ static int netvsc_start_xmit(struct sk_buff *skb, struct net_device *net)
+       int  hdr_offset;
+       u32 net_trans_info;
+       u32 hash;
++      u32 skb_length = skb->len;
+       /* We will atmost need two pages to describe the rndis
+@@ -562,7 +563,7 @@ do_send:
+ drop:
+       if (ret == 0) {
+-              net->stats.tx_bytes += skb->len;
++              net->stats.tx_bytes += skb_length;
+               net->stats.tx_packets++;
+       } else {
+               kfree(packet);
+-- 
+2.4.3
+
similarity index 81%
rename from src/patches/linux-3.14.x-hyperv-2008-fix.patch
rename to src/patches/linux/0011-hyperv-Change-the-receive-buffer-size-for-legacy-hos.patch
index e538e08e5cb7a2286e3ef53f3e321889abdb281a..e3ee8cbc9915be01daa58353646e8b542a92a537 100644 (file)
@@ -1,16 +1,20 @@
-From 99d3016de4f2a29635f5382b0e9bd0e5f2151487 Mon Sep 17 00:00:00 2001
+From 56b3f72d3fed7f9b8d17dcf5d81455fa1b4327d7 Mon Sep 17 00:00:00 2001
 From: Haiyang Zhang <haiyangz@microsoft.com>
 Date: Sun, 9 Mar 2014 16:10:59 -0700
-Subject: hyperv: Change the receive buffer size for legacy hosts
+Subject: [PATCH 11/25] hyperv: Change the receive buffer size for legacy hosts
 
 Due to a bug in the Hyper-V host verion 2008R2, we need to use a slightly smaller
 receive buffer size, otherwise the buffer will not be accepted by the legacy hosts.
 
 Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
 Signed-off-by: David S. Miller <davem@davemloft.net>
+---
+ drivers/net/hyperv/hyperv_net.h | 1 +
+ drivers/net/hyperv/netvsc.c     | 6 +++++-
+ 2 files changed, 6 insertions(+), 1 deletion(-)
 
 diff --git a/drivers/net/hyperv/hyperv_net.h b/drivers/net/hyperv/hyperv_net.h
-index 7d06b49..13010b4 100644
+index 7d06b4959383..13010b4dae5b 100644
 --- a/drivers/net/hyperv/hyperv_net.h
 +++ b/drivers/net/hyperv/hyperv_net.h
 @@ -513,6 +513,7 @@ struct nvsp_message {
@@ -22,7 +26,7 @@ index 7d06b49..13010b4 100644
  #define NETVSC_RECEIVE_BUFFER_ID              0xcafe
  
 diff --git a/drivers/net/hyperv/netvsc.c b/drivers/net/hyperv/netvsc.c
-index 1a0280d..daddea2 100644
+index 1a0280dcba7e..daddea2654ce 100644
 --- a/drivers/net/hyperv/netvsc.c
 +++ b/drivers/net/hyperv/netvsc.c
 @@ -365,6 +365,11 @@ static int netvsc_connect_vsp(struct hv_device *device)
@@ -46,5 +50,5 @@ index 1a0280d..daddea2 100644
  
        INIT_LIST_HEAD(&net_device->recv_pkt_list);
 -- 
-cgit v0.10.2
+2.4.3
 
diff --git a/src/patches/linux/0011-hyperv-Fix-a-bug-in-netvsc_send.patch b/src/patches/linux/0011-hyperv-Fix-a-bug-in-netvsc_send.patch
new file mode 100644 (file)
index 0000000..00f9c5d
--- /dev/null
@@ -0,0 +1,68 @@
+From 26875bba869bd91a1d8fef9229a56a1e6d9fef2b Mon Sep 17 00:00:00 2001
+From: KY Srinivasan <kys@microsoft.com>
+Date: Sun, 5 Oct 2014 10:42:51 -0700
+Subject: [PATCH 11/11] hyperv: Fix a bug in netvsc_send()
+
+[ Upstream commit 3a67c9ccad926a168d8b7891537a452018368a5b ]
+
+After the packet is successfully sent, we should not touch the packet
+as it may have been freed. This patch is based on the work done by
+Long Li <longli@microsoft.com>.
+
+David, please queue this up for stable.
+
+Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
+Reported-by: Sitsofe Wheeler <sitsofe@yahoo.com>
+Signed-off-by: David S. Miller <davem@davemloft.net>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ drivers/net/hyperv/netvsc.c | 15 ++++++++-------
+ 1 file changed, 8 insertions(+), 7 deletions(-)
+
+diff --git a/drivers/net/hyperv/netvsc.c b/drivers/net/hyperv/netvsc.c
+index d97d5f39a04e..7edf976ecfa0 100644
+--- a/drivers/net/hyperv/netvsc.c
++++ b/drivers/net/hyperv/netvsc.c
+@@ -708,6 +708,7 @@ int netvsc_send(struct hv_device *device,
+       unsigned int section_index = NETVSC_INVALID_INDEX;
+       u32 msg_size = 0;
+       struct sk_buff *skb;
++      u16 q_idx = packet->q_idx;
+       net_device = get_outbound_net_device(device);
+@@ -772,24 +773,24 @@ int netvsc_send(struct hv_device *device,
+       if (ret == 0) {
+               atomic_inc(&net_device->num_outstanding_sends);
+-              atomic_inc(&net_device->queue_sends[packet->q_idx]);
++              atomic_inc(&net_device->queue_sends[q_idx]);
+               if (hv_ringbuf_avail_percent(&out_channel->outbound) <
+                       RING_AVAIL_PERCENT_LOWATER) {
+                       netif_tx_stop_queue(netdev_get_tx_queue(
+-                                          ndev, packet->q_idx));
++                                          ndev, q_idx));
+                       if (atomic_read(&net_device->
+-                              queue_sends[packet->q_idx]) < 1)
++                              queue_sends[q_idx]) < 1)
+                               netif_tx_wake_queue(netdev_get_tx_queue(
+-                                                  ndev, packet->q_idx));
++                                                  ndev, q_idx));
+               }
+       } else if (ret == -EAGAIN) {
+               netif_tx_stop_queue(netdev_get_tx_queue(
+-                                  ndev, packet->q_idx));
+-              if (atomic_read(&net_device->queue_sends[packet->q_idx]) < 1) {
++                                  ndev, q_idx));
++              if (atomic_read(&net_device->queue_sends[q_idx]) < 1) {
+                       netif_tx_wake_queue(netdev_get_tx_queue(
+-                                          ndev, packet->q_idx));
++                                          ndev, q_idx));
+                       ret = -ENOSPC;
+               }
+       } else {
+-- 
+2.4.3
+
diff --git a/src/patches/linux/0012-Drivers-net-hyperv-Allocate-memory-for-all-possible-.patch b/src/patches/linux/0012-Drivers-net-hyperv-Allocate-memory-for-all-possible-.patch
new file mode 100644 (file)
index 0000000..c626bb0
--- /dev/null
@@ -0,0 +1,34 @@
+From e0f6906eb7e5b395370da9499189d13b59020382 Mon Sep 17 00:00:00 2001
+From: KY Srinivasan <kys@microsoft.com>
+Date: Wed, 9 Apr 2014 15:00:45 -0700
+Subject: [PATCH 12/25] Drivers: net: hyperv: Allocate memory for all possible
+ per-pecket information
+
+An outgoing packet can potentially need per-packet information for
+all the offloads and VLAN tagging. Fix this issue.
+
+Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
+Reviewed-by: Haiyang Zhang <haiyangz@microsoft.com>
+Signed-off-by: David S. Miller <davem@davemloft.net>
+---
+ drivers/net/hyperv/netvsc_drv.c | 4 +++-
+ 1 file changed, 3 insertions(+), 1 deletion(-)
+
+diff --git a/drivers/net/hyperv/netvsc_drv.c b/drivers/net/hyperv/netvsc_drv.c
+index 5baa1fa7e692..c76c85176644 100644
+--- a/drivers/net/hyperv/netvsc_drv.c
++++ b/drivers/net/hyperv/netvsc_drv.c
+@@ -320,7 +320,9 @@ static int netvsc_start_xmit(struct sk_buff *skb, struct net_device *net)
+       packet = kzalloc(sizeof(struct hv_netvsc_packet) +
+                        (num_data_pgs * sizeof(struct hv_page_buffer)) +
+                        sizeof(struct rndis_message) +
+-                       NDIS_VLAN_PPI_SIZE, GFP_ATOMIC);
++                       NDIS_VLAN_PPI_SIZE +
++                       NDIS_CSUM_PPI_SIZE +
++                       NDIS_LSO_PPI_SIZE, GFP_ATOMIC);
+       if (!packet) {
+               /* out of memory, drop packet */
+               netdev_err(net, "unable to allocate hv_netvsc_packet\n");
+-- 
+2.4.3
+
diff --git a/src/patches/linux/0013-Drivers-net-hyperv-Negotiate-suitable-ndis-version-f.patch b/src/patches/linux/0013-Drivers-net-hyperv-Negotiate-suitable-ndis-version-f.patch
new file mode 100644 (file)
index 0000000..7044c52
--- /dev/null
@@ -0,0 +1,32 @@
+From 8a7882bada78e7d7355aafc0ca3c5696d25eb443 Mon Sep 17 00:00:00 2001
+From: KY Srinivasan <kys@microsoft.com>
+Date: Wed, 9 Apr 2014 15:00:46 -0700
+Subject: [PATCH 13/25] Drivers: net: hyperv: Negotiate suitable ndis version
+ for offload support
+
+Ws2008R2 supports ndis_version 6.1 and 6.1 is the minimal version required
+for various offloads. Negotiate ndis_version 6.1 when on ws2008r2.
+
+Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
+Reviewed-by: Haiyang Zhang <haiyangz@microsoft.com>
+Signed-off-by: David S. Miller <davem@davemloft.net>
+---
+ drivers/net/hyperv/netvsc.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/drivers/net/hyperv/netvsc.c b/drivers/net/hyperv/netvsc.c
+index daddea2654ce..f7629ecefa84 100644
+--- a/drivers/net/hyperv/netvsc.c
++++ b/drivers/net/hyperv/netvsc.c
+@@ -344,7 +344,7 @@ static int netvsc_connect_vsp(struct hv_device *device)
+       memset(init_packet, 0, sizeof(struct nvsp_message));
+       if (net_device->nvsp_version <= NVSP_PROTOCOL_VERSION_4)
+-              ndis_version = 0x00050001;
++              ndis_version = 0x00060001;
+       else
+               ndis_version = 0x0006001e;
+-- 
+2.4.3
+
diff --git a/src/patches/linux/0014-Drivers-net-hyperv-Address-UDP-checksum-issues.patch b/src/patches/linux/0014-Drivers-net-hyperv-Address-UDP-checksum-issues.patch
new file mode 100644 (file)
index 0000000..eaf343e
--- /dev/null
@@ -0,0 +1,111 @@
+From b822ee7a17efd1bc8c7584da5d0a2c042e9ca5b6 Mon Sep 17 00:00:00 2001
+From: KY Srinivasan <kys@microsoft.com>
+Date: Wed, 9 Apr 2014 15:00:47 -0700
+Subject: [PATCH 14/25] Drivers: net: hyperv: Address UDP checksum issues
+
+ws2008r2 does not support UDP checksum offload. Thus, we cannnot turn on
+UDP offload in the host. Also, on ws2012 and ws2012 r2, there appear to be
+an issue with UDP checksum offload.
+Fix this issue by computing the UDP checksum in the Hyper-V driver.
+
+Based on Dave Miller's comments, in this version, I have COWed the skb
+before modifying the UDP header (the checksum field).
+
+Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
+Reviewed-by: Haiyang Zhang <haiyangz@microsoft.com>
+Signed-off-by: David S. Miller <davem@davemloft.net>
+---
+ drivers/net/hyperv/hyperv_net.h   |  1 +
+ drivers/net/hyperv/netvsc_drv.c   | 26 +++++++++++++++++++++++++-
+ drivers/net/hyperv/rndis_filter.c | 12 +++++++++++-
+ 3 files changed, 37 insertions(+), 2 deletions(-)
+
+diff --git a/drivers/net/hyperv/hyperv_net.h b/drivers/net/hyperv/hyperv_net.h
+index 13010b4dae5b..d18f711d0b0c 100644
+--- a/drivers/net/hyperv/hyperv_net.h
++++ b/drivers/net/hyperv/hyperv_net.h
+@@ -747,6 +747,7 @@ struct ndis_oject_header {
+ #define NDIS_TCP_LARGE_SEND_OFFLOAD_IPV4      0
+ #define NDIS_TCP_LARGE_SEND_OFFLOAD_IPV6      1
++#define VERSION_4_OFFLOAD_SIZE                        22
+ /*
+  * New offload OIDs for NDIS 6
+  */
+diff --git a/drivers/net/hyperv/netvsc_drv.c b/drivers/net/hyperv/netvsc_drv.c
+index c76c85176644..0d898876689e 100644
+--- a/drivers/net/hyperv/netvsc_drv.c
++++ b/drivers/net/hyperv/netvsc_drv.c
+@@ -399,7 +399,30 @@ static int netvsc_start_xmit(struct sk_buff *skb, struct net_device *net)
+               csum_info->transmit.tcp_checksum = 1;
+               csum_info->transmit.tcp_header_offset = hdr_offset;
+       } else if (net_trans_info & INFO_UDP) {
+-              csum_info->transmit.udp_checksum = 1;
++              /* UDP checksum offload is not supported on ws2008r2.
++               * Furthermore, on ws2012 and ws2012r2, there are some
++               * issues with udp checksum offload from Linux guests.
++               * (these are host issues).
++               * For now compute the checksum here.
++               */
++              struct udphdr *uh;
++              u16 udp_len;
++
++              ret = skb_cow_head(skb, 0);
++              if (ret)
++                      goto drop;
++
++              uh = udp_hdr(skb);
++              udp_len = ntohs(uh->len);
++              uh->check = 0;
++              uh->check = csum_tcpudp_magic(ip_hdr(skb)->saddr,
++                                            ip_hdr(skb)->daddr,
++                                            udp_len, IPPROTO_UDP,
++                                            csum_partial(uh, udp_len, 0));
++              if (uh->check == 0)
++                      uh->check = CSUM_MANGLED_0;
++
++              csum_info->transmit.udp_checksum = 0;
+       }
+       goto do_send;
+@@ -439,6 +462,7 @@ do_send:
+       ret = netvsc_send(net_device_ctx->device_ctx, packet);
++drop:
+       if (ret == 0) {
+               net->stats.tx_bytes += skb_length;
+               net->stats.tx_packets++;
+diff --git a/drivers/net/hyperv/rndis_filter.c b/drivers/net/hyperv/rndis_filter.c
+index 4a37e3db9e32..143a98caf618 100644
+--- a/drivers/net/hyperv/rndis_filter.c
++++ b/drivers/net/hyperv/rndis_filter.c
+@@ -641,6 +641,16 @@ int rndis_filter_set_offload_params(struct hv_device *hdev,
+       struct rndis_set_complete *set_complete;
+       u32 extlen = sizeof(struct ndis_offload_params);
+       int ret, t;
++      u32 vsp_version = nvdev->nvsp_version;
++
++      if (vsp_version <= NVSP_PROTOCOL_VERSION_4) {
++              extlen = VERSION_4_OFFLOAD_SIZE;
++              /* On NVSP_PROTOCOL_VERSION_4 and below, we do not support
++               * UDP checksum offload.
++               */
++              req_offloads->udp_ip_v4_csum = 0;
++              req_offloads->udp_ip_v6_csum = 0;
++      }
+       request = get_rndis_request(rdev, RNDIS_MSG_SET,
+               RNDIS_MESSAGE_SIZE(struct rndis_set_request) + extlen);
+@@ -674,7 +684,7 @@ int rndis_filter_set_offload_params(struct hv_device *hdev,
+       } else {
+               set_complete = &request->response_msg.msg.set_complete;
+               if (set_complete->status != RNDIS_STATUS_SUCCESS) {
+-                      netdev_err(ndev, "Fail to set MAC on host side:0x%x\n",
++                      netdev_err(ndev, "Fail to set offload on host side:0x%x\n",
+                                  set_complete->status);
+                       ret = -EINVAL;
+               }
+-- 
+2.4.3
+
diff --git a/src/patches/linux/0015-hyperv-Properly-handle-checksum-offload.patch b/src/patches/linux/0015-hyperv-Properly-handle-checksum-offload.patch
new file mode 100644 (file)
index 0000000..0760833
--- /dev/null
@@ -0,0 +1,42 @@
+From 540360773bad2b81f14c38ca92b62797fa32cbc6 Mon Sep 17 00:00:00 2001
+From: KY Srinivasan <kys@microsoft.com>
+Date: Wed, 30 Apr 2014 11:58:25 -0700
+Subject: [PATCH 15/25] hyperv: Properly handle checksum offload
+
+Do checksum offload only if the client of the driver wants checksum to be
+offloaded.
+
+In V1 version of this patch, I  addressed comments from
+Stephen Hemminger <stephen@networkplumber.org> and
+Eric Dumazet <eric.dumazet@gmail.com>.
+
+In this version of the patch I have addressed comments from
+David Miller.
+
+This patch fixes a bug that is exposed in gateway scenarios.
+
+Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
+Reviewed-by: Haiyang Zhang <haiyangz@microsoft.com>
+Signed-off-by: David S. Miller <davem@davemloft.net>
+---
+ drivers/net/hyperv/netvsc_drv.c | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+diff --git a/drivers/net/hyperv/netvsc_drv.c b/drivers/net/hyperv/netvsc_drv.c
+index 0d898876689e..ce6d870dd7ae 100644
+--- a/drivers/net/hyperv/netvsc_drv.c
++++ b/drivers/net/hyperv/netvsc_drv.c
+@@ -383,6 +383,10 @@ static int netvsc_start_xmit(struct sk_buff *skb, struct net_device *net)
+       if (skb_is_gso(skb))
+               goto do_lso;
++      if ((skb->ip_summed == CHECKSUM_NONE) ||
++          (skb->ip_summed == CHECKSUM_UNNECESSARY))
++              goto do_send;
++
+       rndis_msg_size += NDIS_CSUM_PPI_SIZE;
+       ppi = init_ppi_data(rndis_msg, NDIS_CSUM_PPI_SIZE,
+                           TCPIP_CHKSUM_PKTINFO);
+-- 
+2.4.3
+
diff --git a/src/patches/linux/0016-hyperv-Add-support-for-virtual-Receive-Side-Scaling-.patch b/src/patches/linux/0016-hyperv-Add-support-for-virtual-Receive-Side-Scaling-.patch
new file mode 100644 (file)
index 0000000..d01a428
--- /dev/null
@@ -0,0 +1,917 @@
+From 44559a96c6864eb6e95db0ae896c621b82e605f3 Mon Sep 17 00:00:00 2001
+From: Haiyang Zhang <haiyangz@microsoft.com>
+Date: Mon, 21 Apr 2014 10:20:28 -0700
+Subject: [PATCH 16/25] hyperv: Add support for virtual Receive Side Scaling
+ (vRSS)
+
+This feature allows multiple channels to be used by each virtual NIC.
+It is available on Hyper-V host 2012 R2.
+
+Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
+Reviewed-by: K. Y. Srinivasan <kys@microsoft.com>
+Signed-off-by: David S. Miller <davem@davemloft.net>
+---
+ drivers/net/hyperv/hyperv_net.h   | 110 +++++++++++++++++++++-
+ drivers/net/hyperv/netvsc.c       | 136 +++++++++++++++++++++------
+ drivers/net/hyperv/netvsc_drv.c   | 103 ++++++++++++++++++++-
+ drivers/net/hyperv/rndis_filter.c | 189 +++++++++++++++++++++++++++++++++++++-
+ 4 files changed, 504 insertions(+), 34 deletions(-)
+
+diff --git a/drivers/net/hyperv/hyperv_net.h b/drivers/net/hyperv/hyperv_net.h
+index d18f711d0b0c..57eb3f906d64 100644
+--- a/drivers/net/hyperv/hyperv_net.h
++++ b/drivers/net/hyperv/hyperv_net.h
+@@ -28,6 +28,96 @@
+ #include <linux/hyperv.h>
+ #include <linux/rndis.h>
++/* RSS related */
++#define OID_GEN_RECEIVE_SCALE_CAPABILITIES 0x00010203  /* query only */
++#define OID_GEN_RECEIVE_SCALE_PARAMETERS 0x00010204  /* query and set */
++
++#define NDIS_OBJECT_TYPE_RSS_CAPABILITIES 0x88
++#define NDIS_OBJECT_TYPE_RSS_PARAMETERS 0x89
++
++#define NDIS_RECEIVE_SCALE_CAPABILITIES_REVISION_2 2
++#define NDIS_RECEIVE_SCALE_PARAMETERS_REVISION_2 2
++
++struct ndis_obj_header {
++      u8 type;
++      u8 rev;
++      u16 size;
++} __packed;
++
++/* ndis_recv_scale_cap/cap_flag */
++#define NDIS_RSS_CAPS_MESSAGE_SIGNALED_INTERRUPTS 0x01000000
++#define NDIS_RSS_CAPS_CLASSIFICATION_AT_ISR       0x02000000
++#define NDIS_RSS_CAPS_CLASSIFICATION_AT_DPC       0x04000000
++#define NDIS_RSS_CAPS_USING_MSI_X                 0x08000000
++#define NDIS_RSS_CAPS_RSS_AVAILABLE_ON_PORTS      0x10000000
++#define NDIS_RSS_CAPS_SUPPORTS_MSI_X              0x20000000
++#define NDIS_RSS_CAPS_HASH_TYPE_TCP_IPV4          0x00000100
++#define NDIS_RSS_CAPS_HASH_TYPE_TCP_IPV6          0x00000200
++#define NDIS_RSS_CAPS_HASH_TYPE_TCP_IPV6_EX       0x00000400
++
++struct ndis_recv_scale_cap { /* NDIS_RECEIVE_SCALE_CAPABILITIES */
++      struct ndis_obj_header hdr;
++      u32 cap_flag;
++      u32 num_int_msg;
++      u32 num_recv_que;
++      u16 num_indirect_tabent;
++} __packed;
++
++
++/* ndis_recv_scale_param flags */
++#define NDIS_RSS_PARAM_FLAG_BASE_CPU_UNCHANGED     0x0001
++#define NDIS_RSS_PARAM_FLAG_HASH_INFO_UNCHANGED    0x0002
++#define NDIS_RSS_PARAM_FLAG_ITABLE_UNCHANGED       0x0004
++#define NDIS_RSS_PARAM_FLAG_HASH_KEY_UNCHANGED     0x0008
++#define NDIS_RSS_PARAM_FLAG_DISABLE_RSS            0x0010
++
++/* Hash info bits */
++#define NDIS_HASH_FUNC_TOEPLITZ 0x00000001
++#define NDIS_HASH_IPV4          0x00000100
++#define NDIS_HASH_TCP_IPV4      0x00000200
++#define NDIS_HASH_IPV6          0x00000400
++#define NDIS_HASH_IPV6_EX       0x00000800
++#define NDIS_HASH_TCP_IPV6      0x00001000
++#define NDIS_HASH_TCP_IPV6_EX   0x00002000
++
++#define NDIS_RSS_INDIRECTION_TABLE_MAX_SIZE_REVISION_2 (128 * 4)
++#define NDIS_RSS_HASH_SECRET_KEY_MAX_SIZE_REVISION_2   40
++
++#define ITAB_NUM 128
++#define HASH_KEYLEN NDIS_RSS_HASH_SECRET_KEY_MAX_SIZE_REVISION_2
++extern u8 netvsc_hash_key[];
++
++struct ndis_recv_scale_param { /* NDIS_RECEIVE_SCALE_PARAMETERS */
++      struct ndis_obj_header hdr;
++
++      /* Qualifies the rest of the information */
++      u16 flag;
++
++      /* The base CPU number to do receive processing. not used */
++      u16 base_cpu_number;
++
++      /* This describes the hash function and type being enabled */
++      u32 hashinfo;
++
++      /* The size of indirection table array */
++      u16 indirect_tabsize;
++
++      /* The offset of the indirection table from the beginning of this
++       * structure
++       */
++      u32 indirect_taboffset;
++
++      /* The size of the hash secret key */
++      u16 hashkey_size;
++
++      /* The offset of the secret key from the beginning of this structure */
++      u32 kashkey_offset;
++
++      u32 processor_masks_offset;
++      u32 num_processor_masks;
++      u32 processor_masks_entry_size;
++};
++
+ /* Fwd declaration */
+ struct hv_netvsc_packet;
+ struct ndis_tcp_ip_checksum_info;
+@@ -39,6 +129,8 @@ struct xferpage_packet {
+       /* # of netvsc packets this xfer packet contains */
+       u32 count;
++
++      struct vmbus_channel *channel;
+ };
+ /*
+@@ -54,6 +146,9 @@ struct hv_netvsc_packet {
+       bool is_data_pkt;
+       u16 vlan_tci;
++      u16 q_idx;
++      struct vmbus_channel *channel;
++
+       /*
+        * Valid only for receives when we break a xfer page packet
+        * into multiple netvsc packets
+@@ -120,6 +215,7 @@ void netvsc_linkstatus_callback(struct hv_device *device_obj,
+ int netvsc_recv_callback(struct hv_device *device_obj,
+                       struct hv_netvsc_packet *packet,
+                       struct ndis_tcp_ip_checksum_info *csum_info);
++void netvsc_channel_cb(void *context);
+ int rndis_filter_open(struct hv_device *dev);
+ int rndis_filter_close(struct hv_device *dev);
+ int rndis_filter_device_add(struct hv_device *dev,
+@@ -522,6 +618,8 @@ struct nvsp_message {
+ #define NETVSC_PACKET_SIZE                      2048
++#define VRSS_SEND_TAB_SIZE 16
++
+ /* Per netvsc channel-specific */
+ struct netvsc_device {
+       struct hv_device *dev;
+@@ -555,10 +653,20 @@ struct netvsc_device {
+       struct net_device *ndev;
++      struct vmbus_channel *chn_table[NR_CPUS];
++      u32 send_table[VRSS_SEND_TAB_SIZE];
++      u32 num_chn;
++      atomic_t queue_sends[NR_CPUS];
++
+       /* Holds rndis device info */
+       void *extension;
+-      /* The recive buffer for this device */
++
++      int ring_size;
++
++      /* The primary channel callback buffer */
+       unsigned char cb_buffer[NETVSC_PACKET_SIZE];
++      /* The sub channel callback buffer */
++      unsigned char *sub_cb_buf;
+ };
+ /* NdisInitialize message */
+diff --git a/drivers/net/hyperv/netvsc.c b/drivers/net/hyperv/netvsc.c
+index f7629ecefa84..e7e77f12bc38 100644
+--- a/drivers/net/hyperv/netvsc.c
++++ b/drivers/net/hyperv/netvsc.c
+@@ -422,6 +422,9 @@ int netvsc_device_remove(struct hv_device *device)
+               kfree(netvsc_packet);
+       }
++      if (net_device->sub_cb_buf)
++              vfree(net_device->sub_cb_buf);
++
+       kfree(net_device);
+       return 0;
+ }
+@@ -461,7 +464,9 @@ static void netvsc_send_completion(struct netvsc_device *net_device,
+           (nvsp_packet->hdr.msg_type ==
+            NVSP_MSG1_TYPE_SEND_RECV_BUF_COMPLETE) ||
+           (nvsp_packet->hdr.msg_type ==
+-           NVSP_MSG1_TYPE_SEND_SEND_BUF_COMPLETE)) {
++           NVSP_MSG1_TYPE_SEND_SEND_BUF_COMPLETE) ||
++          (nvsp_packet->hdr.msg_type ==
++           NVSP_MSG5_TYPE_SUBCHANNEL)) {
+               /* Copy the response back */
+               memcpy(&net_device->channel_init_pkt, nvsp_packet,
+                      sizeof(struct nvsp_message));
+@@ -469,28 +474,37 @@ static void netvsc_send_completion(struct netvsc_device *net_device,
+       } else if (nvsp_packet->hdr.msg_type ==
+                  NVSP_MSG1_TYPE_SEND_RNDIS_PKT_COMPLETE) {
+               int num_outstanding_sends;
++              u16 q_idx = 0;
++              struct vmbus_channel *channel = device->channel;
++              int queue_sends;
+               /* Get the send context */
+               nvsc_packet = (struct hv_netvsc_packet *)(unsigned long)
+                       packet->trans_id;
+               /* Notify the layer above us */
+-              if (nvsc_packet)
++              if (nvsc_packet) {
++                      q_idx = nvsc_packet->q_idx;
++                      channel = nvsc_packet->channel;
+                       nvsc_packet->completion.send.send_completion(
+                               nvsc_packet->completion.send.
+                               send_completion_ctx);
++              }
+               num_outstanding_sends =
+                       atomic_dec_return(&net_device->num_outstanding_sends);
++              queue_sends = atomic_dec_return(&net_device->
++                                              queue_sends[q_idx]);
+               if (net_device->destroy && num_outstanding_sends == 0)
+                       wake_up(&net_device->wait_drain);
+-              if (netif_queue_stopped(ndev) && !net_device->start_remove &&
+-                      (hv_ringbuf_avail_percent(&device->channel->outbound)
+-                      > RING_AVAIL_PERCENT_HIWATER ||
+-                      num_outstanding_sends < 1))
+-                              netif_wake_queue(ndev);
++              if (netif_tx_queue_stopped(netdev_get_tx_queue(ndev, q_idx)) &&
++                  !net_device->start_remove &&
++                  (hv_ringbuf_avail_percent(&channel->outbound) >
++                   RING_AVAIL_PERCENT_HIWATER || queue_sends < 1))
++                              netif_tx_wake_queue(netdev_get_tx_queue(
++                                                  ndev, q_idx));
+       } else {
+               netdev_err(ndev, "Unknown send completion packet type- "
+                          "%d received!!\n", nvsp_packet->hdr.msg_type);
+@@ -505,6 +519,7 @@ int netvsc_send(struct hv_device *device,
+       int ret = 0;
+       struct nvsp_message sendMessage;
+       struct net_device *ndev;
++      struct vmbus_channel *out_channel = NULL;
+       u64 req_id;
+       net_device = get_outbound_net_device(device);
+@@ -531,15 +546,20 @@ int netvsc_send(struct hv_device *device,
+       else
+               req_id = 0;
++      out_channel = net_device->chn_table[packet->q_idx];
++      if (out_channel == NULL)
++              out_channel = device->channel;
++      packet->channel = out_channel;
++
+       if (packet->page_buf_cnt) {
+-              ret = vmbus_sendpacket_pagebuffer(device->channel,
++              ret = vmbus_sendpacket_pagebuffer(out_channel,
+                                                 packet->page_buf,
+                                                 packet->page_buf_cnt,
+                                                 &sendMessage,
+                                                 sizeof(struct nvsp_message),
+                                                 req_id);
+       } else {
+-              ret = vmbus_sendpacket(device->channel, &sendMessage,
++              ret = vmbus_sendpacket(out_channel, &sendMessage,
+                               sizeof(struct nvsp_message),
+                               req_id,
+                               VM_PKT_DATA_INBAND,
+@@ -548,17 +568,24 @@ int netvsc_send(struct hv_device *device,
+       if (ret == 0) {
+               atomic_inc(&net_device->num_outstanding_sends);
+-              if (hv_ringbuf_avail_percent(&device->channel->outbound) <
++              atomic_inc(&net_device->queue_sends[packet->q_idx]);
++
++              if (hv_ringbuf_avail_percent(&out_channel->outbound) <
+                       RING_AVAIL_PERCENT_LOWATER) {
+-                      netif_stop_queue(ndev);
++                      netif_tx_stop_queue(netdev_get_tx_queue(
++                                          ndev, packet->q_idx));
++
+                       if (atomic_read(&net_device->
+-                              num_outstanding_sends) < 1)
+-                              netif_wake_queue(ndev);
++                              queue_sends[packet->q_idx]) < 1)
++                              netif_tx_wake_queue(netdev_get_tx_queue(
++                                                  ndev, packet->q_idx));
+               }
+       } else if (ret == -EAGAIN) {
+-              netif_stop_queue(ndev);
+-              if (atomic_read(&net_device->num_outstanding_sends) < 1) {
+-                      netif_wake_queue(ndev);
++              netif_tx_stop_queue(netdev_get_tx_queue(
++                                  ndev, packet->q_idx));
++              if (atomic_read(&net_device->queue_sends[packet->q_idx]) < 1) {
++                      netif_tx_wake_queue(netdev_get_tx_queue(
++                                          ndev, packet->q_idx));
+                       ret = -ENOSPC;
+               }
+       } else {
+@@ -570,6 +597,7 @@ int netvsc_send(struct hv_device *device,
+ }
+ static void netvsc_send_recv_completion(struct hv_device *device,
++                                      struct vmbus_channel *channel,
+                                       struct netvsc_device *net_device,
+                                       u64 transaction_id, u32 status)
+ {
+@@ -587,7 +615,7 @@ static void netvsc_send_recv_completion(struct hv_device *device,
+ retry_send_cmplt:
+       /* Send the completion */
+-      ret = vmbus_sendpacket(device->channel, &recvcompMessage,
++      ret = vmbus_sendpacket(channel, &recvcompMessage,
+                              sizeof(struct nvsp_message), transaction_id,
+                              VM_PKT_COMP, 0);
+       if (ret == 0) {
+@@ -618,6 +646,7 @@ static void netvsc_receive_completion(void *context)
+ {
+       struct hv_netvsc_packet *packet = context;
+       struct hv_device *device = packet->device;
++      struct vmbus_channel *channel;
+       struct netvsc_device *net_device;
+       u64 transaction_id = 0;
+       bool fsend_receive_comp = false;
+@@ -649,6 +678,7 @@ static void netvsc_receive_completion(void *context)
+        */
+       if (packet->xfer_page_pkt->count == 0) {
+               fsend_receive_comp = true;
++              channel = packet->xfer_page_pkt->channel;
+               transaction_id = packet->completion.recv.recv_completion_tid;
+               status = packet->xfer_page_pkt->status;
+               list_add_tail(&packet->xfer_page_pkt->list_ent,
+@@ -662,12 +692,13 @@ static void netvsc_receive_completion(void *context)
+       /* Send a receive completion for the xfer page packet */
+       if (fsend_receive_comp)
+-              netvsc_send_recv_completion(device, net_device, transaction_id,
+-                                      status);
++              netvsc_send_recv_completion(device, channel, net_device,
++                                          transaction_id, status);
+ }
+ static void netvsc_receive(struct netvsc_device *net_device,
++                      struct vmbus_channel *channel,
+                       struct hv_device *device,
+                       struct vmpacket_descriptor *packet)
+ {
+@@ -748,7 +779,7 @@ static void netvsc_receive(struct netvsc_device *net_device,
+               spin_unlock_irqrestore(&net_device->recv_pkt_list_lock,
+                                      flags);
+-              netvsc_send_recv_completion(device, net_device,
++              netvsc_send_recv_completion(device, channel, net_device,
+                                           vmxferpage_packet->d.trans_id,
+                                           NVSP_STAT_FAIL);
+@@ -759,6 +790,7 @@ static void netvsc_receive(struct netvsc_device *net_device,
+       xferpage_packet = (struct xferpage_packet *)listHead.next;
+       list_del(&xferpage_packet->list_ent);
+       xferpage_packet->status = NVSP_STAT_SUCCESS;
++      xferpage_packet->channel = channel;
+       /* This is how much we can satisfy */
+       xferpage_packet->count = count - 1;
+@@ -800,10 +832,45 @@ static void netvsc_receive(struct netvsc_device *net_device,
+ }
+-static void netvsc_channel_cb(void *context)
++
++static void netvsc_send_table(struct hv_device *hdev,
++                            struct vmpacket_descriptor *vmpkt)
++{
++      struct netvsc_device *nvscdev;
++      struct net_device *ndev;
++      struct nvsp_message *nvmsg;
++      int i;
++      u32 count, *tab;
++
++      nvscdev = get_outbound_net_device(hdev);
++      if (!nvscdev)
++              return;
++      ndev = nvscdev->ndev;
++
++      nvmsg = (struct nvsp_message *)((unsigned long)vmpkt +
++                                      (vmpkt->offset8 << 3));
++
++      if (nvmsg->hdr.msg_type != NVSP_MSG5_TYPE_SEND_INDIRECTION_TABLE)
++              return;
++
++      count = nvmsg->msg.v5_msg.send_table.count;
++      if (count != VRSS_SEND_TAB_SIZE) {
++              netdev_err(ndev, "Received wrong send-table size:%u\n", count);
++              return;
++      }
++
++      tab = (u32 *)((unsigned long)&nvmsg->msg.v5_msg.send_table +
++                    nvmsg->msg.v5_msg.send_table.offset);
++
++      for (i = 0; i < count; i++)
++              nvscdev->send_table[i] = tab[i];
++}
++
++void netvsc_channel_cb(void *context)
+ {
+       int ret;
+-      struct hv_device *device = context;
++      struct vmbus_channel *channel = (struct vmbus_channel *)context;
++      struct hv_device *device;
+       struct netvsc_device *net_device;
+       u32 bytes_recvd;
+       u64 request_id;
+@@ -812,14 +879,19 @@ static void netvsc_channel_cb(void *context)
+       int bufferlen = NETVSC_PACKET_SIZE;
+       struct net_device *ndev;
++      if (channel->primary_channel != NULL)
++              device = channel->primary_channel->device_obj;
++      else
++              device = channel->device_obj;
++
+       net_device = get_inbound_net_device(device);
+       if (!net_device)
+               return;
+       ndev = net_device->ndev;
+-      buffer = net_device->cb_buffer;
++      buffer = get_per_channel_state(channel);
+       do {
+-              ret = vmbus_recvpacket_raw(device->channel, buffer, bufferlen,
++              ret = vmbus_recvpacket_raw(channel, buffer, bufferlen,
+                                          &bytes_recvd, &request_id);
+               if (ret == 0) {
+                       if (bytes_recvd > 0) {
+@@ -831,8 +903,12 @@ static void netvsc_channel_cb(void *context)
+                                       break;
+                               case VM_PKT_DATA_USING_XFER_PAGES:
+-                                      netvsc_receive(net_device,
+-                                                      device, desc);
++                                      netvsc_receive(net_device, channel,
++                                                     device, desc);
++                                      break;
++
++                              case VM_PKT_DATA_INBAND:
++                                      netvsc_send_table(device, desc);
+                                       break;
+                               default:
+@@ -893,6 +969,8 @@ int netvsc_device_add(struct hv_device *device, void *additional_info)
+               goto cleanup;
+       }
++      net_device->ring_size = ring_size;
++
+       /*
+        * Coming into this function, struct net_device * is
+        * registered as the driver private data.
+@@ -917,10 +995,12 @@ int netvsc_device_add(struct hv_device *device, void *additional_info)
+       }
+       init_completion(&net_device->channel_init_wait);
++      set_per_channel_state(device->channel, net_device->cb_buffer);
++
+       /* Open the channel */
+       ret = vmbus_open(device->channel, ring_size * PAGE_SIZE,
+                        ring_size * PAGE_SIZE, NULL, 0,
+-                       netvsc_channel_cb, device);
++                       netvsc_channel_cb, device->channel);
+       if (ret != 0) {
+               netdev_err(ndev, "unable to open channel: %d\n", ret);
+@@ -930,6 +1010,8 @@ int netvsc_device_add(struct hv_device *device, void *additional_info)
+       /* Channel is opened */
+       pr_info("hv_netvsc channel opened successfully\n");
++      net_device->chn_table[0] = device->channel;
++
+       /* Connect with the NetVsp */
+       ret = netvsc_connect_vsp(device);
+       if (ret != 0) {
+diff --git a/drivers/net/hyperv/netvsc_drv.c b/drivers/net/hyperv/netvsc_drv.c
+index ce6d870dd7ae..e486dbd33f61 100644
+--- a/drivers/net/hyperv/netvsc_drv.c
++++ b/drivers/net/hyperv/netvsc_drv.c
+@@ -101,7 +101,7 @@ static int netvsc_open(struct net_device *net)
+               return ret;
+       }
+-      netif_start_queue(net);
++      netif_tx_start_all_queues(net);
+       nvdev = hv_get_drvdata(device_obj);
+       rdev = nvdev->extension;
+@@ -149,6 +149,88 @@ static void *init_ppi_data(struct rndis_message *msg, u32 ppi_size,
+       return ppi;
+ }
++union sub_key {
++      u64 k;
++      struct {
++              u8 pad[3];
++              u8 kb;
++              u32 ka;
++      };
++};
++
++/* Toeplitz hash function
++ * data: network byte order
++ * return: host byte order
++ */
++static u32 comp_hash(u8 *key, int klen, u8 *data, int dlen)
++{
++      union sub_key subk;
++      int k_next = 4;
++      u8 dt;
++      int i, j;
++      u32 ret = 0;
++
++      subk.k = 0;
++      subk.ka = ntohl(*(u32 *)key);
++
++      for (i = 0; i < dlen; i++) {
++              subk.kb = key[k_next];
++              k_next = (k_next + 1) % klen;
++              dt = data[i];
++              for (j = 0; j < 8; j++) {
++                      if (dt & 0x80)
++                              ret ^= subk.ka;
++                      dt <<= 1;
++                      subk.k <<= 1;
++              }
++      }
++
++      return ret;
++}
++
++static bool netvsc_set_hash(u32 *hash, struct sk_buff *skb)
++{
++      struct iphdr *iphdr;
++      int data_len;
++      bool ret = false;
++
++      if (eth_hdr(skb)->h_proto != htons(ETH_P_IP))
++              return false;
++
++      iphdr = ip_hdr(skb);
++
++      if (iphdr->version == 4) {
++              if (iphdr->protocol == IPPROTO_TCP)
++                      data_len = 12;
++              else
++                      data_len = 8;
++              *hash = comp_hash(netvsc_hash_key, HASH_KEYLEN,
++                                (u8 *)&iphdr->saddr, data_len);
++              ret = true;
++      }
++
++      return ret;
++}
++
++static u16 netvsc_select_queue(struct net_device *ndev, struct sk_buff *skb,
++                      void *accel_priv, select_queue_fallback_t fallback)
++{
++      struct net_device_context *net_device_ctx = netdev_priv(ndev);
++      struct hv_device *hdev =  net_device_ctx->device_ctx;
++      struct netvsc_device *nvsc_dev = hv_get_drvdata(hdev);
++      u32 hash;
++      u16 q_idx = 0;
++
++      if (nvsc_dev == NULL || ndev->real_num_tx_queues <= 1)
++              return 0;
++
++      if (netvsc_set_hash(&hash, skb))
++              q_idx = nvsc_dev->send_table[hash % VRSS_SEND_TAB_SIZE] %
++                      ndev->real_num_tx_queues;
++
++      return q_idx;
++}
++
+ static void netvsc_xmit_completion(void *context)
+ {
+       struct hv_netvsc_packet *packet = (struct hv_netvsc_packet *)context;
+@@ -334,6 +416,8 @@ static int netvsc_start_xmit(struct sk_buff *skb, struct net_device *net)
+       packet->vlan_tci = skb->vlan_tci;
++      packet->q_idx = skb_get_queue_mapping(skb);
++
+       packet->is_data_pkt = true;
+       packet->total_data_buflen = skb->len;
+@@ -559,6 +643,10 @@ int netvsc_recv_callback(struct hv_device *device_obj,
+               __vlan_hwaccel_put_tag(skb, htons(ETH_P_8021Q),
+                                      packet->vlan_tci);
++      skb_record_rx_queue(skb, packet->xfer_page_pkt->channel->
++                          offermsg.offer.sub_channel_index %
++                          net->real_num_rx_queues);
++
+       net->stats.rx_packets++;
+       net->stats.rx_bytes += packet->total_data_buflen;
+@@ -607,7 +695,7 @@ static int netvsc_change_mtu(struct net_device *ndev, int mtu)
+       hv_set_drvdata(hdev, ndev);
+       device_info.ring_size = ring_size;
+       rndis_filter_device_add(hdev, &device_info);
+-      netif_wake_queue(ndev);
++      netif_tx_wake_all_queues(ndev);
+       return 0;
+ }
+@@ -653,6 +741,7 @@ static const struct net_device_ops device_ops = {
+       .ndo_change_mtu =               netvsc_change_mtu,
+       .ndo_validate_addr =            eth_validate_addr,
+       .ndo_set_mac_address =          netvsc_set_mac_addr,
++      .ndo_select_queue =             netvsc_select_queue,
+ };
+ /*
+@@ -699,9 +788,11 @@ static int netvsc_probe(struct hv_device *dev,
+       struct net_device *net = NULL;
+       struct net_device_context *net_device_ctx;
+       struct netvsc_device_info device_info;
++      struct netvsc_device *nvdev;
+       int ret;
+-      net = alloc_etherdev(sizeof(struct net_device_context));
++      net = alloc_etherdev_mq(sizeof(struct net_device_context),
++                              num_online_cpus());
+       if (!net)
+               return -ENOMEM;
+@@ -734,6 +825,12 @@ static int netvsc_probe(struct hv_device *dev,
+       }
+       memcpy(net->dev_addr, device_info.mac_adr, ETH_ALEN);
++      nvdev = hv_get_drvdata(dev);
++      netif_set_real_num_tx_queues(net, nvdev->num_chn);
++      netif_set_real_num_rx_queues(net, nvdev->num_chn);
++      dev_info(&dev->device, "real num tx,rx queues:%u, %u\n",
++               net->real_num_tx_queues, net->real_num_rx_queues);
++
+       ret = register_netdev(net);
+       if (ret != 0) {
+               pr_err("Unable to register netdev.\n");
+diff --git a/drivers/net/hyperv/rndis_filter.c b/drivers/net/hyperv/rndis_filter.c
+index 143a98caf618..d92cfbe43410 100644
+--- a/drivers/net/hyperv/rndis_filter.c
++++ b/drivers/net/hyperv/rndis_filter.c
+@@ -31,7 +31,7 @@
+ #include "hyperv_net.h"
+-#define RNDIS_EXT_LEN 100
++#define RNDIS_EXT_LEN PAGE_SIZE
+ struct rndis_request {
+       struct list_head list_ent;
+       struct completion  wait_event;
+@@ -94,6 +94,8 @@ static struct rndis_request *get_rndis_request(struct rndis_device *dev,
+       rndis_msg->ndis_msg_type = msg_type;
+       rndis_msg->msg_len = msg_len;
++      request->pkt.q_idx = 0;
++
+       /*
+        * Set the request id. This field is always after the rndis header for
+        * request/response packet types so we just used the SetRequest as a
+@@ -509,6 +511,19 @@ static int rndis_filter_query_device(struct rndis_device *dev, u32 oid,
+       query->info_buflen = 0;
+       query->dev_vc_handle = 0;
++      if (oid == OID_GEN_RECEIVE_SCALE_CAPABILITIES) {
++              struct ndis_recv_scale_cap *cap;
++
++              request->request_msg.msg_len +=
++                      sizeof(struct ndis_recv_scale_cap);
++              query->info_buflen = sizeof(struct ndis_recv_scale_cap);
++              cap = (struct ndis_recv_scale_cap *)((unsigned long)query +
++                                                   query->info_buf_offset);
++              cap->hdr.type = NDIS_OBJECT_TYPE_RSS_CAPABILITIES;
++              cap->hdr.rev = NDIS_RECEIVE_SCALE_CAPABILITIES_REVISION_2;
++              cap->hdr.size = sizeof(struct ndis_recv_scale_cap);
++      }
++
+       ret = rndis_filter_send_request(dev, request);
+       if (ret != 0)
+               goto cleanup;
+@@ -695,6 +710,89 @@ cleanup:
+       return ret;
+ }
++u8 netvsc_hash_key[HASH_KEYLEN] = {
++      0x6d, 0x5a, 0x56, 0xda, 0x25, 0x5b, 0x0e, 0xc2,
++      0x41, 0x67, 0x25, 0x3d, 0x43, 0xa3, 0x8f, 0xb0,
++      0xd0, 0xca, 0x2b, 0xcb, 0xae, 0x7b, 0x30, 0xb4,
++      0x77, 0xcb, 0x2d, 0xa3, 0x80, 0x30, 0xf2, 0x0c,
++      0x6a, 0x42, 0xb7, 0x3b, 0xbe, 0xac, 0x01, 0xfa
++};
++
++int rndis_filter_set_rss_param(struct rndis_device *rdev, int num_queue)
++{
++      struct net_device *ndev = rdev->net_dev->ndev;
++      struct rndis_request *request;
++      struct rndis_set_request *set;
++      struct rndis_set_complete *set_complete;
++      u32 extlen = sizeof(struct ndis_recv_scale_param) +
++                   4*ITAB_NUM + HASH_KEYLEN;
++      struct ndis_recv_scale_param *rssp;
++      u32 *itab;
++      u8 *keyp;
++      int i, t, ret;
++
++      request = get_rndis_request(
++                      rdev, RNDIS_MSG_SET,
++                      RNDIS_MESSAGE_SIZE(struct rndis_set_request) + extlen);
++      if (!request)
++              return -ENOMEM;
++
++      set = &request->request_msg.msg.set_req;
++      set->oid = OID_GEN_RECEIVE_SCALE_PARAMETERS;
++      set->info_buflen = extlen;
++      set->info_buf_offset = sizeof(struct rndis_set_request);
++      set->dev_vc_handle = 0;
++
++      rssp = (struct ndis_recv_scale_param *)(set + 1);
++      rssp->hdr.type = NDIS_OBJECT_TYPE_RSS_PARAMETERS;
++      rssp->hdr.rev = NDIS_RECEIVE_SCALE_PARAMETERS_REVISION_2;
++      rssp->hdr.size = sizeof(struct ndis_recv_scale_param);
++      rssp->flag = 0;
++      rssp->hashinfo = NDIS_HASH_FUNC_TOEPLITZ | NDIS_HASH_IPV4 |
++                       NDIS_HASH_TCP_IPV4;
++      rssp->indirect_tabsize = 4*ITAB_NUM;
++      rssp->indirect_taboffset = sizeof(struct ndis_recv_scale_param);
++      rssp->hashkey_size = HASH_KEYLEN;
++      rssp->kashkey_offset = rssp->indirect_taboffset +
++                             rssp->indirect_tabsize;
++
++      /* Set indirection table entries */
++      itab = (u32 *)(rssp + 1);
++      for (i = 0; i < ITAB_NUM; i++)
++              itab[i] = i % num_queue;
++
++      /* Set hask key values */
++      keyp = (u8 *)((unsigned long)rssp + rssp->kashkey_offset);
++      for (i = 0; i < HASH_KEYLEN; i++)
++              keyp[i] = netvsc_hash_key[i];
++
++
++      ret = rndis_filter_send_request(rdev, request);
++      if (ret != 0)
++              goto cleanup;
++
++      t = wait_for_completion_timeout(&request->wait_event, 5*HZ);
++      if (t == 0) {
++              netdev_err(ndev, "timeout before we got a set response...\n");
++              /* can't put_rndis_request, since we may still receive a
++               * send-completion.
++               */
++              return -ETIMEDOUT;
++      } else {
++              set_complete = &request->response_msg.msg.set_complete;
++              if (set_complete->status != RNDIS_STATUS_SUCCESS) {
++                      netdev_err(ndev, "Fail to set RSS parameters:0x%x\n",
++                                 set_complete->status);
++                      ret = -EINVAL;
++              }
++      }
++
++cleanup:
++      put_rndis_request(rdev, request);
++      return ret;
++}
++
++
+ static int rndis_filter_query_device_link_status(struct rndis_device *dev)
+ {
+       u32 size = sizeof(u32);
+@@ -886,6 +984,28 @@ static int rndis_filter_close_device(struct rndis_device *dev)
+       return ret;
+ }
++static void netvsc_sc_open(struct vmbus_channel *new_sc)
++{
++      struct netvsc_device *nvscdev;
++      u16 chn_index = new_sc->offermsg.offer.sub_channel_index;
++      int ret;
++
++      nvscdev = hv_get_drvdata(new_sc->primary_channel->device_obj);
++
++      if (chn_index >= nvscdev->num_chn)
++              return;
++
++      set_per_channel_state(new_sc, nvscdev->sub_cb_buf + (chn_index - 1) *
++                            NETVSC_PACKET_SIZE);
++
++      ret = vmbus_open(new_sc, nvscdev->ring_size * PAGE_SIZE,
++                       nvscdev->ring_size * PAGE_SIZE, NULL, 0,
++                       netvsc_channel_cb, new_sc);
++
++      if (ret == 0)
++              nvscdev->chn_table[chn_index] = new_sc;
++}
++
+ int rndis_filter_device_add(struct hv_device *dev,
+                                 void *additional_info)
+ {
+@@ -894,6 +1014,10 @@ int rndis_filter_device_add(struct hv_device *dev,
+       struct rndis_device *rndis_device;
+       struct netvsc_device_info *device_info = additional_info;
+       struct ndis_offload_params offloads;
++      struct nvsp_message *init_packet;
++      int t;
++      struct ndis_recv_scale_cap rsscap;
++      u32 rsscap_size = sizeof(struct ndis_recv_scale_cap);
+       rndis_device = get_rndis_device();
+       if (!rndis_device)
+@@ -913,6 +1037,7 @@ int rndis_filter_device_add(struct hv_device *dev,
+       /* Initialize the rndis device */
+       net_device = hv_get_drvdata(dev);
++      net_device->num_chn = 1;
+       net_device->extension = rndis_device;
+       rndis_device->net_dev = net_device;
+@@ -952,7 +1077,6 @@ int rndis_filter_device_add(struct hv_device *dev,
+       if (ret)
+               goto err_dev_remv;
+-
+       rndis_filter_query_device_link_status(rndis_device);
+       device_info->link_state = rndis_device->link_state;
+@@ -961,7 +1085,66 @@ int rndis_filter_device_add(struct hv_device *dev,
+                rndis_device->hw_mac_adr,
+                device_info->link_state ? "down" : "up");
+-      return ret;
++      if (net_device->nvsp_version < NVSP_PROTOCOL_VERSION_5)
++              return 0;
++
++      /* vRSS setup */
++      memset(&rsscap, 0, rsscap_size);
++      ret = rndis_filter_query_device(rndis_device,
++                                      OID_GEN_RECEIVE_SCALE_CAPABILITIES,
++                                      &rsscap, &rsscap_size);
++      if (ret || rsscap.num_recv_que < 2)
++              goto out;
++
++      net_device->num_chn = (num_online_cpus() < rsscap.num_recv_que) ?
++                             num_online_cpus() : rsscap.num_recv_que;
++      if (net_device->num_chn == 1)
++              goto out;
++
++      net_device->sub_cb_buf = vzalloc((net_device->num_chn - 1) *
++                                       NETVSC_PACKET_SIZE);
++      if (!net_device->sub_cb_buf) {
++              net_device->num_chn = 1;
++              dev_info(&dev->device, "No memory for subchannels.\n");
++              goto out;
++      }
++
++      vmbus_set_sc_create_callback(dev->channel, netvsc_sc_open);
++
++      init_packet = &net_device->channel_init_pkt;
++      memset(init_packet, 0, sizeof(struct nvsp_message));
++      init_packet->hdr.msg_type = NVSP_MSG5_TYPE_SUBCHANNEL;
++      init_packet->msg.v5_msg.subchn_req.op = NVSP_SUBCHANNEL_ALLOCATE;
++      init_packet->msg.v5_msg.subchn_req.num_subchannels =
++                                              net_device->num_chn - 1;
++      ret = vmbus_sendpacket(dev->channel, init_packet,
++                             sizeof(struct nvsp_message),
++                             (unsigned long)init_packet,
++                             VM_PKT_DATA_INBAND,
++                             VMBUS_DATA_PACKET_FLAG_COMPLETION_REQUESTED);
++      if (ret)
++              goto out;
++      t = wait_for_completion_timeout(&net_device->channel_init_wait, 5*HZ);
++      if (t == 0) {
++              ret = -ETIMEDOUT;
++              goto out;
++      }
++      if (init_packet->msg.v5_msg.subchn_comp.status !=
++          NVSP_STAT_SUCCESS) {
++              ret = -ENODEV;
++              goto out;
++      }
++      net_device->num_chn = 1 +
++              init_packet->msg.v5_msg.subchn_comp.num_subchannels;
++
++      vmbus_are_subchannels_present(dev->channel);
++
++      ret = rndis_filter_set_rss_param(rndis_device, net_device->num_chn);
++
++out:
++      if (ret)
++              net_device->num_chn = 1;
++      return 0; /* return 0 because primary channel can be used alone */
+ err_dev_remv:
+       rndis_filter_device_remove(dev);
+-- 
+2.4.3
+
diff --git a/src/patches/linux/0017-hyperv-Remove-recv_pkt_list-and-lock.patch b/src/patches/linux/0017-hyperv-Remove-recv_pkt_list-and-lock.patch
new file mode 100644 (file)
index 0000000..31465a1
--- /dev/null
@@ -0,0 +1,384 @@
+From d6bf5567c1438b4f3b1bcff1a1525ddb1754df19 Mon Sep 17 00:00:00 2001
+From: Haiyang Zhang <haiyangz@microsoft.com>
+Date: Mon, 21 Apr 2014 14:54:43 -0700
+Subject: [PATCH 17/25] hyperv: Remove recv_pkt_list and lock
+
+Removed recv_pkt_list and lock, and updated related code, so that
+the locking overhead is reduced especially when multiple channels
+are in use.
+
+The recv_pkt_list isn't actually necessary because the packets are
+processed sequentially in each channel. It has been replaced by a
+local variable, and the related lock for this list is also removed.
+The is_data_pkt field is not used in receive path, so its assignment
+is cleaned up.
+
+Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
+Reviewed-by: K. Y. Srinivasan <kys@microsoft.com>
+Signed-off-by: David S. Miller <davem@davemloft.net>
+---
+ drivers/net/hyperv/hyperv_net.h   |  33 --------
+ drivers/net/hyperv/netvsc.c       | 174 +++-----------------------------------
+ drivers/net/hyperv/netvsc_drv.c   |   2 +-
+ drivers/net/hyperv/rndis_filter.c |   2 -
+ 4 files changed, 13 insertions(+), 198 deletions(-)
+
+diff --git a/drivers/net/hyperv/hyperv_net.h b/drivers/net/hyperv/hyperv_net.h
+index 57eb3f906d64..a1af0f7711e2 100644
+--- a/drivers/net/hyperv/hyperv_net.h
++++ b/drivers/net/hyperv/hyperv_net.h
+@@ -119,27 +119,14 @@ struct ndis_recv_scale_param { /* NDIS_RECEIVE_SCALE_PARAMETERS */
+ };
+ /* Fwd declaration */
+-struct hv_netvsc_packet;
+ struct ndis_tcp_ip_checksum_info;
+-/* Represent the xfer page packet which contains 1 or more netvsc packet */
+-struct xferpage_packet {
+-      struct list_head list_ent;
+-      u32 status;
+-
+-      /* # of netvsc packets this xfer packet contains */
+-      u32 count;
+-
+-      struct vmbus_channel *channel;
+-};
+-
+ /*
+  * Represent netvsc packet which contains 1 RNDIS and 1 ethernet frame
+  * within the RNDIS
+  */
+ struct hv_netvsc_packet {
+       /* Bookkeeping stuff */
+-      struct list_head list_ent;
+       u32 status;
+       struct hv_device *device;
+@@ -149,19 +136,8 @@ struct hv_netvsc_packet {
+       u16 q_idx;
+       struct vmbus_channel *channel;
+-      /*
+-       * Valid only for receives when we break a xfer page packet
+-       * into multiple netvsc packets
+-       */
+-      struct xferpage_packet *xfer_page_pkt;
+-
+       union {
+               struct {
+-                      u64 recv_completion_tid;
+-                      void *recv_completion_ctx;
+-                      void (*recv_completion)(void *context);
+-              } recv;
+-              struct {
+                       u64 send_completion_tid;
+                       void *send_completion_ctx;
+                       void (*send_completion)(void *context);
+@@ -613,9 +589,6 @@ struct nvsp_message {
+ #define NETVSC_RECEIVE_BUFFER_ID              0xcafe
+-/* Preallocated receive packets */
+-#define NETVSC_RECEIVE_PACKETLIST_COUNT               256
+-
+ #define NETVSC_PACKET_SIZE                      2048
+ #define VRSS_SEND_TAB_SIZE 16
+@@ -630,12 +603,6 @@ struct netvsc_device {
+       wait_queue_head_t wait_drain;
+       bool start_remove;
+       bool destroy;
+-      /*
+-       * List of free preallocated hv_netvsc_packet to represent receive
+-       * packet
+-       */
+-      struct list_head recv_pkt_list;
+-      spinlock_t recv_pkt_list_lock;
+       /* Receive buffer allocated by us but manages by NetVSP */
+       void *recv_buf;
+diff --git a/drivers/net/hyperv/netvsc.c b/drivers/net/hyperv/netvsc.c
+index e7e77f12bc38..b10334773b32 100644
+--- a/drivers/net/hyperv/netvsc.c
++++ b/drivers/net/hyperv/netvsc.c
+@@ -387,7 +387,6 @@ static void netvsc_disconnect_vsp(struct netvsc_device *net_device)
+ int netvsc_device_remove(struct hv_device *device)
+ {
+       struct netvsc_device *net_device;
+-      struct hv_netvsc_packet *netvsc_packet, *pos;
+       unsigned long flags;
+       net_device = hv_get_drvdata(device);
+@@ -416,12 +415,6 @@ int netvsc_device_remove(struct hv_device *device)
+       vmbus_close(device->channel);
+       /* Release all resources */
+-      list_for_each_entry_safe(netvsc_packet, pos,
+-                               &net_device->recv_pkt_list, list_ent) {
+-              list_del(&netvsc_packet->list_ent);
+-              kfree(netvsc_packet);
+-      }
+-
+       if (net_device->sub_cb_buf)
+               vfree(net_device->sub_cb_buf);
+@@ -641,62 +634,6 @@ retry_send_cmplt:
+       }
+ }
+-/* Send a receive completion packet to RNDIS device (ie NetVsp) */
+-static void netvsc_receive_completion(void *context)
+-{
+-      struct hv_netvsc_packet *packet = context;
+-      struct hv_device *device = packet->device;
+-      struct vmbus_channel *channel;
+-      struct netvsc_device *net_device;
+-      u64 transaction_id = 0;
+-      bool fsend_receive_comp = false;
+-      unsigned long flags;
+-      struct net_device *ndev;
+-      u32 status = NVSP_STAT_NONE;
+-
+-      /*
+-       * Even though it seems logical to do a GetOutboundNetDevice() here to
+-       * send out receive completion, we are using GetInboundNetDevice()
+-       * since we may have disable outbound traffic already.
+-       */
+-      net_device = get_inbound_net_device(device);
+-      if (!net_device)
+-              return;
+-      ndev = net_device->ndev;
+-
+-      /* Overloading use of the lock. */
+-      spin_lock_irqsave(&net_device->recv_pkt_list_lock, flags);
+-
+-      if (packet->status != NVSP_STAT_SUCCESS)
+-              packet->xfer_page_pkt->status = NVSP_STAT_FAIL;
+-
+-      packet->xfer_page_pkt->count--;
+-
+-      /*
+-       * Last one in the line that represent 1 xfer page packet.
+-       * Return the xfer page packet itself to the freelist
+-       */
+-      if (packet->xfer_page_pkt->count == 0) {
+-              fsend_receive_comp = true;
+-              channel = packet->xfer_page_pkt->channel;
+-              transaction_id = packet->completion.recv.recv_completion_tid;
+-              status = packet->xfer_page_pkt->status;
+-              list_add_tail(&packet->xfer_page_pkt->list_ent,
+-                            &net_device->recv_pkt_list);
+-
+-      }
+-
+-      /* Put the packet back */
+-      list_add_tail(&packet->list_ent, &net_device->recv_pkt_list);
+-      spin_unlock_irqrestore(&net_device->recv_pkt_list_lock, flags);
+-
+-      /* Send a receive completion for the xfer page packet */
+-      if (fsend_receive_comp)
+-              netvsc_send_recv_completion(device, channel, net_device,
+-                                          transaction_id, status);
+-
+-}
+-
+ static void netvsc_receive(struct netvsc_device *net_device,
+                       struct vmbus_channel *channel,
+                       struct hv_device *device,
+@@ -704,16 +641,13 @@ static void netvsc_receive(struct netvsc_device *net_device,
+ {
+       struct vmtransfer_page_packet_header *vmxferpage_packet;
+       struct nvsp_message *nvsp_packet;
+-      struct hv_netvsc_packet *netvsc_packet = NULL;
+-      /* struct netvsc_driver *netvscDriver; */
+-      struct xferpage_packet *xferpage_packet = NULL;
++      struct hv_netvsc_packet nv_pkt;
++      struct hv_netvsc_packet *netvsc_packet = &nv_pkt;
++      u32 status = NVSP_STAT_SUCCESS;
+       int i;
+       int count = 0;
+-      unsigned long flags;
+       struct net_device *ndev;
+-      LIST_HEAD(listHead);
+-
+       ndev = net_device->ndev;
+       /*
+@@ -746,78 +680,14 @@ static void netvsc_receive(struct netvsc_device *net_device,
+               return;
+       }
+-      /*
+-       * Grab free packets (range count + 1) to represent this xfer
+-       * page packet. +1 to represent the xfer page packet itself.
+-       * We grab it here so that we know exactly how many we can
+-       * fulfil
+-       */
+-      spin_lock_irqsave(&net_device->recv_pkt_list_lock, flags);
+-      while (!list_empty(&net_device->recv_pkt_list)) {
+-              list_move_tail(net_device->recv_pkt_list.next, &listHead);
+-              if (++count == vmxferpage_packet->range_cnt + 1)
+-                      break;
+-      }
+-      spin_unlock_irqrestore(&net_device->recv_pkt_list_lock, flags);
+-
+-      /*
+-       * We need at least 2 netvsc pkts (1 to represent the xfer
+-       * page and at least 1 for the range) i.e. we can handled
+-       * some of the xfer page packet ranges...
+-       */
+-      if (count < 2) {
+-              netdev_err(ndev, "Got only %d netvsc pkt...needed "
+-                      "%d pkts. Dropping this xfer page packet completely!\n",
+-                      count, vmxferpage_packet->range_cnt + 1);
+-
+-              /* Return it to the freelist */
+-              spin_lock_irqsave(&net_device->recv_pkt_list_lock, flags);
+-              for (i = count; i != 0; i--) {
+-                      list_move_tail(listHead.next,
+-                                     &net_device->recv_pkt_list);
+-              }
+-              spin_unlock_irqrestore(&net_device->recv_pkt_list_lock,
+-                                     flags);
+-
+-              netvsc_send_recv_completion(device, channel, net_device,
+-                                          vmxferpage_packet->d.trans_id,
+-                                          NVSP_STAT_FAIL);
+-
+-              return;
+-      }
+-
+-      /* Remove the 1st packet to represent the xfer page packet itself */
+-      xferpage_packet = (struct xferpage_packet *)listHead.next;
+-      list_del(&xferpage_packet->list_ent);
+-      xferpage_packet->status = NVSP_STAT_SUCCESS;
+-      xferpage_packet->channel = channel;
+-
+-      /* This is how much we can satisfy */
+-      xferpage_packet->count = count - 1;
+-
+-      if (xferpage_packet->count != vmxferpage_packet->range_cnt) {
+-              netdev_err(ndev, "Needed %d netvsc pkts to satisfy "
+-                      "this xfer page...got %d\n",
+-                      vmxferpage_packet->range_cnt, xferpage_packet->count);
+-      }
++      count = vmxferpage_packet->range_cnt;
++      netvsc_packet->device = device;
++      netvsc_packet->channel = channel;
+       /* Each range represents 1 RNDIS pkt that contains 1 ethernet frame */
+-      for (i = 0; i < (count - 1); i++) {
+-              netvsc_packet = (struct hv_netvsc_packet *)listHead.next;
+-              list_del(&netvsc_packet->list_ent);
+-
++      for (i = 0; i < count; i++) {
+               /* Initialize the netvsc packet */
+               netvsc_packet->status = NVSP_STAT_SUCCESS;
+-              netvsc_packet->xfer_page_pkt = xferpage_packet;
+-              netvsc_packet->completion.recv.recv_completion =
+-                                      netvsc_receive_completion;
+-              netvsc_packet->completion.recv.recv_completion_ctx =
+-                                      netvsc_packet;
+-              netvsc_packet->device = device;
+-              /* Save this so that we can send it back */
+-              netvsc_packet->completion.recv.recv_completion_tid =
+-                                      vmxferpage_packet->d.trans_id;
+-
+               netvsc_packet->data = (void *)((unsigned long)net_device->
+                       recv_buf + vmxferpage_packet->ranges[i].byte_offset);
+               netvsc_packet->total_data_buflen =
+@@ -826,10 +696,12 @@ static void netvsc_receive(struct netvsc_device *net_device,
+               /* Pass it to the upper layer */
+               rndis_filter_receive(device, netvsc_packet);
+-              netvsc_receive_completion(netvsc_packet->
+-                              completion.recv.recv_completion_ctx);
++              if (netvsc_packet->status != NVSP_STAT_SUCCESS)
++                      status = NVSP_STAT_FAIL;
+       }
++      netvsc_send_recv_completion(device, channel, net_device,
++                                  vmxferpage_packet->d.trans_id, status);
+ }
+@@ -956,11 +828,9 @@ void netvsc_channel_cb(void *context)
+ int netvsc_device_add(struct hv_device *device, void *additional_info)
+ {
+       int ret = 0;
+-      int i;
+       int ring_size =
+       ((struct netvsc_device_info *)additional_info)->ring_size;
+       struct netvsc_device *net_device;
+-      struct hv_netvsc_packet *packet, *pos;
+       struct net_device *ndev;
+       net_device = alloc_net_device(device);
+@@ -981,18 +851,6 @@ int netvsc_device_add(struct hv_device *device, void *additional_info)
+       ndev = net_device->ndev;
+       /* Initialize the NetVSC channel extension */
+-      spin_lock_init(&net_device->recv_pkt_list_lock);
+-
+-      INIT_LIST_HEAD(&net_device->recv_pkt_list);
+-
+-      for (i = 0; i < NETVSC_RECEIVE_PACKETLIST_COUNT; i++) {
+-              packet = kzalloc(sizeof(struct hv_netvsc_packet), GFP_KERNEL);
+-              if (!packet)
+-                      break;
+-
+-              list_add_tail(&packet->list_ent,
+-                            &net_device->recv_pkt_list);
+-      }
+       init_completion(&net_device->channel_init_wait);
+       set_per_channel_state(device->channel, net_device->cb_buffer);
+@@ -1028,16 +886,8 @@ close:
+ cleanup:
+-      if (net_device) {
+-              list_for_each_entry_safe(packet, pos,
+-                                       &net_device->recv_pkt_list,
+-                                       list_ent) {
+-                      list_del(&packet->list_ent);
+-                      kfree(packet);
+-              }
+-
++      if (net_device)
+               kfree(net_device);
+-      }
+       return ret;
+ }
+diff --git a/drivers/net/hyperv/netvsc_drv.c b/drivers/net/hyperv/netvsc_drv.c
+index e486dbd33f61..6cc4db064fec 100644
+--- a/drivers/net/hyperv/netvsc_drv.c
++++ b/drivers/net/hyperv/netvsc_drv.c
+@@ -643,7 +643,7 @@ int netvsc_recv_callback(struct hv_device *device_obj,
+               __vlan_hwaccel_put_tag(skb, htons(ETH_P_8021Q),
+                                      packet->vlan_tci);
+-      skb_record_rx_queue(skb, packet->xfer_page_pkt->channel->
++      skb_record_rx_queue(skb, packet->channel->
+                           offermsg.offer.sub_channel_index %
+                           net->real_num_rx_queues);
+diff --git a/drivers/net/hyperv/rndis_filter.c b/drivers/net/hyperv/rndis_filter.c
+index d92cfbe43410..48f5a0fbd674 100644
+--- a/drivers/net/hyperv/rndis_filter.c
++++ b/drivers/net/hyperv/rndis_filter.c
+@@ -401,8 +401,6 @@ static void rndis_filter_receive_data(struct rndis_device *dev,
+       pkt->total_data_buflen = rndis_pkt->data_len;
+       pkt->data = (void *)((unsigned long)pkt->data + data_offset);
+-      pkt->is_data_pkt = true;
+-
+       vlan = rndis_get_ppi(rndis_pkt, IEEE_8021Q_INFO);
+       if (vlan) {
+               pkt->vlan_tci = VLAN_TAG_PRESENT | vlan->vlanid |
+-- 
+2.4.3
+
diff --git a/src/patches/linux/0018-hyperv-Simplify-the-send_completion-variables.patch b/src/patches/linux/0018-hyperv-Simplify-the-send_completion-variables.patch
new file mode 100644 (file)
index 0000000..82b742b
--- /dev/null
@@ -0,0 +1,105 @@
+From d6eeeb452c1e6e7cf14f4a581a8f2ea2c50ec17a Mon Sep 17 00:00:00 2001
+From: Haiyang Zhang <haiyangz@microsoft.com>
+Date: Mon, 21 Apr 2014 14:54:44 -0700
+Subject: [PATCH 18/25] hyperv: Simplify the send_completion variables
+
+The union contains only one member now, so we use the variables in it directly.
+
+Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
+Reviewed-by: K. Y. Srinivasan <kys@microsoft.com>
+Signed-off-by: David S. Miller <davem@davemloft.net>
+---
+ drivers/net/hyperv/hyperv_net.h   | 10 +++-------
+ drivers/net/hyperv/netvsc.c       |  7 +++----
+ drivers/net/hyperv/netvsc_drv.c   |  8 ++++----
+ drivers/net/hyperv/rndis_filter.c |  2 +-
+ 4 files changed, 11 insertions(+), 16 deletions(-)
+
+diff --git a/drivers/net/hyperv/hyperv_net.h b/drivers/net/hyperv/hyperv_net.h
+index a1af0f7711e2..d1f7826aa75f 100644
+--- a/drivers/net/hyperv/hyperv_net.h
++++ b/drivers/net/hyperv/hyperv_net.h
+@@ -136,13 +136,9 @@ struct hv_netvsc_packet {
+       u16 q_idx;
+       struct vmbus_channel *channel;
+-      union {
+-              struct {
+-                      u64 send_completion_tid;
+-                      void *send_completion_ctx;
+-                      void (*send_completion)(void *context);
+-              } send;
+-      } completion;
++      u64 send_completion_tid;
++      void *send_completion_ctx;
++      void (*send_completion)(void *context);
+       /* This points to the memory after page_buf */
+       struct rndis_message *rndis_msg;
+diff --git a/drivers/net/hyperv/netvsc.c b/drivers/net/hyperv/netvsc.c
+index b10334773b32..bbee44635035 100644
+--- a/drivers/net/hyperv/netvsc.c
++++ b/drivers/net/hyperv/netvsc.c
+@@ -479,9 +479,8 @@ static void netvsc_send_completion(struct netvsc_device *net_device,
+               if (nvsc_packet) {
+                       q_idx = nvsc_packet->q_idx;
+                       channel = nvsc_packet->channel;
+-                      nvsc_packet->completion.send.send_completion(
+-                              nvsc_packet->completion.send.
+-                              send_completion_ctx);
++                      nvsc_packet->send_completion(nvsc_packet->
++                                                   send_completion_ctx);
+               }
+               num_outstanding_sends =
+@@ -534,7 +533,7 @@ int netvsc_send(struct hv_device *device,
+               0xFFFFFFFF;
+       sendMessage.msg.v1_msg.send_rndis_pkt.send_buf_section_size = 0;
+-      if (packet->completion.send.send_completion)
++      if (packet->send_completion)
+               req_id = (ulong)packet;
+       else
+               req_id = 0;
+diff --git a/drivers/net/hyperv/netvsc_drv.c b/drivers/net/hyperv/netvsc_drv.c
+index 6cc4db064fec..f3d3525ed42d 100644
+--- a/drivers/net/hyperv/netvsc_drv.c
++++ b/drivers/net/hyperv/netvsc_drv.c
+@@ -235,7 +235,7 @@ static void netvsc_xmit_completion(void *context)
+ {
+       struct hv_netvsc_packet *packet = (struct hv_netvsc_packet *)context;
+       struct sk_buff *skb = (struct sk_buff *)
+-              (unsigned long)packet->completion.send.send_completion_tid;
++              (unsigned long)packet->send_completion_tid;
+       kfree(packet);
+@@ -426,9 +426,9 @@ static int netvsc_start_xmit(struct sk_buff *skb, struct net_device *net)
+                               (num_data_pgs * sizeof(struct hv_page_buffer)));
+       /* Set the completion routine */
+-      packet->completion.send.send_completion = netvsc_xmit_completion;
+-      packet->completion.send.send_completion_ctx = packet;
+-      packet->completion.send.send_completion_tid = (unsigned long)skb;
++      packet->send_completion = netvsc_xmit_completion;
++      packet->send_completion_ctx = packet;
++      packet->send_completion_tid = (unsigned long)skb;
+       isvlan = packet->vlan_tci & VLAN_TAG_PRESENT;
+diff --git a/drivers/net/hyperv/rndis_filter.c b/drivers/net/hyperv/rndis_filter.c
+index 48f5a0fbd674..99c527adae5b 100644
+--- a/drivers/net/hyperv/rndis_filter.c
++++ b/drivers/net/hyperv/rndis_filter.c
+@@ -236,7 +236,7 @@ static int rndis_filter_send_request(struct rndis_device *dev,
+                       packet->page_buf[0].len;
+       }
+-      packet->completion.send.send_completion = NULL;
++      packet->send_completion = NULL;
+       ret = netvsc_send(dev->net_dev->dev, packet);
+       return ret;
+-- 
+2.4.3
+
diff --git a/src/patches/linux/0019-hyperv-Enable-sendbuf-mechanism-on-the-send-path.patch b/src/patches/linux/0019-hyperv-Enable-sendbuf-mechanism-on-the-send-path.patch
new file mode 100644 (file)
index 0000000..3940865
--- /dev/null
@@ -0,0 +1,407 @@
+From 4685e50349d5dc5fe485c898ca3ce539e93a0118 Mon Sep 17 00:00:00 2001
+From: KY Srinivasan <kys@microsoft.com>
+Date: Wed, 30 Apr 2014 10:14:31 -0700
+Subject: [PATCH 19/25] hyperv: Enable sendbuf mechanism on the send path
+
+We send packets using a copy-free mechanism (this is the Guest to Host transport
+via VMBUS). While this is obviously optimal for large packets,
+it may not be optimal for small packets. Hyper-V host supports
+a second mechanism for sending packets that is "copy based". We implement that
+mechanism in this patch.
+
+In this version of the patch I have addressed a comment from David Miller.
+
+With this patch (and all of the other offload and VRSS patches), we are now able
+to almost saturate a 10G interface between Linux VMs on Hyper-V
+on different hosts - close to  9 Gbps as measured via iperf.
+
+Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
+Reviewed-by: Haiyang Zhang <haiyangz@microsoft.com>
+Signed-off-by: David S. Miller <davem@davemloft.net>
+---
+ drivers/net/hyperv/hyperv_net.h |  14 +++
+ drivers/net/hyperv/netvsc.c     | 226 ++++++++++++++++++++++++++++++++++++++--
+ drivers/net/hyperv/netvsc_drv.c |   3 +-
+ 3 files changed, 234 insertions(+), 9 deletions(-)
+
+diff --git a/drivers/net/hyperv/hyperv_net.h b/drivers/net/hyperv/hyperv_net.h
+index d1f7826aa75f..4b7df5a5c966 100644
+--- a/drivers/net/hyperv/hyperv_net.h
++++ b/drivers/net/hyperv/hyperv_net.h
+@@ -140,6 +140,8 @@ struct hv_netvsc_packet {
+       void *send_completion_ctx;
+       void (*send_completion)(void *context);
++      u32 send_buf_index;
++
+       /* This points to the memory after page_buf */
+       struct rndis_message *rndis_msg;
+@@ -582,6 +584,9 @@ struct nvsp_message {
+ #define NETVSC_RECEIVE_BUFFER_SIZE            (1024*1024*16)  /* 16MB */
+ #define NETVSC_RECEIVE_BUFFER_SIZE_LEGACY     (1024*1024*15)  /* 15MB */
++#define NETVSC_SEND_BUFFER_SIZE                       (1024 * 1024)   /* 1MB */
++#define NETVSC_INVALID_INDEX                  -1
++
+ #define NETVSC_RECEIVE_BUFFER_ID              0xcafe
+@@ -607,6 +612,15 @@ struct netvsc_device {
+       u32 recv_section_cnt;
+       struct nvsp_1_receive_buffer_section *recv_section;
++      /* Send buffer allocated by us */
++      void *send_buf;
++      u32 send_buf_size;
++      u32 send_buf_gpadl_handle;
++      u32 send_section_cnt;
++      u32 send_section_size;
++      unsigned long *send_section_map;
++      int map_words;
++
+       /* Used for NetVSP initialization protocol */
+       struct completion channel_init_wait;
+       struct nvsp_message channel_init_pkt;
+diff --git a/drivers/net/hyperv/netvsc.c b/drivers/net/hyperv/netvsc.c
+index bbee44635035..c041f63a6d30 100644
+--- a/drivers/net/hyperv/netvsc.c
++++ b/drivers/net/hyperv/netvsc.c
+@@ -28,6 +28,7 @@
+ #include <linux/slab.h>
+ #include <linux/netdevice.h>
+ #include <linux/if_ether.h>
++#include <asm/sync_bitops.h>
+ #include "hyperv_net.h"
+@@ -80,7 +81,7 @@ get_in_err:
+ }
+-static int netvsc_destroy_recv_buf(struct netvsc_device *net_device)
++static int netvsc_destroy_buf(struct netvsc_device *net_device)
+ {
+       struct nvsp_message *revoke_packet;
+       int ret = 0;
+@@ -146,10 +147,62 @@ static int netvsc_destroy_recv_buf(struct netvsc_device *net_device)
+               net_device->recv_section = NULL;
+       }
++      /* Deal with the send buffer we may have setup.
++       * If we got a  send section size, it means we received a
++       * SendsendBufferComplete msg (ie sent
++       * NvspMessage1TypeSendReceiveBuffer msg) therefore, we need
++       * to send a revoke msg here
++       */
++      if (net_device->send_section_size) {
++              /* Send the revoke receive buffer */
++              revoke_packet = &net_device->revoke_packet;
++              memset(revoke_packet, 0, sizeof(struct nvsp_message));
++
++              revoke_packet->hdr.msg_type =
++                      NVSP_MSG1_TYPE_REVOKE_SEND_BUF;
++              revoke_packet->msg.v1_msg.revoke_recv_buf.id = 0;
++
++              ret = vmbus_sendpacket(net_device->dev->channel,
++                                     revoke_packet,
++                                     sizeof(struct nvsp_message),
++                                     (unsigned long)revoke_packet,
++                                     VM_PKT_DATA_INBAND, 0);
++              /* If we failed here, we might as well return and
++               * have a leak rather than continue and a bugchk
++               */
++              if (ret != 0) {
++                      netdev_err(ndev, "unable to send "
++                                 "revoke send buffer to netvsp\n");
++                      return ret;
++              }
++      }
++      /* Teardown the gpadl on the vsp end */
++      if (net_device->send_buf_gpadl_handle) {
++              ret = vmbus_teardown_gpadl(net_device->dev->channel,
++                                         net_device->send_buf_gpadl_handle);
++
++              /* If we failed here, we might as well return and have a leak
++               * rather than continue and a bugchk
++               */
++              if (ret != 0) {
++                      netdev_err(ndev,
++                                 "unable to teardown send buffer's gpadl\n");
++                      return ret;
++              }
++              net_device->recv_buf_gpadl_handle = 0;
++      }
++      if (net_device->send_buf) {
++              /* Free up the receive buffer */
++              free_pages((unsigned long)net_device->send_buf,
++                         get_order(net_device->send_buf_size));
++              net_device->send_buf = NULL;
++      }
++      kfree(net_device->send_section_map);
++
+       return ret;
+ }
+-static int netvsc_init_recv_buf(struct hv_device *device)
++static int netvsc_init_buf(struct hv_device *device)
+ {
+       int ret = 0;
+       int t;
+@@ -248,10 +301,90 @@ static int netvsc_init_recv_buf(struct hv_device *device)
+               goto cleanup;
+       }
++      /* Now setup the send buffer.
++       */
++      net_device->send_buf =
++              (void *)__get_free_pages(GFP_KERNEL|__GFP_ZERO,
++                                       get_order(net_device->send_buf_size));
++      if (!net_device->send_buf) {
++              netdev_err(ndev, "unable to allocate send "
++                         "buffer of size %d\n", net_device->send_buf_size);
++              ret = -ENOMEM;
++              goto cleanup;
++      }
++
++      /* Establish the gpadl handle for this buffer on this
++       * channel.  Note: This call uses the vmbus connection rather
++       * than the channel to establish the gpadl handle.
++       */
++      ret = vmbus_establish_gpadl(device->channel, net_device->send_buf,
++                                  net_device->send_buf_size,
++                                  &net_device->send_buf_gpadl_handle);
++      if (ret != 0) {
++              netdev_err(ndev,
++                         "unable to establish send buffer's gpadl\n");
++              goto cleanup;
++      }
++
++      /* Notify the NetVsp of the gpadl handle */
++      init_packet = &net_device->channel_init_pkt;
++      memset(init_packet, 0, sizeof(struct nvsp_message));
++      init_packet->hdr.msg_type = NVSP_MSG1_TYPE_SEND_SEND_BUF;
++      init_packet->msg.v1_msg.send_recv_buf.gpadl_handle =
++              net_device->send_buf_gpadl_handle;
++      init_packet->msg.v1_msg.send_recv_buf.id = 0;
++
++      /* Send the gpadl notification request */
++      ret = vmbus_sendpacket(device->channel, init_packet,
++                             sizeof(struct nvsp_message),
++                             (unsigned long)init_packet,
++                             VM_PKT_DATA_INBAND,
++                             VMBUS_DATA_PACKET_FLAG_COMPLETION_REQUESTED);
++      if (ret != 0) {
++              netdev_err(ndev,
++                         "unable to send send buffer's gpadl to netvsp\n");
++              goto cleanup;
++      }
++
++      t = wait_for_completion_timeout(&net_device->channel_init_wait, 5*HZ);
++      BUG_ON(t == 0);
++
++      /* Check the response */
++      if (init_packet->msg.v1_msg.
++          send_send_buf_complete.status != NVSP_STAT_SUCCESS) {
++              netdev_err(ndev, "Unable to complete send buffer "
++                         "initialization with NetVsp - status %d\n",
++                         init_packet->msg.v1_msg.
++                         send_recv_buf_complete.status);
++              ret = -EINVAL;
++              goto cleanup;
++      }
++
++      /* Parse the response */
++      net_device->send_section_size = init_packet->msg.
++                              v1_msg.send_send_buf_complete.section_size;
++
++      /* Section count is simply the size divided by the section size.
++       */
++      net_device->send_section_cnt =
++              net_device->send_buf_size/net_device->send_section_size;
++
++      dev_info(&device->device, "Send section size: %d, Section count:%d\n",
++               net_device->send_section_size, net_device->send_section_cnt);
++
++      /* Setup state for managing the send buffer. */
++      net_device->map_words = DIV_ROUND_UP(net_device->send_section_cnt,
++                                           BITS_PER_LONG);
++
++      net_device->send_section_map =
++              kzalloc(net_device->map_words * sizeof(ulong), GFP_KERNEL);
++      if (net_device->send_section_map == NULL)
++              goto cleanup;
++
+       goto exit;
+ cleanup:
+-      netvsc_destroy_recv_buf(net_device);
++      netvsc_destroy_buf(net_device);
+ exit:
+       return ret;
+@@ -369,8 +502,9 @@ static int netvsc_connect_vsp(struct hv_device *device)
+               net_device->recv_buf_size = NETVSC_RECEIVE_BUFFER_SIZE_LEGACY;
+       else
+               net_device->recv_buf_size = NETVSC_RECEIVE_BUFFER_SIZE;
++      net_device->send_buf_size = NETVSC_SEND_BUFFER_SIZE;
+-      ret = netvsc_init_recv_buf(device);
++      ret = netvsc_init_buf(device);
+ cleanup:
+       return ret;
+@@ -378,7 +512,7 @@ cleanup:
+ static void netvsc_disconnect_vsp(struct netvsc_device *net_device)
+ {
+-      netvsc_destroy_recv_buf(net_device);
++      netvsc_destroy_buf(net_device);
+ }
+ /*
+@@ -440,6 +574,12 @@ static inline u32 hv_ringbuf_avail_percent(
+       return avail_write * 100 / ring_info->ring_datasize;
+ }
++static inline void netvsc_free_send_slot(struct netvsc_device *net_device,
++                                       u32 index)
++{
++      sync_change_bit(index, net_device->send_section_map);
++}
++
+ static void netvsc_send_completion(struct netvsc_device *net_device,
+                                  struct hv_device *device,
+                                  struct vmpacket_descriptor *packet)
+@@ -447,6 +587,7 @@ static void netvsc_send_completion(struct netvsc_device *net_device,
+       struct nvsp_message *nvsp_packet;
+       struct hv_netvsc_packet *nvsc_packet;
+       struct net_device *ndev;
++      u32 send_index;
+       ndev = net_device->ndev;
+@@ -477,6 +618,9 @@ static void netvsc_send_completion(struct netvsc_device *net_device,
+               /* Notify the layer above us */
+               if (nvsc_packet) {
++                      send_index = nvsc_packet->send_buf_index;
++                      if (send_index != NETVSC_INVALID_INDEX)
++                              netvsc_free_send_slot(net_device, send_index);
+                       q_idx = nvsc_packet->q_idx;
+                       channel = nvsc_packet->channel;
+                       nvsc_packet->send_completion(nvsc_packet->
+@@ -504,6 +648,52 @@ static void netvsc_send_completion(struct netvsc_device *net_device,
+ }
++static u32 netvsc_get_next_send_section(struct netvsc_device *net_device)
++{
++      unsigned long index;
++      u32 max_words = net_device->map_words;
++      unsigned long *map_addr = (unsigned long *)net_device->send_section_map;
++      u32 section_cnt = net_device->send_section_cnt;
++      int ret_val = NETVSC_INVALID_INDEX;
++      int i;
++      int prev_val;
++
++      for (i = 0; i < max_words; i++) {
++              if (!~(map_addr[i]))
++                      continue;
++              index = ffz(map_addr[i]);
++              prev_val = sync_test_and_set_bit(index, &map_addr[i]);
++              if (prev_val)
++                      continue;
++              if ((index + (i * BITS_PER_LONG)) >= section_cnt)
++                      break;
++              ret_val = (index + (i * BITS_PER_LONG));
++              break;
++      }
++      return ret_val;
++}
++
++u32 netvsc_copy_to_send_buf(struct netvsc_device *net_device,
++                          unsigned int section_index,
++                          struct hv_netvsc_packet *packet)
++{
++      char *start = net_device->send_buf;
++      char *dest = (start + (section_index * net_device->send_section_size));
++      int i;
++      u32 msg_size = 0;
++
++      for (i = 0; i < packet->page_buf_cnt; i++) {
++              char *src = phys_to_virt(packet->page_buf[i].pfn << PAGE_SHIFT);
++              u32 offset = packet->page_buf[i].offset;
++              u32 len = packet->page_buf[i].len;
++
++              memcpy(dest, (src + offset), len);
++              msg_size += len;
++              dest += len;
++      }
++      return msg_size;
++}
++
+ int netvsc_send(struct hv_device *device,
+                       struct hv_netvsc_packet *packet)
+ {
+@@ -513,6 +703,10 @@ int netvsc_send(struct hv_device *device,
+       struct net_device *ndev;
+       struct vmbus_channel *out_channel = NULL;
+       u64 req_id;
++      unsigned int section_index = NETVSC_INVALID_INDEX;
++      u32 msg_size = 0;
++      struct sk_buff *skb;
++
+       net_device = get_outbound_net_device(device);
+       if (!net_device)
+@@ -528,10 +722,26 @@ int netvsc_send(struct hv_device *device,
+               sendMessage.msg.v1_msg.send_rndis_pkt.channel_type = 1;
+       }
+-      /* Not using send buffer section */
++      /* Attempt to send via sendbuf */
++      if (packet->total_data_buflen < net_device->send_section_size) {
++              section_index = netvsc_get_next_send_section(net_device);
++              if (section_index != NETVSC_INVALID_INDEX) {
++                      msg_size = netvsc_copy_to_send_buf(net_device,
++                                                         section_index,
++                                                         packet);
++                      skb = (struct sk_buff *)
++                            (unsigned long)packet->send_completion_tid;
++                      if (skb)
++                              dev_kfree_skb_any(skb);
++                      packet->page_buf_cnt = 0;
++              }
++      }
++      packet->send_buf_index = section_index;
++
++
+       sendMessage.msg.v1_msg.send_rndis_pkt.send_buf_section_index =
+-              0xFFFFFFFF;
+-      sendMessage.msg.v1_msg.send_rndis_pkt.send_buf_section_size = 0;
++              section_index;
++      sendMessage.msg.v1_msg.send_rndis_pkt.send_buf_section_size = msg_size;
+       if (packet->send_completion)
+               req_id = (ulong)packet;
+diff --git a/drivers/net/hyperv/netvsc_drv.c b/drivers/net/hyperv/netvsc_drv.c
+index f3d3525ed42d..9a19aa5672e6 100644
+--- a/drivers/net/hyperv/netvsc_drv.c
++++ b/drivers/net/hyperv/netvsc_drv.c
+@@ -236,10 +236,11 @@ static void netvsc_xmit_completion(void *context)
+       struct hv_netvsc_packet *packet = (struct hv_netvsc_packet *)context;
+       struct sk_buff *skb = (struct sk_buff *)
+               (unsigned long)packet->send_completion_tid;
++      u32 index = packet->send_buf_index;
+       kfree(packet);
+-      if (skb)
++      if (skb && (index == NETVSC_INVALID_INDEX))
+               dev_kfree_skb_any(skb);
+ }
+-- 
+2.4.3
+
diff --git a/src/patches/linux/0020-Add-support-for-netvsc-build-without-CONFIG_SYSFS-fl.patch b/src/patches/linux/0020-Add-support-for-netvsc-build-without-CONFIG_SYSFS-fl.patch
new file mode 100644 (file)
index 0000000..b610b54
--- /dev/null
@@ -0,0 +1,42 @@
+From 3f0b77385356301cf4718a94f76a4068588ecb8e Mon Sep 17 00:00:00 2001
+From: Haiyang Zhang <haiyangz@microsoft.com>
+Date: Thu, 8 May 2014 15:14:10 -0700
+Subject: [PATCH 20/25] Add support for netvsc build without CONFIG_SYSFS flag
+
+This change ensures the driver can be built successfully without the
+CONFIG_SYSFS flag.
+MS-TFS: 182270
+
+Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
+Reviewed-by: K. Y. Srinivasan <kys@microsoft.com>
+Signed-off-by: David S. Miller <davem@davemloft.net>
+---
+ drivers/net/hyperv/netvsc_drv.c | 5 +----
+ 1 file changed, 1 insertion(+), 4 deletions(-)
+
+diff --git a/drivers/net/hyperv/netvsc_drv.c b/drivers/net/hyperv/netvsc_drv.c
+index 9a19aa5672e6..346f1aeb9c24 100644
+--- a/drivers/net/hyperv/netvsc_drv.c
++++ b/drivers/net/hyperv/netvsc_drv.c
+@@ -645,8 +645,7 @@ int netvsc_recv_callback(struct hv_device *device_obj,
+                                      packet->vlan_tci);
+       skb_record_rx_queue(skb, packet->channel->
+-                          offermsg.offer.sub_channel_index %
+-                          net->real_num_rx_queues);
++                          offermsg.offer.sub_channel_index);
+       net->stats.rx_packets++;
+       net->stats.rx_bytes += packet->total_data_buflen;
+@@ -829,8 +828,6 @@ static int netvsc_probe(struct hv_device *dev,
+       nvdev = hv_get_drvdata(dev);
+       netif_set_real_num_tx_queues(net, nvdev->num_chn);
+       netif_set_real_num_rx_queues(net, nvdev->num_chn);
+-      dev_info(&dev->device, "real num tx,rx queues:%u, %u\n",
+-               net->real_num_tx_queues, net->real_num_rx_queues);
+       ret = register_netdev(net);
+       if (ret != 0) {
+-- 
+2.4.3
+
diff --git a/src/patches/linux/0021-hyperv-Add-hash-value-into-RNDIS-Per-packet-info.patch b/src/patches/linux/0021-hyperv-Add-hash-value-into-RNDIS-Per-packet-info.patch
new file mode 100644 (file)
index 0000000..c522d28
--- /dev/null
@@ -0,0 +1,93 @@
+From 1267d9b235e7612f8cdfa842a0433bb82e75f7fb Mon Sep 17 00:00:00 2001
+From: Haiyang Zhang <haiyangz@microsoft.com>
+Date: Wed, 21 May 2014 12:55:39 -0700
+Subject: [PATCH 21/25] hyperv: Add hash value into RNDIS Per-packet info
+
+It passes the hash value as the RNDIS Per-packet info to the Hyper-V host,
+so that the send completion notices can be spread across multiple channels.
+MS-TFS: 140273
+
+Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
+Signed-off-by: David S. Miller <davem@davemloft.net>
+---
+ drivers/net/hyperv/hyperv_net.h |  4 ++++
+ drivers/net/hyperv/netvsc_drv.c | 18 ++++++++++++++----
+ 2 files changed, 18 insertions(+), 4 deletions(-)
+
+diff --git a/drivers/net/hyperv/hyperv_net.h b/drivers/net/hyperv/hyperv_net.h
+index 4b7df5a5c966..6cc37c15e0bf 100644
+--- a/drivers/net/hyperv/hyperv_net.h
++++ b/drivers/net/hyperv/hyperv_net.h
+@@ -791,6 +791,7 @@ enum ndis_per_pkt_info_type {
+       IEEE_8021Q_INFO,
+       ORIGINAL_PKTINFO,
+       PACKET_CANCEL_ID,
++      NBL_HASH_VALUE = PACKET_CANCEL_ID,
+       ORIGINAL_NET_BUFLIST,
+       CACHED_NET_BUFLIST,
+       SHORT_PKT_PADINFO,
+@@ -937,6 +938,9 @@ struct ndis_tcp_lso_info {
+ #define NDIS_LSO_PPI_SIZE (sizeof(struct rndis_per_packet_info) + \
+               sizeof(struct ndis_tcp_lso_info))
++#define NDIS_HASH_PPI_SIZE (sizeof(struct rndis_per_packet_info) + \
++              sizeof(u32))
++
+ /* Format of Information buffer passed in a SetRequest for the OID */
+ /* OID_GEN_RNDIS_CONFIG_PARAMETER. */
+ struct rndis_config_parameter_info {
+diff --git a/drivers/net/hyperv/netvsc_drv.c b/drivers/net/hyperv/netvsc_drv.c
+index 346f1aeb9c24..bd3b3acd04dc 100644
+--- a/drivers/net/hyperv/netvsc_drv.c
++++ b/drivers/net/hyperv/netvsc_drv.c
+@@ -224,9 +224,11 @@ static u16 netvsc_select_queue(struct net_device *ndev, struct sk_buff *skb,
+       if (nvsc_dev == NULL || ndev->real_num_tx_queues <= 1)
+               return 0;
+-      if (netvsc_set_hash(&hash, skb))
++      if (netvsc_set_hash(&hash, skb)) {
+               q_idx = nvsc_dev->send_table[hash % VRSS_SEND_TAB_SIZE] %
+                       ndev->real_num_tx_queues;
++              skb_set_hash(skb, hash, PKT_HASH_TYPE_L3);
++      }
+       return q_idx;
+ }
+@@ -385,6 +387,7 @@ static int netvsc_start_xmit(struct sk_buff *skb, struct net_device *net)
+       struct ndis_tcp_lso_info *lso_info;
+       int  hdr_offset;
+       u32 net_trans_info;
++      u32 hash;
+       /* We will atmost need two pages to describe the rndis
+@@ -403,9 +406,8 @@ static int netvsc_start_xmit(struct sk_buff *skb, struct net_device *net)
+       packet = kzalloc(sizeof(struct hv_netvsc_packet) +
+                        (num_data_pgs * sizeof(struct hv_page_buffer)) +
+                        sizeof(struct rndis_message) +
+-                       NDIS_VLAN_PPI_SIZE +
+-                       NDIS_CSUM_PPI_SIZE +
+-                       NDIS_LSO_PPI_SIZE, GFP_ATOMIC);
++                       NDIS_VLAN_PPI_SIZE + NDIS_CSUM_PPI_SIZE +
++                       NDIS_LSO_PPI_SIZE + NDIS_HASH_PPI_SIZE, GFP_ATOMIC);
+       if (!packet) {
+               /* out of memory, drop packet */
+               netdev_err(net, "unable to allocate hv_netvsc_packet\n");
+@@ -444,6 +446,14 @@ static int netvsc_start_xmit(struct sk_buff *skb, struct net_device *net)
+       rndis_msg_size = RNDIS_MESSAGE_SIZE(struct rndis_packet);
++      hash = skb_get_hash_raw(skb);
++      if (hash != 0 && net->real_num_tx_queues > 1) {
++              rndis_msg_size += NDIS_HASH_PPI_SIZE;
++              ppi = init_ppi_data(rndis_msg, NDIS_HASH_PPI_SIZE,
++                                  NBL_HASH_VALUE);
++              *(u32 *)((void *)ppi + ppi->ppi_offset) = hash;
++      }
++
+       if (isvlan) {
+               struct ndis_pkt_8021q_info *vlan;
+-- 
+2.4.3
+
diff --git a/src/patches/linux/0022-hyperv-fix-apparent-cut-n-paste-error-in-send-path-t.patch b/src/patches/linux/0022-hyperv-fix-apparent-cut-n-paste-error-in-send-path-t.patch
new file mode 100644 (file)
index 0000000..d849ebb
--- /dev/null
@@ -0,0 +1,32 @@
+From ee99150c7f34737e4382e7199d2ffe3dfbb54a5c Mon Sep 17 00:00:00 2001
+From: Dave Jones <davej@redhat.com>
+Date: Mon, 16 Jun 2014 16:59:02 -0400
+Subject: [PATCH 22/25] hyperv: fix apparent cut-n-paste error in send path
+ teardown
+
+c25aaf814a63: "hyperv: Enable sendbuf mechanism on the send path" added
+some teardown code that looks like it was copied from the recieve path
+above, but missed a variable name replacement.
+
+Signed-off-by: Dave Jones <davej@redhat.com>
+Signed-off-by: David S. Miller <davem@davemloft.net>
+---
+ drivers/net/hyperv/netvsc.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/drivers/net/hyperv/netvsc.c b/drivers/net/hyperv/netvsc.c
+index c041f63a6d30..4ed38eaecea8 100644
+--- a/drivers/net/hyperv/netvsc.c
++++ b/drivers/net/hyperv/netvsc.c
+@@ -189,7 +189,7 @@ static int netvsc_destroy_buf(struct netvsc_device *net_device)
+                                  "unable to teardown send buffer's gpadl\n");
+                       return ret;
+               }
+-              net_device->recv_buf_gpadl_handle = 0;
++              net_device->send_buf_gpadl_handle = 0;
+       }
+       if (net_device->send_buf) {
+               /* Free up the receive buffer */
+-- 
+2.4.3
+
diff --git a/src/patches/linux/0023-hyperv-Fix-error-return-code-in-netvsc_init_buf.patch b/src/patches/linux/0023-hyperv-Fix-error-return-code-in-netvsc_init_buf.patch
new file mode 100644 (file)
index 0000000..ab0960d
--- /dev/null
@@ -0,0 +1,34 @@
+From f1009dfec7c439a958bd9ed8893dd6aa692c61f5 Mon Sep 17 00:00:00 2001
+From: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
+Date: Wed, 23 Jul 2014 09:00:35 +0800
+Subject: [PATCH 23/25] hyperv: Fix error return code in netvsc_init_buf()
+
+Fix to return -ENOMEM from the kalloc error handling
+case instead of 0.
+
+Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
+Reviewed-by: Haiyang Zhang <haiyangz@microsoft.com>
+Signed-off-by: David S. Miller <davem@davemloft.net>
+---
+ drivers/net/hyperv/netvsc.c | 4 +++-
+ 1 file changed, 3 insertions(+), 1 deletion(-)
+
+diff --git a/drivers/net/hyperv/netvsc.c b/drivers/net/hyperv/netvsc.c
+index 4ed38eaecea8..d97d5f39a04e 100644
+--- a/drivers/net/hyperv/netvsc.c
++++ b/drivers/net/hyperv/netvsc.c
+@@ -378,8 +378,10 @@ static int netvsc_init_buf(struct hv_device *device)
+       net_device->send_section_map =
+               kzalloc(net_device->map_words * sizeof(ulong), GFP_KERNEL);
+-      if (net_device->send_section_map == NULL)
++      if (net_device->send_section_map == NULL) {
++              ret = -ENOMEM;
+               goto cleanup;
++      }
+       goto exit;
+-- 
+2.4.3
+
diff --git a/src/patches/linux/0024-hyperv-Fix-a-bug-in-netvsc_send.patch b/src/patches/linux/0024-hyperv-Fix-a-bug-in-netvsc_send.patch
new file mode 100644 (file)
index 0000000..8495fa2
--- /dev/null
@@ -0,0 +1,68 @@
+From 38bca2d5bd6fdaa0b8e1e415f79d89322c6825a8 Mon Sep 17 00:00:00 2001
+From: KY Srinivasan <kys@microsoft.com>
+Date: Sun, 5 Oct 2014 10:42:51 -0700
+Subject: [PATCH 24/25] hyperv: Fix a bug in netvsc_send()
+
+[ Upstream commit 3a67c9ccad926a168d8b7891537a452018368a5b ]
+
+After the packet is successfully sent, we should not touch the packet
+as it may have been freed. This patch is based on the work done by
+Long Li <longli@microsoft.com>.
+
+David, please queue this up for stable.
+
+Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
+Reported-by: Sitsofe Wheeler <sitsofe@yahoo.com>
+Signed-off-by: David S. Miller <davem@davemloft.net>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ drivers/net/hyperv/netvsc.c | 15 ++++++++-------
+ 1 file changed, 8 insertions(+), 7 deletions(-)
+
+diff --git a/drivers/net/hyperv/netvsc.c b/drivers/net/hyperv/netvsc.c
+index d97d5f39a04e..7edf976ecfa0 100644
+--- a/drivers/net/hyperv/netvsc.c
++++ b/drivers/net/hyperv/netvsc.c
+@@ -708,6 +708,7 @@ int netvsc_send(struct hv_device *device,
+       unsigned int section_index = NETVSC_INVALID_INDEX;
+       u32 msg_size = 0;
+       struct sk_buff *skb;
++      u16 q_idx = packet->q_idx;
+       net_device = get_outbound_net_device(device);
+@@ -772,24 +773,24 @@ int netvsc_send(struct hv_device *device,
+       if (ret == 0) {
+               atomic_inc(&net_device->num_outstanding_sends);
+-              atomic_inc(&net_device->queue_sends[packet->q_idx]);
++              atomic_inc(&net_device->queue_sends[q_idx]);
+               if (hv_ringbuf_avail_percent(&out_channel->outbound) <
+                       RING_AVAIL_PERCENT_LOWATER) {
+                       netif_tx_stop_queue(netdev_get_tx_queue(
+-                                          ndev, packet->q_idx));
++                                          ndev, q_idx));
+                       if (atomic_read(&net_device->
+-                              queue_sends[packet->q_idx]) < 1)
++                              queue_sends[q_idx]) < 1)
+                               netif_tx_wake_queue(netdev_get_tx_queue(
+-                                                  ndev, packet->q_idx));
++                                                  ndev, q_idx));
+               }
+       } else if (ret == -EAGAIN) {
+               netif_tx_stop_queue(netdev_get_tx_queue(
+-                                  ndev, packet->q_idx));
+-              if (atomic_read(&net_device->queue_sends[packet->q_idx]) < 1) {
++                                  ndev, q_idx));
++              if (atomic_read(&net_device->queue_sends[q_idx]) < 1) {
+                       netif_tx_wake_queue(netdev_get_tx_queue(
+-                                          ndev, packet->q_idx));
++                                          ndev, q_idx));
+                       ret = -ENOSPC;
+               }
+       } else {
+-- 
+2.4.3
+
diff --git a/src/patches/linux/0025-Drivers-hv-vmbus-Support-per-channel-driver-state.patch b/src/patches/linux/0025-Drivers-hv-vmbus-Support-per-channel-driver-state.patch
new file mode 100644 (file)
index 0000000..47037be
--- /dev/null
@@ -0,0 +1,51 @@
+From 4b71288758aa1d510402b84ca93b1ef566575d22 Mon Sep 17 00:00:00 2001
+From: "K. Y. Srinivasan" <kys@microsoft.com>
+Date: Mon, 3 Feb 2014 12:42:45 -0800
+Subject: [PATCH 25/25] Drivers: hv: vmbus: Support per-channel driver state
+
+As we implement Virtual Receive Side Scaling on the networking side
+(the VRSS patches are currently under review), it will be useful to have
+per-channel state that vmbus drivers can manage. Add support for
+managing per-channel state.
+
+Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ include/linux/hyperv.h | 14 ++++++++++++++
+ 1 file changed, 14 insertions(+)
+
+diff --git a/include/linux/hyperv.h b/include/linux/hyperv.h
+index 6088058a3e00..732dc7e37e96 100644
+--- a/include/linux/hyperv.h
++++ b/include/linux/hyperv.h
+@@ -1045,6 +1045,10 @@ struct vmbus_channel {
+        * This will be NULL for the primary channel.
+        */
+       struct vmbus_channel *primary_channel;
++      /*
++       * Support per-channel state for use by vmbus drivers.
++       */
++      void *per_channel_state;
+ };
+ static inline void set_channel_read_state(struct vmbus_channel *c, bool state)
+@@ -1052,6 +1056,16 @@ static inline void set_channel_read_state(struct vmbus_channel *c, bool state)
+       c->batched_reading = state;
+ }
++static inline void set_per_channel_state(struct vmbus_channel *c, void *s)
++{
++      c->per_channel_state = s;
++}
++
++static inline void *get_per_channel_state(struct vmbus_channel *c)
++{
++      return c->per_channel_state;
++}
++
+ void vmbus_onmessage(void *context);
+ int vmbus_request_offers(void);
+-- 
+2.4.3
+
diff --git a/src/patches/lua-5.3.0-autotoolize.patch b/src/patches/lua-5.3.0-autotoolize.patch
new file mode 100644 (file)
index 0000000..3e4723a
--- /dev/null
@@ -0,0 +1,192 @@
+diff -up lua-5.3.0/configure.ac.autoxxx lua-5.3.0/configure.ac
+--- lua-5.3.0/configure.ac.autoxxx     2015-01-15 10:20:03.826889574 -0500
++++ lua-5.3.0/configure.ac     2015-01-15 10:20:03.826889574 -0500
+@@ -0,0 +1,69 @@
++AC_PREREQ(2.59)
++AC_INIT([lua], [5.3.0], [https://bugzilla.redhat.com/], [lua-at], [http://www.lua.org])
++AC_SUBST([MAJOR_VERSION], [5.3])
++
++AC_CONFIG_HEADERS([config.h])
++AC_CONFIG_SRCDIR([src/lapi.c])
++
++AM_INIT_AUTOMAKE([1.9 foreign])
++
++AC_PROG_CC
++AC_PROG_LIBTOOL
++
++AC_ARG_WITH(
++  [readline],
++  [AC_HELP_STRING([--with-readline], [Use readline for interpreter input [default=yes]])],
++  [use_readline=$withval],
++  [use_readline=yes]
++)
++
++LUA_LIBS="-lm"
++
++# Check for readline
++READLINE_DEFS="#undef LUA_USE_READLINE"
++if test "x$use_readline" == "xyes"; then
++  AC_CHECK_LIB([readline], [readline], [:], [use_readline=no], [-lncurses])
++  AC_CHECK_HEADERS([readline/readline.h readline/history.h], [], [use_readline=no])
++  if test "x$use_readline" == "xno"; then
++    AC_MSG_WARN([readline headers could not be found, disabling readline support])
++  else
++    READLINE_DEFS="#define LUA_USE_READLINE"
++    READLINE_LIBS="-lreadline -lncurses"
++  fi
++fi
++AC_SUBST(READLINE_DEFS)
++AC_SUBST(READLINE_LIBS)
++
++case "$host" in
++  *-mingw*)  use_os=win32  ;;
++  *-darwin*) use_os=macosx ;;
++  *)         use_os=posix  ;;
++esac
++
++POSIX_DEFS="#undef LUA_USE_POSIX"
++LUA_DL_DEFS="#undef LUA_USE_DLOPEN"
++LUA_BUILD_AS_DLL_DEFS="#undef LUA_BUILD_AS_DLL"
++
++if test "x$use_os" == "xwin32"; then
++  LUA_BUILD_AS_DLL_DEFS="#define LUA_BUILD_AS_DLL"
++elif test "x$use_os" == "xmacosx"; then
++  POSIX_DEFS="#define LUA_USE_POSIX"
++  LUA_DL_DEFS="#define LUA_DL_DYLD"
++elif test "x$use_os" == "xposix"; then
++  POSIX_DEFS="#define LUA_USE_POSIX"
++  LUA_DL_DEFS="#define LUA_DL_DLOPEN"
++  LUA_LIBS="$LUA_LIBS -ldl"
++fi
++AC_SUBST(POSIX_DEFS)
++AC_SUBST(LUA_DL_DEFS)
++AC_SUBST(LUA_BUILD_AS_DLL_DEFS)
++
++AC_SUBST(LUA_LIBS)
++
++AC_CONFIG_FILES([Makefile
++                 src/Makefile
++                 src/lua.pc
++                 src/luaconf.h.template
++                 doc/Makefile
++])
++AC_OUTPUT
+diff -up lua-5.3.0/doc/Makefile.am.autoxxx lua-5.3.0/doc/Makefile.am
+--- lua-5.3.0/doc/Makefile.am.autoxxx  2015-01-15 10:20:03.826889574 -0500
++++ lua-5.3.0/doc/Makefile.am  2015-01-15 10:20:03.826889574 -0500
+@@ -0,0 +1,4 @@
++man1_MANS = lua.1 luac.1
++
++EXTRA_DIST = \
++      contents.html logo.gif lua.1 luac.1 lua.css manual.css manual.html osi-certified-72x60.png readme.html
+diff -up lua-5.3.0/Makefile.am.autoxxx lua-5.3.0/Makefile.am
+--- lua-5.3.0/Makefile.am.autoxxx      2015-01-15 10:20:03.826889574 -0500
++++ lua-5.3.0/Makefile.am      2015-01-15 10:20:03.826889574 -0500
+@@ -0,0 +1,3 @@
++SUBDIRS = src doc
++
++EXTRA_DIST = README
+diff -up lua-5.3.0/src/.gitignore.autoxxx lua-5.3.0/src/.gitignore
+--- lua-5.3.0/src/.gitignore.autoxxx   2015-01-15 10:20:03.826889574 -0500
++++ lua-5.3.0/src/.gitignore   2015-01-15 10:20:03.826889574 -0500
+@@ -0,0 +1,5 @@
++lua
++lua.pc
++luac
++luaconf.h
++luaconf.h.template
+diff -up lua-5.3.0/src/luaconf.h.template.in.autoxxx lua-5.3.0/src/luaconf.h.template.in
+--- lua-5.3.0/src/luaconf.h.template.in.autoxxx        2015-01-15 10:20:03.828889562 -0500
++++ lua-5.3.0/src/luaconf.h.template.in        2015-01-15 10:22:37.420027778 -0500
+@@ -11,6 +11,11 @@
+ #include <limits.h>
+ #include <stddef.h>
++@POSIX_DEFS@
++@LUA_DL_DEFS@
++@LUA_BUILD_AS_DLL_DEFS@
++@READLINE_DEFS@
++
+ /*
+ ** ===================================================================
+@@ -175,9 +180,9 @@
+ #else                 /* }{ */
+-#define LUA_ROOT      "/usr/local/"
+-#define LUA_LDIR      LUA_ROOT "share/lua/" LUA_VDIR "/"
+-#define LUA_CDIR      LUA_ROOT "lib/lua/" LUA_VDIR "/"
++#define LUA_ROOT      "@prefix@/"
++#define LUA_LDIR      "@pkgdatadir@/lua/" LUA_VDIR "/"
++#define LUA_CDIR      "@libdir@/lua/" LUA_VDIR "/"
+ #define LUA_PATH_DEFAULT  \
+               LUA_LDIR"?.lua;"  LUA_LDIR"?/init.lua;" \
+               LUA_CDIR"?.lua;"  LUA_CDIR"?/init.lua;" \
+diff -up lua-5.3.0/src/lua.pc.in.autoxxx lua-5.3.0/src/lua.pc.in
+--- lua-5.3.0/src/lua.pc.in.autoxxx    2015-01-15 10:20:03.827889568 -0500
++++ lua-5.3.0/src/lua.pc.in    2015-01-15 10:20:03.827889568 -0500
+@@ -0,0 +1,13 @@
++V= @MAJOR_VERSION@
++R= @VERSION@
++prefix= @prefix@
++exec_prefix=${prefix}
++libdir= @libdir@
++includedir=${prefix}/include
++
++Name: Lua
++Description: An Extensible Extension Language
++Version: ${R}
++Requires:
++Libs: -llua @LUA_LIBS@
++Cflags: -I${includedir}
+diff -up lua-5.3.0/src/Makefile.am.autoxxx lua-5.3.0/src/Makefile.am
+--- lua-5.3.0/src/Makefile.am.autoxxx  2015-01-15 10:20:03.826889574 -0500
++++ lua-5.3.0/src/Makefile.am  2015-01-15 10:20:03.826889574 -0500
+@@ -0,0 +1,46 @@
++AM_CFLAGS = -Wall
++
++include_HEADERS = lua.h lualib.h lauxlib.h lua.hpp
++
++nodist_include_HEADERS = luaconf.h
++
++lib_LTLIBRARIES = liblua.la
++liblua_la_LDFLAGS = -release @MAJOR_VERSION@
++liblua_la_SOURCES = \
++      lapi.c lauxlib.c lbaselib.c lbitlib.c lcode.c lcorolib.c lctype.c ldblib.c \
++      ldebug.c ldo.c ldump.c lfunc.c lgc.c linit.c liolib.c llex.c lmathlib.c lmem.c \
++      loadlib.c lobject.c lopcodes.c loslib.c lparser.c lstate.c lstring.c lstrlib.c \
++      ltable.c ltablib.c ltm.c lundump.c lutf8lib.c lvm.c lzio.c \
++      lapi.h lcode.h lctype.h ldebug.h ldo.h lfunc.h lgc.h llex.h llimits.h \
++      lmem.h lobject.h lopcodes.h lparser.h lstate.h lstring.h ltable.h ltm.h \
++      lundump.h lvm.h lzio.h
++
++pkgconfigdir = $(libdir)/pkgconfig
++pkgconfig_DATA = lua.pc
++
++bin_PROGRAMS = lua luac
++
++lua_SOURCES = lua.c
++lua_LDADD = liblua.la @LUA_LIBS@ @READLINE_LIBS@
++lua_DEPENDENCIES = liblua.la
++
++luac_SOURCES = luac.c
++# Statically link liblua against luac since luac uses symbols not exported in liblua
++luac_LDADD = .libs/liblua.a @LUA_LIBS@
++luac_DEPENDENCIES = liblua.la
++
++EXTRA_DIST = luaconf.h.template
++BUILT_SOURCES = luaconf.h
++CLEANFILES = luaconf.h luaconf.h.template
++
++readline_defs = @READLINE_DEFS@
++
++edit =        sed \
++        -e 's,%prefix%,$(prefix),g' \
++        -e 's,%lua_datadir%,$(datadir),g' \
++        -e 's,%lua_libdir%,$(libdir),g'
++
++luaconf.h : luaconf.h.template
++      rm -f $@ $@.tmp
++      $(edit) $< >$@.tmp
++      mv $@.tmp $@
diff --git a/src/patches/ntp-fix-sycing-with-local-clock.patch b/src/patches/ntp-fix-sycing-with-local-clock.patch
deleted file mode 100644 (file)
index bdca2e7..0000000
+++ /dev/null
@@ -1,23 +0,0 @@
-# http://bugs.ntp.org/show_bug.cgi?id=2965
-
-From 6f68f1f0fd764f0006506e3957a5b8116726d443 Mon Sep 17 00:00:00 2001
-From:  <burnicki/martin@pc-martin4.>
-Date: Mon, 16 Nov 2015 11:59:55 +0100
-Subject: [PATCH] [Bug 2965] Local clock didn't work since 4.2.8p4
-
----
- ntpd/refclock_local.c | 1 +
- 1 files changed, 1 insertions(+)
-
-diff --git a/ntpd/refclock_local.c b/ntpd/refclock_local.c
-index d816c55..8c0f74f 100644
---- a/ntpd/refclock_local.c
-+++ b/ntpd/refclock_local.c
-@@ -205,6 +205,7 @@ local_poll(
-       pp->disp = 0;
-       pp->jitter = 0;
- #else /* KERNEL_PLL LOCKCLOCK */
-+      pp->leap = LEAP_NOWARNING;
-       pp->disp = DISPERSION;
-       pp->jitter = 0;
- #endif /* KERNEL_PLL LOCKCLOCK */
diff --git a/src/patches/squid-3.4-13230.patch b/src/patches/squid-3.4-13230.patch
new file mode 100644 (file)
index 0000000..597d135
--- /dev/null
@@ -0,0 +1,44 @@
+------------------------------------------------------------
+revno: 13230
+revision-id: squid3@treenet.co.nz-20160212045316-zwx4r9we4gf27rx3
+parent: squid3@treenet.co.nz-20151119051038-vwclso11p68sgvxc
+fixes bug: http://bugs.squid-cache.org/show_bug.cgi?id=4431
+author: Marcos Mello <marcosfrm@gmail.com>
+committer: Amos Jeffries <squid3@treenet.co.nz>
+branch nick: 3.4
+timestamp: Fri 2016-02-12 17:53:16 +1300
+message:
+  Bug 4431: C code is not compiled with CFLAGS
+------------------------------------------------------------
+# Bazaar merge directive format 2 (Bazaar 0.90)
+# revision_id: squid3@treenet.co.nz-20160212045316-zwx4r9we4gf27rx3
+# target_branch: http://bzr.squid-cache.org/bzr/squid3/3.4
+# testament_sha1: 53c8d70db04dad826815fb86995cda7e99f1d8e2
+# timestamp: 2016-02-12 05:50:53 +0000
+# source_branch: http://bzr.squid-cache.org/bzr/squid3/3.4
+# base_revision_id: squid3@treenet.co.nz-20151119051038-\
+#   vwclso11p68sgvxc
+# 
+# Begin patch
+=== modified file 'acinclude/compiler-flags.m4'
+--- acinclude/compiler-flags.m4        2015-01-09 10:30:44 +0000
++++ acinclude/compiler-flags.m4        2016-02-12 04:53:16 +0000
+@@ -36,7 +36,7 @@
+   AC_CACHE_CHECK([whether compiler accepts $2],[$1],
+   [{
+     AC_REQUIRE([AC_PROG_CC])
+-    SAVED_FLAGS="$CFLAGS"
++    SAVED_CFLAGS="$CFLAGS"
+     SAVED_CXXFLAGS="$CXXFLAGS"
+     CFLAGS="$CFLAGS $2"
+     CXXFLAGS="$CXXFLAGS $2"
+@@ -60,7 +60,7 @@
+   AC_CACHE_CHECK([whether compiler requires $2],[$1],
+   [{
+     AC_REQUIRE([AC_PROG_CC])
+-    SAVED_FLAGS="$CFLAGS"
++    SAVED_CFLAGS="$CFLAGS"
+     SAVED_CXXFLAGS="$CXXFLAGS"
+     AC_COMPILE_IFELSE([AC_LANG_PROGRAM($3,$4)],[$1=no],[],[$1=no])
+     if test "x$1" != "xno" ; then
+
diff --git a/src/patches/squid-3.4.14-fix-max-file-descriptors.patch b/src/patches/squid-3.4.14-fix-max-file-descriptors.patch
new file mode 100644 (file)
index 0000000..54275b8
--- /dev/null
@@ -0,0 +1,21 @@
+--- configure.ac~      2016-01-23 01:27:44.078013879 +0000
++++ configure.ac       2016-01-23 01:28:19.422179243 +0000
+@@ -2573,6 +2573,9 @@
+     ;;
+ esac
++SQUID_CHECK_DEFAULT_FD_SETSIZE
++SQUID_CHECK_MAXFD
++
+ dnl --with-maxfd present for compatibility with Squid-2.
+ dnl undocumented in ./configure --help  to encourage using the Squid-3 directive
+ AC_ARG_WITH(maxfd,,
+@@ -2603,8 +2606,6 @@
+     esac
+ ])
+-SQUID_CHECK_DEFAULT_FD_SETSIZE
+-SQUID_CHECK_MAXFD
+ if test "x$squid_filedescriptors_num" != "x"; then
+   AC_MSG_NOTICE([Default number of fieldescriptors: $squid_filedescriptors_num])
+ fi
index fdd204b93cd402dea5359b1d5465a9263fdd10f5..b059a297d1cf2855e06e5fa8bf585be8196f29e5 100644 (file)
@@ -74,7 +74,7 @@ else
            echo "$FIRE gateway" >> /tmp/hosts
        else
            #DNS lookup failed use direct ip
-           echo "178.63.73.246 gateway" >> /tmp/hosts
+           echo "81.3.27.38    gateway" >> /tmp/hosts
        fi
 fi
 mv /tmp/hosts /etc/hosts
index e297c50cef72a6ef3b579e01294d1fe28d0317b4..a42e3fa0e5a28a934bf235dbcc4f079bc589098b 100644 (file)
@@ -70,19 +70,19 @@ configure_target() {
        case "${target_arch}" in
                x86_64)
                        BUILDTARGET="${target_arch}-unknown-linux-gnu"
-                       CROSSTARGET="${BUILD_ARCH}-cross-linux-gnu"
+                       CROSSTARGET="${target_arch}-cross-linux-gnu"
                        CFLAGS_ARCH="-m64 -mtune=generic"
                        ;;
 
                i586)
                        BUILDTARGET="${target_arch}-pc-linux-gnu"
-                       CROSSTARGET="${BUILD_ARCH}-cross-linux-gnu"
+                       CROSSTARGET="${target_arch}-cross-linux-gnu"
                        CFLAGS_ARCH="-march=i586 -mtune=generic -fomit-frame-pointer"
                        ;;
 
                armv5tel)
                        BUILDTARGET="${target_arch}-unknown-linux-gnueabi"
-                       CROSSTARGET="${BUILD_ARCH}-cross-linux-gnueabi"
+                       CROSSTARGET="${target_arch}-cross-linux-gnueabi"
                        CFLAGS_ARCH="-march=armv5te -mfloat-abi=soft -fomit-frame-pointer"
                        MACHINE_TYPE="arm"
                        ;;
@@ -109,7 +109,7 @@ configure_target() {
        MACHINE="${TARGET_ARCH}"
 
        CFLAGS="-O2 -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fPIC"
-       CFLAGS="${CFLAGS} -fstack-protector-all --param=ssp-buffer-size=4 ${CFLAGS_ARCH}"
+       CFLAGS="${CFLAGS} -fstack-protector-strong --param=ssp-buffer-size=4 ${CFLAGS_ARCH}"
        CXXFLAGS="${CFLAGS}"
 }