]> git.baikalelectronics.ru Git - kernel.git/commit
ipv4: nexthop: Use nla_put_be32() for NHA_GATEWAY
authorIdo Schimmel <idosch@nvidia.com>
Wed, 26 Aug 2020 16:48:52 +0000 (19:48 +0300)
committerDavid S. Miller <davem@davemloft.net>
Wed, 26 Aug 2020 23:00:51 +0000 (16:00 -0700)
commit5f21f18514fa301f5299cceab5fc136cd453d20d
tree0a26a51da987eb31228538042a1639201e2a7f4c
parenta863827cec662cfbd822212deb3dba423676909f
ipv4: nexthop: Use nla_put_be32() for NHA_GATEWAY

The code correctly uses nla_get_be32() to get the payload of the
attribute, but incorrectly uses nla_put_u32() to add the attribute to
the payload. This results in the following warning:

net/ipv4/nexthop.c:279:59: warning: incorrect type in argument 3 (different base types)
net/ipv4/nexthop.c:279:59:    expected unsigned int [usertype] value
net/ipv4/nexthop.c:279:59:    got restricted __be32 [usertype] ipv4

Suppress the warning by using nla_put_be32().

Signed-off-by: Ido Schimmel <idosch@nvidia.com>
Reviewed-by: David Ahern <dsahern@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/ipv4/nexthop.c