diff -Nur SDK.UBNT.v3.5.4499.orig/apps/web/common/index.cgi SDK.UBNT.v3.5.4499/apps/web/common/index.cgi
--- SDK.UBNT.v3.5.4499.orig/apps/web/common/index.cgi	2009-03-31 09:35:16.000000000 +0200
+++ SDK.UBNT.v3.5.4499/apps/web/common/index.cgi	2009-11-29 00:22:22.000000000 +0100
@@ -77,6 +77,14 @@
 			addOption(o, '<? echo dict_translate("Show Port Forward..."); >', 'pfw.cgi');
 			addOption(o, '<? echo dict_translate("Show DHCP Leases..."); >', 'leases.cgi');
 		}
+    if('<? echo cfg_get_def($cfg, "olsrd.status", "disabled"); >'=='enabled') {
+			addOption(o, '<? echo dict_translate("Show OLSR Neighbors..."); >', 'solsr.cgi?olsrview=neigh');
+			addOption(o, '<? echo dict_translate("Show OLSR Links..."); >', 'solsr.cgi?olsrview=link');
+			addOption(o, '<? echo dict_translate("Show OLSR Topology..."); >', 'solsr.cgi?olsrview=topo');
+			addOption(o, '<? echo dict_translate("Show OLSR MID..."); >', 'solsr.cgi?olsrview=mid');
+			addOption(o, '<? echo dict_translate("Show OLSR HNA..."); >', 'solsr.cgi?olsrview=hna');
+			addOption(o, '<? echo dict_translate("Show OLSR Routes..."); >', 'solsr.cgi?olsrview=route');
+    }
 		selectOption(o,'');
 	}
 	var o = document.getElementById('tools');
@@ -324,6 +332,12 @@
 	       	<option value="fw.cgi?netmode=<? echo $netmode;>"><? echo dict_translate("Show Firewall..."); ></option>
 		<option value="fw.cgi"><? echo dict_translate("Show Port Forward..."); ></option>
 		<option value="leases.cgi"><? echo dict_translate("Show DHCP Leases..."); ></option>
+		<option value="solsr.cgi?olsrview=neigh"><? echo dict_translate("Show OLSR Neighbors..."); ></option>
+		<option value="solsr.cgi?olsrview=link"><? echo dict_translate("Show OLSR Links..."); ></option>
+		<option value="solsr.cgi?olsrview=topo"><? echo dict_translate("Show OLSR Topology..."); ></option>
+		<option value="solsr.cgi?olsrview=mid"><? echo dict_translate("Show OLSR MID..."); ></option>
+		<option value="solsr.cgi?olsrview=hna"><? echo dict_translate("Show OLSR HNA..."); ></option>
+		<option value="solsr.cgi?olsrview=route"><? echo dict_translate("Show OLSR Routes..."); ></option>
 	  </select></td>
 		  <td>&nbsp;</td>
 		  <td class="h"><? echo dict_translate("Tools:"); ></td>
