Getting Compilation Error When Running make command to install the hping in Ubuntu 19.04

未关闭
#49 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
2/5
预计耗时
1-3 小时
新手友好度
45/100
Issue 类型
缺陷
描述清晰度
基本清楚
活跃度
停滞
技术栈
c, linux

调研方向

首先在 Ubuntu 上运行 make,并检查 libpcap_stuff.c,尤其是 include net/bpf.h,以及 Makefile 的第 66 行。检查项目期望在 Ubuntu 上如何提供此头文件或其依赖项。项目能够成功编译且不再出现所报告的 fatal error,即表示完成。

由索引模型根据 Issue 内容生成。

描述

root@guru:/home/sait32/Downloads/hping-master# make
gcc -c -O2 -Wall -g main.c
gcc -c -O2 -Wall -g getifname.c
gcc -c -O2 -Wall -g getlhs.c
gcc -c -O2 -Wall -g parseoptions.c
gcc -c -O2 -Wall -g datafiller.c
gcc -c -O2 -Wall -g datahandler.c
gcc -c -O2 -Wall -g gethostname.c
gcc -c -O2 -Wall -g binding.c
gcc -c -O2 -Wall -g getusec.c
gcc -c -O2 -Wall -g opensockraw.c
gcc -c -O2 -Wall -g logicmp.c
gcc -c -O2 -Wall -g waitpacket.c
gcc -c -O2 -Wall -g resolve.c
gcc -c -O2 -Wall -g sendip.c
gcc -c -O2 -Wall -g sendicmp.c
In file included from /usr/include/string.h:494,
from sendicmp.c:19:
In function ‘memcpy’,
inlined from ‘send_icmp_other’ at sendicmp.c:256:2:
/usr/include/x86_64-linux-gnu/bits/string_fortified.h:34:10: warning: ‘__builtin_memcpy’ forming offset [21, 28] is out of the bounds [0, 20] of object ‘icmp_ip’ with type ‘struct myiphdr’ [-Warray-bounds]
return __builtin___memcpy_chk (__dest, __src, __len, __bos0 (__dest));
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
sendicmp.c: In function ‘send_icmp_other’:
sendicmp.c:197:17: note: ‘icmp_ip’ declared here
struct myiphdr icmp_ip;
^~~~~~~
gcc -c -O2 -Wall -g sendudp.c
gcc -c -O2 -Wall -g sendtcp.c
gcc -c -O2 -Wall -g cksum.c
gcc -c -O2 -Wall -g statistics.c
gcc -c -O2 -Wall -g usage.c
gcc -c -O2 -Wall -g version.c
gcc -c -O2 -Wall -g antigetopt.c
gcc -c -O2 -Wall -g sockopt.c
gcc -c -O2 -Wall -g listen.c
listen.c: In function ‘listenmain’:
listen.c:77:4: warning: ignoring return value of ‘write’, declared with attribute warn_unused_result [-Wunused-result]
write(stdoutFD, p, size-(p-ip_packet));
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
gcc -c -O2 -Wall -g sendhcmp.c
gcc -c -O2 -Wall -g memstr.c
gcc -c -O2 -Wall -g rtt.c
rtt.c: In function ‘rtt’:
rtt.c:43:3: warning: this ‘for’ clause does not guard... [-Wmisleading-indentation]
for (i=0; i<TABLESIZE; i++)
^~~
rtt.c:48:4: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘for’
if (i != TABLESIZE)
^~
gcc -c -O2 -Wall -g relid.c
gcc -c -O2 -Wall -g sendip_handler.c
gcc -c -O2 -Wall -g libpcap_stuff.c
libpcap_stuff.c:19:10: fatal error: net/bpf.h: No such file or directory
#include <net/bpf.h>
^~~~~~~~~~~
compilation terminated.
make: *** [Makefile:66: libpcap_stuff.o] Error 1
root@guru:/home/sait32/Downloads/hping-master#

主要语言
C
星标
1.7k
派生
367
PR 合并指标
30 天内没有已合并 PR

环境准备

这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

antirez/hping 的其他 Issue

查看 antirez/hping 的全部 Issue

相似的 Issue

更多 C Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。