- fixed Eth_pkt_recv
- DHCP sending of client id is disabled git-svn-id: http://moon:8086/svn/mips@209 a8ebac50-d88d-4704-bea3-6648445a41b3
This commit is contained in:
@@ -4,12 +4,12 @@
|
||||
// 21.12.2003, J. Ahrensfeld
|
||||
//
|
||||
// -------------------------------------------------------------------------
|
||||
#include <string.h>
|
||||
#include <libsys/libsys.h>
|
||||
#include "ethernet.h"
|
||||
#include "ipv4.h"
|
||||
#include "udp.h"
|
||||
#include "dhcp.h"
|
||||
#include "string.h"
|
||||
|
||||
const char hostname[] = "ML-402";
|
||||
|
||||
@@ -46,6 +46,7 @@ void DHCP_request_send(packet_t *pPacket, uint32_t dhcp_msg_type, uint8_t *mac_a
|
||||
pos = 0;
|
||||
|
||||
size = sizeof(magic);
|
||||
memset(&pDHCP->options[pos], 0xAA, sizeof(pDHCP->options));
|
||||
memcpy(&pDHCP->options[pos], &magic, size);
|
||||
pos += size;
|
||||
|
||||
@@ -60,6 +61,7 @@ void DHCP_request_send(packet_t *pPacket, uint32_t dhcp_msg_type, uint8_t *mac_a
|
||||
pDHCP->options[pos] = dhcp_msg_type;
|
||||
pos += size;
|
||||
|
||||
#ifdef WITH_CLIENT_ID
|
||||
// Set client ID
|
||||
size = sizeof(dhcp_opt_hdr_t);
|
||||
pOpt_hdr = (dhcp_opt_hdr_t*)&pDHCP->options[pos];
|
||||
@@ -70,7 +72,8 @@ void DHCP_request_send(packet_t *pPacket, uint32_t dhcp_msg_type, uint8_t *mac_a
|
||||
size = pOpt_hdr->len;
|
||||
memcpy(&pDHCP->options[pos], mac_addr_src, size);
|
||||
pos += size;
|
||||
|
||||
#endif
|
||||
|
||||
// Set client name
|
||||
size = sizeof(dhcp_opt_hdr_t);
|
||||
pOpt_hdr = (dhcp_opt_hdr_t*)&pDHCP->options[pos];
|
||||
@@ -107,6 +110,7 @@ void DHCP_request_send(packet_t *pPacket, uint32_t dhcp_msg_type, uint8_t *mac_a
|
||||
pDHCP->options[pos] = dhcp_msg_type;
|
||||
pos += size;
|
||||
|
||||
#ifdef WITH_CLIENT_ID
|
||||
// Set client ID
|
||||
size = sizeof(dhcp_opt_hdr_t);
|
||||
pOpt_hdr = (dhcp_opt_hdr_t*)&pDHCP->options[pos];
|
||||
@@ -117,7 +121,7 @@ void DHCP_request_send(packet_t *pPacket, uint32_t dhcp_msg_type, uint8_t *mac_a
|
||||
size = pOpt_hdr->len;
|
||||
memcpy(&pDHCP->options[pos], mac_addr_src, size);
|
||||
pos += size;
|
||||
|
||||
#endif
|
||||
// Set client name
|
||||
size = sizeof(dhcp_opt_hdr_t);
|
||||
pOpt_hdr = (dhcp_opt_hdr_t*)&pDHCP->options[pos];
|
||||
|
||||
Reference in New Issue
Block a user