{"id":1084,"date":"2022-12-27T10:03:41","date_gmt":"2022-12-27T10:03:41","guid":{"rendered":"http:\/\/www.recologypower.com:9080\/?p=1078"},"modified":"2022-12-27T10:03:41","modified_gmt":"2022-12-27T10:03:41","slug":"%e3%80%90linux%e3%80%91%e5%ae%89%e8%a3%85sctp%e5%8d%8f%e8%ae%ae%e6%94%af%e6%8c%81","status":"publish","type":"post","link":"http:\/\/www.recologypower.com:9080\/?p=1084","title":{"rendered":"\u3010Linux\u3011\u5b89\u88c5SCTP\u534f\u8bae\u652f\u6301"},"content":{"rendered":"\n<h2 class=\"wp-block-heading\">\u4e00\u3001\u62a5\u9519\u73b0\u8c61<\/h2>\n\n\n\n<pre class=\"wp-block-code\"><code>\nsctp\u7a0b\u5e8f\u8fd0\u884c\uff1a\nint i = socket(AF_INET,SOCK_STREAM,IPPROTO_SCTP);\nprintf(\"huilh:%d,%d\\r\\n\",i,errno);\n\u8f93\u51fa\uff1a\nhuilh:-1,93\n\nchecksctp:\nsctp: Protocol not supported<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">\u4e8c\u3001\u89e3\u51b3\u65b9\u6cd5<\/h2>\n\n\n\n<p>1\u3001\u5916\u56f4\u7684\u6a21\u5757\u52a0\u8f7d\u5230\u5185\u6838\u4e2d<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>#yum list kernel-modules-extra*\n\nkernel-modules-extra.x86_64             4.18.0-240.15.1.el8_3             BaseOS\n\n#yum install kernel-modules-extra.x86_64<\/code><\/pre>\n\n\n\n<p>2\u3001\u5b89\u88c5SCTP<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>yum install lksctp*<\/code><\/pre>\n\n\n\n<p>3\u3001\u67e5\u770b\u5b89\u88c5\u662f\u5426\u6210\u529f<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code># modinfo sctp\n\nfilename:       \/lib\/modules\/4.18.0-240.15.1.el8_3.x86_64\/kernel\/net\/sctp\/sctp.ko.xz\nlicense:        GPL\ndescription:    Support for the SCTP protocol (RFC2960)\nauthor:         Linux Kernel SCTP developers &lt;linux-sctp@vger.kernel.org>\nalias:          net-pf-10-proto-132\nalias:          net-pf-2-proto-132\nrhelversion:    8.3\nsrcversion:     1F7FF36BEF4076DB3D4AF26\ndepends:        libcrc32c\nintree:         Y\nname:           sctp\nvermagic:       4.18.0-240.15.1.el8_3.x86_64 SMP mod_unload modversions\nsig_id:         PKCS#7\nsigner:         CentOS kernel signing key\nsig_key:        43:C1:A4:E8:DF:2E:B3:D4:43:C1:4B:38:46:94:93:EB:C4:27:08:0D\nsig_hashalgo:   sha256\nsignature:      1F:34:2A:3F:35:55:A9:24:B2:64:31:D6:AA:8F:E0:10:0C:76:B8:BF:\n        CB:47:B0:59:39:22:B4:E8:3B:9A:F9:B5:82:D9:22:53:4E:A7:27:4C:\n        D7:F3:C9:65:B6:77:1A:5A:25:18:C8:9B:D7:27:CB:A3:D4:95:ED:E5:\n        3E:87:4E:E3:4F:A0:5B:DA:31:18:34:89:88:D9:CC:F5:90:76:D6:4A:\n        0D:BA:1B:09:E2:10:80:7B:77:7B:15:97:7E:F9:45:92:39:7D:7C:A9:\n        5D:4E:D5:8C:61:E0:F0:8D:CB:97:A7:E6:0C:84:64:6B:26:C7:69:02:\n        54:EA:EB:04:C9:02:39:F8:7E:C7:08:C2:7E:83:4A:69:4F:B2:8C:83:\n        C9:51:9B:5D:C7:C4:DB:5A:C4:14:DA:52:64:A2:FF:C5:E2:FE:DA:ED:\n        B9:44:4B:C7:A8:D9:F4:78:A6:35:E9:E8:1C:14:E6:1B:1B:AD:72:4B:\n        22:4E:05:6D:E6:DE:0A:D8:98:2C:AD:6E:25:84:1F:38:C1:D7:2B:5C:\n        79:E6:CC:DF:16:D2:54:17:CD:87:B5:56:00:20:9D:09:F4:01:75:85:\n        83:CA:C6:75:7E:3A:15:95:04:98:F1:D4:A1:47:CD:B1:8A:6A:3A:51:\n        1F:07:1C:47:02:6A:17:CC:27:F5:DD:58:15:18:77:5B:BC:76:60:3C:\n        D5:97:2C:EF:0E:32:E4:A3:93:EE:E7:F8:93:09:CB:1D:DB:84:D3:B5:\n        56:C9:50:5C:42:95:7E:64:DF:CD:CE:4E:7E:AF:DE:C8:E9:29:51:62:\n        46:C1:6F:BF:85:1E:EB:36:65:40:74:EF:64:47:6A:AB:11:B0:B7:24:\n        4E:4F:3A:60:83:C7:5B:42:6A:A3:DC:0B:89:6C:CB:7D:EC:00:6A:8C:\n        48:DE:17:B4:85:41:A1:F7:68:74:1C:FA:D2:10:89:20:A7:75:34:05:\n        E7:A8:BB:AD:BA:33:2F:04:92:A1:33:1B:68:9A:D7:20:25:BA:7A:61:\n        A8:DE:D2:85\nparm:           no_checksums:Disable checksums computing and verification (bool)<\/code><\/pre>\n\n\n\n<p>\u4ece\u4e0a\u8ff0\u7ed3\u679c\u53ef\u4ee5\u770b\u51fa\uff0c\u53ef\u4ee5\u67e5\u5230\u6a21\u5757\uff0c\u7136\u540e\u4f7f\u7528lsmod | grep sctp\u67e5\u770b\u662f\u5426\u80fd\u67e5\u5230\u6a21\u5757\uff0c\u5982\u679c\u4e0d\u80fd\u67e5\u5230\uff0c\u5219\u4f7f\u7528modprobe sctp \u5b89\u88c5<\/p>\n\n\n\n<p>4\u3001\u624b\u52a8\u52a0\u8f7dSCTP<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code># modprobe sctp<\/code><\/pre>\n\n\n\n<p>\u5b89\u88c5\u5b8c\u6bd5\u540e\uff0c\u518d\u7528lsmod \u67e5\u770b\u662f\u5426\u5df2\u5b89\u88c5sctp\u6a21\u5757\u3002\u6240\u793a\u7ed3\u679c\u5982\u4e0b\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>#lsmod | grep sctp\n\nsctp                  405504  18\nlibcrc32c              16384  4 nf_conntrack,nf_nat,xfs,sctp<\/code><\/pre>\n\n\n\n<p>\u8868\u660elsctp\u6a21\u5757\u5df2\u5728\u5f53\u524dlinux\u4e0b\u5b89\u88c5\u5b8c\u6210\u3002\u6216\u8005\u4f7f\u7528cat \u547d\u4ee4\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code># cat \/proc\/modules | grep sctp\n\nsctp 405504 18 - Live 0xffffffffc0d71000\nlibcrc32c 16384 4 sctp,nf_nat,nf_conntrack,xfs, Live 0xffffffffc00dc000<\/code><\/pre>\n\n\n\n<p>5\u3001\u81ea\u52a8\u52a0\u8f7d<\/p>\n\n\n\n<p>\u5982\u679csctp\u4e0d\u80fd\u81ea\u52a8\u52a0\u8f7d\u5230\u5185\u6838\uff0c\u8bf7\u4f7f\u7528\u4e0b\u9762\u5904\u7406\u65b9\u5f0f\u3002<\/p>\n\n\n\n<p>\u5728\/etc\/sysconfig\/modules\u7684\u76ee\u5f55\u4e0b\u65b0\u5efasctp.modules\u6587\u4ef6<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>#! \/bin\/sh\n\n\/sbin\/modinfo -F filename sctp > \/dev\/null 2>&amp;1\nif &#91; $? -eq 0 ]; then\n    \/sbin\/modprobe sctp\nfi<\/code><\/pre>\n\n\n\n<p>\u4fdd\u5b58\u540e\uff0c\u4fee\u6539\u6743\u9650chmod+777 sctp.modules\uff0c\u91cd\u542f\u4fbf\u53ef\u770b\u5230\u5df2\u81ea\u52a8\u52a0\u8f7d\u3002<\/p>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<div class=\"slide-text-bg2\">\n<h3>\u4e00\u3001\u62a5\u9519\u73b0\u8c61 \u4e8c\u3001\u89e3\u51b3\u65b9\u6cd5 1\u3001\u5916\u56f4\u7684\u6a21<\/h3>\n<\/div>\n<div class=\"flex-btn-div\"><a href=\"http:\/\/www.recologypower.com:9080\/?p=1084\" class=\"btn1 flex-btn\">\u9605\u8bfb\u66f4\u591a<\/a><\/div>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[110],"tags":[],"_links":{"self":[{"href":"http:\/\/www.recologypower.com:9080\/index.php?rest_route=\/wp\/v2\/posts\/1084"}],"collection":[{"href":"http:\/\/www.recologypower.com:9080\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.recologypower.com:9080\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.recologypower.com:9080\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"http:\/\/www.recologypower.com:9080\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1084"}],"version-history":[{"count":0,"href":"http:\/\/www.recologypower.com:9080\/index.php?rest_route=\/wp\/v2\/posts\/1084\/revisions"}],"wp:attachment":[{"href":"http:\/\/www.recologypower.com:9080\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1084"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.recologypower.com:9080\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1084"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.recologypower.com:9080\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1084"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}