2021-05-12 14:32:11
Linux下ppp安裝及「field 'pppol2tp' has incomplete type「解決
PPP官網下載:https://download.samba.org/pub/ppp/
編譯:
root@zhaoxc-VBox:/opt/arm-tools/ppp-2.4.5# ./configure --prefix=/opt/arm-tools/ppp-2.4.5/install-arm/
root@zhaoxc-VBox:/opt/arm-tools/ppp-2.4.5# make CC=arm-none-linux-gnueabi
root@zhaoxc-VBox:/opt/arm-tools/ppp-2.4.5# make install
註1:由於一開始的編譯命令式./configure --host=arm-none-linux-gnueabi --prefix=/opt/arm-tools/ppp-2.4.5/install-arm/ 實際上生成的Makefile裡面並沒有指定編譯器,但是make時使用的是gcc,而不是arm-none-linux-gnueabi-gcc,所以在ARM無法執行。報錯“pppd -sh: cannot execute binary file ”
註2:make時出錯“ppp install "error: field ‘pppol2tp’ has incomplete type”然後搜尋原因,在網上找到一位大神的修復方法:在ppp-2.4.5/include/linux/if_pppol2tp.h中新增程式如下:
--- ppp-2.4.5/include/linux/if_pppol2tp.h 2009-11-16 22:26:07.000000000 +0000
+++ ppp-2.4.5/include/linux/if_pppol2tp.h 2010-07-16 22:35:22.000000000 +0100
@@ -32,6 +32,45 @@
__u16 d_tunnel, d_session;
};
+
+struct pppol2tpin6_addr {
+ __kernel_pid_t pid;
+ int fd;
+
+ __u16 s_tunnel, s_session;
+ __u16 d_tunnel, d_session;
+
+ struct sockaddr_in6 addr;
+};
+
+
+struct pppol2tpv3_addr {
+ pid_t pid;
+ int fd;
+
+ struct sockaddr_in addr;
+
+ __u32 s_tunnel, s_session;
+ __u32 d_tunnel, d_session;
+};
+
+struct pppol2tpv3in6_addr {
+ __kernel_pid_t pid;
+ int fd;
+
+ __u32 s_tunnel, s_session;
+ __u32 d_tunnel, d_session;
+
+ struct sockaddr_in6 addr;
+};
+
/* Socket options:
* DEBUG - bitmask of debug message categories
* SENDSEQ - 0 => don't send packets with sequence numbers
複製到ARM上:
按照上面的make好之後,由於make install出錯,所以直接在目錄中找到如下的四個檔案:
chat pppd pppdump pppstats
複製到ARM的/usr/sbin目錄下
建立/etc/ppp目錄:
從ppp-2.4.5相應目錄中拷貝檔案,建立如下目錄結構:
/etc/ppp/chap-secrets
/etc/ppp/pap-secrets
/etc/ppp/ip-up
/etc/ppp/ip-down
/etc/ppp/peer/
撥號上網:
見 http://www.linuxidc.com/Linux/2016-03/129581.htm
參考網頁:https://forums.gentoo.org/viewtopic-p-7100056.html
https://bugs.gentoo.org/attachment.cgi?id=320466&action=edit
本文永久更新連結地址:http://www.linuxidc.com/Linux/2016-03/129580.htm
相關文章