Changeset 836dd794 in mainline


Ignore:
Timestamp:
2010-03-07T20:17:17Z (15 years ago)
Author:
Lukas Mejdrech <lukasmejdrech@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
31c80a5
Parents:
936835e
Message:
  • local delivery fix (bug #198)
File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/srv/net/il/ip/ip.c

    r936835e r836dd794  
    696696                        return ip_release_and_return(packet, EAFNOSUPPORT);
    697697        }
     698        netif = NULL;
     699        route = NULL;
    698700        fibril_rwlock_read_lock(&ip_globals.netifs_lock);
    699701        // device specified?
     
    704706                        route = &ip_globals.gateway;
    705707                }
    706         }else{
     708        }
     709        if(! route){
    707710                route = ip_find_route(*dest);
    708711                netif = route ? route->netif : NULL;
     
    726729                }
    727730        }
    728         if(route->address.s_addr == dest->s_addr){
     731        // if the local host is the destination
     732        if((route->address.s_addr == dest->s_addr)
     733                && (dest->s_addr != IPV4_LOCALHOST_ADDRESS)){
    729734                // find the loopback device to deliver
    730735                dest->s_addr = IPV4_LOCALHOST_ADDRESS;
     
    15811586        fibril_rwlock_read_lock(&ip_globals.lock);
    15821587        route = ip_find_route(*dest);
     1588        // if the local host is the destination
     1589        if(route && (route->address.s_addr == dest->s_addr)
     1590                && (dest->s_addr != IPV4_LOCALHOST_ADDRESS)){
     1591                // find the loopback device to deliver
     1592                dest->s_addr = IPV4_LOCALHOST_ADDRESS;
     1593                route = ip_find_route(*dest);
     1594        }
    15831595        if(!(route && route->netif)){
    15841596                fibril_rwlock_read_unlock(&ip_globals.lock);
Note: See TracChangeset for help on using the changeset viewer.