From 9dd10e46abf7682234da52fdddfee12f159b0d99 Mon Sep 17 00:00:00 2001 From: likewise Date: Wed, 5 May 2004 18:33:01 +0000 Subject: [PATCH] Fix three bugs during tests. --- src/netif/etharp.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/netif/etharp.c b/src/netif/etharp.c index c3c0bece..8cd43ed9 100644 --- a/src/netif/etharp.c +++ b/src/netif/etharp.c @@ -526,7 +526,7 @@ etharp_output(struct netif *netif, struct ip_addr *ipaddr, struct pbuf *q) struct eth_addr *dest, *srcaddr, mcastaddr; struct eth_hdr *ethhdr; s8_t i; - err_t result; + err_t result = ERR_OK; /* make room for Ethernet header - should not fail*/ if (pbuf_header(q, sizeof(struct eth_hdr)) != 0) { @@ -631,6 +631,7 @@ etharp_output(struct netif *netif, struct ip_addr *ipaddr, struct pbuf *q) err_t etharp_query(struct netif *netif, struct ip_addr *ipaddr, struct pbuf *q) { struct pbuf *p; + struct eth_addr * srcaddr = (struct eth_addr *)netif->hwaddr; err_t result = ERR_OK; s8_t i; /* ARP entry index */ u8_t k; /* Ethernet address octet index */ @@ -720,12 +721,11 @@ err_t etharp_query(struct netif *netif, struct ip_addr *ipaddr, struct pbuf *q) /* { i is either a (new or existing) PENDING or STABLE entry } */ /* packet given? */ - if (q != NULL) + if (q != NULL) { /* stable entry? */ if (arp_table[i].state == ETHARP_STATE_STABLE) { /* we have a valid IP->Ethernet address mapping, * fill in the Ethernet header for the outgoing packet */ - struct eth_addr * srcaddr = (struct eth_addr *)netif->hwaddr; struct eth_hdr *ethhdr = q->payload; for(k = 0; k < netif->hwaddr_len; k++) { ethhdr->dest.addr[k] = arp_table[i].ethaddr.addr[k];