当前位置: 首页 > news >正文

ptpd2提示failed to join the multicast group (strerror: No buffer space available)

下载交叉编译ptpd-ptpd-2.3.1源码,downloads-yocto/ptpd-2.3.1.tar.gz

./configure CC=aarch64-zxic-linux-gcc,提示编译链编译程序失败如下,需要添加系统目录--sysroot=/home/wangyb/sda3/zm9300c-V2XR260010/toolchain/sysroots/aarch64-zxic-linux,

checking for gcc... aarch64-zxic-linux-gcc checking whether the C compiler works... no configure: error: in `/home/wangyb/sda3/zm9300-tools/ptpd-2.3.1': configure: error: C compiler cannot create executables See `config.log' for more details configure:3582: checking whether the C compiler works configure:3604: aarch64-zxic-linux-gcc -O2 -pipe -g -feliminate-unused-debug-types -Wl,-O1 -Wl,--hash-style=gnu -Wl,--as-needed -fstack-protector-all -Wl,-z,relro,-z,now -fstack-protector-all -Wl,-z,relro,-z,now conftest.c >&5 /home/wangyb/sda3/zm9300c-V2XR260010/toolchain/sysroots/x86_64-zxic-linux/usr/libexec/aarch64-zxic-linux/gcc/aarch64-zxic-linux/9.3.0/real-ld: cannot find Scrt1.o: No such file or directory /home/wangyb/sda3/zm9300c-V2XR260010/toolchain/sysroots/x86_64-zxic-linux/usr/libexec/aarch64-zxic-linux/gcc/aarch64-zxic-linux/9.3.0/real-ld: cannot find crti.o: No such file or directory /home/wangyb/sda3/zm9300c-V2XR260010/toolchain/sysroots/x86_64-zxic-linux/usr/libexec/aarch64-zxic-linux/gcc/aarch64-zxic-linux/9.3.0/real-ld: cannot find crtbeginS.o: No such file or directory /home/wangyb/sda3/zm9300c-V2XR260010/toolchain/sysroots/x86_64-zxic-linux/usr/libexec/aarch64-zxic-linux/gcc/aarch64-zxic-linux/9.3.0/real-ld: cannot find -lgcc /home/wangyb/sda3/zm9300c-V2XR260010/toolchain/sysroots/x86_64-zxic-linux/usr/libexec/aarch64-zxic-linux/gcc/aarch64-zxic-linux/9.3.0/real-ld: cannot find -lgcc_s /home/wangyb/sda3/zm9300c-V2XR260010/toolchain/sysroots/x86_64-zxic-linux/usr/libexec/aarch64-zxic-linux/gcc/aarch64-zxic-linux/9.3.0/real-ld: cannot find -lc /home/wangyb/sda3/zm9300c-V2XR260010/toolchain/sysroots/x86_64-zxic-linux/usr/libexec/aarch64-zxic-linux/gcc/aarch64-zxic-linux/9.3.0/real-ld: cannot find -lgcc /home/wangyb/sda3/zm9300c-V2XR260010/toolchain/sysroots/x86_64-zxic-linux/usr/libexec/aarch64-zxic-linux/gcc/aarch64-zxic-linux/9.3.0/real-ld: cannot find -lgcc_s /home/wangyb/sda3/zm9300c-V2XR260010/toolchain/sysroots/x86_64-zxic-linux/usr/libexec/aarch64-zxic-linux/gcc/aarch64-zxic-linux/9.3.0/real-ld: cannot find crtendS.o: No such file or directory /home/wangyb/sda3/zm9300c-V2XR260010/toolchain/sysroots/x86_64-zxic-linux/usr/libexec/aarch64-zxic-linux/gcc/aarch64-zxic-linux/9.3.0/real-ld: cannot find crtn.o: No such file or directory collect2: error: ld returned 1 exit status configure:3608: $? = 1 configure:3646: result: no ./configure CC="aarch64-zxic-linux-gcc -mcpu=cortex-a53+crc -fstack-protector-all -pie -fPIE -Wformat -Wformat-security -Werror=format-security -fstack-protector-all -pie -fPIE -Wformat -Wformat-security -Werror=format-security --sysroot=/home/wangyb/sda3/zm9300c-V2XR260010/toolchain/sysroots/aarch64-zxic-linux"

提示不能运行编译链如下,由于没有指定host平台默认是x86 gcc,需要指定为arm平台:--host=aarch64-zxic-linux,配置成功后,make编译完成后文件位置:src/ptpd2

checking whether we are cross compiling... configure: error: in `/home/wangyb/sda3/zm9300-tools/ptpd-2.3.1': configure: error: cannot run C compiled programs. If you meant to cross compile, use `--host'. See `config.log' for more details 最终配置命令 ./configure CC="aarch64-zxic-linux-gcc -mcpu=cortex-a53+crc -fstack-protector-all -pie -fPIE -Wformat -Wformat-security -Werror=format-security -fstack-protector-all -pie -fPIE -Wformat -Wformat-security -Werror=format-security --sysroot=/home/wangyb/sda3/zm9300c-V2XR260010/toolchain/sysroots/aarch64-zxic-linux" --host=aarch64-zxic-linux

在IMX6板子上面运行ptpd2提示错误如下:

