Message ID | 1299172043.2983.142.camel@edumazet-laptop |
---|---|
State | Not Applicable, archived |
Delegated to: | David Miller |
Headers | show |
From: Eric Dumazet <eric.dumazet@gmail.com> Date: Thu, 03 Mar 2011 18:07:23 +0100 > [PATCH net-next-2.6] udp: udp_sendmsg() fix > > commit b23dd4fe42b455af (ipv4: Make output route lookup return rtable > directly) introduced a regression in udp_sendmsg() > > If IP route lookup fails, we should not try to release an non existent > route. > > Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com> Ok, this works too. My version NULL's out rt, so that if we had any changes in code paths here it would be unlikely we'd reintroduce this bug. I'm fine either way, although my version is in net-next-2.6 at the moment :-) -- To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Le jeudi 03 mars 2011 à 10:42 -0800, David Miller a écrit : > My version NULL's out rt, so that if we had any changes in code paths > here it would be unlikely we'd reintroduce this bug. > > I'm fine either way, although my version is in net-next-2.6 at the > moment :-) No problem, your version pleases me as well ;) -- To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
diff --git a/net/ipv4/udp.c b/net/ipv4/udp.c index 95e0c2c..f6c0c00 100644 --- a/net/ipv4/udp.c +++ b/net/ipv4/udp.c @@ -927,7 +927,7 @@ int udp_sendmsg(struct kiocb *iocb, struct sock *sk, struct msghdr *msg, err = PTR_ERR(rt); if (err == -ENETUNREACH) IP_INC_STATS_BH(net, IPSTATS_MIB_OUTNOROUTES); - goto out; + goto out2; } err = -EACCES; @@ -991,6 +991,7 @@ do_append_data: out: ip_rt_put(rt); +out2: if (free) kfree(ipc.opt); if (!err)