15AH, San Francisco

California, United States.

Send Your Mail At:

tianyingkejishe@sina.cn

Working Hours

Mon-Sat: 9.30am To 7.00pm

【Centos】Centos8默认不支持SCTP

一、问题

#include <sys/types.h>
#include <sys/socket.h>
#include <string.h>
#include <netinet/sctp.h>
#include <stdio.h>

int main()
{
        int i = socket(AF_INET,SOCK_STREAM,IPPROTO_SCTP);
        printf("huilh:%d\r\n",i);
        return 0;
}

执行后i=-1,通过系统指令checksctp检测,发现system not surpote。

二、解决方式

打开网址:https://centos.pkgs.org/,下载sctp rpm安装包,安装完。

yum -y install kernel-modules-extra

打开/etc/modprobe.d/sctp-blacklist.conf文件,注释掉blacklist sctp。把sctp从黑名单删除。

重启电脑。

anyShare分享到:
本站的文章和资源来自互联网或者站长的原创,按照 CC BY -NC -SA 3.0 CN协议发布和共享,转载或引用本站文章应遵循相同协议。如果有侵犯版权的资源请尽快联系站长,我们会在24h内删除有争议的资源。欢迎大家多多交流,期待共同学习进步。
stormwind