diff -Nur SDK.UBNT.v3.5.4499.orig/apps/web/common/lib/link.inc SDK.UBNT.v3.5.4499/apps/web/common/lib/link.inc
--- SDK.UBNT.v3.5.4499.orig/apps/web/common/lib/link.inc	2009-09-01 15:20:07.000000000 +0200
+++ SDK.UBNT.v3.5.4499/apps/web/common/lib/link.inc	2009-11-29 00:22:22.000000000 +0100
@@ -953,10 +953,16 @@
 );
 
 Function cfg_get_ipv4gw $cfg, $iface, $gw (
-        if (!strlen($gw)) {
-                $gw = "0.0.0.0";
-        }
-        return cfg_get_def($cfg, "route.1.gateway", $gw);
+  $status = "disabled";
+  $status = cfg_get_def($cfg, "route.1.status", $status);
+  if($status == "enabled")
+  {
+    if (!strlen($gw)) {
+      $gw = "0.0.0.0";
+    }
+    return cfg_get_def($cfg, "route.1.gateway", $gw);
+  }
+  return "";
 );
 
 Function cfg_get_dns $cfg, $dns (
diff -Nur SDK.UBNT.v3.5.4499.orig/apps/web/common/lib/netrouterap.tmpl SDK.UBNT.v3.5.4499/apps/web/common/lib/netrouterap.tmpl
--- SDK.UBNT.v3.5.4499.orig/apps/web/common/lib/netrouterap.tmpl	2008-11-17 16:42:54.000000000 +0100
+++ SDK.UBNT.v3.5.4499/apps/web/common/lib/netrouterap.tmpl	2009-11-29 00:22:22.000000000 +0100
@@ -129,7 +129,7 @@
 	  	onClick="return openPage('ipalias.cgi?iface=<? echo $wan_iface;>',720,330);" /></td>
       </tr>
        <tr><td class="f"><strong><? echo dict_translate("Gateway IP:"); ></strong></td>
-	<td colspan="3"><input class="f" type="text" name="wangw" id="wangw" value="<?echo $wangw>" required="1" callback="validateWanIP" realname="<? echo dict_translate("LAN Gateway IP"); >"/></td>
+	<td colspan="3"><input class="f" type="text" name="wangw" id="wangw" value="<?echo $wangw>" required="1" callback="validateWlanOptIP" realname="<? echo dict_translate("LAN Gateway IP"); >"/></td>
       </tr>
        <tr><td class="f"><strong><? echo dict_translate("Primary DNS IP:"); ></strong></td>
 	<td colspan="3"><input class="f" type="text" name="dns1" id="dns1" value="<?echo $dns1>" required="1" callback="validateWanIP" realname="<? echo dict_translate("Primary DNS IP"); >"/></td>
diff -Nur SDK.UBNT.v3.5.4499.orig/apps/web/common/lib/netroutersta.tmpl SDK.UBNT.v3.5.4499/apps/web/common/lib/netroutersta.tmpl
--- SDK.UBNT.v3.5.4499.orig/apps/web/common/lib/netroutersta.tmpl	2008-11-17 16:42:54.000000000 +0100
+++ SDK.UBNT.v3.5.4499/apps/web/common/lib/netroutersta.tmpl	2009-11-29 00:22:22.000000000 +0100
@@ -83,7 +83,7 @@
 	  	onClick="return openPage('ipalias.cgi?iface=<? echo $wan_iface;>',720,330);" /></td>
       </tr>
        <tr><td class="f"><strong><? echo dict_translate("Gateway IP:"); ></strong></td>
-	<td colspan="3"><input class="f" type="text" name="wangw" id="wangw" value="<?echo $wangw>" required="1" callback="validateWanIP" realname="<? echo dict_translate("WLAN Gateway IP"); >"/></td>
+	<td colspan="3"><input class="f" type="text" name="wangw" id="wangw" value="<?echo $wangw>" required="1" callback="validateWlanOptIP" realname="<? echo dict_translate("WLAN Gateway IP"); >"/></td>
       </tr>
        <tr><td class="f"><strong><? echo dict_translate("Primary DNS IP:"); ></strong></td>
 	<td colspan="3"><input class="f" type="text" name="dns1" id="dns1" value="<?echo $dns1>" required="1" callback="validateWanIP" realname="<? echo dict_translate("Primary DNS IP"); >"/></td>
diff -Nur SDK.UBNT.v3.5.4499.orig/apps/web/common/lib/services.tmpl SDK.UBNT.v3.5.4499/apps/web/common/lib/services.tmpl
--- SDK.UBNT.v3.5.4499.orig/apps/web/common/lib/services.tmpl	2008-11-17 16:42:54.000000000 +0100
+++ SDK.UBNT.v3.5.4499/apps/web/common/lib/services.tmpl	2009-11-29 00:22:22.000000000 +0100
@@ -19,6 +19,7 @@
                 telnetStatusClicked();
                 sshStatusClicked();
                 syslogStatusClicked();
+                olsrStatusClicked();
         }
         window.onload=init;
 </script>
@@ -242,6 +243,23 @@
 	</tr>
 	</table>
 	</form>
