This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU Inetutils ".

The branch, master has been updated
       via  f526fef2535fabc21da4377716dd8805cad9476a (commit)
      from  c4457e97b26331534fe83c35768f92f98403c24a (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://git.savannah.gnu.org/cgit/inetutils.git/commit/?id=f526fef2535fabc21da4377716dd8805cad9476a


commit f526fef2535fabc21da4377716dd8805cad9476a
Author: Mats Erik Andersson <[email protected]>
Date:   Sat Oct 29 01:35:58 2011 +0200

    tftp: Set default port for non-connected transfers.

diff --git a/ChangeLog b/ChangeLog
index 6a3809d..84e372f 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2011-10-29  Mats Erik Andersson <[email protected]>
+
+       * src/tftp.c (main): New variable SP. Set default value for PORT.
+
 2011-10-28  Simon Josefsson  <[email protected]>
 
        * cfg.mk (_build-aux): Add variable, gnulib now needs this for
diff --git a/src/tftp.c b/src/tftp.c
index 46eb7eb..89b6b4b 100644
--- a/src/tftp.c
+++ b/src/tftp.c
@@ -225,11 +225,19 @@ int
 main (int argc, char *argv[])
 {
   struct sockaddr_in sin;
+  struct servent *sp;
 
   set_program_name (argv[0]);
   iu_argp_init ("tftp", default_program_authors);
   argp_parse (&argp, argc, argv, 0, NULL, NULL);
 
+  /* Initiate a default port.  */
+  sp = getservbyname ("tftp", "udp");
+  if (sp == 0)
+    port = htons (69);
+  else
+    port = sp->s_port;
+
   f = socket (AF_INET, SOCK_DGRAM, 0);
   if (f < 0)
     {

-----------------------------------------------------------------------

Summary of changes:
 ChangeLog  |    4 ++++
 src/tftp.c |    8 ++++++++
 2 files changed, 12 insertions(+), 0 deletions(-)


hooks/post-receive
-- 
GNU Inetutils 

_______________________________________________
Commit-inetutils mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/commit-inetutils

Reply via email to