Skip to contentSkip to conversation

soreuseport: Fix reuseport_bpf testcase on 32bit architectures

PATCH In review Helge Deller 2 participants 2 messages Jun 3, 2016 – Jun 6, 2016

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 soreuseport: Fix reuseport_bpf testcase on 32bit architectures

This fixes the following compiler warnings when compiling the reuseport_bpf testcase on a 32 bit platform:

reuseport_bpf.c: In function =E2=80=98attach_ebpf=E2=80=99:
reuseport_bpf.c:114:15: warning: cast from pointer to integer of iffere= nt size [-Wpointer-to-int-cast]

tools/testin= renamed from tools/testing/selftests/net/reuseport_bpf.c +0 -0

g/selftests/net/reuseport_bpf.c
index 96ba386..4a82174 100644

tools/testing/selftests/net/reuseport_bpf.c +3 -3
@@ -111,9 +111,9 @@ static void attach_ebpf(int fd, uint16_t mod)
 	memset(&attr, 0, sizeof(attr));
 	attr.prog_type =3D BPF_PROG_TYPE_SOCKET_FILTER;
 	attr.insn_cnt =3D ARRAY_SIZE(prog);
-	attr.insns =3D (uint64_t)prog;
-	attr.license =3D (uint64_t)bpf_license;
-	attr.log_buf =3D (uint64_t)bpf_log_buf;
+	attr.insns =3D (unsigned long) &prog;
+	attr.license =3D (unsigned long) &bpf_license;
+	attr.log_buf =3D (unsigned long) &bpf_log_buf;
 	attr.log_size =3D sizeof(bpf_log_buf);
 	attr.log_level =3D 1;
 	attr.kern_version =3D 0;
@@ -351,8 +351,8 @@ static void test_filter_no_reuseport(const struct t=

est_params p)
memset(&eprog, 0, sizeof(eprog));
eprog.prog_type =3D BPF_PROG_TYPE_SOCKET_FILTER; eprog.insn_cnt =3D ARRAY_SIZE(ecode);
- eprog.insns =3D (uint64_t)ecode;
- eprog.license =3D (uint64_t)bpf_license;
+ eprog.insns =3D (unsigned long) &ecode;
+ eprog.license =3D (unsigned long) &bpf_license;
eprog.kern_version =3D 0;
=20
memset(&cprog, 0, sizeof(cprog));
--
To unsubscribe from this list: send the line "unsubscribe linux-parisc"=
in
the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

maintainer
#1 lore raw

RnJvbTogSGVsZ2UgRGVsbGVyIDxkZWxsZXJAZ214LmRlPg0KRGF0ZTogRnJpLCAzIEp1biAyMDE2 IDE5OjE5OjIwICswMjAwDQoNCj4gVGhpcyBmaXhlcyB0aGUgZm9sbG93aW5nIGNvbXBpbGVyIHdh cm5pbmdzIHdoZW4gY29tcGlsaW5nIHRoZQ0KPiByZXVzZXBvcnRfYnBmIHRlc3RjYXNlIG9uIGEg MzIgYml0IHBsYXRmb3JtOg0KPiANCj4gcmV1c2Vwb3J0X2JwZi5jOiBJbiBmdW5jdGlvbiChYXR0 YWNoX2VicGaiOg0KPiByZXVzZXBvcnRfYnBmLmM6MTE0OjE1OiB3YXJuaW5nOiBjYXN0IGZyb20g cG9pbnRlciB0byBpbnRlZ2VyIG9mIGlmZmVyZW50IHNpemUgWy1XcG9pbnRlci10by1pbnQtY2Fz dF0NCj4gDQo+IFNpZ25lZC1vZmYtYnk6IEhlbGdlIERlbGxlciA8ZGVsbGVyQGdteC5kZT4NCg0K QXBwbGllZC4NCg==