@@ -605,7 +605,8 @@ static struct tc_cookie *nla_memdup_cookie(struct nlattr **tb)
605
605
606
606
struct tc_action * tcf_action_init_1 (struct net * net , struct tcf_proto * tp ,
607
607
struct nlattr * nla , struct nlattr * est ,
608
- char * name , int ovr , int bind )
608
+ char * name , int ovr , int bind ,
609
+ struct netlink_ext_ack * extack )
609
610
{
610
611
struct tc_action * a ;
611
612
struct tc_action_ops * a_o ;
@@ -621,7 +622,7 @@ struct tc_action *tcf_action_init_1(struct net *net, struct tcf_proto *tp,
621
622
goto err_out ;
622
623
err = - EINVAL ;
623
624
kind = tb [TCA_ACT_KIND ];
624
- if (kind == NULL )
625
+ if (! kind )
625
626
goto err_out ;
626
627
if (nla_strlcpy (act_name , kind , IFNAMSIZ ) >= IFNAMSIZ )
627
628
goto err_out ;
@@ -726,7 +727,7 @@ static void cleanup_a(struct list_head *actions, int ovr)
726
727
727
728
int tcf_action_init (struct net * net , struct tcf_proto * tp , struct nlattr * nla ,
728
729
struct nlattr * est , char * name , int ovr , int bind ,
729
- struct list_head * actions )
730
+ struct list_head * actions , struct netlink_ext_ack * extack )
730
731
{
731
732
struct nlattr * tb [TCA_ACT_MAX_PRIO + 1 ];
732
733
struct tc_action * act ;
@@ -738,7 +739,8 @@ int tcf_action_init(struct net *net, struct tcf_proto *tp, struct nlattr *nla,
738
739
return err ;
739
740
740
741
for (i = 1 ; i <= TCA_ACT_MAX_PRIO && tb [i ]; i ++ ) {
741
- act = tcf_action_init_1 (net , tp , tb [i ], est , name , ovr , bind );
742
+ act = tcf_action_init_1 (net , tp , tb [i ], est , name , ovr , bind ,
743
+ extack );
742
744
if (IS_ERR (act )) {
743
745
err = PTR_ERR (act );
744
746
goto err ;
@@ -822,7 +824,7 @@ static int tca_get_fill(struct sk_buff *skb, struct list_head *actions,
822
824
t -> tca__pad2 = 0 ;
823
825
824
826
nest = nla_nest_start (skb , TCA_ACT_TAB );
825
- if (nest == NULL )
827
+ if (! nest )
826
828
goto out_nlmsg_trim ;
827
829
828
830
if (tcf_action_dump (skb , actions , bind , ref ) < 0 )
@@ -934,7 +936,7 @@ static int tca_action_flush(struct net *net, struct nlattr *nla,
934
936
t -> tca__pad2 = 0 ;
935
937
936
938
nest = nla_nest_start (skb , TCA_ACT_TAB );
937
- if (nest == NULL )
939
+ if (! nest )
938
940
goto out_module_put ;
939
941
940
942
err = ops -> walk (net , skb , & dcb , RTM_DELACTION , ops );
@@ -1007,10 +1009,10 @@ tca_action_gd(struct net *net, struct nlattr *nla, struct nlmsghdr *n,
1007
1009
return ret ;
1008
1010
1009
1011
if (event == RTM_DELACTION && n -> nlmsg_flags & NLM_F_ROOT ) {
1010
- if (tb [1 ] != NULL )
1012
+ if (tb [1 ])
1011
1013
return tca_action_flush (net , tb [1 ], n , portid );
1012
- else
1013
- return - EINVAL ;
1014
+
1015
+ return - EINVAL ;
1014
1016
}
1015
1017
1016
1018
for (i = 1 ; i <= TCA_ACT_MAX_PRIO && tb [i ]; i ++ ) {
@@ -1062,12 +1064,14 @@ tcf_add_notify(struct net *net, struct nlmsghdr *n, struct list_head *actions,
1062
1064
}
1063
1065
1064
1066
static int tcf_action_add (struct net * net , struct nlattr * nla ,
1065
- struct nlmsghdr * n , u32 portid , int ovr )
1067
+ struct nlmsghdr * n , u32 portid , int ovr ,
1068
+ struct netlink_ext_ack * extack )
1066
1069
{
1067
1070
int ret = 0 ;
1068
1071
LIST_HEAD (actions );
1069
1072
1070
- ret = tcf_action_init (net , NULL , nla , NULL , NULL , ovr , 0 , & actions );
1073
+ ret = tcf_action_init (net , NULL , nla , NULL , NULL , ovr , 0 , & actions ,
1074
+ extack );
1071
1075
if (ret )
1072
1076
return ret ;
1073
1077
@@ -1115,7 +1119,8 @@ static int tc_ctl_action(struct sk_buff *skb, struct nlmsghdr *n,
1115
1119
if (n -> nlmsg_flags & NLM_F_REPLACE )
1116
1120
ovr = 1 ;
1117
1121
replay :
1118
- ret = tcf_action_add (net , tca [TCA_ACT_TAB ], n , portid , ovr );
1122
+ ret = tcf_action_add (net , tca [TCA_ACT_TAB ], n , portid , ovr ,
1123
+ extack );
1119
1124
if (ret == - EAGAIN )
1120
1125
goto replay ;
1121
1126
break ;
0 commit comments