mirror of
https://git.kernel.org/pub/scm/network/iproute2/iproute2.git
synced 2026-01-26 14:13:24 +00:00
ss: change aafilter port from int to long (inode support)
The aafilter struct considers the port as (usually) 32 bit signed integer. In case of a unix socket, the port is used with an inode number which is an unsigned int. In this case, the 'ss' command fails because it assumes that the value does not look like a port (<0). Here an example of command call where the inode is passed and is larger than a signed integer: ss -H -A unix_stream src :2259952798 Signed-off-by: Mathieu Schroeter <mathieu@schroetersa.ch> Signed-off-by: David Ahern <dsahern@kernel.org>
This commit is contained in:
parent
db7fb3f196
commit
012cb5152d
@ -1733,7 +1733,7 @@ static void inet_addr_print(const inet_prefix *a, int port,
|
||||
|
||||
struct aafilter {
|
||||
inet_prefix addr;
|
||||
int port;
|
||||
long port;
|
||||
unsigned int iface;
|
||||
__u32 mark;
|
||||
__u32 mask;
|
||||
@ -2256,7 +2256,7 @@ void *parse_hostcond(char *addr, bool is_port)
|
||||
port = find_port(addr, is_port);
|
||||
if (port) {
|
||||
if (*port && strcmp(port, "*")) {
|
||||
if (get_integer(&a.port, port, 0)) {
|
||||
if (get_long(&a.port, port, 0)) {
|
||||
if ((a.port = xll_name_to_index(port)) <= 0)
|
||||
return NULL;
|
||||
}
|
||||
@ -2279,7 +2279,7 @@ void *parse_hostcond(char *addr, bool is_port)
|
||||
port = find_port(addr, is_port);
|
||||
if (port) {
|
||||
if (*port && strcmp(port, "*")) {
|
||||
if (get_integer(&a.port, port, 0)) {
|
||||
if (get_long(&a.port, port, 0)) {
|
||||
if (strcmp(port, "kernel") == 0)
|
||||
a.port = 0;
|
||||
else
|
||||
@ -2335,7 +2335,7 @@ void *parse_hostcond(char *addr, bool is_port)
|
||||
*port++ = 0;
|
||||
|
||||
if (*port && *port != '*') {
|
||||
if (get_integer(&a.port, port, 0)) {
|
||||
if (get_long(&a.port, port, 0)) {
|
||||
struct servent *se1 = NULL;
|
||||
struct servent *se2 = NULL;
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user