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

Collapse All | Expand All

(-)libexec/bootpd/bootpd.8 (+2 lines)
Lines 103-108 Link Here
103
.Sh OPTIONS
103
.Sh OPTIONS
104
The following options are available:
104
The following options are available:
105
.Bl -tag -width indent
105
.Bl -tag -width indent
106
.It Fl a
107
Skip ARP table modifications.
106
.It Fl t Ar timeout
108
.It Fl t Ar timeout
107
Specify the
109
Specify the
108
.Ar timeout
110
.Ar timeout
(-)libexec/bootpd/bootpd.c (-5 / +12 lines)
Lines 143-148 Link Here
143
	15 * 60L,					/* tv_sec */
143
	15 * 60L,					/* tv_sec */
144
	0							/* tv_usec */
144
	0							/* tv_usec */
145
};
145
};
146
int noarp = FALSE;				/* skip modifications of ARP table */
146
147
147
/*
148
/*
148
 * General
149
 * General
Lines 266-271 Link Here
266
			break;
267
			break;
267
		switch (argv[0][1]) {
268
		switch (argv[0][1]) {
268
269
270
		case 'a':				/* don't modify the ARP table */
271
			noarp = TRUE;
272
			break;
269
		case 'c':				/* chdir_path */
273
		case 'c':				/* chdir_path */
270
			if (argv[0][2]) {
274
			if (argv[0][2]) {
271
				stmp = &(argv[0][2]);
275
				stmp = &(argv[0][2]);
Lines 583-590 Link Here
583
usage()
587
usage()
584
{
588
{
585
	fprintf(stderr,
589
	fprintf(stderr,
586
			"usage:  bootpd [-i | -s] [-c chdir-path] [-d level] [-h hostname] [-t timeout]\n");
590
			"usage:  bootpd [-a] [-i | -s] [-c chdir-path] [-d level] [-h hostname] [-t timeout]\n");
587
	fprintf(stderr, "               [bootptab [dumpfile]]\n");
591
	fprintf(stderr, "               [bootptab [dumpfile]]\n");
592
	fprintf(stderr, "\t -a\tdon't modify ARP table\n");
588
	fprintf(stderr, "\t -c n\tset current directory\n");
593
	fprintf(stderr, "\t -c n\tset current directory\n");
589
	fprintf(stderr, "\t -d n\tset debug level\n");
594
	fprintf(stderr, "\t -d n\tset debug level\n");
590
	fprintf(stderr, "\t -h n\tset the hostname to listen on\n");
595
	fprintf(stderr, "\t -h n\tset the hostname to listen on\n");
Lines 1063-1072 Link Here
1063
		if (haf == 0)
1068
		if (haf == 0)
1064
			haf = HTYPE_ETHERNET;
1069
			haf = HTYPE_ETHERNET;
1065
1070
1066
		if (debug > 1)
1071
		if ( noarp == FALSE ) {
1067
			report(LOG_INFO, "setarp %s - %s",
1072
			if (debug > 1)
1068
				   inet_ntoa(dst), haddrtoa(ha, len));
1073
				report(LOG_INFO, "setarp %s - %s",
1069
		setarp(s, &dst, haf, ha, len);
1074
					   inet_ntoa(dst), haddrtoa(ha, len));
1075
			setarp(s, &dst, haf, ha, len);
1076
		}
1070
	}
1077
	}
1071
1078
1072
	if ((forward == 0) &&
1079
	if ((forward == 0) &&
(-)libexec/bootpd/bootpgw/bootpgw.c (-13 / +20 lines)
Lines 124-129 Link Here
124
u_char maxhops = 4;				/* Number of hops allowed for requests. */
124
u_char maxhops = 4;				/* Number of hops allowed for requests. */
125
u_int minwait = 3;				/* Number of seconds client must wait before
125
u_int minwait = 3;				/* Number of seconds client must wait before
126
						   its bootrequest packets are forwarded. */
126
						   its bootrequest packets are forwarded. */
127
int noarp = FALSE;				/* skip modifications of ARP table */
127
128
128
/*
129
/*
129
 * General
130
 * General
Lines 238-243 Link Here
238
			break;
239
			break;
239
		switch (argv[0][1]) {
240
		switch (argv[0][1]) {
240
241
242
		case 'a':				/* don't modify the ARP table */
243
			noarp = TRUE;
244
			break;
241
		case 'd':				/* debug level */
245
		case 'd':				/* debug level */
242
			if (argv[0][2]) {
246
			if (argv[0][2]) {
243
				stmp = &(argv[0][2]);
247
				stmp = &(argv[0][2]);
Lines 496-502 Link Here
496
usage()
500
usage()
497
{
501
{
498
	fprintf(stderr,
502
	fprintf(stderr,
499
			"usage:  bootpgw [-d level] [-i] [-s] [-t timeout] server\n");
503
			"usage:  \nbootpgw [-a] [-d level] [-h count] [-i] [-s] [-t timeout] [-w time] server\n");
504
	fprintf(stderr, "\t -a\tdon't modify ARP table\n");
500
	fprintf(stderr, "\t -d n\tset debug level\n");
505
	fprintf(stderr, "\t -d n\tset debug level\n");
501
	fprintf(stderr, "\t -h n\tset max hop count\n");
506
	fprintf(stderr, "\t -h n\tset max hop count\n");
502
	fprintf(stderr, "\t -i\tforce inetd mode (run as child of inetd)\n");
507
	fprintf(stderr, "\t -i\tforce inetd mode (run as child of inetd)\n");
Lines 641-659 Link Here
641
	send_addr.sin_addr = bp->bp_yiaddr;
646
	send_addr.sin_addr = bp->bp_yiaddr;
642
	send_addr.sin_port = htons(bootpc_port);
647
	send_addr.sin_port = htons(bootpc_port);
643
648
644
	/* Create an ARP cache entry for the client. */
649
	if ( noarp == FALSE ) {
645
	ha = bp->bp_chaddr;
650
		/* Create an ARP cache entry for the client. */
646
	len = bp->bp_hlen;
651
		ha = bp->bp_chaddr;
647
	if (len > MAXHADDRLEN)
652
		len = bp->bp_hlen;
648
		len = MAXHADDRLEN;
653
		if (len > MAXHADDRLEN)
649
	haf = (int) bp->bp_htype;
654
			len = MAXHADDRLEN;
650
	if (haf == 0)
655
		haf = (int) bp->bp_htype;
651
		haf = HTYPE_ETHERNET;
656
		if (haf == 0)
657
			haf = HTYPE_ETHERNET;
652
658
653
	if (debug > 1)
659
		if (debug > 1)
654
		report(LOG_INFO, "setarp %s - %s",
660
			report(LOG_INFO, "setarp %s - %s",
655
			   inet_ntoa(bp->bp_yiaddr), haddrtoa(ha, len));
661
				   inet_ntoa(dst), haddrtoa(ha, len));
656
	setarp(s, &bp->bp_yiaddr, haf, ha, len);
662
		setarp(s, &dst, haf, ha, len);
663
	}
657
664
658
	/* Send reply with same size packet as request used. */
665
	/* Send reply with same size packet as request used. */
659
	if (sendto(s, pktbuf, pktlen, 0,
666
	if (sendto(s, pktbuf, pktlen, 0,

Return to bug 30854