~ubuntu-branches/ubuntu/karmic/likewise-open/karmic

« back to all changes in this revision

Viewing changes to samba/source/lib/util_sock.c

  • Committer: Bazaar Package Importer
  • Author(s): Rick Clark
  • Date: 2008-08-27 08:56:20 UTC
  • mfrom: (1.1.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20080827085620-5q0f58b9qtog9myq
Tags: 4.1.0.2956-0ubuntu1
* missing-likewise-logo.diff: removed
* fixed copyright notice
* updated Standards-Version to 3.8.0
* removed path from command in prerm
* removed stop in S runlevel

Show diffs side-by-side

added added

removed removed

Lines of Context:
108
108
        hints.ai_socktype = SOCK_STREAM;
109
109
        hints.ai_flags = flags;
110
110
 
 
111
        /* Linux man page on getaddinfo() says port will be 
 
112
           uninitialized when service string in NULL */
 
113
 
111
114
        ret = getaddrinfo(str, NULL,
112
115
                        &hints,
113
116
                        ppres);
 
117
 
114
118
        if (ret) {
115
119
                DEBUG(3,("interpret_string_addr_internal: getaddrinfo failed "
116
120
                        "for name %s [%s]\n",
561
565
                /* IPv6 */
562
566
                const struct sockaddr_in6 *sa6 =
563
567
                        (const struct sockaddr_in6 *)pss;
564
 
                uint16_t port = ntohs(sa6->sin6_port);
 
568
                uint16_t port = 0;
 
569
                
565
570
 
 
571
#if 0
 
572
                /* This is buggy since
 
573
                   interpret_string_addr_internal() passes NULL for the
 
574
                   service name to getaddrinfo() which means that port is
 
575
                   left uninitialized. */
 
576
                port = ntohs(sa6->sin6_port);
 
577
#endif
566
578
                if (port) {
567
579
                        dest = talloc_asprintf(ctx,
568
580
                                        "[%s]:%d",
579
591
        } else {
580
592
                const struct sockaddr_in *sa =
581
593
                        (const struct sockaddr_in *)pss;
582
 
                uint16_t port = ntohs(sa->sin_port);
583
 
 
 
594
                uint16_t port = 0;              
 
595
 
 
596
#if 0
 
597
                /* This is buggy since
 
598
                   interpret_string_addr_internal() passes NULL for the
 
599
                   service name to getaddrinfo() which means that port is
 
600
                   left uninitialized. */
 
601
 
 
602
                port = ntohs(sa->sin_port);
 
603
#endif  
584
604
                if (port) {
585
605
                        dest = talloc_asprintf(ctx,
586
606
                                        "%s:%d",