Skip to content

Commit

Permalink
[IPV6] IPSEC: Omit redirect for tunnelled packet.
Browse files Browse the repository at this point in the history
IPv6 IPsec tunnel gateway incorrectly sends redirect to
router or sender when network device the IPsec tunnelled packet
is arrived is the same as the one the decapsulated packet
is sent.

With this patch, it omits to send the redirect when the forwarding
skbuff carries secpath, since such skbuff should be assumed as
a decapsulated packet from IPsec tunnel by own.

It may be a rare case for an IPsec security gateway, however
it is not rare when the gateway is MIPv6 Home Agent since
the another tunnel end-point is Mobile Node and it changes
the attached network.

Signed-off-by: Masahide NAKAMURA <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
  • Loading branch information
Masahide NAKAMURA authored and David S. Miller committed Oct 10, 2007
1 parent a47ed4c commit 1e5dc14
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion net/ipv6/ip6_output.c
Original file line number Diff line number Diff line change
Expand Up @@ -441,8 +441,10 @@ int ip6_forward(struct sk_buff *skb)

/* IPv6 specs say nothing about it, but it is clear that we cannot
send redirects to source routed frames.
We don't send redirects to frames decapsulated from IPsec.
*/
if (skb->dev == dst->dev && dst->neighbour && opt->srcrt == 0) {
if (skb->dev == dst->dev && dst->neighbour && opt->srcrt == 0 &&
!skb->sp) {
struct in6_addr *target = NULL;
struct rt6_info *rt;
struct neighbour *n = dst->neighbour;
Expand Down

0 comments on commit 1e5dc14

Please sign in to comment.