|
From: | Dyan Chiang |
Subject: | [lwip-users] question about compile minimal under Fedora 2 |
Date: | Sat, 11 Jun 2005 16:29:58 +0800 |
I port lwip to Fedora 2(kernel 2.6).
And just when I start to compiler the /minimal porject
gcc version is 3.3.3 and the make
program exit with the following error:
minitapif.c:271:error: void value not
ignored as it ought to be
minitapif.c:276:error: void value not
ignored as it ought to be
and I check the minitapif.c file I
find that on the line 271 and 276 is the "mintapif_input()"
function as here(I mark it with red
color).
it call void etharp_ip_input() and
void etharp_arp_input()
static
void
mintapif_input(struct netif *netif) { struct mintapif *mintapif; struct eth_hdr *ethhdr; struct pbuf *p, *q; mintapif = netif->state; p = low_level_input(mintapif); if (p != NULL) {
#ifdef LINK_STATS
lwip_stats.link.recv++; #endif /* LINK_STATS */ ethhdr =
p->payload;
q =
NULL;
switch (htons(ethhdr->type)) { case ETHTYPE_IP: q = etharp_ip_input(netif, p); pbuf_header(p, -14); netif->input(p, netif); break; case ETHTYPE_ARP: q = etharp_arp_input(netif, mintapif->ethaddr, p); break; default: pbuf_free(p); break; } if (q != NULL) { low_level_output(netif, q); pbuf_free(q); } }
} And I go to the lwip-1.0.0/src/netif/etharp.c and
lwip-1.0.0/src/include/netif/etharp.h
find the
void etharp_ip_input(struct netif *netif, struct pbuf *p);
void etharp_arp_input(struct netif *netif, struct
eth_addr *ethaddr,
struct pbuf *p); change to the following:
struct pbuf
* etharp_ip_input(struct netif *netif, struct pbuf *p);
struct pbuf
* etharp_arp_input(struct netif *netif, struct eth_addr
*ethaddr,
struct pbuf *p); and I compiler again. Now compiling
is success.
I have some question to
ask:
1. Is it OK if I do such
changes?
2. Why it is declare as void and in
minitapif.c call it again with return. What is it aim try to
accomplish?
Thank you very much.
Please forgive me my
ungreatefully asking question.
|
[Prev in Thread] | Current Thread | [Next in Thread] |