+
+	<form enctype="multipart/form-data" action="services.cgi" method="POST" onSubmit="return validateStandard(this, 'error');">
+	<table class="linktable" cellspacing="0"> 
+	<tr><th colspan="3"><? echo dict_translate("OLSRd"); ></th></tr>
+	<tr>
+	<td class="f"><strong><? echo dict_translate("Enable OLSRd:"); ></strong></td>
+	<td><input type="checkbox" name="olsr_status" value="enabled" id="olsr_status" <? if ($olsr_status=="enabled") { echo "checked"; }> onClick="olsrStatusClicked();"></td>
+	<td class="f">&nbsp;</td>
+	</tr>
+	<tr>
+	  <td class="f">&nbsp;<input type="hidden" name="action" value="cholsr"></td>
+	  <td><input type="submit" value="<? echo dict_translate("Change"); >">&nbsp;</td>
+	  <td class="f">&nbsp; </td>
+	</tr>
+	</table>
+	</form>
+
 <!-- we use default certificates
 	<form enctype="multipart/form-data" action="services.cgi" method="POST" onSubmit="return validateStandard(this, 'error');">
 	<table class="linktable" cellspacing="0"> 
@@ -274,6 +292,34 @@
 	</form>
 -->
 
+	<form enctype="multipart/form-data" action="services.cgi" method="POST" onSubmit="return validateStandard(this, 'error');">
+	<table class="linktable" cellspacing="0"> 
+	<tr><th colspan="3"><? echo dict_translate("OLSRd Configuration"); ></th></tr>
+	<tr>
+	<td class="f"><strong><? echo dict_translate("Upload Configuration File:"); ></strong></td>
+	<td><input type="file" name="olsr_conf_file" id="olsr_conf_file" realname="<? echo dict_translate("Configuration File"); >"></td>
+	</td>
+	<td class="f">&nbsp;</td>
+	</tr>
+	<tr>
+	  <td class="f">&nbsp;<input type="hidden" name="action" value="olsrconfupload"></td>
+	  <td><input type="submit" value="<? echo dict_translate("Upload"); >">&nbsp;</td>
+	  <td class="f">&nbsp; </td>
+	</tr>
+	<tr>
+	 <td class="f" rowspan="2"><strong><? echo dict_translate("Current Configuration File:"); ></strong></td>
+	 <td>
+       <input type="button" onClick="return openPage('olsrconf.cgi');" value="<? echo dict_translate("Download..."); >">
+       <input type="submit" id="olsrconfdelete" name="olsrconfdelete" value="<? echo dict_translate("Remove"); >"
+         onClick="return confirm('<? echo dict_translate("qst_remove_olsr_conf|Do you really want to remove uploaded OLSRd Configuration file?"); >');">
+	 </td>
+	  <td class="f"> &nbsp; </td>
+	</tr>
+  	<td></td>
+	</table>
+	</form>
+
+
     </td>
   </tr>
   <tr> 
diff -Nur SDK.UBNT.v3.5.4499.orig/apps/web/common/services.cgi SDK.UBNT.v3.5.4499/apps/web/common/services.cgi
--- SDK.UBNT.v3.5.4499.orig/apps/web/common/services.cgi	2008-09-30 17:09:13.000000000 +0200
+++ SDK.UBNT.v3.5.4499/apps/web/common/services.cgi	2009-11-29 00:22:22.000000000 +0100
@@ -132,6 +132,13 @@
                 }
 		cfg_save($cfg, $cfg_file);
 		cfg_set_modified($cfg_file);
+	} elseif ($action == "cholsr") {
+		if ($olsr_status != "enabled") {
+			$olsr_status = "disabled";
+		}
+		cfg_set($cfg, "olsrd.status", $olsr_status);
+		cfg_save($cfg, $cfg_file);
+		cfg_set_modified($cfg_file);
 	} elseif ($action == "httpscertupload" && strlen($httpscertdelete) > 0) {
 		@unlink("/etc/persistent/https/server.crt");
 		@unlink("/etc/persistent/https/server.key");
@@ -174,6 +181,32 @@
 		}
 		cfg_save($cfg, $cfg_file);
 		cfg_set_modified($cfg_file);
