diff options
author | Vladimir Homutov <vl@nginx.com> | 2021-03-23 10:58:18 +0300 |
---|---|---|
committer | Vladimir Homutov <vl@nginx.com> | 2021-03-23 10:58:18 +0300 |
commit | d8fd0b31619ed7302690abf1b27a7c7ec99fbc9d (patch) | |
tree | ac62ed3ecf833feb4baf71492b51eb2c844bd0ed /src/core/ngx_bpf.c | |
parent | 19c461a522cfdf6e6b4251472fd170973501e279 (diff) | |
download | nginx-d8fd0b31619ed7302690abf1b27a7c7ec99fbc9d.tar.gz nginx-d8fd0b31619ed7302690abf1b27a7c7ec99fbc9d.zip |
Core: fixed build with BPF on non-64bit platforms (ticket #2152).
Diffstat (limited to 'src/core/ngx_bpf.c')
-rw-r--r-- | src/core/ngx_bpf.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/core/ngx_bpf.c b/src/core/ngx_bpf.c index 6b2611708..363a02c7d 100644 --- a/src/core/ngx_bpf.c +++ b/src/core/ngx_bpf.c @@ -45,14 +45,14 @@ ngx_bpf_load_program(ngx_log_t *log, ngx_bpf_program_t *program) ngx_memzero(&attr, sizeof(union bpf_attr)); - attr.license = (uint64_t) program->license; + attr.license = (uintptr_t) program->license; attr.prog_type = program->type; - attr.insns = (uint64_t) program->ins; + attr.insns = (uintptr_t) program->ins; attr.insn_cnt = program->nins; #if (NGX_DEBUG) /* for verifier errors */ - attr.log_buf = (uint64_t) buf; + attr.log_buf = (uintptr_t) buf; attr.log_size = NGX_BPF_LOGBUF_SIZE; attr.log_level = 1; #endif @@ -106,8 +106,8 @@ ngx_bpf_map_update(int fd, const void *key, const void *value, uint64_t flags) ngx_memzero(&attr, sizeof(union bpf_attr)); attr.map_fd = fd; - attr.key = (uint64_t) key; - attr.value = (uint64_t) value; + attr.key = (uintptr_t) key; + attr.value = (uintptr_t) value; attr.flags = flags; return ngx_bpf(BPF_MAP_UPDATE_ELEM, &attr, sizeof(attr)); @@ -122,7 +122,7 @@ ngx_bpf_map_delete(int fd, const void *key) ngx_memzero(&attr, sizeof(union bpf_attr)); attr.map_fd = fd; - attr.key = (uint64_t) key; + attr.key = (uintptr_t) key; return ngx_bpf(BPF_MAP_DELETE_ELEM, &attr, sizeof(attr)); } @@ -136,8 +136,8 @@ ngx_bpf_map_lookup(int fd, const void *key, void *value) ngx_memzero(&attr, sizeof(union bpf_attr)); attr.map_fd = fd; - attr.key = (uint64_t) key; - attr.value = (uint64_t) value; + attr.key = (uintptr_t) key; + attr.value = (uintptr_t) value; return ngx_bpf(BPF_MAP_LOOKUP_ELEM, &attr, sizeof(attr)); } |