Skip to content

Commit

Permalink
fix a retry logic on dhcp version
Browse files Browse the repository at this point in the history
  • Loading branch information
mchome committed Sep 7, 2017
1 parent d5dd15d commit a037665
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# dogcom [![travis-ci](https://travis-ci.org/mchome/dogcom.svg "Build status")](https://travis-ci.org/mchome/dogcom) [![badge](https://img.shields.io/badge/%20built%20with-%20%E2%9D%A4-ff69b4.svg "build with love")](https://github.com/mchome/dogcom) [![version](https://img.shields.io/badge/stable%20-%20v1.4.2-4dc71f.svg "stable version")](https://github.com/mchome/dogcom/tree/v1.4.2)
# dogcom [![travis-ci](https://travis-ci.org/mchome/dogcom.svg "Build status")](https://travis-ci.org/mchome/dogcom) [![badge](https://img.shields.io/badge/%20built%20with-%20%E2%9D%A4-ff69b4.svg "build with love")](https://github.com/mchome/dogcom) [![version](https://img.shields.io/badge/stable%20-%20v1.4.3-4dc71f.svg "stable version")](https://github.com/mchome/dogcom/tree/v1.4.3)

[Drcom-generic](https://github.com/drcoms/drcom-generic) implementation in C.

Expand Down
5 changes: 5 additions & 0 deletions auth.c
Original file line number Diff line number Diff line change
Expand Up @@ -492,6 +492,7 @@ int dogcom(int try_times) {
usleep(200000); // 0.2 sec
if (!login(sockfd, dest_addr, seed, auth_information)) {
int keepalive_counter = 0;
int keepalive_try_counter = 0;
int first = 1;
while (1) {
if (!keepalive_1(sockfd, dest_addr, seed, auth_information)) {
Expand All @@ -507,6 +508,10 @@ int dogcom(int try_times) {
}
sleep(20);
} else {
if (keepalive_try_counter > 5) {
break;
}
keepalive_try_counter ++;
continue;
}
}
Expand Down
2 changes: 1 addition & 1 deletion main.c
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
#include "libs/common.h"
#endif

#define VERSION "1.4.2"
#define VERSION "1.4.3"

void print_help(int exval);
int try_smart_eaplogin(void);
Expand Down

0 comments on commit a037665

Please sign in to comment.