韦东山视频实验之虚拟网卡

本文记录了一次虚拟网卡的实验过程,包括在编译时遇到的因缺少头文件‘ip.h’导致的错误,以及在insmod模块后,ifconfig配置IP并进行ping测试时,发现hard_start_xmit函数未按预期调用的问题。实验揭示了广播通信和不同IP响应的网络行为。
摘要由CSDN通过智能技术生成

遇到的问题

1.调试老是弹出以下问题

/home/smb/pro/16th_virtnet/virtnet.c: In function 'emulator_rx_packet':
/home/smb/pro/16th_virtnet/virtnet.c:48: error: dereferencing pointer to incomplete type
/home/smb/pro/16th_virtnet/virtnet.c:49: error: dereferencing pointer to incomplete type
/home/smb/pro/16th_virtnet/virtnet.c:55: error: invalid application of 'sizeof' to incomplete type 'struct iphdr'
/home/smb/pro/16th_virtnet/virtnet.c:59: error: dereferencing pointer to incomplete type
/home/smb/pro/16th_virtnet/virtnet.c:60: error: dereferencing pointer to incomplete type
/home/smb/pro/16th_virtnet/virtnet.c:60: error: dereferencing pointer to incomplete type
make[2]: *** [/home/smb/pro/16th_virtnet/virtnet.o] 错误 1
make[1]: *** [_module_/home/smb/pro/16th_virtnet] 错误 2
make[1]

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值