Skip to content

Commit 7c1a232

Browse files
committed
webui: Fixed the issue that password modification did not take effect
1 parent 0c599bb commit 7c1a232

File tree

4 files changed

+10
-30
lines changed

4 files changed

+10
-30
lines changed

package/openwrt/control/prerm

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,10 @@ default_prerm $0 $@
2020
/etc/init.d/smartdns disable
2121
rm /var/etc/smartdns.conf -f
2222
rm /var/etc/smartdns/smartdns.conf -f
23-
rm /var/log/smartdns/ -fr
24-
rm /etc/smartdns/smartdns.cache -f
23+
if [ "$1" = "remove" ]; then
24+
rm /var/run/smartdns.pid -f
25+
rm /var/log/smartdns/ -fr
26+
rm /etc/smartdns/smartdns.cache -f
27+
rm /var/lib/smartdns/ -fr
28+
fi
2529
exit 0

plugin/smartdns-ui/src/plugin.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,9 +151,9 @@ impl SmartdnsPlugin {
151151

152152
pub fn start(&self, args: &Vec<String>) -> Result<(), Box<dyn Error>> {
153153
self.parser_args(args)?;
154-
self.load_config()?;
155154
self.data_server_ctl
156155
.init_db(&self.data_conf.lock().unwrap())?;
156+
self.load_config()?;
157157
self.data_server_ctl.start_data_server()?;
158158
let http_conf = self.http_conf.lock().unwrap().clone();
159159
self.http_server_ctl.start_http_server(&http_conf)?;

src/dns_server/neighbor.c

Lines changed: 1 addition & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -231,36 +231,11 @@ struct dns_client_rules *_dns_server_get_client_rules_by_mac(uint8_t *netaddr, i
231231
args.netaddr = netaddr;
232232
args.netaddr_len = netaddr_len;
233233

234-
for (int i = 0; i < 2; i++) {
234+
for (int i = 0; i < 1; i++) {
235235
ret = netlink_get_neighbors(family, _dns_server_neighbors_callback, &args);
236236
if (ret < 0) {
237237
goto add_cache;
238238
}
239-
240-
if (ret != 1) {
241-
/* FIXME: ugly force refresh NDP table by sending ICMP message.*/
242-
if (i == 0) {
243-
char host[DNS_MAX_CNAME_LEN] = {0};
244-
if (family == AF_INET) {
245-
snprintf(host, sizeof(host), "%d.%d.%d.%d", netaddr[0], netaddr[1], netaddr[2], netaddr[3]);
246-
} else if (family == AF_INET6) {
247-
snprintf(host, sizeof(host),
248-
"%.2x%.2x:%.2x%.2x:%.2x%.2x:%.2x%.2x:%.2x%.2x:%.2x%.2x:%.2x%.2x:%.2x%.2x", netaddr[0],
249-
netaddr[1], netaddr[2], netaddr[3], netaddr[4], netaddr[5], netaddr[6], netaddr[7],
250-
netaddr[8], netaddr[9], netaddr[10], netaddr[11], netaddr[12], netaddr[13], netaddr[14],
251-
netaddr[15]);
252-
}
253-
struct ping_host_struct *ping_host = fast_ping_start(PING_TYPE_ICMP, host, 0, 10, 1000, NULL, NULL);
254-
if (ping_host) {
255-
/* wait for NDP*/
256-
usleep(1000);
257-
fast_ping_stop(ping_host);
258-
continue;
259-
}
260-
}
261-
262-
goto add_cache;
263-
}
264239
}
265240

266241
if (args.group_mac == NULL) {

src/utils/daemon.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -267,6 +267,7 @@ int create_pid_file(const char *pid_file)
267267
int fd = 0;
268268
int flags = 0;
269269
char buff[TMP_BUFF_LEN_32];
270+
int unused __attribute__((unused));
270271

271272
/* create pid file, and lock this file */
272273
fd = open(pid_file, O_RDWR | O_CREAT, S_IRUSR | S_IWUSR);
@@ -296,7 +297,7 @@ int create_pid_file(const char *pid_file)
296297
goto errout;
297298
}
298299

299-
ftruncate(fd, 0);
300+
unused = ftruncate(fd, 0);
300301
snprintf(buff, TMP_BUFF_LEN_32, "%d\n", getpid());
301302

302303
if (write(fd, buff, strnlen(buff, TMP_BUFF_LEN_32)) < 0) {

0 commit comments

Comments
 (0)