+	} elseif ($action == "olsrconfupload" && strlen($olsrconfdelete) > 0) {
+		@unlink("/etc/persistent/olsrd.conf");
+		cfg_save($cfg, $cfg_file);
+		cfg_set_modified($cfg_file);
+	} elseif ($action == "olsrconfupload") {
+		if (strlen($olsr_conf_file) == 0)
+		{
+			$error_msg = dict_translate("msg_no_olsr_conf_file_specified|No OLSRd configuration file specified.");
+			include("lib/services.tmpl");
+			exit;			
+		}
+		$conf_error = check_uploaded_file($olsr_conf_file,
+				$olsr_conf_file_size, dict_translate("OLSRd configuration"), 5120);
+		if (strlen($conf_error) > 0)
+		{
+  		$error_msg = $conf_error;
+			@unlink($olsr_conf_file);
+			include("lib/services.tmpl");
+			exit;
+		}		
+		if (strlen($olsr_conf_file))
+		{
+			exec("mv "+$olsr_conf_file+" /etc/persistent/olsrd.conf");
+		}
+		cfg_save($cfg, $cfg_file);
+		cfg_set_modified($cfg_file);
 	}
 }
 
@@ -182,6 +215,7 @@
 $ssh_status = cfg_get_def($cfg, "sshd.status", $ssh_status);
 $syslog_status = cfg_get_def($cfg, "syslog.status", $syslog_status);
 $rsyslog_status = cfg_get_def($cfg, "syslog.remote.status", $rsyslog_status);
+$olsr_status = cfg_get_def($cfg, "olsrd.status", $olsr_status);
 $httpport = cfg_get_def($cfg, "httpd.port", "80");
 if (strlen($httpport) == 0) {
 	$httpport = "80";
diff -Nur SDK.UBNT.v3.5.4499.orig/apps/web/common/system.js SDK.UBNT.v3.5.4499/apps/web/common/system.js
--- SDK.UBNT.v3.5.4499.orig/apps/web/common/system.js	2008-10-08 16:44:17.000000000 +0200
+++ SDK.UBNT.v3.5.4499/apps/web/common/system.js	2009-11-29 00:22:22.000000000 +0100
@@ -104,3 +104,7 @@
 var c=document.getElementById('roStatus');
 statusClicked(c,new Array('rousername', 'roPassword'));
 }
+function olsrStatusClicked() {
+var c=document.getElementById('olsr_status');
+statusClicked(c,new Array());
+}
diff -Nur SDK.UBNT.v3.5.4499.orig/conf/xs2/busybox.config SDK.UBNT.v3.5.4499/conf/xs2/busybox.config
--- SDK.UBNT.v3.5.4499.orig/conf/xs2/busybox.config	2008-10-20 23:34:04.000000000 +0200
+++ SDK.UBNT.v3.5.4499/conf/xs2/busybox.config	2009-11-29 00:22:22.000000000 +0100
@@ -360,8 +360,9 @@
 CONFIG_PIDOF=y
 CONFIG_PS=y
 # CONFIG_RENICE is not set
-# CONFIG_TOP is not set
-# CONFIG_UPTIME is not set
+CONFIG_TOP=y
+FEATURE_CPU_USAGE_PERCENTAGE=y
+CONFIG_UPTIME=y
 # CONFIG_SYSCTL is not set
 
 #
diff -Nur SDK.UBNT.v3.5.4499.orig/conf/xs2/product.mk SDK.UBNT.v3.5.4499/conf/xs2/product.mk
--- SDK.UBNT.v3.5.4499.orig/conf/xs2/product.mk	2009-10-01 14:20:37.000000000 +0200
+++ SDK.UBNT.v3.5.4499/conf/xs2/product.mk	2009-11-29 00:24:03.000000000 +0100
@@ -38,6 +38,7 @@
 	    iproute2  trigger_url ntpclient igmpproxy dropbear
 #	    bird batmand wifidog
 #APPS_GPL += libpcap tcpdump iperfi
