linux/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
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
hv tools: hv: Add clean up function for Ubuntu config 2017-03-06 17:10:40 -08:00
iio
include bpf: add napi_id read access to __sk_buff 2017-04-21 13:53:27 -04:00
kvm/kvm_stat
laptop
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
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
testing bpf: fix _htons occurences in test_progs 2017-04-28 15:48:15 -04:00
thermal/tmon
time
usb
virtio
vm tools/vm: add missing Makefile rules 2017-02-22 16:41:26 -08:00
Makefile