NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

bin/37865: yppoll uses only UDP to request the map-info



>Number:         37865
>Category:       bin
>Synopsis:       yppoll uses only UDP to request the map-info
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    bin-bug-people
>State:          open
>Class:          change-request
>Submitter-Id:   net
>Arrival-Date:   Thu Jan 24 15:05:00 +0000 2008
>Originator:     Wolfgang Stukenbrock
>Release:        NetBSD 4.0
>Organization:
Dr. Nagler & Company GmbH
        
>Environment:
        
        
System: NetBSD s012 2.1 NetBSD 2.1 (NSW-S012) #10: Mon Dec 12 12:03:54 CET 2005 
wgstuken@s011:/export/netbsd-2.1/usr/src/sys/arch/i386/compile/NSW-S012 i386
Architecture: i386
Machine: i386
>Description:
        The yppoll command uses UDP to do its work. This is unrelyable on busy 
WAN connections.
        The optional use of TCP makes it much more relyable.
>How-To-Repeat:
        not relevant - new functionality
>Fix:
        The following fix will a  new option (-T) to the yppoll command and the 
manual.
        This new option will take only effect, when yppoll is called with -h 
option.

        Patch for /usr/src/usr.sbin/yppoll/yppoll.8
*** /export/NetBSD-4.0/src/usr.sbin/yppoll/yppoll.8     Sat Feb 26 17:20:36 2005
--- src/usr.sbin/yppoll/yppoll.8        Fri Oct 27 12:36:42 2006
***************
*** 42,47 ****
--- 42,48 ----
  .Nd ask version of NIS map from NIS server
  .Sh SYNOPSIS
  .Nm
+ .Op Fl T
  .Op Fl h Ar host
  .Op Fl d Ar domain
  .Ar mapname
***************
*** 55,60 ****
--- 56,65 ----
  .Pp
  The options are as follows:
  .Bl -tag -width indent
+ .It Fl T
+ Use TCP protocol instead of UDP for request if
+ .Ar -h
+ option is present.
  .It Fl h Ar host
  Ask the
  .Tn NIS
xxxx end of patch for /usr/src/usr.sbin/yppoll/yppoll.8

        Patch for /usr/src/usr.sbin/yppoll/yppoll.c
*** /export/NetBSD-4.0/src/usr.sbin/yppoll/yppoll.c     Wed Dec 10 18:10:34 2003
--- src/usr.sbin/yppoll/yppoll.c        Fri Oct 27 12:41:44 2006
***************
*** 82,87 ****
--- 82,89 ----
  int   get_remote_info __P((char *, char *, char *, int *, char **));
  void  usage __P((void));
  
+ static int T_flag = 0;
+ 
  int
  main(argc, argv)
        int  argc;
***************
*** 95,102 ****
  
        yp_get_default_domain(&domainname);
  
!       while ((c = getopt(argc, argv, "h:d:")) != -1) {
                switch (c) {
                case 'd':
                        domainname = optarg;
                        break;
--- 97,107 ----
  
        yp_get_default_domain(&domainname);
  
!       while ((c = getopt(argc, argv, "Th:d:")) != -1) {
                switch (c) {
+               case 'T':
+                       T_flag = 1;
+                       break;
                case 'd':
                        domainname = optarg;
                        break;
***************
*** 174,182 ****
        tv.tv_sec = 10;
        tv.tv_usec = 0;
  
!       client = clntudp_create(&rsrv_sin, YPPROG, YPVERS, tv, &rsrv_sock);
!       if (client == NULL)
                errx(1, "clntudp_create: no contact with host %s.", server);
        
        yprnk.domain = indomain;
        yprnk.map = inmap;
--- 179,196 ----
        tv.tv_sec = 10;
        tv.tv_usec = 0;
  
!       if (T_flag != 0)
!         {
!           client = clnttcp_create(&rsrv_sin, YPPROG, YPVERS, &rsrv_sock, 0, 
0);
!           if (client == NULL)
!               errx(1, "clnttcp_create: no contact with host %s.", server);
!         }
!       else
!         {
!           client = clntudp_create(&rsrv_sin, YPPROG, YPVERS, tv, &rsrv_sock);
!           if (client == NULL)
                errx(1, "clntudp_create: no contact with host %s.", server);
+         }
        
        yprnk.domain = indomain;
        yprnk.map = inmap;
***************
*** 212,218 ****
  usage()
  {
  
!       fprintf(stderr, "usage: %s [-h host] [-d domainname] mapname\n",
            getprogname());
        exit(1);
  }
--- 226,232 ----
  usage()
  {
  
!       fprintf(stderr, "usage: %s [-T] [-h host] [-d domainname] mapname\n",
            getprogname());
        exit(1);
  }
xxxx end of patch for /usr/src/usr.sbin/yppoll/yppoll.c

>Unformatted:
        
        



Home | Main Index | Thread Index | Old Index