Skip to content

Commit

Permalink
fix format and build problem of new keepalived version
Browse files Browse the repository at this point in the history
  • Loading branch information
ywc689 committed Jan 8, 2020
1 parent 58ee09c commit 143058b
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 29 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ tools/keepalived/keepalived/libipvs-2.6/libipvs.a
tools/keepalived/keepalived/vrrp/Makefile
tools/keepalived/lib/Makefile
tools/keepalived/lib/config.h
tools/keepalived/install-sh
src/dpvs
.cache.mk
.tmp_versions/
Expand Down
4 changes: 2 additions & 2 deletions src/ipset.c
Original file line number Diff line number Diff line change
Expand Up @@ -341,8 +341,8 @@ static int ipset_parse_conf_file(void)
RTE_LOG(WARNING, IPSET, "no memory for ipset buf\n");
return -1;
}
while(!feof(g_current_stream)) {
if((ch=getc(g_current_stream))=='\n')
while (!feof(g_current_stream)) {
if ((ch=getc(g_current_stream)) == '\n')
ip_num++;
}
if (!ip_num) {
Expand Down
1 change: 1 addition & 0 deletions tools/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ config: keepalived_conf
keepalived_conf:
if [ ! -f keepalived/Makefile ]; then \
cd keepalived && \
./build_setup && \
./configure && \
cd -; \
fi
Expand Down
52 changes: 26 additions & 26 deletions tools/ipvsadm/ipvsadm.c
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ static const char* optnames[] = {
"syncid",
"exact",
"ops",
"pe" ,
"pe" ,
"local-address" ,
"blklst-address",
"synproxy" ,
Expand All @@ -214,39 +214,39 @@ static const char* optnames[] = {
static const char commands_v_options[NUMBER_OF_CMD][NUMBER_OF_OPT] =
{
/* -n -c svc -s -p -M -r fwd -w -x -y -mc tot dmn -st -rt thr -pc srt sid -ex ops pe laddr blst syn ifname sockpair hashtag cpu*/
/*ADD*/
/*ADD*/
{'x', 'x', '+', ' ', ' ', ' ', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', ' ', 'x', 'x', 'x', ' ', 'x' ,'x' ,' ', 'x'},
/*EDIT*/
/*EDIT*/
{'x', 'x', '+', ' ', ' ', ' ', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', ' ', 'x', 'x', 'x', ' ', 'x' ,'x' ,' ', 'x'},
/*DEL*/
/*DEL*/
{'x', 'x', '+', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x' ,'x' ,'x', 'x'},
/*FLUSH*/
/*FLUSH*/
{'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x' ,'x' ,'x', 'x'},
/*LIST*/
/*LIST*/
{' ', '1', '1', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', '1', '1', ' ', ' ', ' ', ' ', ' ', ' ', ' ', 'x', 'x', 'x', 'x', 'x', 'x' ,' ' ,'x', ' '},
/*ADDSRV*/
/*ADDSRV*/
{'x', 'x', '+', 'x', 'x', 'x', '+', ' ', ' ', ' ', ' ', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x' ,'x' ,'x', 'x'},
/*DELSRV*/
/*DELSRV*/
{'x', 'x', '+', 'x', 'x', 'x', '+', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x' ,'x' ,'x', 'x'},
/*EDITSRV*/
/*EDITSRV*/
{'x', 'x', '+', 'x', 'x', 'x', '+', ' ', ' ', ' ', ' ', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x' ,'x' ,'x', 'x'},
/*TIMEOUT*/
/*TIMEOUT*/
{'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x' ,'x' ,'x', 'x'},
/*STARTD*/
/*STARTD*/
{'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', ' ', 'x', 'x', 'x', 'x', 'x', 'x', 'x', ' ', 'x', 'x', 'x', 'x', 'x', 'x', 'x' ,'x' ,'x', 'x'},
/*STOPD*/
/*STOPD*/
{'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', ' ', 'x', 'x', 'x', 'x', 'x', 'x', 'x' ,'x' ,'x', 'x'},
/*RESTORE*/
/*RESTORE*/
{'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x' ,'x' ,'x', 'x'},
/*SAVE*/
/*SAVE*/
{' ', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x' ,'x' ,'x', 'x'},
/*ZERO*/
/*ZERO*/
{'x', 'x', ' ', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x' ,'x' ,'x', 'x'},
/*ADDLADDR*/
/*ADDLADDR*/
{'x', 'x', '+', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', '+', 'x', 'x', '+' ,'x' ,'x', 'x'},
/*DELLADDR*/
/*DELLADDR*/
{'x', 'x', '+', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', '+', 'x', 'x', '+' ,'x' ,'x', 'x'},
/*GETLADDR*/
/*GETLADDR*/
{'x', 'x', ' ', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x' ,'x' ,'x', ' '},
/*ADDBLKLST*/
{'x', 'x', '+', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', '+', 'x', 'x' ,'x' ,'x', 'x'},
Expand Down Expand Up @@ -307,7 +307,7 @@ enum {
TAG_NO_SORT,
TAG_PERSISTENCE_ENGINE,
TAG_SOCKPAIR,
TAG_CPU,
TAG_CPU,
};

/* various parsing helpers & parsing functions */
Expand Down Expand Up @@ -610,7 +610,7 @@ parse_options(int argc, char **argv, struct ipvs_command_entry *ce,
strncpy(ce->svc.user.sched_name,
optarg, IP_VS_SCHEDNAME_MAXLEN);
if (!memcmp(ce->svc.user.sched_name, "conhash", strlen("conhash")))
ce->svc.user.flags = ce->svc.user.flags | IP_VS_SVC_F_SIP_HASH;
ce->svc.user.flags = ce->svc.user.flags | IP_VS_SVC_F_SIP_HASH;
break;
case 'p':
set_option(options, OPT_PERSISTENT);
Expand Down Expand Up @@ -1202,7 +1202,7 @@ parse_service(char *buf, ipvs_service_t *svc)
* Get sockpair from the arguments.
* sockpair := PROTO:SIP:SPORT:TIP:TPORT
* PROTO := [tcp|udp]
* SIP,TIP := dotted-decimal ip address
* SIP,TIP := dotted-decimal ip address or square-blacketed ip6 address
* SPORT,TPORT := range(0, 65535)
*/
static int
Expand Down Expand Up @@ -1739,7 +1739,7 @@ static void print_largenum(unsigned long long i, unsigned int format)
printf("%*llu", len <= 8 ? 9 : len + 1, i);
return;
}

if (i < 100000000) /* less than 100 million */
printf("%9llu", i);
else if (i < 1000000000) /* less than 1 billion */
Expand Down Expand Up @@ -1826,7 +1826,7 @@ print_service_entry(ipvs_service_entry_t *se, unsigned int format, lcoreid_t cid
proto = "UDP";
else if (se->user.protocol == IPPROTO_ICMP)
proto = "ICMP";
else
else
proto = "ICMPv6";

sprintf(svc_name, "%s %s", proto, vname);
Expand Down Expand Up @@ -1866,7 +1866,7 @@ print_service_entry(ipvs_service_entry_t *se, unsigned int format, lcoreid_t cid

left -= snprintf(svc_name + strlen(svc_name), left,
",MATCH %s", proto);

if (strcmp(se->user.srange, "[::-::]:0-0") != 0 &&
strcmp(se->user.srange, "0.0.0.0-0.0.0.0:0-0") != 0)
left -= snprintf(svc_name + strlen(svc_name), left,
Expand Down Expand Up @@ -2041,7 +2041,7 @@ static void list_laddrs_print_laddr(struct ip_vs_laddr_entry * entry)
char pbuf[INET6_ADDRSTRLEN];

inet_ntop(entry->af, (char *)&entry->addr, pbuf, sizeof(pbuf));

printf("%-20s %-8s %-20s %-10lu %-10u\n",
"",
"",
Expand All @@ -2058,7 +2058,7 @@ static void print_service_and_laddrs(struct ip_vs_get_laddrs* d, int with_title)

list_laddrs_print_service(d);
for(i = 0 ; i < d->num_laddrs ; i ++){
list_laddrs_print_laddr(d->entrytable + i);
list_laddrs_print_laddr(d->entrytable + i);
}

return;
Expand Down
1 change: 0 additions & 1 deletion tools/keepalived/install-sh

This file was deleted.

0 comments on commit 143058b

Please sign in to comment.