0
爲了學習目的,我正在開發一個名爲HTP(在傳輸層上作爲UDP/TCP)的新協議,並傾向於將其註冊到Linux內核作爲一個模塊。錯誤協議41> = NPROTO(41)將新協議添加到Linux內核
在此之後教程 https://linuxwarrior.wordpress.com/2008/12/02/add-a-new-protocol-to-linux-kernel/
我插入一個新的記錄到LINUX/sock.h頭文件:
#define AF_HTP 41 /* new HTP protocol family*/
#define AF_MAX 42 /* For now.. */
(它使用僅具有41協議,AF_MAX = 41)
在我的代碼中,我做了:
static struct net_proto_family htp_proto_family = {
.family = AF_HTP,
.create = htp_create_socket,
.owner = THIS_MODULE,
};
...
//in init_module
proto_register_status = proto_register(&htp_proto, 1);
這是我得到的dmesg的沒有安裝模塊後:
[ 594.098672] protocol 41 >= NPROTO(41)
我的問題: 我應該在這種情況下怎麼辦?我必須重新編譯Linux內核還是有其他解決方法?
非常感謝。
謝謝,我會嘗試一下:) – Immort