~ubuntu-branches/ubuntu/saucy/xinetd/saucy

« back to all changes in this revision

Viewing changes to xinetd/service.c

  • Committer: Package Import Robot
  • Author(s): Jackson Doak
  • Date: 2013-08-14 19:26:27 UTC
  • mfrom: (5.1.3 sid)
  • Revision ID: package-import@ubuntu.com-20130814192627-4guvw89l76qp20uh
Tags: 1:2.3.15-1ubuntu1
* Merge from Debian unstable. Remaining changes:
  - Add xinetd upstart job.

Show diffs side-by-side

added added

removed removed

Lines of Context:
176
176
   else
177
177
      memset( &tsin, 0, sizeof(tsin));
178
178
 
 
179
   if ( SC_PROTOVAL ( scp ) == IPPROTO_TCP ) {
 
180
      M_SET ( scp->sc_xflags, SF_NOLIBWRAP );
 
181
   }
179
182
   if( SC_IPV4( scp ) ) {
180
183
      tsin.sa_in.sin_family = AF_INET ;
181
184
      sin_len = sizeof(struct sockaddr_in);
200
203
      return( FAILED ) ;
201
204
   }
202
205
   
203
 
   if( tsin.sa.sa_family == AF_INET ) 
 
206
   if( tsin.sa.sa_family == AF_INET )
204
207
      SC_SET_PORT( scp, ntohs( tsin.sa_in.sin_port ) ) ;
205
208
   else if( tsin.sa.sa_family == AF_INET6 )
206
209
      SC_SET_PORT( scp, ntohs( tsin.sa_in6.sin6_port ) ) ;
301
304
      return( FAILED ) ;
302
305
   }
303
306
 
 
307
#ifdef IN_MULTICAST
 
308
   if( SC_IPV4(scp) && IN_MULTICAST(tsin.sa_in.sin_addr.s_addr) ) {
 
309
      struct ip_mreq mreq;
 
310
      mreq.imr_multiaddr.s_addr = tsin.sa_in.sin_addr.s_addr;
 
311
      mreq.imr_interface.s_addr = htonl(INADDR_ANY);
 
312
      setsockopt(sd, IPPROTO_IP, IP_ADD_MEMBERSHIP, &mreq, sizeof(mreq));
 
313
      if ( debug.on )
 
314
         msg( LOG_DEBUG, func, "Adding multicast membership." );
 
315
   }
 
316
#endif
 
317
 
304
318
   return( OK ) ;
305
319
}
306
320
 
607
621
   /* print the banner regardless of access control */
608
622
   if ( SC_BANNER(scp) != NULL ) {
609
623
      char tmpbuf[TMPSIZE];
610
 
      int retval;
 
624
      ssize_t retval;
611
625
      int bannerfd = open(SC_BANNER(scp), O_RDONLY);
612
626
 
613
627
      if( bannerfd < 0 ) {
617
631
      }
618
632
 
619
633
      while( (retval = read(bannerfd, tmpbuf, sizeof(tmpbuf))) ) {
620
 
         if (retval == -1)
 
634
         if (retval == (ssize_t)-1)
621
635
         {
622
636
            if (errno == EINTR)
623
637
               continue;