diff --git a/src/sys/include/net/netif.h b/src/sys/include/net/netif.h index 368bfff..866a7d8 100644 --- a/src/sys/include/net/netif.h +++ b/src/sys/include/net/netif.h @@ -50,8 +50,8 @@ 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. */ -typedef struct route_cache { - struct netif *next; +typedef struct __route_cache { + struct __route_cache *next; uInt8 num; struct ip_addr ip_addr; struct ip_addr netmask; @@ -61,11 +61,11 @@ void *state; } route_cache_t; -extern struct route_cache *route_cache_list; +extern route_cache_t *route_cache_list; void route_cache_init(); -struct route_cache *route_cache_add(struct ip_addr *ipaddr, +route_cache_t *route_cache_add(struct ip_addr *ipaddr, struct ip_addr *netmask, struct ip_addr *gw); diff --git a/src/sys/net/core/ip.c b/src/sys/net/core/ip.c index 81e9a77..fad3eea 100644 --- a/src/sys/net/core/ip.c +++ b/src/sys/net/core/ip.c @@ -63,6 +63,8 @@ #include "lwip/dhcp.h" #endif /* LWIP_DHCP */ +#include + /*-----------------------------------------------------------------------------------*/ /* ip_init: * @@ -157,8 +159,8 @@ to test the cache system. */ kprintf ("RouteNG: Adding Cache Entry\n"); - IP4_ADDR(&netmask, 255,255,255,0); - route_cache_add(dest, &netmask, &(netif_default->gw)); + IP4_ADDR(&(route_cache->netmask), 255,255,255,0); + route_cache_add(dest, &(route_cache->netmask), &(netif_default->gw)); return netif_default; } diff --git a/src/sys/net/core/netif.c b/src/sys/net/core/netif.c index 7a1e892..49b25c0 100644 --- a/src/sys/net/core/netif.c +++ b/src/sys/net/core/netif.c @@ -45,7 +45,7 @@ struct netif *netif_list = NULL; struct netif *netif_default = NULL; -struct route_cache *route_cache_list = NULL; +route_cache_t *route_cache_list = NULL; /*-----------------------------------------------------------------------------------*/ struct netif * @@ -147,7 +147,7 @@ /*-----------------------------------------------------------------------------------*/ /* Add to the Route Cache */ -struct route_cache * +route_cache_t * route_cache_add(struct ip_addr *ipaddr, struct ip_addr *netmask, struct ip_addr *gw) { @@ -165,7 +165,8 @@ ip_addr_set(&(route_cache->netmask), netmask); ip_addr_set(&(route_cache->gw), gw); - init(route_cache); + /* TODO: WTF? Learn how to compile stuff before you check it in. */ + /** init(route_cache); **/ route_cache->next = route_cache_list; route_cache_list = route_cache;