mirror of
http://git.haproxy.org/git/haproxy.git/
synced 2025-04-11 03:31:36 +00:00
[MINOR] Allow showing and clearing by key of ipv6 stick tables
This commit is contained in:
parent
c88b887d8d
commit
c5b89f6495
@ -9336,7 +9336,7 @@ clear table <table> [ data.<type> <operator> <value> ] | [ key <key> ]
|
|||||||
- gt : match entries whose data is greater than this value
|
- gt : match entries whose data is greater than this value
|
||||||
|
|
||||||
When the key form is used the entry <key> is removed. The key must be of the
|
When the key form is used the entry <key> is removed. The key must be of the
|
||||||
same type as the table, which currently is limited to IPv4.
|
same type as the table, which currently is limited to IPv4 and IPv6.
|
||||||
|
|
||||||
Example :
|
Example :
|
||||||
$ echo "show table http_proxy" | socat stdio /tmp/sock1
|
$ echo "show table http_proxy" | socat stdio /tmp/sock1
|
||||||
@ -9562,7 +9562,7 @@ show table <name> [ data.<type> <operator> <value> ] | [ key <key> ]
|
|||||||
|
|
||||||
|
|
||||||
When the key form is used the entry <key> is shown. The key must be of the
|
When the key form is used the entry <key> is shown. The key must be of the
|
||||||
same type as the table, which currently is limited to IPv4.
|
same type as the table, which currently is limited to IPv4 and IPv6.
|
||||||
|
|
||||||
Example :
|
Example :
|
||||||
$ echo "show table http_proxy" | socat stdio /tmp/sock1
|
$ echo "show table http_proxy" | socat stdio /tmp/sock1
|
||||||
|
@ -511,6 +511,7 @@ static void stats_sock_table_key_request(struct stream_interface *si, char **arg
|
|||||||
struct proxy *px = si->applet.ctx.table.target;
|
struct proxy *px = si->applet.ctx.table.target;
|
||||||
struct stksess *ts;
|
struct stksess *ts;
|
||||||
unsigned int ip_key;
|
unsigned int ip_key;
|
||||||
|
unsigned char ip6_key[sizeof(struct in6_addr)];
|
||||||
|
|
||||||
si->applet.st0 = STAT_CLI_OUTPUT;
|
si->applet.st0 = STAT_CLI_OUTPUT;
|
||||||
|
|
||||||
@ -520,15 +521,20 @@ static void stats_sock_table_key_request(struct stream_interface *si, char **arg
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (px->table.type == STKTABLE_TYPE_IP) {
|
switch (px->table.type) {
|
||||||
|
case STKTABLE_TYPE_IP:
|
||||||
ip_key = htonl(inetaddr_host(args[4]));
|
ip_key = htonl(inetaddr_host(args[4]));
|
||||||
static_table_key.key = (void *)&ip_key;
|
static_table_key.key = (void *)&ip_key;
|
||||||
}
|
break;
|
||||||
else {
|
case STKTABLE_TYPE_IPV6:
|
||||||
|
inet_pton(AF_INET6, args[4], ip6_key);
|
||||||
|
static_table_key.key = &ip6_key;
|
||||||
|
break;
|
||||||
|
default:
|
||||||
if (show)
|
if (show)
|
||||||
si->applet.ctx.cli.msg = "Showing keys from non-ip tables is not supported\n";
|
si->applet.ctx.cli.msg = "Showing keys from tables of type other than ip and ipv6 is not supported\n";
|
||||||
else
|
else
|
||||||
si->applet.ctx.cli.msg = "Removing keys from non-ip tables is not supported\n";
|
si->applet.ctx.cli.msg = "Removing keys from ip tables of type other than ip and ipv6 is not supported\n";
|
||||||
si->applet.st0 = STAT_CLI_PRINT;
|
si->applet.st0 = STAT_CLI_PRINT;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user