Openwrt / Coovachilli分段错误

时间:2015-11-17 16:35:54

标签: openwrt coovachilli

这是辣椒的配置:

~# cat /etc/chilli.conf 
ipup=/etc/chilli/up.sh
ipdown=/etc/chilli/down.sh
conup=/etc/chilli/conup.sh
include /etc/chilli/main.conf
include /etc/chilli/1_wl.conf
include /etc/chilli/2_wl.conf
include /etc/chilli/3_wl.conf
include /etc/chilli/4_wl.conf

" * _ wl.conf"文件包含如下列表:

uamdomain=*.doodle.com
uamdomain=*.stackoverflow.com

当我运行coovachilli的调试时,我注意到存在内存分段错误:

~# chilli --debug --fg

main-opt.c: 605: 0 (Debug) DHCP Listen: 192.168.182.25
main-opt.c: 606: 0 (Debug) UAM Listen: 192.168.182.25
garden.c: 414: 0 (Debug) Uamallowed IP address #0:128: proto=0 host=167.22.27.58 port=80
main-opt.c: 785: 0 (Debug) uamdomain *.mysite.com
main-opt.c: 785: 0 (Debug) uamdomain *.stackoverflow.com
main-opt.c: 785: 0 (Debug) uamdomain *.mysite.com
main-opt.c: 785: 0 (Debug) uamdomain *.google.com
main-opt.c: 785: 0 (Debug) uamdomain *.mysite.com
main-opt.c: 785: 0 (Debug) uamdomain *.stackoverflow.com
main-opt.c: 785: 0 (Debug) uamdomain *.mysite.com
main-opt.c: 785: 0 (Debug) uamdomain *.google.com
main-opt.c: 785: 0 (Debug) uamdomain *.mysite.com
main-opt.c: 785: 0 (Debug) uamdomain *.stackoverflow.com
main-opt.c: 785: 0 (Debug) uamdomain *.mysite.com
main-opt.c: 785: 0 (Debug) uamdomain *.google.com
main-opt.c: 785: 0 (Debug) uamdomain *.mysite.com
main-opt.c: 785: 0 (Debug) uamdomain *.stackoverflow.com
main-opt.c: 785: 0 (Debug) uamdomain *.mysite.com
main-opt.c: 785: 0 (Debug) uamdomain *.google.com
main-opt.c: 785: 0 (Debug) uamdomain *.mysite.com
main-opt.c: 785: 0 (Debug) uamdomain *.stackoverflow.com
main-opt.c: 785: 0 (Debug) uamdomain *.mysite.com
main-opt.c: 785: 0 (Debug) uamdomain *.google.com
main-opt.c: 785: 0 (Debug) uamdomain *.mysite.com
main-opt.c: 785: 0 (Debug) uamdomain *.stackoverflow.com
main-opt.c: 785: 0 (Debug) uamdomain *.mysite.com
main-opt.c: 785: 0 (Debug) uamdomain *.google.com
main-opt.c: 785: 0 (Debug) uamdomain *.mysite.com
main-opt.c: 785: 0 (Debug) uamdomain *.stackoverflow.com
main-opt.c: 785: 0 (Debug) uamdomain *.mysite.com
main-opt.c: 785: 0 (Debug) uamdomain *.google.com
main-opt.c: 785: 0 (Debug) uamdomain *.mysite.com
main-opt.c: 785: 0 (Debug) uamdomain *.stackoverflow.com
main-opt.c: 785: 0 (Debug) uamdomain *.mysite.com
main-opt.c: 785: 0 (Debug) uamdomain *.google.com
options.c: 443: 0 (Debug) PID 2928 saving options to /var/run/chilli.2927.cfg.bin
options.c: 652: 0 (Debug) PID 2927 reloaded binary options file
chilli.c: 7143: 0 (Debug) clock realtime sec 1447776837 nsec 649225082
chilli.c: 7148: 0 (Debug) clock monotonic sec 203 nsec 835970546
tun.c: 605: 0 (Debug) TX queue length set to 100
tun.c: 1108: 0 (Debug) Running /etc/chilli/up.sh
ippool.c: 338: 0 (Debug) Hashlog 9 509 512
net.c: 1239: 0 (Debug) Net SNDBUF 163840
net.c: 1242: 0 (Debug) Net RCVBUF 163840
net.c: 1295: 0 (Debug) device br-coova ifindex 6
net.c: 1311: 0 (Debug) lo  address family: 17 (AF_PACKET)
net.c: 1311: 0 (Debug) eth0  address family: 17 (AF_PACKET)
net.c: 1311: 0 (Debug) eth1  address family: 17 (AF_PACKET)
net.c: 1311: 0 (Debug) br-coova  address family: 17 (AF_PACKET)
net.c: 1311: 0 (Debug) eth1.4  address family: 17 (AF_PACKET)
net.c: 1311: 0 (Debug) br-lan  address family: 17 (AF_PACKET)
net.c: 1311: 0 (Debug) eth1.1  address family: 17 (AF_PACKET)
net.c: 1311: 0 (Debug) eth1.3  address family: 17 (AF_PACKET)
net.c: 1311: 0 (Debug) wlan0  address family: 17 (AF_PACKET)
net.c: 1311: 0 (Debug) wlan1  address family: 17 (AF_PACKET)
net.c: 1311: 0 (Debug) wlan1-1  address family: 17 (AF_PACKET)
net.c: 1311: 0 (Debug) wlan0-1  address family: 17 (AF_PACKET)
net.c: 1311: 0 (Debug) tap0  address family: 17 (AF_PACKET)
net.c: 1311: 0 (Debug) lo  address family: 2 (AF_INET)
net.c: 1311: 0 (Debug) eth0  address family: 2 (AF_INET)
net.c: 1311: 0 (Debug) br-coova  address family: 2 (AF_INET)
net.c: 1311: 0 (Debug) br-lan  address family: 2 (AF_INET)
net.c: 1311: 0 (Debug) eth1.3  address family: 2 (AF_INET)
net.c: 1311: 0 (Debug) tap0  address family: 2 (AF_INET)
net.c: 1311: 0 (Debug) tun1  address family: 2 (AF_INET)
net.c: 1311: 0 (Debug) lo  address family: 10 (AF_INET6)
net.c: 1311: 0 (Debug) eth0  address family: 10 (AF_INET6)
net.c: 1311: 0 (Debug) eth1  address family: 10 (AF_INET6)
net.c: 1311: 0 (Debug) br-coova  address family: 10 (AF_INET6)
net.c: 1326: 0 (Debug) address: <fe80::32b5:c23f:fe62:4fb2%br-coova>

