ipv4: Add redirect support to all protocol icmp error handlers.
[linux-2.6-block.git] / net / dccp / ipv4.c
index 07f5579ca756c90030758b99fff0e43708f115be..8f41a31908584b9f935dba30fab39d465188aa5e 100644 (file)
@@ -195,6 +195,14 @@ static inline void dccp_do_pmtu_discovery(struct sock *sk,
        } /* else let the usual retransmit timer handle it */
 }
 
+static void dccp_do_redirect(struct sk_buff *skb, struct sock *sk)
+{
+       struct dst_entry *dst = __sk_dst_check(sk, 0);
+
+       if (dst && dst->ops->redirect)
+               dst->ops->redirect(dst, skb);
+}
+
 /*
  * This routine is called by the ICMP module when it gets some sort of error
  * condition. If err < 0 then the socket should be closed and the error
@@ -259,6 +267,9 @@ static void dccp_v4_err(struct sk_buff *skb, u32 info)
        }
 
        switch (type) {
+       case ICMP_REDIRECT:
+               dccp_do_redirect(skb, sk);
+               goto out;
        case ICMP_SOURCE_QUENCH:
                /* Just silently ignore these. */
                goto out;
@@ -504,7 +515,7 @@ static int dccp_v4_send_response(struct sock *sk, struct request_sock *req,
        struct dst_entry *dst;
        struct flowi4 fl4;
 
-       dst = inet_csk_route_req(sk, &fl4, req);
+       dst = inet_csk_route_req(sk, &fl4, req, false);
        if (dst == NULL)
                goto out;