<div dir="ltr">I made the changes you mentioned and when I run it in the foreground&nbsp; it seems to go just fine before eventually aborting. Will wifidog not run indefinitely in the foreground of a terminal? When I run it in the backround I see the following in syslog:<br>
<br>Jul 28 15:14:03 wifidog wifidog[26746]: Reading configuration file &#39;/usr/local/etc/wifidog.conf&#39;<br>Jul 28 15:14:03 wifidog wifidog[26746]: Forking into background<br>Jul 28 15:14:03 wifidog wifidog[26748]: Setting started_time<br>
Jul 28 15:14:03 wifidog wifidog[26748]: Creating web server on <a href="http://216.193.211.3:2060">216.193.211.3:2060</a><br>Jul 28 15:14:03 wifidog wifidog[26748]: Removing Firewall rules<br>Jul 28 15:14:03 wifidog wifidog[26748]: Creating ICMP socket<br>
Jul 28 15:14:03 wifidog wifidog[26748]: Initializing Firewall<br>Jul 28 15:14:03 wifidog wifidog[26748]: Waiting for connections<br>Jul 28 15:14:03 wifidog wifidog[26748]: ONLINE status became ON<br>Jul 28 15:14:03 wifidog wifidog[26748]: Clearing the authservers list<br>
Jul 28 15:14:03 wifidog wifidog[26748]: Setting the authservers list<br><br><br>However I don&#39;t see any process called wifidog running and when I look for 2060 in netstat I don&#39;t see anything listening. I am confused.<br>
<br>Thanks<br>Clifford<br><br><div class="gmail_quote">On Mon, Jul 28, 2008 at 5:45 PM, Clifford Thurber &lt;<a href="mailto:clifford@hdn.net">clifford@hdn.net</a>&gt; wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div dir="ltr">I am running: <br>Fedora release 9 (Sulphur) on an Intel Xeon. I am going to try the fix you suggested right now.<div><div></div><div class="Wj3C7c"><br><br><br><div class="gmail_quote">On Mon, Jul 28, 2008 at 5:20 PM, acv &lt;<a href="mailto:acv@miniguru.ca" target="_blank">acv@miniguru.ca</a>&gt; wrote:<br>

