@@ -461,16 +461,15 @@ static int nf_tables_fill_table_info(struct sk_buff *skb, struct net *net,
461
461
return -1 ;
462
462
}
463
463
464
- static int nf_tables_table_notify (const struct nft_ctx * ctx , int event )
464
+ static void nf_tables_table_notify (const struct nft_ctx * ctx , int event )
465
465
{
466
466
struct sk_buff * skb ;
467
467
int err ;
468
468
469
469
if (!ctx -> report &&
470
470
!nfnetlink_has_listeners (ctx -> net , NFNLGRP_NFTABLES ))
471
- return 0 ;
471
+ return ;
472
472
473
- err = - ENOBUFS ;
474
473
skb = nlmsg_new (NLMSG_GOODSIZE , GFP_KERNEL );
475
474
if (skb == NULL )
476
475
goto err ;
@@ -482,14 +481,11 @@ static int nf_tables_table_notify(const struct nft_ctx *ctx, int event)
482
481
goto err ;
483
482
}
484
483
485
- err = nfnetlink_send (skb , ctx -> net , ctx -> portid , NFNLGRP_NFTABLES ,
486
- ctx -> report , GFP_KERNEL );
484
+ nfnetlink_send (skb , ctx -> net , ctx -> portid , NFNLGRP_NFTABLES ,
485
+ ctx -> report , GFP_KERNEL );
486
+ return ;
487
487
err :
488
- if (err < 0 ) {
489
- nfnetlink_set_err (ctx -> net , ctx -> portid , NFNLGRP_NFTABLES ,
490
- err );
491
- }
492
- return err ;
488
+ nfnetlink_set_err (ctx -> net , ctx -> portid , NFNLGRP_NFTABLES , - ENOBUFS );
493
489
}
494
490
495
491
static int nf_tables_dump_tables (struct sk_buff * skb ,
@@ -1050,16 +1046,15 @@ static int nf_tables_fill_chain_info(struct sk_buff *skb, struct net *net,
1050
1046
return -1 ;
1051
1047
}
1052
1048
1053
- static int nf_tables_chain_notify (const struct nft_ctx * ctx , int event )
1049
+ static void nf_tables_chain_notify (const struct nft_ctx * ctx , int event )
1054
1050
{
1055
1051
struct sk_buff * skb ;
1056
1052
int err ;
1057
1053
1058
1054
if (!ctx -> report &&
1059
1055
!nfnetlink_has_listeners (ctx -> net , NFNLGRP_NFTABLES ))
1060
- return 0 ;
1056
+ return ;
1061
1057
1062
- err = - ENOBUFS ;
1063
1058
skb = nlmsg_new (NLMSG_GOODSIZE , GFP_KERNEL );
1064
1059
if (skb == NULL )
1065
1060
goto err ;
@@ -1072,14 +1067,11 @@ static int nf_tables_chain_notify(const struct nft_ctx *ctx, int event)
1072
1067
goto err ;
1073
1068
}
1074
1069
1075
- err = nfnetlink_send (skb , ctx -> net , ctx -> portid , NFNLGRP_NFTABLES ,
1076
- ctx -> report , GFP_KERNEL );
1070
+ nfnetlink_send (skb , ctx -> net , ctx -> portid , NFNLGRP_NFTABLES ,
1071
+ ctx -> report , GFP_KERNEL );
1072
+ return ;
1077
1073
err :
1078
- if (err < 0 ) {
1079
- nfnetlink_set_err (ctx -> net , ctx -> portid , NFNLGRP_NFTABLES ,
1080
- err );
1081
- }
1082
- return err ;
1074
+ nfnetlink_set_err (ctx -> net , ctx -> portid , NFNLGRP_NFTABLES , - ENOBUFS );
1083
1075
}
1084
1076
1085
1077
static int nf_tables_dump_chains (struct sk_buff * skb ,
@@ -1934,18 +1926,16 @@ static int nf_tables_fill_rule_info(struct sk_buff *skb, struct net *net,
1934
1926
return -1 ;
1935
1927
}
1936
1928
1937
- static int nf_tables_rule_notify (const struct nft_ctx * ctx ,
1938
- const struct nft_rule * rule ,
1939
- int event )
1929
+ static void nf_tables_rule_notify (const struct nft_ctx * ctx ,
1930
+ const struct nft_rule * rule , int event )
1940
1931
{
1941
1932
struct sk_buff * skb ;
1942
1933
int err ;
1943
1934
1944
1935
if (!ctx -> report &&
1945
1936
!nfnetlink_has_listeners (ctx -> net , NFNLGRP_NFTABLES ))
1946
- return 0 ;
1937
+ return ;
1947
1938
1948
- err = - ENOBUFS ;
1949
1939
skb = nlmsg_new (NLMSG_GOODSIZE , GFP_KERNEL );
1950
1940
if (skb == NULL )
1951
1941
goto err ;
@@ -1958,14 +1948,11 @@ static int nf_tables_rule_notify(const struct nft_ctx *ctx,
1958
1948
goto err ;
1959
1949
}
1960
1950
1961
- err = nfnetlink_send (skb , ctx -> net , ctx -> portid , NFNLGRP_NFTABLES ,
1962
- ctx -> report , GFP_KERNEL );
1951
+ nfnetlink_send (skb , ctx -> net , ctx -> portid , NFNLGRP_NFTABLES ,
1952
+ ctx -> report , GFP_KERNEL );
1953
+ return ;
1963
1954
err :
1964
- if (err < 0 ) {
1965
- nfnetlink_set_err (ctx -> net , ctx -> portid , NFNLGRP_NFTABLES ,
1966
- err );
1967
- }
1968
- return err ;
1955
+ nfnetlink_set_err (ctx -> net , ctx -> portid , NFNLGRP_NFTABLES , - ENOBUFS );
1969
1956
}
1970
1957
1971
1958
struct nft_rule_dump_ctx {
@@ -2696,19 +2683,18 @@ static int nf_tables_fill_set(struct sk_buff *skb, const struct nft_ctx *ctx,
2696
2683
return -1 ;
2697
2684
}
2698
2685
2699
- static int nf_tables_set_notify (const struct nft_ctx * ctx ,
2700
- const struct nft_set * set ,
2701
- int event , gfp_t gfp_flags )
2686
+ static void nf_tables_set_notify (const struct nft_ctx * ctx ,
2687
+ const struct nft_set * set , int event ,
2688
+ gfp_t gfp_flags )
2702
2689
{
2703
2690
struct sk_buff * skb ;
2704
2691
u32 portid = ctx -> portid ;
2705
2692
int err ;
2706
2693
2707
2694
if (!ctx -> report &&
2708
2695
!nfnetlink_has_listeners (ctx -> net , NFNLGRP_NFTABLES ))
2709
- return 0 ;
2696
+ return ;
2710
2697
2711
- err = - ENOBUFS ;
2712
2698
skb = nlmsg_new (NLMSG_GOODSIZE , gfp_flags );
2713
2699
if (skb == NULL )
2714
2700
goto err ;
@@ -2719,12 +2705,11 @@ static int nf_tables_set_notify(const struct nft_ctx *ctx,
2719
2705
goto err ;
2720
2706
}
2721
2707
2722
- err = nfnetlink_send (skb , ctx -> net , portid , NFNLGRP_NFTABLES ,
2723
- ctx -> report , gfp_flags );
2708
+ nfnetlink_send (skb , ctx -> net , portid , NFNLGRP_NFTABLES , ctx -> report ,
2709
+ gfp_flags );
2710
+ return ;
2724
2711
err :
2725
- if (err < 0 )
2726
- nfnetlink_set_err (ctx -> net , portid , NFNLGRP_NFTABLES , err );
2727
- return err ;
2712
+ nfnetlink_set_err (ctx -> net , portid , NFNLGRP_NFTABLES , - ENOBUFS );
2728
2713
}
2729
2714
2730
2715
static int nf_tables_dump_sets (struct sk_buff * skb , struct netlink_callback * cb )
@@ -3504,20 +3489,19 @@ static int nf_tables_fill_setelem_info(struct sk_buff *skb,
3504
3489
return -1 ;
3505
3490
}
3506
3491
3507
- static int nf_tables_setelem_notify (const struct nft_ctx * ctx ,
3508
- const struct nft_set * set ,
3509
- const struct nft_set_elem * elem ,
3510
- int event , u16 flags )
3492
+ static void nf_tables_setelem_notify (const struct nft_ctx * ctx ,
3493
+ const struct nft_set * set ,
3494
+ const struct nft_set_elem * elem ,
3495
+ int event , u16 flags )
3511
3496
{
3512
3497
struct net * net = ctx -> net ;
3513
3498
u32 portid = ctx -> portid ;
3514
3499
struct sk_buff * skb ;
3515
3500
int err ;
3516
3501
3517
3502
if (!ctx -> report && !nfnetlink_has_listeners (net , NFNLGRP_NFTABLES ))
3518
- return 0 ;
3503
+ return ;
3519
3504
3520
- err = - ENOBUFS ;
3521
3505
skb = nlmsg_new (NLMSG_GOODSIZE , GFP_KERNEL );
3522
3506
if (skb == NULL )
3523
3507
goto err ;
@@ -3529,12 +3513,11 @@ static int nf_tables_setelem_notify(const struct nft_ctx *ctx,
3529
3513
goto err ;
3530
3514
}
3531
3515
3532
- err = nfnetlink_send (skb , net , portid , NFNLGRP_NFTABLES , ctx -> report ,
3533
- GFP_KERNEL );
3516
+ nfnetlink_send (skb , net , portid , NFNLGRP_NFTABLES , ctx -> report ,
3517
+ GFP_KERNEL );
3518
+ return ;
3534
3519
err :
3535
- if (err < 0 )
3536
- nfnetlink_set_err (net , portid , NFNLGRP_NFTABLES , err );
3537
- return err ;
3520
+ nfnetlink_set_err (net , portid , NFNLGRP_NFTABLES , - ENOBUFS );
3538
3521
}
3539
3522
3540
3523
static struct nft_trans * nft_trans_elem_alloc (struct nft_ctx * ctx ,
@@ -4476,18 +4459,17 @@ static int nf_tables_delobj(struct net *net, struct sock *nlsk,
4476
4459
return nft_delobj (& ctx , obj );
4477
4460
}
4478
4461
4479
- int nft_obj_notify (struct net * net , struct nft_table * table ,
4480
- struct nft_object * obj , u32 portid , u32 seq , int event ,
4481
- int family , int report , gfp_t gfp )
4462
+ void nft_obj_notify (struct net * net , struct nft_table * table ,
4463
+ struct nft_object * obj , u32 portid , u32 seq , int event ,
4464
+ int family , int report , gfp_t gfp )
4482
4465
{
4483
4466
struct sk_buff * skb ;
4484
4467
int err ;
4485
4468
4486
4469
if (!report &&
4487
4470
!nfnetlink_has_listeners (net , NFNLGRP_NFTABLES ))
4488
- return 0 ;
4471
+ return ;
4489
4472
4490
- err = - ENOBUFS ;
4491
4473
skb = nlmsg_new (NLMSG_GOODSIZE , gfp );
4492
4474
if (skb == NULL )
4493
4475
goto err ;
@@ -4499,21 +4481,18 @@ int nft_obj_notify(struct net *net, struct nft_table *table,
4499
4481
goto err ;
4500
4482
}
4501
4483
4502
- err = nfnetlink_send (skb , net , portid , NFNLGRP_NFTABLES , report , gfp );
4484
+ nfnetlink_send (skb , net , portid , NFNLGRP_NFTABLES , report , gfp );
4485
+ return ;
4503
4486
err :
4504
- if (err < 0 ) {
4505
- nfnetlink_set_err (net , portid , NFNLGRP_NFTABLES , err );
4506
- }
4507
- return err ;
4487
+ nfnetlink_set_err (net , portid , NFNLGRP_NFTABLES , - ENOBUFS );
4508
4488
}
4509
4489
EXPORT_SYMBOL_GPL (nft_obj_notify );
4510
4490
4511
- static int nf_tables_obj_notify (const struct nft_ctx * ctx ,
4512
- struct nft_object * obj , int event )
4491
+ static void nf_tables_obj_notify (const struct nft_ctx * ctx ,
4492
+ struct nft_object * obj , int event )
4513
4493
{
4514
- return nft_obj_notify (ctx -> net , ctx -> table , obj , ctx -> portid ,
4515
- ctx -> seq , event , ctx -> afi -> family , ctx -> report ,
4516
- GFP_KERNEL );
4494
+ nft_obj_notify (ctx -> net , ctx -> table , obj , ctx -> portid , ctx -> seq , event ,
4495
+ ctx -> afi -> family , ctx -> report , GFP_KERNEL );
4517
4496
}
4518
4497
4519
4498
static int nf_tables_fill_gen_info (struct sk_buff * skb , struct net * net ,
@@ -4543,17 +4522,17 @@ static int nf_tables_fill_gen_info(struct sk_buff *skb, struct net *net,
4543
4522
return - EMSGSIZE ;
4544
4523
}
4545
4524
4546
- static int nf_tables_gen_notify (struct net * net , struct sk_buff * skb , int event )
4525
+ static void nf_tables_gen_notify (struct net * net , struct sk_buff * skb ,
4526
+ int event )
4547
4527
{
4548
4528
struct nlmsghdr * nlh = nlmsg_hdr (skb );
4549
4529
struct sk_buff * skb2 ;
4550
4530
int err ;
4551
4531
4552
4532
if (nlmsg_report (nlh ) &&
4553
4533
!nfnetlink_has_listeners (net , NFNLGRP_NFTABLES ))
4554
- return 0 ;
4534
+ return ;
4555
4535
4556
- err = - ENOBUFS ;
4557
4536
skb2 = nlmsg_new (NLMSG_GOODSIZE , GFP_KERNEL );
4558
4537
if (skb2 == NULL )
4559
4538
goto err ;
@@ -4565,14 +4544,12 @@ static int nf_tables_gen_notify(struct net *net, struct sk_buff *skb, int event)
4565
4544
goto err ;
4566
4545
}
4567
4546
4568
- err = nfnetlink_send (skb2 , net , NETLINK_CB (skb ).portid ,
4569
- NFNLGRP_NFTABLES , nlmsg_report (nlh ), GFP_KERNEL );
4547
+ nfnetlink_send (skb2 , net , NETLINK_CB (skb ).portid , NFNLGRP_NFTABLES ,
4548
+ nlmsg_report (nlh ), GFP_KERNEL );
4549
+ return ;
4570
4550
err :
4571
- if (err < 0 ) {
4572
- nfnetlink_set_err (net , NETLINK_CB (skb ).portid , NFNLGRP_NFTABLES ,
4573
- err );
4574
- }
4575
- return err ;
4551
+ nfnetlink_set_err (net , NETLINK_CB (skb ).portid , NFNLGRP_NFTABLES ,
4552
+ - ENOBUFS );
4576
4553
}
4577
4554
4578
4555
static int nf_tables_getgen (struct net * net , struct sock * nlsk ,
0 commit comments