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/

拨号上网:

参考网页:https://forums.gentoo.org/viewtopic-p-7100056.html

https://bugs.gentoo.org/attachment.cgi?id=320466&action=edit

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:https://www.heiqu.com/15394.html