route.c (4e0c1159d83a658d1ffba5bc3442f4ec4cadb436) route.c (e5ed639913eea3e4783a550291775ab78dd84966)
1/*
2 * INET An implementation of the TCP/IP protocol suite for the LINUX
3 * operating system. INET is implemented using the BSD Socket
4 * interface as the means of communication with the user level.
5 *
6 * ROUTE - implementation of the IP router.
7 *
8 * Version: $Id: route.c,v 1.103 2002/01/12 07:44:09 davem Exp $

--- 2114 unchanged lines hidden (view full) ---

2123 comparing with route cache reject entries.
2124 Note, that multicast routers are not affected, because
2125 route cache entry is created eventually.
2126 */
2127 if (MULTICAST(daddr)) {
2128 struct in_device *in_dev;
2129
2130 rcu_read_lock();
1/*
2 * INET An implementation of the TCP/IP protocol suite for the LINUX
3 * operating system. INET is implemented using the BSD Socket
4 * interface as the means of communication with the user level.
5 *
6 * ROUTE - implementation of the IP router.
7 *
8 * Version: $Id: route.c,v 1.103 2002/01/12 07:44:09 davem Exp $

--- 2114 unchanged lines hidden (view full) ---

2123 comparing with route cache reject entries.
2124 Note, that multicast routers are not affected, because
2125 route cache entry is created eventually.
2126 */
2127 if (MULTICAST(daddr)) {
2128 struct in_device *in_dev;
2129
2130 rcu_read_lock();
2131 if ((in_dev = __in_dev_get(dev)) != NULL) {
2131 if ((in_dev = __in_dev_get_rcu(dev)) != NULL) {
2132 int our = ip_check_mc(in_dev, daddr, saddr,
2133 skb->nh.iph->protocol);
2134 if (our
2135#ifdef CONFIG_IP_MROUTE
2136 || (!LOCAL_MCAST(daddr) && IN_DEV_MFORWARD(in_dev))
2137#endif
2138 ) {
2139 rcu_read_unlock();

--- 298 unchanged lines hidden (view full) ---

2438 }
2439
2440
2441 if (oldflp->oif) {
2442 dev_out = dev_get_by_index(oldflp->oif);
2443 err = -ENODEV;
2444 if (dev_out == NULL)
2445 goto out;
2132 int our = ip_check_mc(in_dev, daddr, saddr,
2133 skb->nh.iph->protocol);
2134 if (our
2135#ifdef CONFIG_IP_MROUTE
2136 || (!LOCAL_MCAST(daddr) && IN_DEV_MFORWARD(in_dev))
2137#endif
2138 ) {
2139 rcu_read_unlock();

--- 298 unchanged lines hidden (view full) ---

2438 }
2439
2440
2441 if (oldflp->oif) {
2442 dev_out = dev_get_by_index(oldflp->oif);
2443 err = -ENODEV;
2444 if (dev_out == NULL)
2445 goto out;
2446 if (__in_dev_get(dev_out) == NULL) {
2446
2447 /* RACE: Check return value of inet_select_addr instead. */
2448 if (__in_dev_get_rtnl(dev_out) == NULL) {
2447 dev_put(dev_out);
2448 goto out; /* Wrong error code */
2449 }
2450
2451 if (LOCAL_MCAST(oldflp->fl4_dst) || oldflp->fl4_dst == 0xFFFFFFFF) {
2452 if (!fl.fl4_src)
2453 fl.fl4_src = inet_select_addr(dev_out, 0,
2454 RT_SCOPE_LINK);

--- 757 unchanged lines hidden ---
2449 dev_put(dev_out);
2450 goto out; /* Wrong error code */
2451 }
2452
2453 if (LOCAL_MCAST(oldflp->fl4_dst) || oldflp->fl4_dst == 0xFFFFFFFF) {
2454 if (!fl.fl4_src)
2455 fl.fl4_src = inet_select_addr(dev_out, 0,
2456 RT_SCOPE_LINK);

--- 757 unchanged lines hidden ---