aboutsummaryrefslogtreecommitdiffstats
path: root/net/dccp/ipv4.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/dccp/ipv4.c')
-rw-r--r--net/dccp/ipv4.c24
1 files changed, 14 insertions, 10 deletions
diff --git a/net/dccp/ipv4.c b/net/dccp/ipv4.c
index 07f5579ca756..176ecdba4a22 100644
--- a/net/dccp/ipv4.c
+++ b/net/dccp/ipv4.c
@@ -161,17 +161,10 @@ static inline void dccp_do_pmtu_discovery(struct sock *sk,
161 if (sk->sk_state == DCCP_LISTEN) 161 if (sk->sk_state == DCCP_LISTEN)
162 return; 162 return;
163 163
164 /* We don't check in the destentry if pmtu discovery is forbidden 164 dst = inet_csk_update_pmtu(sk, mtu);
165 * on this route. We just assume that no packet_to_big packets 165 if (!dst)
166 * are send back when pmtu discovery is not active.
167 * There is a small race when the user changes this flag in the
168 * route, but I think that's acceptable.
169 */
170 if ((dst = __sk_dst_check(sk, 0)) == NULL)
171 return; 166 return;
172 167
173 dst->ops->update_pmtu(dst, mtu);
174
175 /* Something is about to be wrong... Remember soft error 168 /* Something is about to be wrong... Remember soft error
176 * for the case, if this connection will not able to recover. 169 * for the case, if this connection will not able to recover.
177 */ 170 */
@@ -195,6 +188,14 @@ static inline void dccp_do_pmtu_discovery(struct sock *sk,
195 } /* else let the usual retransmit timer handle it */ 188 } /* else let the usual retransmit timer handle it */
196} 189}
197 190
191static void dccp_do_redirect(struct sk_buff *skb, struct sock *sk)
192{
193 struct dst_entry *dst = __sk_dst_check(sk, 0);
194
195 if (dst)
196 dst->ops->redirect(dst, sk, skb);
197}
198
198/* 199/*
199 * This routine is called by the ICMP module when it gets some sort of error 200 * This routine is called by the ICMP module when it gets some sort of error
200 * condition. If err < 0 then the socket should be closed and the error 201 * condition. If err < 0 then the socket should be closed and the error
@@ -259,6 +260,9 @@ static void dccp_v4_err(struct sk_buff *skb, u32 info)
259 } 260 }
260 261
261 switch (type) { 262 switch (type) {
263 case ICMP_REDIRECT:
264 dccp_do_redirect(skb, sk);
265 goto out;
262 case ICMP_SOURCE_QUENCH: 266 case ICMP_SOURCE_QUENCH:
263 /* Just silently ignore these. */ 267 /* Just silently ignore these. */
264 goto out; 268 goto out;
@@ -477,7 +481,7 @@ static struct dst_entry* dccp_v4_route_skb(struct net *net, struct sock *sk,
477 struct rtable *rt; 481 struct rtable *rt;
478 const struct iphdr *iph = ip_hdr(skb); 482 const struct iphdr *iph = ip_hdr(skb);
479 struct flowi4 fl4 = { 483 struct flowi4 fl4 = {
480 .flowi4_oif = skb_rtable(skb)->rt_iif, 484 .flowi4_oif = inet_iif(skb),
481 .daddr = iph->saddr, 485 .daddr = iph->saddr,
482 .saddr = iph->daddr, 486 .saddr = iph->daddr,
483 .flowi4_tos = RT_CONN_FLAGS(sk), 487 .flowi4_tos = RT_CONN_FLAGS(sk),