OSDN Git Service

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)
commit33d80996b85283f90474d531920e40ccc2aab918
tree0a26a51da987eb31228538042a1639201e2a7f4c
parentd7d49dc77c8db113393a31aced3f0562f4afd439
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