Skip to content

Commit

Permalink
[XFRM] Statistics: Add outbound-dropping error.
Browse files Browse the repository at this point in the history
o Increment PolError counter when flow_cache_lookup() returns
  errored pointer.

o Increment NoStates counter at larval-drop.

Signed-off-by: Masahide NAKAMURA <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
  • Loading branch information
Masahide NAKAMURA authored and davem330 committed Jan 28, 2008
1 parent a067d9a commit d66e37a
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion net/xfrm/xfrm_policy.c
Original file line number Diff line number Diff line change
Expand Up @@ -1510,8 +1510,10 @@ int __xfrm_lookup(struct dst_entry **dst_p, struct flowi *fl,
policy = flow_cache_lookup(fl, dst_orig->ops->family,
dir, xfrm_policy_lookup);
err = PTR_ERR(policy);
if (IS_ERR(policy))
if (IS_ERR(policy)) {
XFRM_INC_STATS(LINUX_MIB_XFRMOUTPOLERROR);
goto dropdst;
}
}

if (!policy)
Expand Down Expand Up @@ -1603,6 +1605,7 @@ int __xfrm_lookup(struct dst_entry **dst_p, struct flowi *fl,
/* EREMOTE tells the caller to generate
* a one-shot blackhole route.
*/
XFRM_INC_STATS(LINUX_MIB_XFRMOUTNOSTATES);
xfrm_pol_put(policy);
return -EREMOTE;
}
Expand Down

0 comments on commit d66e37a

Please sign in to comment.