net.c: 1311: 0 (Debug) br-lan  address family: 10 (AF_INET6)
net.c: 1311: 0 (Debug) eth1.3  address family: 10 (AF_INET6)
net.c: 1311: 0 (Debug) wlan0  address family: 10 (AF_INET6)
net.c: 1311: 0 (Debug) wlan1  address family: 10 (AF_INET6)
net.c: 1311: 0 (Debug) wlan1-1  address family: 10 (AF_INET6)
net.c: 1311: 0 (Debug) wlan0-1  address family: 10 (AF_INET6)
net.c: 1311: 0 (Debug) tap0  address family: 10 (AF_INET6)
dhcp.c: 481: 0 (Debug) hash table size 64 (56)
dhcp.c: 333: 0 (Debug) GARP: Replying to broadcast
dhcp.c: 1173: 0 (Debug) dhcpif (br-coova) IPv6 address fe81::32b5:f2ff:fe62:4fb2
radius.c: 1315: 0 (Debug) RADIUS client 10.9.1.231:0
chilli.c: 7303: 0 (Debug) Waiting for client request...
radius.c: 321: 0 (Debug) Allocating RADIUS packet
net.c: 388: 0 (Debug) net select count: 1
net.c: 388: 0 (Debug) net select count: 2
net.c: 388: 0 (Debug) net select count: 3
net.c: 388: 0 (Debug) net select count: 4
net.c: 388: 0 (Debug) net select count: 5
net.c: 388: 0 (Debug) net select count: 6
net.c: 388: 0 (Debug) net select count: 7
net.c: 388: 0 (Debug) net select count: 8
dhcp.c: 3593: 0 (Debug) Not for our MAC or broadcast: 32-B4-DC-62-4F-B3
radius.c: 1898: 0 (Debug) Received RADIUS packet id=0
radius.c: 421: 0 (Debug) Freeing RADIUS packet
radius.c: 426: 0 (Debug) RADIUS queue-out id=0 idx=0
chilli.c: 379: 0 (Debug) caught 18 via selfpipe
chilli.c: 310: 0 (Debug) child 2932 terminated
dhcp.c: 5060: 0 (Debug) Layer2 PROT: 0x86dd dropped
dhcp.c: 5060: 0 (Debug) Layer2 PROT: 0x86dd dropped
dhcp.c: 5060: 0 (Debug) Layer2 PROT: 0x86dd dropped
dhcp.c: 3618: 0 (Debug) dhcp/bootps request being processed
dhcp.c: 3263: 0 (Debug) function dhcp_getreq()
dhcp.c: 730: 0 (Debug) DHCP newconn: 48:5a:3f:7d:d4:8b
chilli.c: 5117: 0 (Debug) New DHCP request from MAC=48-5A-3F-7D-D4-8B
chilli.c: 5120: 0 (Debug) New DHCP connection established
chilli.c: 5076: 0 (Debug) New Chilli Connection
chilli.c: 4869: 0 (Debug) ----> cb_dhcp_request <----
chilli.c: 4873: 0 (Debug) DHCP request for IP address 0.0.0.0
chilli.c: 835: 0 (Debug) newip 0.0.0.0
ippool.c: 456: 0 (Debug) Requesting new static ip: 0.0.0.0
ippool.c: 456: 0 (Debug) Requesting new dynamic ip: 0.0.0.0
chilli.c: 5005: 0 (Debug) Client MAC=48-5A-3F-7D-D4-8B assigned IP 192.168.182.2
dhcp.c: 2755: 0 (Debug) dhcp server: 
dhcp.c: 3618: 0 (Debug) dhcp/bootps request being processed
dhcp.c: 3263: 0 (Debug) function dhcp_getreq()
chilli.c: 4869: 0 (Debug) ----> cb_dhcp_request <----
chilli.c: 4873: 0 (Debug) DHCP request for IP address 192.168.182.2
dhcp.c: 2755: 0 (Debug) dhcp server: 
dhcp.c: 5060: 0 (Debug) Layer2 PROT: 0x86dd dropped
dhcp.c: 5622: 0 (Debug) ARP: 48-5A-3F-7D-D4-8B asking about 192.168.182.25
dhcp.c: 5506: 0 (Debug) ARP: Replying to 192.168.182.2 / 48-5A-3F-7D-D4-8B
dns.c: 187: 0 (Debug) It was a dns record type: 1 class: 1
dns.c: 194: 0 (Debug) DNS: www.google.com
dns.c: 187: 0 (Debug) It was a dns record type: 1 class: 1
dns.c: 194: 0 (Debug) DNS: www.google.com
dns.c: 187: 0 (Debug) It was a dns record type: 1 class: 1
dns.c: 194: 0 (Debug) DNS: www.google.com
dns.c: 210: 0 (Debug) checking *.mysite.com [www.google.com]
dns.c: 210: 0 (Debug) checking *.stackoverflow.com [www.google.com]
dns.c: 210: 0 (Debug) checking *.mysite.com [www.google.com]
dns.c: 210: 0 (Debug) checking *.google.com [www.google.com]
dns.c: 210: 0 (Debug) checking *.mysite.com [www.google.com]
dns.c: 210: 0 (Debug) checking *.stackoverflow.com [www.google.com]
dns.c: 210: 0 (Debug) checking *.mysite.com [www.google.com]
dns.c: 210: 0 (Debug) checking *.google.com [www.google.com]
dns.c: 210: 0 (Debug) checking *.mysite.com [www.google.com]
dns.c: 210: 0 (Debug) checking *.stackoverflow.com [www.google.com]
dns.c: 210: 0 (Debug) checking *.mysite.com [www.google.com]
dns.c: 210: 0 (Debug) checking *.google.com [www.google.com]
dns.c: 210: 0 (Debug) checking *.mysite.com [www.google.com]
dns.c: 210: 0 (Debug) checking *.stackoverflow.com [www.google.com]
dns.c: 210: 0 (Debug) checking *.mysite.com [www.google.com]
dns.c: 210: 0 (Debug) checking *.google.com [www.google.com]
dns.c: 210: 0 (Debug) checking *.mysite.com [www.google.com]
dns.c: 210: 0 (Debug) checking *.stackoverflow.com [www.google.com]
dns.c: 210: 0 (Debug) checking *.mysite.com [www.google.com]
dns.c: 210: 0 (Debug) checking *.google.com [www.google.com]
dns.c: 210: 0 (Debug) checking *.mysite.com [www.google.com]
dns.c: 210: 0 (Debug) checking *.stackoverflow.com [www.google.com]
dns.c: 210: 0 (Debug) checking *.mysite.com [www.google.com]
dns.c: 210: 0 (Debug) checking *.google.com [www.google.com]
dns.c: 210: 0 (Debug) checking *.mysite.com [www.google.com]
dns.c: 210: 0 (Debug) checking *.stackoverflow.com [www.google.com]
dns.c: 210: 0 (Debug) checking *.mysite.com [www.google.com]
dns.c: 210: 0 (Debug) checking *.google.com [www.google.com]
dns.c: 210: 0 (Debug) checking *.mysite.com [www.google.com]
dns.c: 210: 0 (Debug) checking *.stackoverflow.com [www.google.com]
dns.c: 210: 0 (Debug) checking *.mysite.com [www.google.com]
dns.c: 210: 0 (Debug) checking *.google.com [www.google.com]
Segmentation fault