root@imx6qsabresd_genvict:~# ./ptpd2 -C -m -i eth0 2023-11-24 14:30:21.484399 ptpd2[6512].startup (info) (___) Configuration OK 2023-11-24 14:30:21.487152 ptpd2[6512].startup (info) (___) Successfully acquired lock on /var/run/ptpd2.lock 2023-11-24 14:30:21.487684 ptpd2[6512].startup (notice) (___) PTPDv2 started successfully on eth0 using "masterslave" preset (PID 6512) 2023-11-24 14:30:21.487775 ptpd2[6512].startup (info) (___) TimingService.PTP0: PTP service init 2023-11-24 14:30:21.491781 ptpd2[6512].eth0 (error) (init) failed to join the multicast group (strerror: No buffer space available) 2023-11-24 14:30:21.491880 ptpd2[6512].eth0 (error) (init) Failed to initialize network 2023-11-24 14:30:21.491943 ptpd2[6512].eth0 (error) (flt) PTPd init failed - will retry in 10 seconds

查看源码:src/dep/net.c,函数:netInitMulticastIPv4

/* join multicast group (for receiving) on specified interface */ if (setsockopt(netPath->eventSock, IPPROTO_IP, IP_ADD_MEMBERSHIP, &imr, sizeof(struct ip_mreq)) < 0 || setsockopt(netPath->generalSock, IPPROTO_IP, IP_ADD_MEMBERSHIP, &imr, sizeof(struct ip_mreq)) < 0) { PERROR("failed to join the multicast group"); return FALSE; }

添加错误值打印:

int ret1=0; int ret2=0; ret1=setsockopt(netPath->eventSock, IPPROTO_IP, IP_ADD_MEMBERSHIP, &imr, sizeof(struct ip_mreq)); if(ret1 < 0){ printf("errno = %d\n",errno); //105 printf("ret1=%d\n",ret1); return FALSE; } ret2=setsockopt(netPath->generalSock, IPPROTO_IP, IP_ADD_MEMBERSHIP, &imr, sizeof(struct ip_mreq)); if(ret2 < 0){ printf("ret2=%d\n",ret2); return FALSE; }

setsockopt返回-1,错误值105,搜索系统头文件:/usr/include/asm-generic/errno.h

#define ENOBUFS 105 /* No buffer space available */

通过网上搜到https://www.jianshu.com/p/6dfaeefac922,UDP组播的内核参数为0导致问题,修改10解决问题:

root@imx6qsabresd_genvict:~# sysctl net.ipv4.igmp_max_memberships net.ipv4.igmp_max_memberships = 0 root@imx6qsabresd_genvict:~# root@imx6qsabresd_genvict:~# sysctl -w net.ipv4.igmp_max_memberships=10 net.ipv4.igmp_max_memberships = 10

查看其他平台是设置的参数20,所以没有这个问题。

http://www.jsqmd.com/news/1166865/

相关文章:

  • 排序算法-冒泡排序
  • 9大网盘直链解析工具LinkSwift:彻底告别下载限速的终极解决方案
  • MJ V6出图崩坏?紧急修复清单:3分钟定位--tile错配、--stylize漂移、--v 6.2内核兼容性漏洞
  • GitHub加速终极指南:如何让你的下载速度提升10倍以上?
  • 如何将微信对话转化为永久数字资产:WeChatMsg数据管理完全指南
  • 2026淮海经济区多场景腻子粉建材采购供应商指南 - 起跑123
  • 5分钟解锁Kodi播放115网盘高清视频的完美方案
  • Animal-AI环境实战:基于动物认知的AI智能体测试与强化学习训练
  • H3C 云化园区网络 V100R023C10 部署:基于意图的 3 步配置与自动化运维实战
  • 【Midjourney批量生成黄金法则】:20年AI图像工程师亲授17种高效批量提示词架构与错误规避清单
  • 【RPA已死?AI Agent崛起真相】:Gartner认证架构师独家披露——传统RPA在2024 Q3后将面临3类不可逆失效场景
  • 抖音下载终极神器:douyin-downloader一键批量保存去水印工具全解析
  • BepInEx macOS开发实战:从源码编译到插件部署的完整指南
  • Grouper入门教程:从安装到生成首份组策略安全报告的完整步骤
  • Elsevier Tracker:科研投稿的智能追踪神器,彻底告别焦虑等待
  • Arduino Uno R3开发板入门学习笔记
  • 2026年7月上海宏碁售后本地化服务全景|交通指引气候养护到店全攻略.txt - 数码品牌推荐
  • 蓝牙5.4音频开发:IDC777-1模块与PIC18F4620实战
  • STM32F722VE与AD5593R混合信号系统开发指南
  • Windows服务器入侵排查:系统日志与FTP日志分析实战
  • 2026年7月赣州惠普售后设备故障诊断排查手册|常见问题一站式解答.txt - 数码品牌推荐
  • Spring Boot 2.x + MySQL 8.0 构建体质健康系统:从ER图到API的3个关键设计
  • 独立游戏开发从0到1:72小时闪电原型实战指南
  • eBPF 性能调优:避免生产环境中的副作用与开销
  • CTF SQL注入实战:SWPUCTF-2022 ez_sql 双写绕过与注释符应用解析
  • 二叉树遍历非递归算法:3种方法栈操作对比与10行代码实现差异
  • 深度解析C++11并发编程:从std::thread到内存模型的实战源码剖析
  • 蓝桥杯省赛编程题解析与攻略
  • Midjourney高清放大不是越多次越好!权威验证:单次放大>2x即触发纹理坍缩,第3次必损细节
  • Windows远程桌面CredSSP加密Oracle修正故障排查与解决方案