diff options
author | Guillaume Nault <gnault@redhat.com> | 2019-04-11 17:45:57 +0300 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2019-04-11 21:26:27 +0300 |
commit | ecce39ec10937fb0d9f34ab43c75482d6c243292 (patch) | |
tree | 5dbfa48f6210e95739bb04e6ac663afa12bd6e6d | |
parent | 526bb57a6ad6b0ed6de34b3c5eabf394b248618f (diff) | |
download | linux-ecce39ec10937fb0d9f34ab43c75482d6c243292.tar.xz |
netns: read NETNSA_NSID as s32 attribute in rtnl_net_getid()
NETNSA_NSID is signed. Use nla_get_s32() to avoid confusion.
Signed-off-by: Guillaume Nault <gnault@redhat.com>
Acked-by: Nicolas Dichtel <nicolas.dichtel@6wind.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r-- | net/core/net_namespace.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/net/core/net_namespace.c b/net/core/net_namespace.c index 7e6dcc625701..ebb5b6d21a13 100644 --- a/net/core/net_namespace.c +++ b/net/core/net_namespace.c @@ -839,7 +839,7 @@ static int rtnl_net_getid(struct sk_buff *skb, struct nlmsghdr *nlh, peer = get_net_ns_by_fd(nla_get_u32(tb[NETNSA_FD])); nla = tb[NETNSA_FD]; } else if (tb[NETNSA_NSID]) { - peer = get_net_ns_by_id(net, nla_get_u32(tb[NETNSA_NSID])); + peer = get_net_ns_by_id(net, nla_get_s32(tb[NETNSA_NSID])); if (!peer) peer = ERR_PTR(-ENOENT); nla = tb[NETNSA_NSID]; |