All of lore.kernel.org
 help / color / mirror / Atom feed
From: Bernard Pidoux <bernard.pidoux@upmc.fr>
To: linux-hams@vger.kernel.org
Cc: Ralf Baechle DL5RB <ralf@linux-mips.org>, ax25@x-berg.in-berlin.de
Subject: Re: [PATCH] ax25ipd : added provision for dynamic dns hosts
Date: Tue, 03 Nov 2009 14:33:40 +0100	[thread overview]
Message-ID: <4AF03134.7010300@upmc.fr> (raw)
In-Reply-To: <4AE1AA6C.9040500@upmc.fr>

[-- Attachment #1: Type: text/plain, Size: 117 bytes --]

In the submitted patch io.c patch was malformed.

Here is a corrected patch for ax25ipd/io.c

73 de Bernard, f6bvp



[-- Attachment #2: ax25ipd-0.0.8-rc2_io.patch --]
[-- Type: text/plain, Size: 1915 bytes --]

--- ax25-apps-0.0.8-rc2/ax25ipd/io.c	2009-06-14 17:42:11.000000000 +0200
+++ ax25-apps-0.0.8-rc2/ax25ipd/io.c	2009-11-03 14:03:40.890816311 +0100
@@ -15,7 +15,6 @@
 
 #include <sys/types.h>
 #include <sys/time.h>
-#include <time.h>
 #include <sys/socket.h>
 #include <netinet/in.h>
 #include <netinet/in_systm.h>
@@ -67,8 +66,7 @@
 struct sockaddr_in from;
 socklen_t fromlen;
 
-time_t last_bc_time;
-
+time_t last_bc_time, last_dns_time;
 int ttyfd_bpq = 0;
 
 /*
@@ -134,6 +132,8 @@
 
 	bzero((char *) &udpbind, sizeof(struct sockaddr));
 	udpbind.sin_family = AF_INET;
+
+        last_dns_time = time(NULL);
 }
 
 /*
@@ -378,9 +378,19 @@
 		if (nb == 0) {
 			fflush(stdout);
 			fflush(stderr);
+/*                      do we need to check hostname->ip mappings? */
+                        if (time(NULL) > last_dns_time + 300) {
+                           update_dns();
+                           last_dns_time = time(NULL); 
+                        }
 			/* just so we go back to the top of the loop! */
 			continue;
 		}
+/*              just in case we've been too busy......... */
+                if (time(NULL) > last_dns_time + 900) {
+                   update_dns();
+                   last_dns_time = time(NULL); 
+                }
 
 		if (FD_ISSET(ttyfd, &readfds)) {
 			do {
@@ -599,8 +609,9 @@
 			perror("reading from raw ip socket");
 			exit(2);
 		} else if (mode == UDP_MODE) {
-			perror("reading from udp socket");
+/*			perror("reading from udp socket");
 			exit(2);
+*/
 		} else if (mode == TTY_MODE) {
 			perror("reading from tty device");
 			exit(2);
@@ -645,8 +656,9 @@
 				usleep(100000);	/* sleep a bit */
 				return 1;	/* and retry */
 			}
-			perror("writing to udp socket");
+/*			perror("writing to udp socket");
 			exit(2);
+*/
 		} else if (mode == TTY_MODE) {
 			if (errno == EWOULDBLOCK) {
 				LOGL4("write to tty would block, sleeping and retrying!\n");

      parent reply	other threads:[~2009-11-03 13:33 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-01-26 17:31 ax25-apps/-tools: clarification about the project status IT2 Stuart Blake Tener, USNR
2009-10-23 13:06 ` [PATCH] ax25ipd : added provision for dynamic dns hosts Bernard Pidoux
2009-11-02 17:22   ` Thomas Osterried
2009-11-03 13:46     ` Pidoux
2009-11-06 22:43       ` Bernard Pidoux
2009-11-03 13:33   ` Bernard Pidoux [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4AF03134.7010300@upmc.fr \
    --to=bernard.pidoux@upmc.fr \
    --cc=ax25@x-berg.in-berlin.de \
    --cc=linux-hams@vger.kernel.org \
    --cc=ralf@linux-mips.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.