View | Details | Raw Unified | Return to bug 137678 | Differences between
and this patch

Collapse All | Expand All

(-)bootp.c (-7 / +32 lines)
Lines 39-44 Link Here
39
__FBSDID("$FreeBSD$");
39
__FBSDID("$FreeBSD$");
40
40
41
#include <sys/types.h>
41
#include <sys/types.h>
42
#include <osreldate.h>
42
#include <netinet/in.h>
43
#include <netinet/in.h>
43
#include <netinet/in_systm.h>
44
#include <netinet/in_systm.h>
44
45
Lines 75-80 Link Here
75
#ifdef SUPPORT_DHCP
76
#ifdef SUPPORT_DHCP
76
static char expected_dhcpmsgtype = -1, dhcp_ok;
77
static char expected_dhcpmsgtype = -1, dhcp_ok;
77
struct in_addr dhcp_serverip;
78
struct in_addr dhcp_serverip;
79
static void vend_ident(u_char *);
78
#endif
80
#endif
79
81
80
/* Fetch required bootp infomation */
82
/* Fetch required bootp infomation */
Lines 93-99 Link Here
93
		u_char header[HEADER_SIZE];
95
		u_char header[HEADER_SIZE];
94
		struct bootp rbootp;
96
		struct bootp rbootp;
95
	} rbuf;
97
	} rbuf;
96
98
#ifdef SUPPORT_DHCP
99
	char *vendor_ident;
100
#endif
97
#ifdef BOOTP_DEBUG
101
#ifdef BOOTP_DEBUG
98
 	if (debug)
102
 	if (debug)
99
		printf("bootp: socket=%d\n", sock);
103
		printf("bootp: socket=%d\n", sock);
Lines 132-140 Link Here
132
	 */
136
	 */
133
	if (flag & BOOTP_PXE) {
137
	if (flag & BOOTP_PXE) {
134
		bp->bp_vend[7] = TAG_CLASSID;
138
		bp->bp_vend[7] = TAG_CLASSID;
135
		bp->bp_vend[8] = 9;
139
		vendor_ident=malloc(1024);
136
		bcopy("PXEFBSD71", &bp->bp_vend[9], 9);
140
		vend_ident(vendor_ident);
137
		bp->bp_vend[18] = TAG_END;
141
		bp->bp_vend[8] = strlen(vendor_ident);
142
		bcopy(vendor_ident, &bp->bp_vend[9], bp->bp_vend[8]);
143
		free(vendor_ident);
144
		bp->bp_vend[(9 + bp->bp_vend[8])] = TAG_END;
138
	} else
145
	} else
139
		bp->bp_vend[7] = TAG_END;
146
		bp->bp_vend[7] = TAG_END;
140
#else
147
#else
Lines 175-183 Link Here
175
		bcopy(&leasetime, &bp->bp_vend[21], 4);
182
		bcopy(&leasetime, &bp->bp_vend[21], 4);
176
		if (flag & BOOTP_PXE) {
183
		if (flag & BOOTP_PXE) {
177
			bp->bp_vend[25] = TAG_CLASSID;
184
			bp->bp_vend[25] = TAG_CLASSID;
178
			bp->bp_vend[26] = 9;
185
			vendor_ident=malloc(1024);
179
			bcopy("PXEClient", &bp->bp_vend[27], 9);
186
			vend_ident(vendor_ident);
180
			bp->bp_vend[36] = TAG_END;
187
			bp->bp_vend[8] = strlen(vendor_ident);
188
			bcopy(vendor_ident, &bp->bp_vend[27], bp->bp_vend[26]);
189
			free(vendor_ident);
190
			bp->bp_vend[(27 + bp->bp_vend[26])] = TAG_END;
181
		} else
191
		} else
182
			bp->bp_vend[25] = TAG_END;
192
			bp->bp_vend[25] = TAG_END;
183
193
Lines 390-395 Link Here
390
	}
400
	}
391
	return(0);
401
	return(0);
392
}
402
}
403
#ifdef SUPPORT_DHCP
404
static void
405
vend_ident(cp)
406
	u_char *cp;
407
{
408
	char default_vendor_ident[] = "PXEClient:FBSD";
409
#ifdef __i386__
410
	sprintf(cp,"%s:i386:%d",default_vendor_ident,__FreeBSD_version);
411
#elif __amd64__
412
	sprintf(cp,"%s:amd64:%d",default_vendor_ident,__FreeBSD_version);
413
#else
414
	sprintf(cp,"%s:%d",default_vendor_ident,__FreeBSD_version);
415
#endif
416
}
417
#endif
393
418
394
#ifdef BOOTP_VEND_CMU
419
#ifdef BOOTP_VEND_CMU
395
static void
420
static void

Return to bug 137678