diff --git a/src/sys/include/net/netif.h b/src/sys/include/net/netif.h index 5aaba47..baf9898 100644 --- a/src/sys/include/net/netif.h +++ b/src/sys/include/net/netif.h @@ -50,7 +50,7 @@ Dupliates almost 100% the layout of the netif table allow complete reuse of existing routines for the netif table to manipulate the route_cache table. */ -struct route_cache { +typedef struct route_cache { struct netif *next; uInt8 num; struct ip_addr ip_addr; @@ -59,7 +59,7 @@ char hwaddr[6]; char name[2]; void *state; -}; +} route_cache_t; extern struct route_cache *route_cache_list; diff --git a/src/sys/net/core/ip.c b/src/sys/net/core/ip.c index c9a396d..e765408 100644 --- a/src/sys/net/core/ip.c +++ b/src/sys/net/core/ip.c @@ -137,7 +137,8 @@ struct netif * ip_route(struct ip_addr *dest) { - struct netif *netif; + struct netif *netif = 0x0; + route_cache_t *route_cache = 0x0; for(netif = netif_list; netif != NULL; netif = netif->next) { if(ip_addr_maskcmp(dest, &(netif->ip_addr), &(netif->netmask))) { @@ -145,11 +146,11 @@ } } -/* for(route_cache = route_cache_list; route_cache != NULL; route_cache = route_cache->next) { + for(route_cache = route_cache_list; route_cache != NULL; route_cache = route_cache->next) { if(ip_addr_maskcmp(dest, &(route_cache->ip_addr), &(route_cache->netmask))) { return route_cache; } - } */ + } return netif_default; } diff --git a/src/sys/net/core/netif.c b/src/sys/net/core/netif.c index 4018430..e1f1e9a 100644 --- a/src/sys/net/core/netif.c +++ b/src/sys/net/core/netif.c @@ -152,10 +152,10 @@ struct ip_addr *gw, void (* init)(struct route_cache *route_cache)) { - struct route_cache *route_cache; + route_cache_t *route_cache; static int route_cache_num = 0; - route_cache = mem_malloc(sizeof(struct route_cache)); + route_cache = mem_malloc(sizeof(route_cache_t)); if(route_cache == NULL) { return NULL;