提交 7a7ee531 编写于 作者: S Scott Feldman 提交者: David S. Miller

switchdev: sparse warning: pass ipv4 fib dst as network-byte order

And let driver convert it to host-byte order as needed.
Signed-off-by: NScott Feldman <sfeldma@gmail.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 22c1f67e
...@@ -4471,7 +4471,7 @@ static int rocker_port_obj_add(struct net_device *dev, ...@@ -4471,7 +4471,7 @@ static int rocker_port_obj_add(struct net_device *dev,
case SWITCHDEV_OBJ_IPV4_FIB: case SWITCHDEV_OBJ_IPV4_FIB:
fib4 = &obj->ipv4_fib; fib4 = &obj->ipv4_fib;
err = rocker_port_fib_ipv4(rocker_port, obj->trans, err = rocker_port_fib_ipv4(rocker_port, obj->trans,
fib4->dst, fib4->dst_len, htonl(fib4->dst), fib4->dst_len,
fib4->fi, fib4->tb_id, 0); fib4->fi, fib4->tb_id, 0);
break; break;
default: default:
...@@ -4525,8 +4525,9 @@ static int rocker_port_obj_del(struct net_device *dev, ...@@ -4525,8 +4525,9 @@ static int rocker_port_obj_del(struct net_device *dev,
case SWITCHDEV_OBJ_IPV4_FIB: case SWITCHDEV_OBJ_IPV4_FIB:
fib4 = &obj->ipv4_fib; fib4 = &obj->ipv4_fib;
err = rocker_port_fib_ipv4(rocker_port, SWITCHDEV_TRANS_NONE, err = rocker_port_fib_ipv4(rocker_port, SWITCHDEV_TRANS_NONE,
fib4->dst, fib4->dst_len, fib4->fi, htonl(fib4->dst), fib4->dst_len,
fib4->tb_id, ROCKER_OP_FLAG_REMOVE); fib4->fi, fib4->tb_id,
ROCKER_OP_FLAG_REMOVE);
break; break;
default: default:
err = -EOPNOTSUPP; err = -EOPNOTSUPP;
......
...@@ -645,7 +645,7 @@ int switchdev_fib_ipv4_add(u32 dst, int dst_len, struct fib_info *fi, ...@@ -645,7 +645,7 @@ int switchdev_fib_ipv4_add(u32 dst, int dst_len, struct fib_info *fi,
struct switchdev_obj fib_obj = { struct switchdev_obj fib_obj = {
.id = SWITCHDEV_OBJ_IPV4_FIB, .id = SWITCHDEV_OBJ_IPV4_FIB,
.ipv4_fib = { .ipv4_fib = {
.dst = htonl(dst), .dst = dst,
.dst_len = dst_len, .dst_len = dst_len,
.fi = fi, .fi = fi,
.tos = tos, .tos = tos,
...@@ -699,7 +699,7 @@ int switchdev_fib_ipv4_del(u32 dst, int dst_len, struct fib_info *fi, ...@@ -699,7 +699,7 @@ int switchdev_fib_ipv4_del(u32 dst, int dst_len, struct fib_info *fi,
struct switchdev_obj fib_obj = { struct switchdev_obj fib_obj = {
.id = SWITCHDEV_OBJ_IPV4_FIB, .id = SWITCHDEV_OBJ_IPV4_FIB,
.ipv4_fib = { .ipv4_fib = {
.dst = htonl(dst), .dst = dst,
.dst_len = dst_len, .dst_len = dst_len,
.fi = fi, .fi = fi,
.tos = tos, .tos = tos,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册