linux-stable/tools
Daniel Borkmann 43bcf707cc bpf: fix _htons occurences in test_progs
Dave reported that on sparc test_progs generates buggy swapped
eth->h_proto protocol comparisons:

  10: (15) if r3 == 0xdd86 goto pc+9
   R0=imm2,min_value=2,max_value=2 R1=pkt(id=0,off=0,r=14) R2=pkt_end R3=inv
   R4=pkt(id=0,off=14,r=14) R5=inv56 R10=fp

This is due to the unconditional ...

  #define htons __builtin_bswap16
  #define ntohs __builtin_bswap16

... in test_progs that causes this. Make use of asm/byteorder.h
and use __constant_htons() where possible and only perform the
bswap16 when on little endian in non-constant case.

Fixes: 6882804c91 ("selftests/bpf: add a test for overlapping packet range checks")
Fixes: 3782161362 ("selftests/bpf: add l4 load balancer test based on sched_cls")
Reported-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Acked-by: Alexei Starovoitov <ast@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
2017-04-28 15:48:15 -04:00
..
accounting tools: move accounting tool from Documentation 2016-09-23 13:07:15 -06:00
arch Merge branch 'x86-cpufeature-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip 2017-02-20 14:37:08 -08:00
build bpf: Add sparc support to tools and samples. 2017-04-22 13:01:52 -07:00
cgroup
firewire
gpio gpio-hammer: fix make consumer_label suitable to work on gpio-nails 2017-01-26 16:29:09 +01:00
hv tools: hv: Add clean up function for Ubuntu config 2017-03-06 17:10:40 -08:00
iio iio: Add channel for Gravity 2017-01-05 13:02:25 +00:00
include bpf: add napi_id read access to __sk_buff 2017-04-21 13:53:27 -04:00
kvm/kvm_stat
laptop tools: move laptops dslm tool from Documentation 2016-09-23 13:07:21 -06:00
leds tools/leds: Add led_hw_brightness_mon program 2017-02-14 22:20:23 +01:00
lguest scripts/spelling.txt: add "overide" pattern and fix typo instances 2017-03-09 17:01:09 -08:00
lib bpf: Add sparc support to tools and samples. 2017-04-22 13:01:52 -07:00
net tools: bpf_jit_disasm: Add option to dump JIT image to a file. 2017-04-13 13:04:03 -04:00
nfsd
objtool objtool: Fix another GCC jump table detection issue 2017-03-07 08:42:55 +01:00
pcmcia tools: move pcmcia crc32hash tool from Documentation 2016-09-23 13:07:27 -06:00
perf perf/urgent annotate fix for s390: 2017-04-11 21:41:39 +02:00
power cpupower: Fix turbo frequency reporting for pre-Sandy Bridge cores 2017-04-13 14:51:10 +02:00
scripts tools: Suppress request for warning options not existent in clang 2017-02-14 10:34:35 -03:00
spi spi: spidev_test: Fix input file check when transferring file 2016-11-04 09:56:09 -06:00
testing bpf: fix _htons occurences in test_progs 2017-04-28 15:48:15 -04:00
thermal/tmon
time
usb USB: changes for v4.11 2017-01-26 15:36:28 +01:00
virtio tools/virtio/ringtest: tweaks for s390 2017-01-19 23:46:32 +02:00
vm tools/vm: add missing Makefile rules 2017-02-22 16:41:26 -08:00
Makefile tools/leds: Add uledmon program for monitoring userspace LEDs 2016-11-22 12:07:02 +01:00