当我评论白名单的包含时,一切正常,没有ant内存错误:

~# cat /etc/chilli.conf 
ipup=/etc/chilli/up.sh
ipdown=/etc/chilli/down.sh
conup=/etc/chilli/conup.sh
include /etc/chilli/main.conf
#include /etc/chilli/1_wl.conf
#include /etc/chilli/2_wl.conf
#include /etc/chilli/3_wl.conf
#include /etc/chilli/4_wl.conf

Whiltelist文件非常小:

# du -sh /etc/chilli/
90.0K   /etc/chilli/

更新

使用bash脚本完成配置:echo "" > /etc/chilli.conf没有魔法!

复制/粘贴到配置文件时脚本生成的相同配置工作正常,但在生成并使用脚本重定向到配置文件时,我遇到了分段错误。

1 个答案:

答案 0 :(得分:-1)

看起来您的配置不对:

main-opt.c: 785: 0 (Debug) uamdomain *.mysite.com
main-opt.c: 785: 0 (Debug) uamdomain *.stackoverflow.com
main-opt.c: 785: 0 (Debug) uamdomain *.mysite.com
main-opt.c: 785: 0 (Debug) uamdomain *.google.com
main-opt.c: 785: 0 (Debug) uamdomain *.mysite.com
main-opt.c: 785: 0 (Debug) uamdomain *.stackoverflow.com
main-opt.c: 785: 0 (Debug) uamdomain *.mysite.com
main-opt.c: 785: 0 (Debug) uamdomain *.google.com
main-opt.c: 785: 0 (Debug) uamdomain *.mysite.com
main-opt.c: 785: 0 (Debug) uamdomain *.stackoverflow.com
main-opt.c: 785: 0 (Debug) uamdomain *.mysite.com
main-opt.c: 785: 0 (Debug) uamdomain *.google.com
main-opt.c: 785: 0 (Debug) uamdomain *.mysite.com
main-opt.c: 785: 0 (Debug) uamdomain *.stackoverflow.com
main-opt.c: 785: 0 (Debug) uamdomain *.mysite.com
main-opt.c: 785: 0 (Debug) uamdomain *.google.com
main-opt.c: 785: 0 (Debug) uamdomain *.mysite.com
main-opt.c: 785: 0 (Debug) uamdomain *.stackoverflow.com
main-opt.c: 785: 0 (Debug) uamdomain *.mysite.com
main-opt.c: 785: 0 (Debug) uamdomain *.google.com
main-opt.c: 785: 0 (Debug) uamdomain *.mysite.com
main-opt.c: 785: 0 (Debug) uamdomain *.stackoverflow.com
main-opt.c: 785: 0 (Debug) uamdomain *.mysite.com
main-opt.c: 785: 0 (Debug) uamdomain *.google.com
main-opt.c: 785: 0 (Debug) uamdomain *.mysite.com
main-opt.c: 785: 0 (Debug) uamdomain *.stackoverflow.com
main-opt.c: 785: 0 (Debug) uamdomain *.mysite.com
main-opt.c: 785: 0 (Debug) uamdomain *.google.com
main-opt.c: 785: 0 (Debug) uamdomain *.mysite.com
main-opt.c: 785: 0 (Debug) uamdomain *.stackoverflow.com
main-opt.c: 785: 0 (Debug) uamdomain *.mysite.com
main-opt.c: 785: 0 (Debug) uamdomain *.google.com

chilli允许多个uamdomain选项,但辣椒不会检查它是否已经在uamdomain列表中。

请删除/etc/chilli/*_wl.conf文件中的重复的uamdomain选项。

它应该只显示每个域的一个uamdomain调试消息,如下所示:

main-opt.c: 785: 0 (Debug) uamdomain *.mysite.com
main-opt.c: 785: 0 (Debug) uamdomain *.stackoverflow.com
main-opt.c: 785: 0 (Debug) uamdomain *.google.com