<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[Chillispot forum - Local proxy arp patch]]></title>
	<link rel="self" href="http://www.chillispot.info/chilliforum/feed-atom-topic383.xml"/>
	<updated>2009-11-13T14:58:08Z</updated>
	<generator version="1.3.5">PunBB</generator>
	<id>http://www.chillispot.info/chilliforum/topic383-local-proxy-arp-patch.html</id>
		<entry>
			<title type="html"><![CDATA[Re: Local proxy arp patch]]></title>
			<link rel="alternate" href="http://www.chillispot.info/chilliforum/post1173.html#p1173"/>
			<content type="html"><![CDATA[<p>hello.i want to patch my chillispot, but I don&#039;t know where is the chilli.c file. I haven&#039;t been able to find it. Can you explain me how to do it? please?<br />or anyone else knows how to apply it?<br />thank you</p>]]></content>
			<author>
				<name><![CDATA[angeltu]]></name>
				<uri>http://www.chillispot.info/chilliforum/user883.html</uri>
			</author>
			<updated>2009-11-13T14:58:08Z</updated>
			<id>http://www.chillispot.info/chilliforum/post1173.html#p1173</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Local proxy arp patch]]></title>
			<link rel="alternate" href="http://www.chillispot.info/chilliforum/post1101.html#p1101"/>
			<content type="html"><![CDATA[<p>Add the option &quot;proxyarp&quot; in the configuration file</p><div class="codebox"><pre><code>diff -rNpu chillispot-1.1.0.orig/src/chilli.c chillispot-1.1.0/src/chilli.c
--- chillispot-1.1.0.orig/src/chilli.c    Sun Sep 24 23:48:25 2006
+++ chillispot-1.1.0/src/chilli.c    Mon Sep 21 15:55:25 2009
@@ -622,6 +622,9 @@ int static process_options(int argc, cha
     options.dhcpusemac  = 1;
   }
 
+  /* proxyarp                                                    */
+  options.proxyarp = args_info.proxyarp_flag;
+
   /* lease                                                           */
   options.lease = args_info.lease_arg;
 
@@ -1125,7 +1128,7 @@ void static reprocess_options(int argc, 
   (void) dhcp_set(dhcp, (options.debug &amp; DEBUG_DHCP),
           options.uamserver, options.uamserverlen, options.uamanydns,
           options.uamokip, options.uamokiplen,
-          options.uamokaddr, options.uamokmask, options.uamoknetlen);
+          options.uamokaddr, options.uamokmask, options.uamoknetlen, options.proxyarp);
   
   /* Reinit RADIUS parameters */
   (void) radius_set(radius, (options.debug &amp; DEBUG_RADIUS),
@@ -2880,7 +2883,7 @@ int radius_conf(struct radius_t *radius,
   (void) dhcp_set(dhcp, (options.debug &amp; DEBUG_DHCP),
           options.uamserver, options.uamserverlen, options.uamanydns,
           options.uamokip, options.uamokiplen,
-          options.uamokaddr, options.uamokmask, options.uamoknetlen);
+          options.uamokaddr, options.uamokmask, options.uamoknetlen, options.proxyarp);
 }
 
 /* Radius callback when access accept/reject/challenge has been received */
@@ -3954,7 +3957,7 @@ int main(int argc, char **argv)
     if (dhcp_set(dhcp, (options.debug &amp; DEBUG_DHCP),
          options.uamserver, options.uamserverlen, options.uamanydns,
          options.uamokip, options.uamokiplen,
-         options.uamokaddr, options.uamokmask, options.uamoknetlen)) {
+         options.uamokaddr, options.uamokmask, options.uamoknetlen, options.proxyarp)) {
       sys_err(LOG_ERR, __FILE__, __LINE__, 0,
           &quot;Failed to set DHCP parameters&quot;);
       exit(1);
diff -rNpu chillispot-1.1.0.orig/src/chilli.h chillispot-1.1.0/src/chilli.h
--- chillispot-1.1.0.orig/src/chilli.h    Sun Sep 24 23:48:25 2006
+++ chillispot-1.1.0/src/chilli.h    Mon Sep 21 15:55:25 2009
@@ -273,6 +273,7 @@ struct options_t {
   /* DHCP parameters */
   int nodhcp;                    /* Do not use DHCP */
   char* dhcpif;                 /* Interface: eth0 */
+  int proxyarp;            /* Enable Local Proxy arp */
   unsigned char dhcpmac[DHCP_ETH_ALEN]; /* Interface MAC address */
   int dhcpusemac;               /* Use given MAC or interface default */
   struct in_addr dhcplisten;     /* IP address to listen to */
diff -rNpu chillispot-1.1.0.orig/src/cmdline.c chillispot-1.1.0/src/cmdline.c
--- chillispot-1.1.0.orig/src/cmdline.c    Sun Sep 24 23:48:25 2006
+++ chillispot-1.1.0/src/cmdline.c    Mon Sep 21 15:55:25 2009
@@ -100,6 +100,7 @@ void clear_given (struct gengetopt_args_
   args_info-&gt;confpassword_given = 0 ;
   args_info-&gt;dhcpif_given = 0 ;
   args_info-&gt;dhcpmac_given = 0 ;
+  args_info-&gt;proxyarp_given = 0 ;
   args_info-&gt;lease_given = 0 ;
   args_info-&gt;eapolenable_given = 0 ;
   args_info-&gt;uamserver_given = 0 ;
@@ -193,6 +194,7 @@ void clear_args (struct gengetopt_args_i
   args_info-&gt;dhcpif_orig = NULL;
   args_info-&gt;dhcpmac_arg = NULL;
   args_info-&gt;dhcpmac_orig = NULL;
+  args_info-&gt;proxyarp_flag = 0;
   args_info-&gt;lease_arg = 600;
   args_info-&gt;lease_orig = NULL;
   args_info-&gt;eapolenable_flag = 0;
@@ -272,6 +274,7 @@ cmdline_parser_print_help (void)
   printf(&quot;%s\n&quot;,&quot;      --confpassword=STRING     Password for remote config&quot;);
   printf(&quot;%s\n&quot;,&quot;      --dhcpif=STRING           Local Ethernet interface&quot;);
   printf(&quot;%s\n&quot;,&quot;      --dhcpmac=STRING          Interface MAC address&quot;);
+  printf(&quot;%s\n&quot;,&quot;      --proxyarp                Enable Local Proxy ARP&quot;);
   printf(&quot;%s\n&quot;,&quot;      --lease=INT               Lease time to allocate to clients  \n                                  (default=`600&#039;)&quot;);
   printf(&quot;%s\n&quot;,&quot;      --eapolenable             Enable IEEE 802.1x authentication  \n                                  (default=off)&quot;);
   printf(&quot;%s\n&quot;,&quot;      --uamserver=STRING        URL of authentication web server  \n                                  (default=`https://login.hotradius.com&#039;)&quot;);
@@ -1024,6 +1027,9 @@ cmdline_parser_file_save(const char *fil
       fprintf(outfile, &quot;%s\n&quot;, &quot;dhcpmac&quot;);
     }
   }
+  if (args_info-&gt;proxyarp_given) {
+    fprintf(outfile, &quot;%s\n&quot;, &quot;proxyarp&quot;);
+  }
   if (args_info-&gt;lease_given) {
     if (args_info-&gt;lease_orig) {
       fprintf(outfile, &quot;%s=\&quot;%s\&quot;\n&quot;, &quot;lease&quot;, args_info-&gt;lease_orig);
@@ -1286,6 +1292,7 @@ cmdline_parser_internal (int argc, char 
         { &quot;confpassword&quot;,    1, NULL, 0 },
         { &quot;dhcpif&quot;,    1, NULL, 0 },
         { &quot;dhcpmac&quot;,    1, NULL, 0 },
+        { &quot;proxyarp&quot;,    0, NULL, 0 },
         { &quot;lease&quot;,    1, NULL, 0 },
         { &quot;eapolenable&quot;,    0, NULL, 0 },
         { &quot;uamserver&quot;,    1, NULL, 0 },
@@ -2028,6 +2035,20 @@ cmdline_parser_internal (int argc, char 
             if (args_info-&gt;dhcpmac_orig)
               free (args_info-&gt;dhcpmac_orig); /* free previous string */
             args_info-&gt;dhcpmac_orig = gengetopt_strdup (optarg);
+          }
+          /* Enable Local Proxy ARP.  */
+          else if (strcmp (long_options[option_index].name, &quot;proxyarp&quot;) == 0)
+          {
+            if (local_args_info.proxyarp_given)
+              {
+                fprintf (stderr, &quot;%s: `--proxyarp&#039; option given more than once%s\n&quot;, argv[0], (additional_error ? additional_error : &quot;&quot;));
+                goto failure;
+              }
+            if (args_info-&gt;proxyarp_given &amp;&amp; ! override)
+              continue;
+            local_args_info.proxyarp_given = 1;
+            args_info-&gt;proxyarp_given = 1;
+            args_info-&gt;proxyarp_flag = !(args_info-&gt;proxyarp_flag);
           }
           /* Lease time to allocate to clients.  */
           else if (strcmp (long_options[option_index].name, &quot;lease&quot;) == 0)
diff -rNpu chillispot-1.1.0.orig/src/cmdline.ggo chillispot-1.1.0/src/cmdline.ggo
--- chillispot-1.1.0.orig/src/cmdline.ggo    Sun Sep 24 23:48:25 2006
+++ chillispot-1.1.0/src/cmdline.ggo    Mon Sep 21 15:55:25 2009
@@ -97,6 +97,7 @@ option &quot;confpassword&quot; - &quot;Password for re
 # DHCP parameters
 option &quot;dhcpif&quot;      - &quot;Local Ethernet interface&quot;    string no
 option &quot;dhcpmac&quot;     - &quot;Interface MAC address&quot;       string no
+option &quot;proxyarp&quot;    - &quot;Local Proxy ARP&quot;             flag no
 option &quot;lease&quot;       - &quot;Lease time to allocate to clients&quot; int default=&quot;600&quot; no
 
 
diff -rNpu chillispot-1.1.0.orig/src/cmdline.h chillispot-1.1.0/src/cmdline.h
--- chillispot-1.1.0.orig/src/cmdline.h    Sun Sep 24 23:48:25 2006
+++ chillispot-1.1.0/src/cmdline.h    Mon Sep 21 15:55:25 2009
@@ -97,6 +97,7 @@ struct gengetopt_args_info
   char * confpassword_orig;    /* Password for remote config original value given at command line.  */
   char * dhcpif_arg;    /* Local Ethernet interface.  */
   char * dhcpif_orig;    /* Local Ethernet interface original value given at command line.  */
+  int proxyarp_flag;    /* Local Proxy Arp  (default=off). */
   char * dhcpmac_arg;    /* Interface MAC address.  */
   char * dhcpmac_orig;    /* Interface MAC address original value given at command line.  */
   int lease_arg;    /* Lease time to allocate to clients (default=&#039;600&#039;).  */
@@ -164,6 +165,7 @@ struct gengetopt_args_info
   int confpassword_given ;    /* Whether confpassword was given.  */
   int dhcpif_given ;    /* Whether dhcpif was given.  */
   int dhcpmac_given ;    /* Whether dhcpmac was given.  */
+  int proxyarp_given ;    /* Whether proxyarp was given.  */
   int lease_given ;    /* Whether lease was given.  */
   int eapolenable_given ;    /* Whether eapolenable was given.  */
   int uamserver_given ;    /* Whether uamserver was given.  */
diff -rNpu chillispot-1.1.0.orig/src/dhcp.c chillispot-1.1.0/src/dhcp.c
--- chillispot-1.1.0.orig/src/dhcp.c    Sun Sep 24 23:48:25 2006
+++ chillispot-1.1.0/src/dhcp.c    Mon Sep 21 15:55:39 2009
@@ -1208,13 +1208,14 @@ dhcp_set(struct dhcp_t *dhcp, int debug,
      struct in_addr *authip, int authiplen, int anydns,
      struct in_addr *uamokip, int uamokiplen, 
      struct in_addr *uamokaddr,
-     struct in_addr *uamokmask, int uamoknetlen) {
+     struct in_addr *uamokmask, int uamoknetlen, int proxyarp) {
 
   
   int i;
 
   dhcp-&gt;debug = debug;
   dhcp-&gt;anydns = anydns;
+  dhcp-&gt;proxyarp = proxyarp;
 
   /* Copy list of uamserver IP addresses */
   if ((dhcp)-&gt;authip) free((dhcp)-&gt;authip);
@@ -2359,7 +2360,7 @@ int dhcp_receive_arp(struct dhcp_t *this
     return 0; /* Only reply if he was allocated an address */
   }
   
-  if (memcmp(&amp;conn-&gt;ourip.s_addr, pack-&gt;arp.tpa, 4)) {
+  if (memcmp(&amp;conn-&gt;ourip.s_addr, pack-&gt;arp.tpa, 4) &amp;&amp; !this-&gt;proxyarp) {
     if (this-&gt;debug) printf(&quot;Did not ask for router address: %.8x - %.2x%.2x%.2x%.2x\n&quot;, conn-&gt;ourip.s_addr, 
                 pack-&gt;arp.tpa[0],
                 pack-&gt;arp.tpa[1],
diff -rNpu chillispot-1.1.0.orig/src/dhcp.h chillispot-1.1.0/src/dhcp.h
--- chillispot-1.1.0.orig/src/dhcp.h    Sun Sep 24 23:48:25 2006
+++ chillispot-1.1.0/src/dhcp.h    Mon Sep 21 15:55:25 2009
@@ -384,6 +384,7 @@ struct dhcp_t {
   int arp_fd;           /* File descriptor to network interface */
   unsigned char arp_hwaddr[DHCP_ETH_ALEN]; /* Hardware address of interface */
   int arp_ifindex;      /* Hardware address of interface */
+  int proxyarp;        /* Enable proxy arp */
   int eapol_fd;         /* File descriptor to network interface */
   unsigned char eapol_hwaddr[DHCP_ETH_ALEN]; /* Hardware address of interface */
   int eapol_ifindex;    /* Hardware address of interface */
@@ -442,7 +443,7 @@ extern int
 dhcp_set(struct dhcp_t *dhcp, int debug,
      struct in_addr *authip, int authiplen, int anydns,
      struct in_addr *uamokip, int uamokiplen, struct in_addr *uamokaddr,
-     struct in_addr *uamokmask, int uamoknetlen);
+     struct in_addr *uamokmask, int uamoknetlen, int proxyarp);
 
 extern int
 dhcp_free(struct dhcp_t *dhcp);</code></pre></div>]]></content>
			<author>
				<name><![CDATA[Harunaga]]></name>
				<uri>http://www.chillispot.info/chilliforum/user887.html</uri>
			</author>
			<updated>2009-09-21T11:08:19Z</updated>
			<id>http://www.chillispot.info/chilliforum/post1101.html#p1101</id>
		</entry>
</feed>
