aboutsummaryrefslogtreecommitdiffstats
path: root/net/switchdev/switchdev.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/switchdev/switchdev.c')
-rw-r--r--net/switchdev/switchdev.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/net/switchdev/switchdev.c b/net/switchdev/switchdev.c
index b7e01d88bdc5..59658b2e9cdf 100644
--- a/net/switchdev/switchdev.c
+++ b/net/switchdev/switchdev.c
@@ -1188,6 +1188,7 @@ int switchdev_fib_ipv4_add(u32 dst, int dst_len, struct fib_info *fi,
1188 .obj.id = SWITCHDEV_OBJ_ID_IPV4_FIB, 1188 .obj.id = SWITCHDEV_OBJ_ID_IPV4_FIB,
1189 .dst = dst, 1189 .dst = dst,
1190 .dst_len = dst_len, 1190 .dst_len = dst_len,
1191 .fi = fi,
1191 .tos = tos, 1192 .tos = tos,
1192 .type = type, 1193 .type = type,
1193 .nlflags = nlflags, 1194 .nlflags = nlflags,
@@ -1196,8 +1197,6 @@ int switchdev_fib_ipv4_add(u32 dst, int dst_len, struct fib_info *fi,
1196 struct net_device *dev; 1197 struct net_device *dev;
1197 int err = 0; 1198 int err = 0;
1198 1199
1199 memcpy(&ipv4_fib.fi, fi, sizeof(ipv4_fib.fi));
1200
1201 /* Don't offload route if using custom ip rules or if 1200 /* Don't offload route if using custom ip rules or if
1202 * IPv4 FIB offloading has been disabled completely. 1201 * IPv4 FIB offloading has been disabled completely.
1203 */ 1202 */
@@ -1242,6 +1241,7 @@ int switchdev_fib_ipv4_del(u32 dst, int dst_len, struct fib_info *fi,
1242 .obj.id = SWITCHDEV_OBJ_ID_IPV4_FIB, 1241 .obj.id = SWITCHDEV_OBJ_ID_IPV4_FIB,
1243 .dst = dst, 1242 .dst = dst,
1244 .dst_len = dst_len, 1243 .dst_len = dst_len,
1244 .fi = fi,
1245 .tos = tos, 1245 .tos = tos,
1246 .type = type, 1246 .type = type,
1247 .nlflags = 0, 1247 .nlflags = 0,
@@ -1250,8 +1250,6 @@ int switchdev_fib_ipv4_del(u32 dst, int dst_len, struct fib_info *fi,
1250 struct net_device *dev; 1250 struct net_device *dev;
1251 int err = 0; 1251 int err = 0;
1252 1252
1253 memcpy(&ipv4_fib.fi, fi, sizeof(ipv4_fib.fi));
1254
1255 if (!(fi->fib_flags & RTNH_F_OFFLOAD)) 1253 if (!(fi->fib_flags & RTNH_F_OFFLOAD))
1256 return 0; 1254 return 0;
1257 1255