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

Collapse All | Expand All

(-)libexec/bootpd/bootpd.c (-5 / +12 lines)
Lines 151-156 Link Here
151
	15 * 60L,					/* tv_sec */
151
	15 * 60L,					/* tv_sec */
152
	0							/* tv_usec */
152
	0							/* tv_usec */
153
};
153
};
154
int noarp = FALSE;				/* skip modifications of ARP table */
154
155
155
/*
156
/*
156
 * General
157
 * General
Lines 272-277 Link Here
272
			break;
273
			break;
273
		switch (argv[0][1]) {
274
		switch (argv[0][1]) {
274
275
276
		case 'a':				/* don't modify the ARP table */
277
			noarp = TRUE;
278
			break;
275
		case 'c':				/* chdir_path */
279
		case 'c':				/* chdir_path */
276
			if (argv[0][2]) {
280
			if (argv[0][2]) {
277
				stmp = &(argv[0][2]);
281
				stmp = &(argv[0][2]);
Lines 588-594 Link Here
588
usage()
592
usage()
589
{
593
{
590
	fprintf(stderr,
594
	fprintf(stderr,
591
			"usage:  bootpd [-d level] [-i] [-s] [-t timeout] [configfile [dumpfile]]\n");
595
			"usage:  \nbootpd [-a] [-c path] [-d level] [-i] [-s] [-t timeout] [configfile [dumpfile]]\n");
596
	fprintf(stderr, "\t -a\tdon't modify ARP table\n");
592
	fprintf(stderr, "\t -c n\tset current directory\n");
597
	fprintf(stderr, "\t -c n\tset current directory\n");
593
	fprintf(stderr, "\t -d n\tset debug level\n");
598
	fprintf(stderr, "\t -d n\tset debug level\n");
594
	fprintf(stderr, "\t -i\tforce inetd mode (run as child of inetd)\n");
599
	fprintf(stderr, "\t -i\tforce inetd mode (run as child of inetd)\n");
Lines 1066-1075 Link Here
1066
		if (haf == 0)
1071
		if (haf == 0)
1067
			haf = HTYPE_ETHERNET;
1072
			haf = HTYPE_ETHERNET;
1068
1073
1069
		if (debug > 1)
1074
		if ( noarp == FALSE ) {
1070
			report(LOG_INFO, "setarp %s - %s",
1075
			if (debug > 1)
1071
				   inet_ntoa(dst), haddrtoa(ha, len));
1076
				report(LOG_INFO, "setarp %s - %s",
1072
		setarp(s, &dst, haf, ha, len);
1077
					   inet_ntoa(dst), haddrtoa(ha, len));
1078
			setarp(s, &dst, haf, ha, len);
1079
		}
1073
	}
1080
	}
1074
1081
1075
	if ((forward == 0) &&
1082
	if ((forward == 0) &&
(-)libexec/bootpd/bootpgw/bootpgw.c (-13 / +20 lines)
Lines 130-135 Link Here
130
u_char maxhops = 4;				/* Number of hops allowed for requests. */
130
u_char maxhops = 4;				/* Number of hops allowed for requests. */
131
u_int minwait = 3;				/* Number of seconds client must wait before
131
u_int minwait = 3;				/* Number of seconds client must wait before
132
						   its bootrequest packets are forwarded. */
132
						   its bootrequest packets are forwarded. */
133
int noarp = FALSE;				/* skip modifications of ARP table */
133
134
134
/*
135
/*
135
 * General
136
 * General
Lines 246-251 Link Here
246
			break;
247
			break;
247
		switch (argv[0][1]) {
248
		switch (argv[0][1]) {
248
249
250
		case 'a':				/* don't modify the ARP table */
251
			noarp = TRUE;
252
			break;
249
		case 'd':				/* debug level */
253
		case 'd':				/* debug level */
250
			if (argv[0][2]) {
254
			if (argv[0][2]) {
251
				stmp = &(argv[0][2]);
255
				stmp = &(argv[0][2]);
Lines 511-517 Link Here
511
usage()
515
usage()
512
{
516
{
513
	fprintf(stderr,
517
	fprintf(stderr,
514
			"usage:  bootpgw [-d level] [-i] [-s] [-t timeout] server\n");
518
			"usage:  \nbootpgw [-a] [-d level] [-h count] [-i] [-s] [-t timeout] [-w time] server\n");
519
	fprintf(stderr, "\t -a\tdon't modify ARP table\n");
515
	fprintf(stderr, "\t -d n\tset debug level\n");
520
	fprintf(stderr, "\t -d n\tset debug level\n");
516
	fprintf(stderr, "\t -h n\tset max hop count\n");
521
	fprintf(stderr, "\t -h n\tset max hop count\n");
517
	fprintf(stderr, "\t -i\tforce inetd mode (run as child of inetd)\n");
522
	fprintf(stderr, "\t -i\tforce inetd mode (run as child of inetd)\n");
Lines 656-674 Link Here
656
	send_addr.sin_addr = bp->bp_yiaddr;
661
	send_addr.sin_addr = bp->bp_yiaddr;
657
	send_addr.sin_port = htons(bootpc_port);
662
	send_addr.sin_port = htons(bootpc_port);
658
663
659
	/* Create an ARP cache entry for the client. */
664
	if ( noarp == FALSE ) {
660
	ha = bp->bp_chaddr;
665
		/* Create an ARP cache entry for the client. */
661
	len = bp->bp_hlen;
666
		ha = bp->bp_chaddr;
662
	if (len > MAXHADDRLEN)
667
		len = bp->bp_hlen;
663
		len = MAXHADDRLEN;
668
		if (len > MAXHADDRLEN)
664
	haf = (int) bp->bp_htype;
669
			len = MAXHADDRLEN;
665
	if (haf == 0)
670
		haf = (int) bp->bp_htype;
666
		haf = HTYPE_ETHERNET;
671
		if (haf == 0)
672
			haf = HTYPE_ETHERNET;
667
673
668
	if (debug > 1)
674
		if (debug > 1)
669
		report(LOG_INFO, "setarp %s - %s",
675
			report(LOG_INFO, "setarp %s - %s",
670
			   inet_ntoa(bp->bp_yiaddr), haddrtoa(ha, len));
676
				   inet_ntoa(dst), haddrtoa(ha, len));
671
	setarp(s, &bp->bp_yiaddr, haf, ha, len);
677
		setarp(s, &dst, haf, ha, len);
678
	}
672
679
673
	/* Send reply with same size packet as request used. */
680
	/* Send reply with same size packet as request used. */
674
	if (sendto(s, pktbuf, pktlen, 0,
681
	if (sendto(s, pktbuf, pktlen, 0,

Return to bug 30854