Index: /branches/rel_apv_10_7_3/usr/click/bin/heartbeat/heartbeat.c
===================================================================
--- /branches/rel_apv_10_7_3/usr/click/bin/heartbeat/heartbeat.c	(revision 40034)
+++ /branches/rel_apv_10_7_3/usr/click/bin/heartbeat/heartbeat.c	(working copy)
@@ -779,6 +779,9 @@
                         logging("[heartbeat]Current device is enabled successfully and update license.", 1);
                         bandwidth_volume_update(bandwidth_limit);
                         feactl_p->max_vapv_bandwidth = bandwidth_limit * 1000000;
+                        FILE *f = fopen("/ca/etc/bw_cm", "w");
+                        fprintf(f, "%d\n", feactl_p->max_vapv_bandwidth);
+                        fclose(f);
                         logging("[heartbeat]Current device update bandwidth", 1);
                         strncpy(heartbeat_info.license_key, license_key, LICENSE_KEY);
                         strncpy(heartbeat_info.cm_serial_number, cm_serial_number, CM_SN);
@@ -792,6 +795,9 @@
                 } else if (heartbeat_info.bandwidth_limit != bandwidth_limit) {
                     bandwidth_volume_update(bandwidth_limit);
                     feactl_p->max_vapv_bandwidth = bandwidth_limit * 1000000;
+                    FILE *f = fopen("/ca/etc/bw_cm", "w");
+                    fprintf(f, "%d\n", feactl_p->max_vapv_bandwidth);
+                    fclose(f);
                     logging("[heartbeat]Just update bandwidth successfully.", 1);
                     heartbeat_info.bandwidth_limit = bandwidth_limit;
                     heartbeat_info.heartbeat_time = t;
@@ -803,6 +809,9 @@
                     heartbeat_info.bandwidth_limit = 1;
                     bandwidth_volume_update(1);
                     feactl_p->max_vapv_bandwidth = 1 * 1000000;
+                    FILE *f = fopen("/ca/etc/bw_cm", "w");
+                    fprintf(f, "%d\n", feactl_p->max_vapv_bandwidth);
+                    fclose(f);
                     memset(heartbeat_info.cm_serial_number, 0, sizeof(heartbeat_info.cm_serial_number));
                     memset(heartbeat_info.license_key, 0, sizeof(heartbeat_info.license_key));
                     heartbeat_info.heartbeat_time = t;
Index: /branches/rel_apv_10_7_3/usr/click/bin/vtch/vtch-guest.c
===================================================================
--- /branches/rel_apv_10_7_3/usr/click/bin/vtch/vtch-guest.c	(revision 40034)
+++ /branches/rel_apv_10_7_3/usr/click/bin/vtch/vtch-guest.c	(working copy)
@@ -20,6 +20,10 @@
 #include <arpa/inet.h>
 #include <syslog.h>
 
+#include <sys/sysctl.h>
+
+#define sysctlbyname    u_sysctlbyname
+
 #include "feactl.h"
 #include "vtch.h"
 #include "../../../src/sys/click/app/fastlog/fastlog_var.h"
@@ -334,6 +338,31 @@
 			syslog(LOG_USER | LOG_INFO, "vtch log info:feactl_shm_attach\n");  
 			return;
 		}
+		syslog(LOG_USER | LOG_INFO, "CMD_DEL_LICENSE : feactl_p->flag = %d\n", feactl_p->flag);
+		if(access("/var/crash/cm_address", F_OK) == 0){
+		    int is_licensepermit_enable;
+		    size_t len = sizeof(is_licensepermit_enable);
+		    if (sysctlbyname("net.inet.clicktcp.licensepermit_enable", &is_licensepermit_enable,
+			&len, NULL, 0)) {
+			syslog(LOG_EMERG, "error retrieving license information");
+		    }
+		    if (is_licensepermit_enable) {
+			syslog(LOG_EMERG, "licensepermit is enabled.\n");
+			if (access("/ca/etc/bw_cm", F_OK) == 0) {
+			    syslog(LOG_EMERG, "CMD_DEL_LICENSE : read bandwidth from file\n");
+			    FILE *f = fopen("/ca/etc/bw_cm", "r");
+			    if (f) {
+				fscanf(f, "%d", &(feactl_p->max_vapv_bandwidth));
+				syslog(LOG_EMERG, "CMD_DEL_LICENSE : setting bandwidth to : %d\n", feactl_p->max_vapv_bandwidth);
+				fclose(f);
+			    }
+			}
+			syslog(LOG_USER | LOG_INFO, "Stop setting license as invalid.\n");
+			break;
+		    }
+		} else	{
+		    syslog(LOG_USER | LOG_INFO, "activation server failed");
+		}
 		null_kernel_license_features();
 		syslog(LOG_EMERG, "guest_handle_msg call set_license_invalid...");
 		set_license_invalid( feactl_p );
