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

Collapse All | Expand All

(-)bootp.c (-4 / +26 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 88-93 Link Here
88
#ifdef SUPPORT_DHCP
89
#ifdef SUPPORT_DHCP
89
static char expected_dhcpmsgtype = -1, dhcp_ok;
90
static char expected_dhcpmsgtype = -1, dhcp_ok;
90
struct in_addr dhcp_serverip;
91
struct in_addr dhcp_serverip;
92
static void vend_ident(u_char *);
91
#endif
93
#endif
92
94
93
/* Fetch required bootp infomation */
95
/* Fetch required bootp infomation */
Lines 106-112 Link Here
106
		u_char header[HEADER_SIZE];
108
		u_char header[HEADER_SIZE];
107
		struct bootp rbootp;
109
		struct bootp rbootp;
108
	} rbuf;
110
	} rbuf;
109
111
#ifdef SUPPORT_DHCP
112
	char *vendor_ident;
113
#endif
110
#ifdef BOOTP_DEBUG
114
#ifdef BOOTP_DEBUG
111
 	if (debug)
115
 	if (debug)
112
		printf("bootp: socket=%d\n", sock);
116
		printf("bootp: socket=%d\n", sock);
Lines 188-196 Link Here
188
		bcopy(&leasetime, &bp->bp_vend[21], 4);
192
		bcopy(&leasetime, &bp->bp_vend[21], 4);
189
		if (flag & BOOTP_PXE) {
193
		if (flag & BOOTP_PXE) {
190
			bp->bp_vend[25] = TAG_CLASSID;
194
			bp->bp_vend[25] = TAG_CLASSID;
191
			bp->bp_vend[26] = 9;
195
			vendor_ident=malloc(1024);
192
			bcopy("PXEClient", &bp->bp_vend[27], 9);
196
			vend_ident(vendor_ident);
193
			bp->bp_vend[36] = TAG_END;
197
			bp->bp_vend[8] = strlen(vendor_ident);
198
			bcopy(vendor_ident, &bp->bp_vend[27], bp->bp_vend[26]);
199
			free(vendor_ident);
200
			bp->bp_vend[(27 + bp->bp_vend[26])] = TAG_END;
194
		} else
201
		} else
195
			bp->bp_vend[25] = TAG_END;
202
			bp->bp_vend[25] = TAG_END;
196
203
Lines 405-410 Link Here
405
	}
412
	}
406
	return(0);
413
	return(0);
407
}
414
}
415
#ifdef SUPPORT_DHCP
416
static void
417
vend_ident(cp)
418
	u_char *cp;
419
{
420
	char default_vendor_ident[] = "PXEClient:FBSD";
421
#ifdef __i386__
422
	sprintf(cp,"%s:i386:%d",default_vendor_ident,__FreeBSD_version);
423
#elif __amd64__
424
	sprintf(cp,"%s:amd64:%d",default_vendor_ident,__FreeBSD_version);
425
#else
426
	sprintf(cp,"%s:%d",default_vendor_ident,__FreeBSD_version);
427
#endif
428
}
429
#endif
408
430
409
#ifdef BOOTP_VEND_CMU
431
#ifdef BOOTP_VEND_CMU
410
static void
432
static void

Return to bug 137678