Commit fb7611e6 authored by Cyrill Gorcunov's avatar Cyrill Gorcunov Committed by Andrei Vagin

sk-unix: Use unsigned values for inodes

It is especially important when accessing a hash --
there must be no negative indices ever.

https://jira.sw.ru/browse/PSBM-82945Signed-off-by: 's avatarCyrill Gorcunov <gorcunov@virtuozzo.com>
Signed-off-by: 's avatarAndrei Vagin <avagin@virtuozzo.com>
parent 221f1151
...@@ -117,7 +117,7 @@ struct unix_sk_listen_icon { ...@@ -117,7 +117,7 @@ struct unix_sk_listen_icon {
static struct unix_sk_listen_icon *unix_listen_icons[SK_HASH_SIZE]; static struct unix_sk_listen_icon *unix_listen_icons[SK_HASH_SIZE];
static struct unix_sk_listen_icon *lookup_unix_listen_icons(int peer_ino) static struct unix_sk_listen_icon *lookup_unix_listen_icons(unsigned int peer_ino)
{ {
struct unix_sk_listen_icon *ic; struct unix_sk_listen_icon *ic;
...@@ -717,8 +717,8 @@ static int unix_collect_one(const struct unix_diag_msg *m, ...@@ -717,8 +717,8 @@ static int unix_collect_one(const struct unix_diag_msg *m,
} }
if (tb[UNIX_DIAG_ICONS]) { if (tb[UNIX_DIAG_ICONS]) {
int len = nla_len(tb[UNIX_DIAG_ICONS]); unsigned int len = nla_len(tb[UNIX_DIAG_ICONS]);
int i; unsigned int i;
d->icons = xmalloc(len); d->icons = xmalloc(len);
if (!d->icons) if (!d->icons)
...@@ -733,7 +733,7 @@ static int unix_collect_one(const struct unix_diag_msg *m, ...@@ -733,7 +733,7 @@ static int unix_collect_one(const struct unix_diag_msg *m,
*/ */
for (i = 0; i < d->nr_icons; i++) { for (i = 0; i < d->nr_icons; i++) {
struct unix_sk_listen_icon *e, **chain; struct unix_sk_listen_icon *e, **chain;
int n; unsigned int n;
e = xzalloc(sizeof(*e)); e = xzalloc(sizeof(*e));
if (!e) if (!e)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment