@@ -1663,6 +1663,9 @@ AC_CHECK_MEMBERS([struct swapent.se_nblks],,,[
#include <sys/stat.h>
#include <sys/swap.h>
])
+AC_CHECK_MEMBERS([struct msghdr.msg_control, struct msghdr.msg_controllen],
+ AC_DEFINE([HAVE_MSGHDR_MSG_CONTROL],1,
+ [Define if struct msghdr has msg_control and msg_controllen]))
if test "$ac_cv_have_decl_swapctl" = "yes";
then
@@ -962,8 +962,10 @@ recvfrom_wto(int sock, void *buf, unsigned int len, struct sockaddr *saddr,
hdr.msg_namelen = slen;
hdr.msg_iov = &iov;
hdr.msg_iovlen = 1;
+#ifdef HAVE_MSGHDR_MSG_CONTROL
hdr.msg_control = ans_data;
hdr.msg_controllen = sizeof(ans_data);
+#endif
ret = recvmsg(sock, &hdr, 0);
#ifdef SO_TIMESTAMP
@@ -66,7 +66,7 @@ void print_usage (void);
char *community = NULL;
char *address = NULL;
-char *port = NULL;
+int port = 0;
int
main (int argc, char **argv)
@@ -371,14 +371,14 @@ process_arguments (int argc, char **argv)
if (community == NULL) {
if (argv[c] != NULL )
- community = argv[c];
+ community = argv[c++];
else
community = strdup (DEFAULT_COMMUNITY);
}
- if (port == NULL) {
+ if (port == 0) {
- port = argv[c];
+ port = atoi (argv[c++]);
port = atoi (DEFAULT_PORT);