@@ -570,8 +570,9 @@ static int fib_detect_death(struct fib_info *fi, int order,
570570 return 1 ;
571571}
572572
573- int fib_nh_common_init (struct fib_nh_common * nhc , struct nlattr * encap ,
574- u16 encap_type , void * cfg , gfp_t gfp_flags ,
573+ int fib_nh_common_init (struct net * net , struct fib_nh_common * nhc ,
574+ struct nlattr * encap , u16 encap_type ,
575+ void * cfg , gfp_t gfp_flags ,
575576 struct netlink_ext_ack * extack )
576577{
577578 int err ;
@@ -589,8 +590,9 @@ int fib_nh_common_init(struct fib_nh_common *nhc, struct nlattr *encap,
589590 err = - EINVAL ;
590591 goto lwt_failure ;
591592 }
592- err = lwtunnel_build_state (encap_type , encap , nhc -> nhc_family ,
593- cfg , & lwtstate , extack );
593+ err = lwtunnel_build_state (net , encap_type , encap ,
594+ nhc -> nhc_family , cfg , & lwtstate ,
595+ extack );
594596 if (err )
595597 goto lwt_failure ;
596598
@@ -614,7 +616,7 @@ int fib_nh_init(struct net *net, struct fib_nh *nh,
614616
615617 nh -> fib_nh_family = AF_INET ;
616618
617- err = fib_nh_common_init (& nh -> nh_common , cfg -> fc_encap ,
619+ err = fib_nh_common_init (net , & nh -> nh_common , cfg -> fc_encap ,
618620 cfg -> fc_encap_type , cfg , GFP_KERNEL , extack );
619621 if (err )
620622 return err ;
@@ -814,7 +816,7 @@ static int fib_get_nhs(struct fib_info *fi, struct rtnexthop *rtnh,
814816
815817#endif /* CONFIG_IP_ROUTE_MULTIPATH */
816818
817- static int fib_encap_match (u16 encap_type ,
819+ static int fib_encap_match (struct net * net , u16 encap_type ,
818820 struct nlattr * encap ,
819821 const struct fib_nh * nh ,
820822 const struct fib_config * cfg ,
@@ -826,7 +828,7 @@ static int fib_encap_match(u16 encap_type,
826828 if (encap_type == LWTUNNEL_ENCAP_NONE )
827829 return 0 ;
828830
829- ret = lwtunnel_build_state (encap_type , encap , AF_INET ,
831+ ret = lwtunnel_build_state (net , encap_type , encap , AF_INET ,
830832 cfg , & lwtstate , extack );
831833 if (!ret ) {
832834 result = lwtunnel_cmp_encap (lwtstate , nh -> fib_nh_lws );
@@ -836,7 +838,7 @@ static int fib_encap_match(u16 encap_type,
836838 return result ;
837839}
838840
839- int fib_nh_match (struct fib_config * cfg , struct fib_info * fi ,
841+ int fib_nh_match (struct net * net , struct fib_config * cfg , struct fib_info * fi ,
840842 struct netlink_ext_ack * extack )
841843{
842844#ifdef CONFIG_IP_ROUTE_MULTIPATH
@@ -857,8 +859,8 @@ int fib_nh_match(struct fib_config *cfg, struct fib_info *fi,
857859 struct fib_nh * nh = fib_info_nh (fi , 0 );
858860
859861 if (cfg -> fc_encap ) {
860- if (fib_encap_match (cfg -> fc_encap_type , cfg -> fc_encap ,
861- nh , cfg , extack ))
862+ if (fib_encap_match (net , cfg -> fc_encap_type ,
863+ cfg -> fc_encap , nh , cfg , extack ))
862864 return 1 ;
863865 }
864866#ifdef CONFIG_IP_ROUTE_CLASSID
0 commit comments