diff options
author | Mat Martineau <mathew.j.martineau@linux.intel.com> | 2020-01-09 18:59:14 +0300 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2020-01-10 05:41:40 +0300 |
commit | e9cdced78dc20c1592c1fb98ed064943007a46c5 (patch) | |
tree | 733872a3d2f4cc0aac217f383b1d69e91879ba61 /net/decnet/af_decnet.c | |
parent | 6b3acfc3cc3d54a99cc5148960edfc38c94a93f2 (diff) | |
download | linux-e9cdced78dc20c1592c1fb98ed064943007a46c5.tar.xz |
net: Make sock protocol value checks more specific
SK_PROTOCOL_MAX is only used in two places, for DECNet and AX.25. The
limits have more to do with the those protocol definitions than they do
with the data type of sk_protocol, so remove SK_PROTOCOL_MAX and use
U8_MAX directly.
Reviewed-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: Mat Martineau <mathew.j.martineau@linux.intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/decnet/af_decnet.c')
-rw-r--r-- | net/decnet/af_decnet.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/net/decnet/af_decnet.c b/net/decnet/af_decnet.c index e19a92a62e14..0a46ea3bddd5 100644 --- a/net/decnet/af_decnet.c +++ b/net/decnet/af_decnet.c @@ -670,7 +670,7 @@ static int dn_create(struct net *net, struct socket *sock, int protocol, { struct sock *sk; - if (protocol < 0 || protocol > SK_PROTOCOL_MAX) + if (protocol < 0 || protocol > U8_MAX) return -EINVAL; if (!net_eq(net, &init_net)) |