Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F145841039
D2581.id8699.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
3 KB
Referenced Files
None
Subscribers
None
D2581.id8699.diff
View Options
Index: libexec/bootpd/bootpd.8
===================================================================
--- libexec/bootpd/bootpd.8
+++ libexec/bootpd/bootpd.8
@@ -103,6 +103,8 @@
.Sh OPTIONS
The following options are available:
.Bl -tag -width indent
+.It Fl a
+Skip ARP table modifications.
.It Fl t Ar timeout
Specify the
.Ar timeout
Index: libexec/bootpd/bootpd.c
===================================================================
--- libexec/bootpd/bootpd.c
+++ libexec/bootpd/bootpd.c
@@ -143,6 +143,7 @@
15 * 60L, /* tv_sec */
0 /* tv_usec */
};
+int arpmod = FALSE; /* skip modifications of ARP table */
/*
* General
@@ -266,6 +267,9 @@
break;
switch (argv[0][1]) {
+ case 'a': /* don't modify the ARP table */
+ arpmod = TRUE;
+ break;
case 'c': /* chdir_path */
if (argv[0][2]) {
stmp = &(argv[0][2]);
@@ -583,8 +587,9 @@
usage()
{
fprintf(stderr,
- "usage: bootpd [-i | -s] [-c chdir-path] [-d level] [-h hostname] [-t timeout]\n");
+ "usage: bootpd [-a] [-i | -s] [-c chdir-path] [-d level] [-h hostname] [-t timeout]\n");
fprintf(stderr, " [bootptab [dumpfile]]\n");
+ fprintf(stderr, "\t -a\tdon't modify ARP table\n");
fprintf(stderr, "\t -c n\tset current directory\n");
fprintf(stderr, "\t -d n\tset debug level\n");
fprintf(stderr, "\t -h n\tset the hostname to listen on\n");
@@ -1063,10 +1068,12 @@
if (haf == 0)
haf = HTYPE_ETHERNET;
- if (debug > 1)
- report(LOG_INFO, "setarp %s - %s",
- inet_ntoa(dst), haddrtoa(ha, len));
- setarp(s, &dst, haf, ha, len);
+ if ( arpmod == FALSE ) {
+ if (debug > 1)
+ report(LOG_INFO, "setarp %s - %s",
+ inet_ntoa(dst), haddrtoa(ha, len));
+ setarp(s, &dst, haf, ha, len);
+ }
}
if ((forward == 0) &&
Index: libexec/bootpd/bootpgw/bootpgw.c
===================================================================
--- libexec/bootpd/bootpgw/bootpgw.c
+++ libexec/bootpd/bootpgw/bootpgw.c
@@ -124,6 +124,7 @@
u_char maxhops = 4; /* Number of hops allowed for requests. */
u_int minwait = 3; /* Number of seconds client must wait before
its bootrequest packets are forwarded. */
+int arpmod = FALSE; /* skip modifications of ARP table */
/*
* General
@@ -238,6 +239,9 @@
break;
switch (argv[0][1]) {
+ case 'a': /* don't modify the ARP table */
+ arpmod = TRUE;
+ break;
case 'd': /* debug level */
if (argv[0][2]) {
stmp = &(argv[0][2]);
@@ -496,7 +500,8 @@
usage()
{
fprintf(stderr,
- "usage: bootpgw [-d level] [-i] [-s] [-t timeout] server\n");
+ "usage: \nbootpgw [-a] [-d level] [-h count] [-i] [-s] [-t timeout] [-w time] server\n");
+ fprintf(stderr, "\t -a\tdon't modify ARP table\n");
fprintf(stderr, "\t -d n\tset debug level\n");
fprintf(stderr, "\t -h n\tset max hop count\n");
fprintf(stderr, "\t -i\tforce inetd mode (run as child of inetd)\n");
@@ -641,19 +646,23 @@
send_addr.sin_addr = bp->bp_yiaddr;
send_addr.sin_port = htons(bootpc_port);
- /* Create an ARP cache entry for the client. */
- ha = bp->bp_chaddr;
- len = bp->bp_hlen;
- if (len > MAXHADDRLEN)
- len = MAXHADDRLEN;
- haf = (int) bp->bp_htype;
- if (haf == 0)
- haf = HTYPE_ETHERNET;
-
- if (debug > 1)
- report(LOG_INFO, "setarp %s - %s",
- inet_ntoa(bp->bp_yiaddr), haddrtoa(ha, len));
- setarp(s, &bp->bp_yiaddr, haf, ha, len);
+ if ( arpmod == FALSE ) {
+ /* Create an ARP cache entry for the client. */
+ ha = bp->bp_chaddr;
+ len = bp->bp_hlen;
+ struct in_addr dst;
+
+ if (len > MAXHADDRLEN)
+ len = MAXHADDRLEN;
+ haf = (int) bp->bp_htype;
+ if (haf == 0)
+ haf = HTYPE_ETHERNET;
+
+ if (debug > 1)
+ report(LOG_INFO, "setarp %s - %s",
+ inet_ntoa(dst), haddrtoa(ha, len));
+ setarp(s, &dst, haf, ha, len);
+ }
/* Send reply with same size packet as request used. */
if (sendto(s, pktbuf, pktlen, 0,
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Thu, Feb 26, 3:05 AM (6 h, 47 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
28999914
Default Alt Text
D2581.id8699.diff (3 KB)
Attached To
Mode
D2581: bootpd: add support for disabling ARP cache modifications
Attached
Detach File
Event Timeline
Log In to Comment