]> git.ipfire.org Git - thirdparty/dhcp.git/commitdiff
Adjust declaration of fallback_discard so that it can be a protocol handler
authorTed Lemon <source@isc.org>
Thu, 6 Mar 1997 06:55:53 +0000 (06:55 +0000)
committerTed Lemon <source@isc.org>
Thu, 6 Mar 1997 06:55:53 +0000 (06:55 +0000)
common/socket.c

index d9cee6e227e4b691d63ac45d1f5b0fb324a1b501..114630d9a562145cdb208e0e51c16569369c8241 100644 (file)
@@ -50,7 +50,7 @@
 
 #ifndef lint
 static char copyright[] =
-"$Id: socket.c,v 1.20 1997/02/26 05:20:53 mellon Exp $ Copyright (c) 1995, 1996 The Internet Software Consortium.  All rights reserved.\n";
+"$Id: socket.c,v 1.21 1997/03/06 06:55:53 mellon Exp $ Copyright (c) 1995, 1996 The Internet Software Consortium.  All rights reserved.\n";
 #endif /* not lint */
 
 #include "dhcpd.h"
@@ -216,14 +216,18 @@ size_t receive_packet (interface, buf, len, from, hfrom)
 #ifdef USE_SOCKET_FALLBACK
 /* This just reads in a packet and silently discards it. */
 
-size_t fallback_discard (interface)
-       struct interface_info *interface;
+void fallback_discard (protocol)
+       struct protocol *protocol;
 {
        char buf [1540];
        struct sockaddr_in from;
        int flen = sizeof from;
+       int status;
+       struct interface_info *interface = protocol -> local;
 
-       return recvfrom (interface -> wfdesc, buf, sizeof buf, 0,
-                        (struct sockaddr *)&from, &flen);
+       status = recvfrom (interface -> wfdesc, buf, sizeof buf, 0,
+                          (struct sockaddr *)&from, &flen);
+       if (status < 0)
+               warn ("fallback_discard: %m");
 }
 #endif /* USE_SOCKET_RECEIVE */