+APPS_GPL += olsrd
 
 export DRIVERS APPS_OPEN APPS_GPL
 
diff -Nur SDK.UBNT.v3.5.4499.orig/conf/xs5/busybox.config SDK.UBNT.v3.5.4499/conf/xs5/busybox.config
--- SDK.UBNT.v3.5.4499.orig/conf/xs5/busybox.config	2008-10-17 23:03:39.000000000 +0200
+++ SDK.UBNT.v3.5.4499/conf/xs5/busybox.config	2009-11-29 00:22:22.000000000 +0100
@@ -360,8 +360,9 @@
 CONFIG_PIDOF=y
 CONFIG_PS=y
 # CONFIG_RENICE is not set
-# CONFIG_TOP is not set
-# CONFIG_UPTIME is not set
+CONFIG_TOP=y
+FEATURE_CPU_USAGE_PERCENTAGE=y
+CONFIG_UPTIME=y
 # CONFIG_SYSCTL is not set
 
 #
diff -Nur SDK.UBNT.v3.5.4499.orig/conf/xs5/product.mk SDK.UBNT.v3.5.4499/conf/xs5/product.mk
--- SDK.UBNT.v3.5.4499.orig/conf/xs5/product.mk	2009-10-01 14:20:37.000000000 +0200
+++ SDK.UBNT.v3.5.4499/conf/xs5/product.mk	2009-11-29 00:22:22.000000000 +0100
@@ -38,6 +38,7 @@
 	    iproute2  trigger_url ntpclient igmpproxy dropbear
 #	    bird batmand wifidog
 #APPS_GPL += libpcap tcpdump iperf
+APPS_GPL += olsrd
 
 export DRIVERS APPS_OPEN APPS_GPL
 
diff -Nur SDK.UBNT.v3.5.4499.orig/rootfs/ls2/linuxrc SDK.UBNT.v3.5.4499/rootfs/ls2/linuxrc
--- SDK.UBNT.v3.5.4499.orig/rootfs/ls2/linuxrc	2009-07-28 14:56:55.000000000 +0200
+++ SDK.UBNT.v3.5.4499/rootfs/ls2/linuxrc	2009-11-29 00:22:23.000000000 +0100
@@ -129,6 +129,15 @@
 	/sbin/ubntconf
 fi
 
+# add olsrd to init
+grep -q "olsrd.status=enabled" /tmp/system.cfg
+if [ $? -eq 0 ] && [ -x /bin/olsrd ]; then
+    cp -f /usr/etc/init.d/olsrd /etc/sysinit/olsrd.conf
+    echo "null::respawn:/bin/olsrd -nofork" >> /etc/inittab
+    echo "olsrd" >> /etc/startup.list
+fi
+
+
 echo "Executing init..."
 exec /sbin/init -f
 
diff -Nur SDK.UBNT.v3.5.4499.orig/rootfs/ls2/usr/etc/rc.d/rc.softrestart SDK.UBNT.v3.5.4499/rootfs/ls2/usr/etc/rc.d/rc.softrestart
--- SDK.UBNT.v3.5.4499.orig/rootfs/ls2/usr/etc/rc.d/rc.softrestart	2008-07-29 13:03:56.000000000 +0200
+++ SDK.UBNT.v3.5.4499/rootfs/ls2/usr/etc/rc.d/rc.softrestart	2009-11-29 00:22:23.000000000 +0100
@@ -20,6 +20,14 @@
 	/sbin/ubntconf
 fi
 
+# add olsrd to init
+grep -q "olsrd.status=enabled" /tmp/system.cfg
+if [ $? -eq 0 ] && [ -x /bin/olsrd ]; then
+    cp -f /usr/etc/init.d/olsrd /etc/sysinit/olsrd.conf
+    echo "null::respawn:/bin/olsrd -nofork" >> /etc/inittab
+    echo "olsrd" >> /etc/startup.list
+fi
+
 RC_CMD=start
 . /etc/rc.d/rc
 
