ipv4: Add redirect support to all protocol icmp error handlers.

Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
David S. Miller 2012-07-11 21:27:49 -07:00
parent b42597e2f3
commit 55be7a9c60
12 changed files with 110 additions and 16 deletions

View file

@ -423,6 +423,18 @@ void sctp_icmp_frag_needed(struct sock *sk, struct sctp_association *asoc,
sctp_retransmit(&asoc->outqueue, t, SCTP_RTXR_PMTUD);
}
static void sctp_icmp_redirect(struct sock *sk, struct sctp_transport *t,
struct sk_buff *skb)
{
struct dst_entry *dst;
if (!t)
return;
dst = sctp_transport_dst_check(t);
if (dst && dst->ops->redirect)
dst->ops->redirect(dst, skb);
}
/*
* SCTP Implementer's Guide, 2.37 ICMP handling procedures
*
@ -628,6 +640,10 @@ void sctp_v4_err(struct sk_buff *skb, __u32 info)
err = EHOSTUNREACH;
break;
case ICMP_REDIRECT:
sctp_icmp_redirect(sk, transport, skb);
err = 0;
break;
default:
goto out_unlock;
}