Mercurial > flash_v2
comparison packages/redboot/current/src/net/bootp.c @ 1117:c461c509e6ef
Fix BOOTP/DHCP
| author | gthomas |
|---|---|
| date | Tue, 15 Jul 2003 18:53:49 +0000 |
| parents | e54a552c19f9 |
| children | 92e31da869cc |
comparison
equal
deleted
inserted
replaced
| 1116:f886ab6517f0 | 1117:c461c509e6ef |
|---|---|
| 68 static bootp_header_t *bp_info; | 68 static bootp_header_t *bp_info; |
| 69 | 69 |
| 70 #ifdef CYGSEM_REDBOOT_NETWORKING_USE_GATEWAY | 70 #ifdef CYGSEM_REDBOOT_NETWORKING_USE_GATEWAY |
| 71 static const unsigned char dhcpCookie[] = {99,130,83,99}; | 71 static const unsigned char dhcpCookie[] = {99,130,83,99}; |
| 72 static const unsigned char dhcpEndOption[] = {255}; | 72 static const unsigned char dhcpEndOption[] = {255}; |
| 73 static const unsigned char dhcpRequestOption[] = {53,1,3}; | 73 static const unsigned char dhcpDiscoverOption[] = {53,1,1}; |
| 74 #endif | 74 #endif |
| 75 | 75 |
| 76 static void | 76 static void |
| 77 bootp_handler(udp_socket_t *skt, char *buf, int len, | 77 bootp_handler(udp_socket_t *skt, char *buf, int len, |
| 78 ip_route_t *src_route, word src_port) | 78 ip_route_t *src_route, word src_port) |
| 167 | 167 |
| 168 #ifdef CYGSEM_REDBOOT_NETWORKING_USE_GATEWAY | 168 #ifdef CYGSEM_REDBOOT_NETWORKING_USE_GATEWAY |
| 169 p = b.bp_vend; | 169 p = b.bp_vend; |
| 170 | 170 |
| 171 AddOption(p,dhcpCookie); | 171 AddOption(p,dhcpCookie); |
| 172 AddOption(p,dhcpRequestOption); | 172 AddOption(p,dhcpDiscoverOption); |
| 173 AddOption(p,dhcpEndOption); | 173 AddOption(p,dhcpEndOption); |
| 174 | 174 |
| 175 // Some servers insist on a minimum amount of "vendor" data | 175 // Some servers insist on a minimum amount of "vendor" data |
| 176 if (p < &b.bp_vend[BP_MIN_VEND_SIZE]) p = &b.bp_vend[BP_MIN_VEND_SIZE]; | 176 if (p < &b.bp_vend[BP_MIN_VEND_SIZE]) p = &b.bp_vend[BP_MIN_VEND_SIZE]; |
| 177 txSize = p - (unsigned char*)&b; | 177 txSize = p - (unsigned char*)&b; |
