Skip to content

Commit

Permalink
Merge branch 'optimize' into dev4
Browse files Browse the repository at this point in the history
* optimize:
  kmod-oaf: recheck drop for subsequent packets
  • Loading branch information
jjm2473 committed Mar 15, 2024
2 parents fecd0ca + d1e3275 commit 25b5328
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions oaf/src/app_filter.c
Original file line number Diff line number Diff line change
Expand Up @@ -833,6 +833,11 @@ int af_match_one(flow_info_t *flow, af_feature_node_t *node)
return ret;
}

int app_filter_redrop(u_int32_t app_id, unsigned char *mac)
{
return af_get_app_status(app_id) && (!is_user_match_enable() || find_af_mac(mac));
}

int app_filter_match(flow_info_t *flow, unsigned char *mac)
{
af_feature_node_t *n, *node;
Expand Down Expand Up @@ -1097,6 +1102,10 @@ u_int32_t app_filter_hook_gateway_handle(struct sk_buff *skb, struct net_device
if (app_id > 1000 && app_id < 9999){
if (NF_DROP_BIT == (ct->mark & NF_DROP_BIT))
drop = 1;
else if (app_filter_redrop(app_id, smac)) {
ct->mark |= NF_DROP_BIT;
drop = 1;
}
af_update_client_app_info(smac, app_id, drop);

if (drop){
Expand Down

0 comments on commit 25b5328

Please sign in to comment.