<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">I&#39;ve reproduced the bug on Ubuntu 7.10 x86_64. The fix is trivial,<br>
util.c must include &lt;arpa/inet.h&gt;. Right now this only happens if<br>
__NetBSD__ is defined.<br>
<br>
I&#39;ve tested on Red Hat 7.3 (as a suitable substitute for antique<br>
Linux platform and as an i386 32-bit platform) and there it works<br>
regardless of whether &lt;arpa/inet.h&gt; is included. Although the man<br>
page says it&#39;s required.<br>
<br>
I don&#39;t have a 32-bit Ubuntu 7.10 to test whether 32-bit Linux as<br>
a whole is exempt from including that file. I&#39;ll commit the include<br>
to the SVN later today when I get home (hopefully I&#39;ll remember my<br>
password.) If someone else wants to check it in, go ahead.<br>
<br>
Temporary fix:<br>
<br>
In src/util.c, cut line 45 (#include &lt;arpa/inet.h&gt;) and paste it<br>
above line 44 (#if defined(__NetBSD__)).<br>
<br>
Cheers,<br>
<br>
Alex<br>
<br>
On Mon, Jul 28, 2008 at 04:57:28PM -0400, acv wrote:<br>
&gt; Date: Mon, 28 Jul 2008 16:57:28 -0400<br>
&gt; From: acv &lt;<a href="mailto:acv@miniguru.ca" target="_blank">acv@miniguru.ca</a>&gt;<br>
<div>&gt; To: WiFiDog Captive Portal &lt;<a href="mailto:wifidog@listes.ilesansfil.org" target="_blank">wifidog@listes.ilesansfil.org</a>&gt;<br>
</div>&gt; Mail-Followup-To: WiFiDog Captive Portal &lt;<a href="mailto:wifidog@listes.ilesansfil.org" target="_blank">wifidog@listes.ilesansfil.org</a>&gt;<br>
<div><div></div><div>&gt; Subject: Re: [isf-wifidog] seg fault<br>
&gt;<br>
&gt; On the surface, it looks like the bug is caused by inet_ntoa() not returning<br>
&gt; a null-terminated string, that&#39;s why strlen() segfaults, it goes beyond the<br>
&gt; end of the string. This could either be caused by inet_ntoa() failing or<br>
&gt; the ioctl() call failing or even the memcpy() bit just below.<br>
&gt;<br>
&gt; Code snippet (lines 176-185 from src/util.c):<br>
&gt;<br>
&gt; 176 &nbsp; &nbsp; &nbsp; &nbsp;if (ioctl (sockd, SIOCGIFADDR, &amp;if_data) &lt; 0) {<br>
&gt; 177 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;debug(LOG_ERR, &quot;ioctl(): SIOCGIFADDR %s&quot;, strerror(errno));<br>
&gt; 178 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;return NULL;<br>
&gt; 179 &nbsp; &nbsp; &nbsp; &nbsp;}<br>
&gt; 180 &nbsp; &nbsp; &nbsp; &nbsp;memcpy ((void *) &amp;ip, (void *) &amp;if_data.ifr_addr.sa_data + 2, 4);<br>
&gt; 181 &nbsp; &nbsp; &nbsp; &nbsp;in.s_addr = ip;<br>
&gt; 182<br>
&gt; 183 &nbsp; &nbsp; &nbsp; &nbsp;ip_str = (char *)inet_ntoa(in);<br>
&gt; 184 &nbsp; &nbsp; &nbsp; &nbsp;close(sockd);<br>
&gt; 185 &nbsp; &nbsp; &nbsp; &nbsp;return safe_strdup(ip_str);<br>
&gt;<br>
&gt; &nbsp; &nbsp; &nbsp; ioctl() errors are checked. Either the memcpy() call or its<br>
&gt; pointer arithmetics is off? sa_data in a sockaddr_in struct starts<br>
&gt; with a 16-bit value so the math looks OK. This stumps me right now,<br>
&gt; what&#39;s the distro? Ubuntu 7.10?<br>
&gt;<br>
&gt; Alex<br>
&gt;<br>
&gt; On Mon, Jul 28, 2008 at 04:15:08PM -0400, Clifford Thurber wrote:<br>
&gt; &gt; Date: Mon, 28 Jul 2008 16:15:08 -0400<br>
&gt; &gt; From: &quot;Clifford Thurber&quot; &lt;<a href="mailto:clifford@hdn.net" target="_blank">clifford@hdn.net</a>&gt;<br>
&gt; &gt; To: &quot;WiFiDog Captive Portal&quot; &lt;<a href="mailto:wifidog@listes.ilesansfil.org" target="_blank">wifidog@listes.ilesansfil.org</a>&gt;<br>
&gt; &gt; Subject: Re: [isf-wifidog] seg fault<br>
&gt; &gt;<br>
&gt; &gt; [root@wifidog src]# ifconfig eth1<br>
&gt; &gt; eth1 &nbsp; &nbsp; &nbsp;Link encap:Ethernet &nbsp;HWaddr 00:18:8B:2E:B1:A5<br>
&gt; &gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; inet addr:<a href="http://216.193.211.3" target="_blank">216.193.211.3</a> &nbsp;Bcast:<a href="http://216.193.211.255" target="_blank">216.193.211.255</a> &nbsp;Mask:<a href="http://255.255.255.0" target="_blank">255.255.255.0</a><br>


&gt; &gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; UP BROADCAST RUNNING MULTICAST &nbsp;MTU:1500 &nbsp;Metric:1<br>
&gt; &gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; RX packets:194391 errors:0 dropped:0 overruns:0 frame:0<br>
&gt; &gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; TX packets:84 errors:0 dropped:0 overruns:0 carrier:0<br>
&gt; &gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; collisions:0 txqueuelen:1000<br>
&gt; &gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; RX bytes:12474968 (11.8 MiB) &nbsp;TX bytes:16381 (15.9 KiB)<br>
&gt; &gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Interrupt:16 Memory:f8000000-f8012100<br>
&gt; &gt;<br>
&gt; &gt; On Mon, Jul 28, 2008 at 4:11 PM, acv &lt;<a href="mailto:acv@miniguru.ca" target="_blank">acv@miniguru.ca</a>&gt; wrote:<br>
&gt; &gt;<br>
&gt; &gt; &gt; On Mon, Jul 28, 2008 at 03:43:14PM -0400, Clifford Thurber wrote:<br>
&gt; &gt; &gt; &gt;<br>
&gt; &gt; &gt; &gt; Program received signal SIGSEGV, Segmentation fault.<br>
&gt; &gt; &gt; &gt; 0x0000003ea6280eb0 in strlen () from /lib64/libc.so.6<br>
&gt; &gt; &gt; &gt; Missing separate debuginfos, use: debuginfo-install glibc.x86_64<br>
&gt; &gt; &gt; &gt; (gdb) bt<br>
&gt; &gt; &gt; &gt; #0 &nbsp;0x0000003ea6280eb0 in strlen () from /lib64/libc.so.6<br>
&gt; &gt; &gt; &gt; #1 &nbsp;0x0000003ea6280be6 in strdup () from /lib64/libc.so.6<br>
&gt; &gt; &gt; &gt; #2 &nbsp;0x000000000040bfdc in safe_strdup ()<br>
&gt; &gt; &gt; &gt; #3 &nbsp;0x0000000000409c64 in get_iface_ip ()<br>
&gt; &gt; &gt; &gt; #4 &nbsp;0x000000000040720b in main_loop ()<br>
&gt; &gt; &gt; &gt; #5 &nbsp;0x00000000004078a2 in main ()<br>
&gt; &gt; &gt; &gt; (gdb) exit<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt; &nbsp; &nbsp; &nbsp; &nbsp; This is very strange. What&#39;s the output of ifconfig for that<br>
&gt; &gt; &gt; interface?<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt; Alex<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt; _______________________________________________<br>
&gt; &gt; &gt; WiFiDog mailing list<br>
&gt; &gt; &gt; <a href="mailto:WiFiDog@listes.ilesansfil.org" target="_blank">WiFiDog@listes.ilesansfil.org</a><br>
&gt; &gt; &gt; <a href="http://listes.ilesansfil.org/cgi-bin/mailman/listinfo/wifidog" target="_blank">http://listes.ilesansfil.org/cgi-bin/mailman/listinfo/wifidog</a><br>
&gt; &gt; &gt;<br>
&gt;<br>
&gt; &gt; _______________________________________________<br>
&gt; &gt; WiFiDog mailing list<br>
&gt; &gt; <a href="mailto:WiFiDog@listes.ilesansfil.org" target="_blank">WiFiDog@listes.ilesansfil.org</a><br>
&gt; &gt; <a href="http://listes.ilesansfil.org/cgi-bin/mailman/listinfo/wifidog" target="_blank">http://listes.ilesansfil.org/cgi-bin/mailman/listinfo/wifidog</a><br>
<br>
<br>
<br>
&gt; _______________________________________________<br>
&gt; WiFiDog mailing list<br>
&gt; <a href="mailto:WiFiDog@listes.ilesansfil.org" target="_blank">WiFiDog@listes.ilesansfil.org</a><br>
&gt; <a href="http://listes.ilesansfil.org/cgi-bin/mailman/listinfo/wifidog" target="_blank">http://listes.ilesansfil.org/cgi-bin/mailman/listinfo/wifidog</a><br>
</div></div><br>_______________________________________________<br>
WiFiDog mailing list<br>
<a href="mailto:WiFiDog@listes.ilesansfil.org" target="_blank">WiFiDog@listes.ilesansfil.org</a><br>
<a href="http://listes.ilesansfil.org/cgi-bin/mailman/listinfo/wifidog" target="_blank">http://listes.ilesansfil.org/cgi-bin/mailman/listinfo/wifidog</a><br></blockquote></div><br></div></div></div>
</blockquote></div><br></div>