[PATCH] Fix of ip_route_output_slow [message #522] |
Thu, 08 December 2005 15:06 |
xemul
Messages: 248 Registered: November 2005
|
Senior Member |
|
|
Patch from Denis (den@) and Pavel (xemul@):
When ip_rt_src_check is off we still can try
to route multicast/broadcast packets.
Bug #55476
--- ./net/ipv4/route.c.ipr 2005-12-08 12:33:07.000000000 +0300
+++ ./net/ipv4/route.c 2005-12-08 18:02:16.169811112 +0300
@@ -2112,13 +2112,10 @@ static int ip_route_output_slow(struct r
ZERONET(oldflp->fl4_src))
goto out;
- if (ip_rt_src_check) {
- /* It is equivalent to
- inet_addr_type(saddr) == RTN_LOCAL */
- dev_out = ip_dev_find(oldflp->fl4_src);
- if (dev_out == NULL)
- goto out;
- }
+ /* It is equivalent to inet_addr_type(saddr) == RTN_LOCAL */
+ dev_out = ip_dev_find(oldflp->fl4_src);
+ if (ip_rt_src_check && dev_out == NULL)
+ goto out;
/* I removed check for oif == dev_out->oif here.
It was wrong for two reasons:
@@ -2145,6 +2142,9 @@ static int ip_route_output_slow(struct r
Luckily, this hack is good workaround.
*/
+ if (dev_out == NULL)
+ goto out;
+
fl.oif = dev_out->ifindex;
goto make_route;
}
|
|
|