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