summaryrefslogtreecommitdiff
path: root/net
diff options
context:
space:
mode:
authorJoe Hershberger <joe.hershberger@ni.com>2015-04-08 01:41:04 -0500
committerSimon Glass <sjg@chromium.org>2015-04-18 11:11:32 -0600
commit0adb5b761f4c789ae47d8abb015f5e017263d3f2 (patch)
tree84f951f300ae9d8d0a48c9ab14f11c9c1ecef477 /net
parent586cbe51ab8ef357bcf3a52c6885ab00bc7293dd (diff)
downloadu-boot-0adb5b761f4c789ae47d8abb015f5e017263d3f2.tar.gz
net: cosmetic: Name ethaddr variables consistently
Use "_ethaddr" at the end of variables and drop CamelCase. Make constant values actually 'const'. Signed-off-by: Joe Hershberger <joe.hershberger@ni.com> Acked-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'net')
-rw-r--r--net/arp.c8
-rw-r--r--net/bootp.c19
-rw-r--r--net/cdp.c8
-rw-r--r--net/dns.c4
-rw-r--r--net/eth.c22
-rw-r--r--net/link_local.c18
-rw-r--r--net/net.c24
-rw-r--r--net/nfs.c4
-rw-r--r--net/ping.c2
-rw-r--r--net/rarp.c8
-rw-r--r--net/sntp.c4
-rw-r--r--net/tftp.c6
12 files changed, 63 insertions, 64 deletions
diff --git a/net/arp.c b/net/arp.c
index 4971a53612..c613609b2d 100644
--- a/net/arp.c
+++ b/net/arp.c
@@ -60,7 +60,7 @@ void arp_raw_request(struct in_addr source_ip, const uchar *targetEther,
pkt = NetArpTxPacket;
- eth_hdr_size = NetSetEther(pkt, NetBcastAddr, PROT_ARP);
+ eth_hdr_size = NetSetEther(pkt, net_bcast_ethaddr, PROT_ARP);
pkt += eth_hdr_size;
arp = (struct arp_hdr *) pkt;
@@ -71,7 +71,7 @@ void arp_raw_request(struct in_addr source_ip, const uchar *targetEther,
arp->ar_pln = ARP_PLEN;
arp->ar_op = htons(ARPOP_REQUEST);
- memcpy(&arp->ar_sha, NetOurEther, ARP_HLEN); /* source ET addr */
+ memcpy(&arp->ar_sha, net_ethaddr, ARP_HLEN); /* source ET addr */
net_write_ip(&arp->ar_spa, source_ip); /* source IP addr */
memcpy(&arp->ar_tha, targetEther, ARP_HLEN); /* target ET addr */
net_write_ip(&arp->ar_tpa, target_ip); /* target IP addr */
@@ -93,7 +93,7 @@ void ArpRequest(void)
net_arp_wait_reply_ip = net_arp_wait_packet_ip;
}
- arp_raw_request(net_ip, NetEtherNullAddr, net_arp_wait_reply_ip);
+ arp_raw_request(net_ip, net_null_ethaddr, net_arp_wait_reply_ip);
}
void ArpTimeoutCheck(void)
@@ -168,7 +168,7 @@ void ArpReceive(struct ethernet_hdr *et, struct ip_udp_hdr *ip, int len)
arp->ar_op = htons(ARPOP_REPLY);
memcpy(&arp->ar_tha, &arp->ar_sha, ARP_HLEN);
net_copy_ip(&arp->ar_tpa, &arp->ar_spa);
- memcpy(&arp->ar_sha, NetOurEther, ARP_HLEN);
+ memcpy(&arp->ar_sha, net_ethaddr, ARP_HLEN);
net_copy_ip(&arp->ar_spa, &net_ip);
#ifdef CONFIG_CMD_LINK_LOCAL
diff --git a/net/bootp.c b/net/bootp.c
index 9251e91bf6..9b27d4cb53 100644
--- a/net/bootp.c
+++ b/net/bootp.c
@@ -147,7 +147,8 @@ static void BootpCopyNetParams(struct Bootp_t *bp)
net_copy_ip(&tmp_ip, &bp->bp_siaddr);
if (tmp_ip.s_addr != 0)
net_copy_ip(&net_server_ip, &bp->bp_siaddr);
- memcpy(NetServerEther, ((struct ethernet_hdr *)NetRxPacket)->et_src, 6);
+ memcpy(net_server_ethaddr, ((struct ethernet_hdr *)NetRxPacket)->et_src,
+ 6);
if (strlen(bp->bp_file) > 0)
copy_filename(net_boot_file_name, bp->bp_file,
sizeof(net_boot_file_name));
@@ -693,7 +694,7 @@ BootpRequest(void)
pkt = NetTxPacket;
memset((void *)pkt, 0, PKTSIZE);
- eth_hdr_size = NetSetEther(pkt, NetBcastAddr, PROT_IP);
+ eth_hdr_size = NetSetEther(pkt, net_bcast_ethaddr, PROT_IP);
pkt += eth_hdr_size;
/*
@@ -719,7 +720,7 @@ BootpRequest(void)
net_write_ip(&bp->bp_yiaddr, zero_ip);
net_write_ip(&bp->bp_siaddr, zero_ip);
net_write_ip(&bp->bp_giaddr, zero_ip);
- memcpy(bp->bp_chaddr, NetOurEther, 6);
+ memcpy(bp->bp_chaddr, net_ethaddr, 6);
copy_filename(bp->bp_file, net_boot_file_name, sizeof(bp->bp_file));
/* Request additional information from the BOOTP/DHCP server */
@@ -734,10 +735,10 @@ BootpRequest(void)
* Bootp ID is the lower 4 bytes of our ethernet address
* plus the current time in ms.
*/
- BootpID = ((ulong)NetOurEther[2] << 24)
- | ((ulong)NetOurEther[3] << 16)
- | ((ulong)NetOurEther[4] << 8)
- | (ulong)NetOurEther[5];
+ BootpID = ((ulong)net_ethaddr[2] << 24)
+ | ((ulong)net_ethaddr[3] << 16)
+ | ((ulong)net_ethaddr[4] << 8)
+ | (ulong)net_ethaddr[5];
BootpID += get_timer(0);
BootpID = htonl(BootpID);
bootp_add_id(BootpID);
@@ -896,7 +897,7 @@ static void DhcpSendRequestPkt(struct Bootp_t *bp_offer)
pkt = NetTxPacket;
memset((void *)pkt, 0, PKTSIZE);
- eth_hdr_size = NetSetEther(pkt, NetBcastAddr, PROT_IP);
+ eth_hdr_size = NetSetEther(pkt, net_bcast_ethaddr, PROT_IP);
pkt += eth_hdr_size;
iphdr = pkt; /* We'll need this later to set proper pkt size */
@@ -918,7 +919,7 @@ static void DhcpSendRequestPkt(struct Bootp_t *bp_offer)
zero_ip.s_addr = 0;
net_write_ip(&bp->bp_giaddr, zero_ip);
- memcpy(bp->bp_chaddr, NetOurEther, 6);
+ memcpy(bp->bp_chaddr, net_ethaddr, 6);
/*
* ID is the id of the OFFER packet
diff --git a/net/cdp.c b/net/cdp.c
index 2d8fa03a7e..e8e7a67010 100644
--- a/net/cdp.c
+++ b/net/cdp.c
@@ -18,7 +18,7 @@
#include "cdp.h"
/* Ethernet bcast address */
-const uchar NetCDPAddr[6] = { 0x01, 0x00, 0x0c, 0xcc, 0xcc, 0xcc };
+const u8 net_cdp_ethaddr[6] = { 0x01, 0x00, 0x0c, 0xcc, 0xcc, 0xcc };
#define CDP_DEVICE_ID_TLV 0x0001
#define CDP_ADDRESS_TLV 0x0002
@@ -124,8 +124,8 @@ CDPSendTrigger(void)
/* NOTE: trigger sent not on any VLAN */
/* form ethernet header */
- memcpy(et->et_dest, NetCDPAddr, 6);
- memcpy(et->et_src, NetOurEther, 6);
+ memcpy(et->et_dest, net_cdp_ethaddr, 6);
+ memcpy(et->et_src, net_ethaddr, 6);
pkt += ETHER_HDR_SIZE;
@@ -145,7 +145,7 @@ CDPSendTrigger(void)
#ifdef CONFIG_CDP_DEVICE_ID
*s++ = htons(CDP_DEVICE_ID_TLV);
*s++ = htons(CONFIG_CDP_DEVICE_ID);
- sprintf(buf, CONFIG_CDP_DEVICE_ID_PREFIX "%pm", NetOurEther);
+ sprintf(buf, CONFIG_CDP_DEVICE_ID_PREFIX "%pm", net_ethaddr);
memcpy((uchar *)s, buf, 16);
s += 16 / 2;
#endif
diff --git a/net/dns.c b/net/dns.c
index 6f8b1f2596..0ff2b75ecc 100644
--- a/net/dns.c
+++ b/net/dns.c
@@ -89,7 +89,7 @@ DnsSend(void)
DnsOurPort = random_port();
- NetSendUDPPacket(NetServerEther, net_dns_server, DNS_SERVICE_PORT,
+ NetSendUDPPacket(net_server_ethaddr, net_dns_server, DNS_SERVICE_PORT,
DnsOurPort, n);
debug("DNS packet sent\n");
}
@@ -203,7 +203,7 @@ DnsStart(void)
net_set_udp_handler(dns_handler);
/* Clear a previous MAC address, the server IP might have changed. */
- memset(NetServerEther, 0, sizeof(NetServerEther));
+ memset(net_server_ethaddr, 0, sizeof(net_server_ethaddr));
DnsSend();
}
diff --git a/net/eth.c b/net/eth.c
index f06fdb2743..3f5cb7ec99 100644
--- a/net/eth.c
+++ b/net/eth.c
@@ -32,7 +32,7 @@ void eth_parse_enetaddr(const char *addr, uchar *enetaddr)
int eth_getenv_enetaddr(char *name, uchar *enetaddr)
{
eth_parse_enetaddr(getenv(name), enetaddr);
- return is_valid_ether_addr(enetaddr);
+ return is_valid_ethaddr(enetaddr);
}
int eth_setenv_enetaddr(char *name, const uchar *enetaddr)
@@ -369,7 +369,7 @@ static int eth_write_hwaddr(struct udevice *dev)
/* seq is valid since the device is active */
if (eth_get_ops(dev)->write_hwaddr && !eth_mac_skip(dev->seq)) {
- if (!is_valid_ether_addr(pdata->enetaddr)) {
+ if (!is_valid_ethaddr(pdata->enetaddr)) {
printf("\nError: %s address %pM illegal value\n",
dev->name, pdata->enetaddr);
return -EINVAL;
@@ -470,8 +470,8 @@ static int eth_post_probe(struct udevice *dev)
eth_get_ops(dev)->read_rom_hwaddr(dev);
eth_getenv_enetaddr_by_index("eth", dev->seq, env_enetaddr);
- if (!is_zero_ether_addr(env_enetaddr)) {
- if (!is_zero_ether_addr(pdata->enetaddr) &&
+ if (!is_zero_ethaddr(env_enetaddr)) {
+ if (!is_zero_ethaddr(pdata->enetaddr) &&
memcmp(pdata->enetaddr, env_enetaddr, 6)) {
printf("\nWarning: %s MAC addresses don't match:\n",
dev->name);
@@ -483,11 +483,11 @@ static int eth_post_probe(struct udevice *dev)
/* Override the ROM MAC address */
memcpy(pdata->enetaddr, env_enetaddr, 6);
- } else if (is_valid_ether_addr(pdata->enetaddr)) {
+ } else if (is_valid_ethaddr(pdata->enetaddr)) {
eth_setenv_enetaddr_by_index("eth", dev->seq, pdata->enetaddr);
printf("\nWarning: %s using MAC address from ROM\n",
dev->name);
- } else if (is_zero_ether_addr(pdata->enetaddr)) {
+ } else if (is_zero_ethaddr(pdata->enetaddr)) {
printf("\nError: %s address not set.\n",
dev->name);
return -EINVAL;
@@ -608,8 +608,8 @@ int eth_write_hwaddr(struct eth_device *dev, const char *base_name,
eth_getenv_enetaddr_by_index(base_name, eth_number, env_enetaddr);
- if (!is_zero_ether_addr(env_enetaddr)) {
- if (!is_zero_ether_addr(dev->enetaddr) &&
+ if (!is_zero_ethaddr(env_enetaddr)) {
+ if (!is_zero_ethaddr(dev->enetaddr) &&
memcmp(dev->enetaddr, env_enetaddr, 6)) {
printf("\nWarning: %s MAC addresses don't match:\n",
dev->name);
@@ -620,19 +620,19 @@ int eth_write_hwaddr(struct eth_device *dev, const char *base_name,
}
memcpy(dev->enetaddr, env_enetaddr, 6);
- } else if (is_valid_ether_addr(dev->enetaddr)) {
+ } else if (is_valid_ethaddr(dev->enetaddr)) {
eth_setenv_enetaddr_by_index(base_name, eth_number,
dev->enetaddr);
printf("\nWarning: %s using MAC address from net device\n",
dev->name);
- } else if (is_zero_ether_addr(dev->enetaddr)) {
+ } else if (is_zero_ethaddr(dev->enetaddr)) {
printf("\nError: %s address not set.\n",
dev->name);
return -EINVAL;
}
if (dev->write_hwaddr && !eth_mac_skip(eth_number)) {
- if (!is_valid_ether_addr(dev->enetaddr)) {
+ if (!is_valid_ethaddr(dev->enetaddr)) {
printf("\nError: %s address %pM illegal value\n",
dev->name, dev->enetaddr);
return -EINVAL;
diff --git a/net/link_local.c b/net/link_local.c
index 6d92c555fb..2bca7de12a 100644
--- a/net/link_local.c
+++ b/net/link_local.c
@@ -139,7 +139,7 @@ static void link_local_timeout(void)
nprobes++;
debug_cond(DEBUG_LL_STATE, "probe/%u %s@%pI4\n",
nprobes, eth_get_name(), &ip);
- arp_raw_request(zero_ip, NetEtherNullAddr, ip);
+ arp_raw_request(zero_ip, net_null_ethaddr, ip);
timeout_ms = PROBE_MIN * 1000;
timeout_ms += random_delay_ms(PROBE_MAX - PROBE_MIN);
} else {
@@ -148,7 +148,7 @@ static void link_local_timeout(void)
nclaims = 0;
debug_cond(DEBUG_LL_STATE, "announce/%u %s@%pI4\n",
nclaims, eth_get_name(), &ip);
- arp_raw_request(ip, NetOurEther, ip);
+ arp_raw_request(ip, net_ethaddr, ip);
timeout_ms = ANNOUNCE_INTERVAL * 1000;
}
break;
@@ -160,7 +160,7 @@ static void link_local_timeout(void)
nclaims = 0;
debug_cond(DEBUG_LL_STATE, "announce/%u %s@%pI4\n",
nclaims, eth_get_name(), &ip);
- arp_raw_request(ip, NetOurEther, ip);
+ arp_raw_request(ip, net_ethaddr, ip);
timeout_ms = ANNOUNCE_INTERVAL * 1000;
break;
case ANNOUNCE:
@@ -171,7 +171,7 @@ static void link_local_timeout(void)
nclaims++;
debug_cond(DEBUG_LL_STATE, "announce/%u %s@%pI4\n",
nclaims, eth_get_name(), &ip);
- arp_raw_request(ip, NetOurEther, ip);
+ arp_raw_request(ip, net_ethaddr, ip);
timeout_ms = ANNOUNCE_INTERVAL * 1000;
} else {
/* Switch to monitor state */
@@ -268,11 +268,9 @@ void link_local_receive_arp(struct arp_hdr *arp, int len)
source_ip_conflict = 0;
target_ip_conflict = 0;
- if (memcmp(&arp->ar_spa, &ip, ARP_PLEN) == 0
- && memcmp(&arp->ar_sha, NetOurEther, ARP_HLEN) != 0
- ) {
+ if (memcmp(&arp->ar_spa, &ip, ARP_PLEN) == 0 &&
+ memcmp(&arp->ar_sha, net_ethaddr, ARP_HLEN) != 0)
source_ip_conflict = 1;
- }
/*
* According to RFC 3927, section 2.2.1:
@@ -284,7 +282,7 @@ void link_local_receive_arp(struct arp_hdr *arp, int len)
if (arp->ar_op == htons(ARPOP_REQUEST) &&
memcmp(&arp->ar_spa, &null_ip, ARP_PLEN) == 0 &&
memcmp(&arp->ar_tpa, &ip, ARP_PLEN) == 0 &&
- memcmp(&arp->ar_sha, NetOurEther, ARP_HLEN) != 0) {
+ memcmp(&arp->ar_sha, net_ethaddr, ARP_HLEN) != 0) {
target_ip_conflict = 1;
}
@@ -318,7 +316,7 @@ void link_local_receive_arp(struct arp_hdr *arp, int len)
debug("monitor conflict -- defending\n");
state = DEFEND;
timeout_ms = DEFEND_INTERVAL * 1000;
- arp_raw_request(ip, NetOurEther, ip);
+ arp_raw_request(ip, net_ethaddr, ip);
}
break;
case DEFEND:
diff --git a/net/net.c b/net/net.c
index bfa326e565..6db2b9c08e 100644
--- a/net/net.c
+++ b/net/net.c
@@ -129,9 +129,9 @@ struct in_addr net_mcast_addr;
/** END OF BOOTP EXTENTIONS **/
/* Our ethernet address */
-uchar NetOurEther[6];
+u8 net_ethaddr[6];
/* Boot server enet address */
-uchar NetServerEther[6];
+u8 net_server_ethaddr[6];
/* Our IP addr (0 = unknown) */
struct in_addr net_ip;
/* Server IP addr (0 = unknown) */
@@ -143,8 +143,8 @@ int NetRxPacketLen;
/* IP packet ID */
unsigned NetIPID;
/* Ethernet bcast address */
-uchar NetBcastAddr[6] = { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff };
-uchar NetEtherNullAddr[6];
+const u8 net_bcast_ethaddr[6] = { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff };
+const u8 net_null_ethaddr[6];
#ifdef CONFIG_API
void (*push_packet)(void *, int len) = 0;
#endif
@@ -274,7 +274,7 @@ static void NetInitLoop(void)
env_changed_id = env_id;
}
if (eth_get_dev())
- memcpy(NetOurEther, eth_get_ethaddr(), 6);
+ memcpy(net_ethaddr, eth_get_ethaddr(), 6);
return;
}
@@ -728,7 +728,7 @@ int NetSendUDPPacket(uchar *ether, struct in_addr dest, int dport, int sport,
/* if broadcast, make the ether address a broadcast and don't do ARP */
if (dest.s_addr == 0xFFFFFFFF)
- ether = NetBcastAddr;
+ ether = (uchar *)net_bcast_ethaddr;
pkt = (uchar *)NetTxPacket;
@@ -738,7 +738,7 @@ int NetSendUDPPacket(uchar *ether, struct in_addr dest, int dport, int sport,
pkt_hdr_size = eth_hdr_size + IP_UDP_HDR_SIZE;
/* if MAC address was not discovered yet, do an ARP request */
- if (memcmp(ether, NetEtherNullAddr, 6) == 0) {
+ if (memcmp(ether, net_null_ethaddr, 6) == 0) {
debug_cond(DEBUG_DEV_PKT, "sending ARP for %pI4\n", &dest);
/* save the ip and eth addr for the packet to send after arp */
@@ -1279,7 +1279,7 @@ common:
case CDP:
case DHCP:
case LINKLOCAL:
- if (memcmp(NetOurEther, "\0\0\0\0\0\0", 6) == 0) {
+ if (memcmp(net_ethaddr, "\0\0\0\0\0\0", 6) == 0) {
int num = eth_get_dev_index();
switch (num) {
@@ -1320,7 +1320,7 @@ NetEthHdrSize(void)
}
int
-NetSetEther(uchar *xet, uchar * addr, uint prot)
+NetSetEther(uchar *xet, const uchar *dest_ethaddr, uint prot)
{
struct ethernet_hdr *et = (struct ethernet_hdr *)xet;
ushort myvlanid;
@@ -1329,8 +1329,8 @@ NetSetEther(uchar *xet, uchar * addr, uint prot)
if (myvlanid == (ushort)-1)
myvlanid = VLAN_NONE;
- memcpy(et->et_dest, addr, 6);
- memcpy(et->et_src, NetOurEther, 6);
+ memcpy(et->et_dest, dest_ethaddr, 6);
+ memcpy(et->et_src, net_ethaddr, 6);
if ((myvlanid & VLAN_IDMASK) == VLAN_NONE) {
et->et_protlen = htons(prot);
return ETHER_HDR_SIZE;
@@ -1350,7 +1350,7 @@ int net_update_ether(struct ethernet_hdr *et, uchar *addr, uint prot)
ushort protlen;
memcpy(et->et_dest, addr, 6);
- memcpy(et->et_src, NetOurEther, 6);
+ memcpy(et->et_src, net_ethaddr, 6);
protlen = ntohs(et->et_protlen);
if (protlen == PROT_VLAN) {
struct vlan_ethernet_hdr *vet =
diff --git a/net/nfs.c b/net/nfs.c
index 1e5c1c350a..23a9cc340e 100644
--- a/net/nfs.c
+++ b/net/nfs.c
@@ -211,7 +211,7 @@ rpc_req(int rpc_prog, int rpc_proc, uint32_t *data, int datalen)
else
sport = NfsSrvNfsPort;
- NetSendUDPPacket(NetServerEther, nfs_server_ip, sport, NfsOurPort,
+ NetSendUDPPacket(net_server_ethaddr, nfs_server_ip, sport, NfsOurPort,
pktlen);
}
@@ -788,7 +788,7 @@ NfsStart(void)
NfsOurPort = 1000;
/* zero out server ether in case the server ip has changed */
- memset(NetServerEther, 0, 6);
+ memset(net_server_ethaddr, 0, 6);
NfsSend();
}
diff --git a/net/ping.c b/net/ping.c
index 4918a1cb36..e4e3086e19 100644
--- a/net/ping.c
+++ b/net/ping.c
@@ -50,7 +50,7 @@ static int ping_send(void)
net_arp_wait_packet_ip = net_ping_ip;
- eth_hdr_size = NetSetEther(NetTxPacket, NetEtherNullAddr, PROT_IP);
+ eth_hdr_size = NetSetEther(NetTxPacket, net_null_ethaddr, PROT_IP);
pkt = (uchar *)NetTxPacket + eth_hdr_size;
set_icmp_header(pkt, net_ping_ip);
diff --git a/net/rarp.c b/net/rarp.c
index 3e1c74cdcc..2f5c104d11 100644
--- a/net/rarp.c
+++ b/net/rarp.c
@@ -46,7 +46,7 @@ void rarp_receive(struct ip_udp_hdr *ip, unsigned len)
net_copy_ip(&net_ip, &arp->ar_data[16]);
if (net_server_ip.s_addr == 0)
net_copy_ip(&net_server_ip, &arp->ar_data[6]);
- memcpy(NetServerEther, &arp->ar_data[0], 6);
+ memcpy(net_server_ethaddr, &arp->ar_data[0], 6);
debug_cond(DEBUG_DEV_PKT, "Got good RARP\n");
net_auto_load();
}
@@ -77,7 +77,7 @@ void RarpRequest(void)
printf("RARP broadcast %d\n", ++RarpTry);
pkt = NetTxPacket;
- eth_hdr_size = NetSetEther(pkt, NetBcastAddr, PROT_RARP);
+ eth_hdr_size = NetSetEther(pkt, net_bcast_ethaddr, PROT_RARP);
pkt += eth_hdr_size;
rarp = (struct arp_hdr *)pkt;
@@ -87,10 +87,10 @@ void RarpRequest(void)
rarp->ar_hln = 6;
rarp->ar_pln = 4;
rarp->ar_op = htons(RARPOP_REQUEST);
- memcpy(&rarp->ar_data[0], NetOurEther, 6); /* source ET addr */
+ memcpy(&rarp->ar_data[0], net_ethaddr, 6); /* source ET addr */
memcpy(&rarp->ar_data[6], &net_ip, 4); /* source IP addr */
/* dest ET addr = source ET addr ??*/
- memcpy(&rarp->ar_data[10], NetOurEther, 6);
+ memcpy(&rarp->ar_data[10], net_ethaddr, 6);
/* dest IP addr set to broadcast */
memset(&rarp->ar_data[16], 0xff, 4);
diff --git a/net/sntp.c b/net/sntp.c
index 3e45a8342a..b99aa3ed67 100644
--- a/net/sntp.c
+++ b/net/sntp.c
@@ -37,7 +37,7 @@ SntpSend(void)
SntpOurPort = 10000 + (get_timer(0) % 4096);
sport = NTP_SERVICE_PORT;
- NetSendUDPPacket(NetServerEther, net_ntp_server, sport, SntpOurPort,
+ NetSendUDPPacket(net_server_ethaddr, net_ntp_server, sport, SntpOurPort,
pktlen);
}
@@ -85,7 +85,7 @@ SntpStart(void)
NetSetTimeout(SNTP_TIMEOUT, SntpTimeout);
net_set_udp_handler(sntp_handler);
- memset(NetServerEther, 0, sizeof(NetServerEther));
+ memset(net_server_ethaddr, 0, sizeof(net_server_ethaddr));
SntpSend();
}
diff --git a/net/tftp.c b/net/tftp.c
index bafc35458e..8ddc7be365 100644
--- a/net/tftp.c
+++ b/net/tftp.c
@@ -435,7 +435,7 @@ TftpSend(void)
break;
}
- NetSendUDPPacket(NetServerEther, tftp_remote_ip, TftpRemotePort,
+ NetSendUDPPacket(net_server_ethaddr, tftp_remote_ip, TftpRemotePort,
TftpOurPort, len);
}
@@ -816,7 +816,7 @@ void TftpStart(enum proto_t protocol)
TftpBlock = 0;
/* zero out server ether in case the server ip has changed */
- memset(NetServerEther, 0, 6);
+ memset(net_server_ethaddr, 0, 6);
/* Revert TftpBlkSize to dflt */
TftpBlkSize = TFTP_BLOCK_SIZE;
#ifdef CONFIG_MCAST_TFTP
@@ -861,7 +861,7 @@ TftpStartServer(void)
net_set_udp_handler(tftp_handler);
/* zero out server ether in case the server ip has changed */
- memset(NetServerEther, 0, 6);
+ memset(net_server_ethaddr, 0, 6);
}
#endif /* CONFIG_CMD_TFTPSRV */