Skip to content

Commit

Permalink
count number of ipsec encapsulations on ipsec4_output, so that
Browse files Browse the repository at this point in the history
we can tell ip_output() how to handle the packet further.
  • Loading branch information
itojun committed Nov 20, 2001
1 parent 6fd5957 commit 190df42
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
5 changes: 4 additions & 1 deletion kame/sys/netinet6/ipsec.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* $KAME: ipsec.c,v 1.131 2001/11/06 08:06:21 sakane Exp $ */
/* $KAME: ipsec.c,v 1.132 2001/11/20 08:32:38 itojun Exp $ */

/*
* Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
Expand Down Expand Up @@ -2748,6 +2748,7 @@ ipsec4_output(state, sp, flags)
panic("state->ro == NULL in ipsec4_output");
if (!state->dst)
panic("state->dst == NULL in ipsec4_output");
state->encap = 0;

KEYDEBUG(KEYDEBUG_IPSEC_DATA,
printf("ipsec4_output: applyed SP\n");
Expand Down Expand Up @@ -2889,6 +2890,8 @@ ipsec4_output(state, sp, flags)
state->dst = (struct sockaddr *)state->ro->ro_rt->rt_gateway;
dst4 = (struct sockaddr_in *)state->dst;
}

state->encap++;
} else
splx(s);

Expand Down
3 changes: 2 additions & 1 deletion kame/sys/netinet6/ipsec.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* $KAME: ipsec.h,v 1.52 2001/09/21 05:12:53 sakane Exp $ */
/* $KAME: ipsec.h,v 1.53 2001/11/20 08:32:38 itojun Exp $ */

/*
* Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
Expand Down Expand Up @@ -338,6 +338,7 @@ struct ipsec_output_state {
struct mbuf *m;
struct route *ro;
struct sockaddr *dst;
int encap;
};

struct ipsec_history {
Expand Down

0 comments on commit 190df42

Please sign in to comment.