]> git.ipfire.org Git - thirdparty/dhcp.git/commitdiff
- Add dummies for agent information option handling.
authorTed Lemon <source@isc.org>
Sat, 13 Nov 1999 23:49:41 +0000 (23:49 +0000)
committerTed Lemon <source@isc.org>
Sat, 13 Nov 1999 23:49:41 +0000 (23:49 +0000)
- Don't spin if /tmp missing or some other unexpected error happens when
  invoking client script.

client/dhclient.c

index ebc0d279d558e6d4277dc7bffa3d21d28b6e2a88..94a21480b831e44e677f87c90fa75f9d95c78d3b 100644 (file)
@@ -22,7 +22,7 @@
 
 #ifndef lint
 static char ocopyright[] =
-"$Id: dhclient.c,v 1.88 1999/10/30 14:07:29 mellon Exp $ Copyright (c) 1995, 1996, 1997, 1998, 1999 The Internet Software Consortium.  All rights reserved.\n";
+"$Id: dhclient.c,v 1.89 1999/11/13 23:49:41 mellon Exp $ Copyright (c) 1995, 1996, 1997, 1998, 1999 The Internet Software Consortium.  All rights reserved.\n";
 #endif /* not lint */
 
 #include "dhcpd.h"
@@ -1993,11 +1993,14 @@ void script_init (client, reason, medium)
                fd = mkstemp (scriptName);
 #else
                if (!mktemp (scriptName))
-                       log_fatal ("can't create temporary client script %s: %m",
-                              scriptName);
+                       log_fatal ("can't create temporary script %s: %m",
+                                  scriptName);
                fd = creat (scriptName, 0600);
-       } while (fd < 0);
+       } while (fd < 0 && errno == EEXISTS);
 #endif
+       if (fd < 0)
+               log_fatal ("can't create temporary script %s: %m", scriptName);
+
 
        scriptFile = fdopen (fd, "w");
        if (!scriptFile)
@@ -2275,3 +2278,27 @@ void client_location_changed ()
                }
        }
 }
+
+/* The client should never receive a relay agent information option,
+   so if it does, log it and discard it. */
+
+int parse_agent_information_option (packet, len, data)
+       struct packet *packet;
+       int len;
+       u_int8_t *data;
+{
+       log_info ("relay agent information option received.");
+       return 1;
+}
+
+/* The client never sends relay agent information options. */
+
+unsigned cons_agent_information_options (cfg_options, outpacket,
+                                        agentix, length)
+       struct option_state *cfg_options;
+       struct dhcp_packet *outpacket;
+       unsigned agentix;
+       unsigned length;
+{
+       return length;
+}