===================================================================
|
|
|
|
| 132 | 132 | struct mbuf *m; |
| 133 | 133 | struct bootp_t *rbp; |
| 134 | 134 | struct sockaddr_in saddr, daddr; |
| 135 | | struct in_addr dns_addr_dhcp; |
| | 135 | struct in_addr dns_addr_dhcp, tftp_server; |
| 136 | 136 | int dhcp_msg_type, val; |
| 137 | 137 | uint8_t *q; |
| 138 | 138 | struct in_addr requested_ip; /* the requested IP in DHCPREQUEST */ |
| … |
… |
|
| 200 | 200 | } |
| 201 | 201 | } |
| 202 | 202 | |
| 203 | | if ( tftp_prefix |
| 204 | | && RTDirExists(tftp_prefix) |
| 205 | | && bootp_filename) |
| 206 | | RTStrPrintf((char*)rbp->bp_file, sizeof(rbp->bp_file), "%s", bootp_filename); |
| 207 | | |
| 208 | 203 | saddr.sin_addr.s_addr = htonl(ntohl(special_addr.s_addr) | CTL_ALIAS); |
| 209 | 204 | saddr.sin_port = htons(BOOTP_SERVER); |
| 210 | 205 | |
| … |
… |
|
| 218 | 213 | |
| 219 | 214 | rbp->bp_yiaddr = daddr.sin_addr; /* Client IP address */ |
| 220 | 215 | rbp->bp_siaddr = saddr.sin_addr; /* Server IP address */ |
| | 216 | if (tftp_prefix |
| | 217 | && bootp_filename) { |
| | 218 | if (RTDirExists(tftp_prefix)) { |
| | 219 | RTStrPrintf((char*)rbp->bp_file, sizeof(rbp->bp_file), "%s", bootp_filename); |
| | 220 | } else if (inet_aton(tftp_prefix, &tftp_server)) { |
| | 221 | RTStrPrintf((char*)rbp->bp_file, sizeof(rbp->bp_file), "%s", bootp_filename); |
| | 222 | /* Replace Server IP with external TFTP Server */ |
| | 223 | rbp->bp_siaddr = tftp_server; /* Next Server IP address*/ |
| | 224 | } |
| | 225 | } |
| 221 | 226 | |
| 222 | 227 | q = rbp->bp_vend; |
| 223 | 228 | memcpy(q, rfc1533_cookie, 4); |