@@ -412,7 +412,7 @@ struct ipvl_addr *ipvlan_addr_lookup(struct ipvl_port *port, void *lyr3h,
412
412
return addr ;
413
413
}
414
414
415
- static int ipvlan_process_v4_outbound (struct sk_buff * skb )
415
+ static noinline_for_stack int ipvlan_process_v4_outbound (struct sk_buff * skb )
416
416
{
417
417
const struct iphdr * ip4h = ip_hdr (skb );
418
418
struct net_device * dev = skb -> dev ;
@@ -454,13 +454,11 @@ static int ipvlan_process_v4_outbound(struct sk_buff *skb)
454
454
}
455
455
456
456
#if IS_ENABLED (CONFIG_IPV6 )
457
- static int ipvlan_process_v6_outbound (struct sk_buff * skb )
457
+
458
+ static noinline_for_stack int
459
+ ipvlan_route_v6_outbound (struct net_device * dev , struct sk_buff * skb )
458
460
{
459
461
const struct ipv6hdr * ip6h = ipv6_hdr (skb );
460
- struct net_device * dev = skb -> dev ;
461
- struct net * net = dev_net (dev );
462
- struct dst_entry * dst ;
463
- int err , ret = NET_XMIT_DROP ;
464
462
struct flowi6 fl6 = {
465
463
.flowi6_oif = dev -> ifindex ,
466
464
.daddr = ip6h -> daddr ,
@@ -470,27 +468,38 @@ static int ipvlan_process_v6_outbound(struct sk_buff *skb)
470
468
.flowi6_mark = skb -> mark ,
471
469
.flowi6_proto = ip6h -> nexthdr ,
472
470
};
471
+ struct dst_entry * dst ;
472
+ int err ;
473
473
474
- dst = ip6_route_output (net , NULL , & fl6 );
475
- if ( dst -> error ) {
476
- ret = dst -> error ;
474
+ dst = ip6_route_output (dev_net ( dev ) , NULL , & fl6 );
475
+ err = dst -> error ;
476
+ if ( err ) {
477
477
dst_release (dst );
478
- goto err ;
478
+ return err ;
479
479
}
480
480
skb_dst_set (skb , dst );
481
+ return 0 ;
482
+ }
483
+
484
+ static int ipvlan_process_v6_outbound (struct sk_buff * skb )
485
+ {
486
+ struct net_device * dev = skb -> dev ;
487
+ int err , ret = NET_XMIT_DROP ;
488
+
489
+ err = ipvlan_route_v6_outbound (dev , skb );
490
+ if (unlikely (err )) {
491
+ DEV_STATS_INC (dev , tx_errors );
492
+ kfree_skb (skb );
493
+ return err ;
494
+ }
481
495
482
496
memset (IP6CB (skb ), 0 , sizeof (* IP6CB (skb )));
483
497
484
- err = ip6_local_out (net , skb -> sk , skb );
498
+ err = ip6_local_out (dev_net ( dev ) , skb -> sk , skb );
485
499
if (unlikely (net_xmit_eval (err )))
486
500
DEV_STATS_INC (dev , tx_errors );
487
501
else
488
502
ret = NET_XMIT_SUCCESS ;
489
- goto out ;
490
- err :
491
- DEV_STATS_INC (dev , tx_errors );
492
- kfree_skb (skb );
493
- out :
494
503
return ret ;
495
504
}
496
505
#else
0 commit comments