2015-11-17 4 views
0

Это конфигурация перца чили: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 

Когда я комментирую включение белого списка, все отлично работает без муравьиной ошибки памяти:

~# 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/ 

Update

Конфигурация была выполнена с использованием Баш скрипт, который будет просто падение: echo "" > /etc/chilli.conf никакой магии !

Та же конфигурация, сгенерированная скриптом при копировании/вставке в файл конфигурации, отлично работает, но когда сгенерирована и перенаправлена ​​в файл конфигурации с использованием сценария, у меня есть ошибка сегментации.

ответ

-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 

перец чили позволяет несколько вариант uamdomain, но перец чили не проверяет, является ли он уже в списке uamdomain.

Удалите дублируемую опцию uamdomain в файле /etc/chilli/*_wl.conf.

Он должен показывает только один 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