Bug 60768 - xinetd service echo-udp performs only once
xinetd service echo-udp performs only once
Status: CLOSED DUPLICATE of bug 56487
Product: Red Hat Linux
Classification: Retired
Component: xinetd (Show other bugs)
7.2
i386 Linux
medium Severity medium
: ---
: ---
Assigned To: Trond Eivind Glomsrxd
Brock Organ
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2002-03-06 02:07 EST by Wilhelm Engels
Modified: 2007-04-18 12:40 EDT (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2002-03-06 02:12:39 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Wilhelm Engels 2002-03-06 02:07:15 EST
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:0.9.4) Gecko/20011126
Netscape6/6.2.1

Description of problem:
xinetd-2.3.3-1 performs the echo function if the dgram service is used only
once. any following tries to get a response from xinetd are not successful.

Version-Release number of selected component (if applicable):


How reproducible:
Always

Steps to Reproduce:
1.install xinetd and change the disable line in /etc/xinetd.d/echo-udp,
restart xinetd
2.send something to the echo port, get the response
3.send again:
	

Actual Results:  the 2nd and all other sendto are not answered by the server


Expected Results:  the server should reply

Additional info:

1) a strace -p <xinetd pid> before and after shows one fd less is in the select mask
2) netstat -a|grep echo shows a receive queue for the port
3) if you change the wait entry from "yes" to "no" in the echo-udp init file,
the server works as expected
4) the xinetd version 2.3.4.-0.3 from http://people.redhat.com/teg/xinetd/works also
5) bug exist also in 7.1
Comment 1 Wilhelm Engels 2002-03-06 02:12:34 EST
testprg

--- cut here --- 
#include <stdio.h>
#include <stdlib.h>
#include <errno.h>
#include <netdb.h>
#include <string.h>
#include <sys/socket.h>
#include <sys/param.h>
#include <netinet/in.h>

int main(int argc, char *argv[])
{
struct timeval time_out;                /* struct timeout on select */
struct sockaddr_in Sin;                 /* socket address send */
struct hostent *hp;                     /* struct to get internet address */
struct servent *sp;                     /* struct to get internet service */
fd_set echo_fds;                        /* area for select bits */
char ebuf[64];                          /* send / receive buffer */
int efd;                                /* socket for send */
size_t rlen;                            /* size of returned structed from echo */
int eret;                               /* return value, received */
char hostn[MAXHOSTNAMELEN];             /* for the hostname */

        strncpy(hostn, argv[1], MAXHOSTNAMELEN);

        if (!(hp = gethostbyname(hostn)))       /* get ip addr */
        {
                fprintf(stderr,
                        "%s: unknown host %s\n", argv[0], hostn);
                exit(2);
        }

        if (!(sp = getservbyname("echo", "udp")))
        {
                fprintf(stderr,
                        "%s: echo not in services\n", argv[0]);
                exit(3);
        }

        if ((efd = socket(PF_INET,SOCK_DGRAM,0)) < 0)
        {
                fprintf(stderr, "%s: open socket:%s\n",
                        argv[0],
                        strerror(errno));
                exit(4);
        }

        Sin.sin_family = PF_INET;       /* internet */

        (void) memcpy((char *) &Sin.sin_addr.s_addr,    /* put in remote host */
                (char *) hp->h_addr,
                sizeof(unsigned long));

        Sin.sin_port = (unsigned short) sp->s_port;     /* save port */

        strcpy(ebuf, "calping");        /* send message */

        eret=sendto(
                efd,            /* fileid of socket */
                ebuf,           /* buffer */
                (int) strlen(ebuf),
                0,
                (struct sockaddr *) &Sin,
                sizeof(Sin));

        if (-1 > eret)
        {
                fprintf(stderr, "%s:sendto:%s\n",
                        argv[0],
                        strerror(errno));
                exit(5);
        }

        time_out.tv_sec = 1L;   /* seconds to wait */
        time_out.tv_usec = 0L;  /* milliseconds */

        FD_ZERO(&echo_fds);     /* clear all bits */
        FD_SET(efd, &echo_fds);         /* file descriptor */

        if (!(eret = select(
                FD_SETSIZE,             /* check all fds */
                &echo_fds,              /* read check */
                0,                      /* no write check */
                0,                      /* no execptions */
                &time_out)))            /* time out periode */
        {
                fprintf(stderr, "%s:timeout select\n",
                        argv[0]);
                        exit(1);        /* got timeout */
        }

        if (0 > eret)                   /* error */
        {
                fprintf(stderr, "%s:error select:%s\n",
                        argv[0],
                        strerror(errno));
                exit(7);
        }
        rlen = sizeof(Sin);             /* available space */

        (void) recvfrom(
                efd,                    /* file id to read */
                ebuf,                   /* buffer */
                64,                     /* length of buffer */
                0,                      /* flags */
                (struct sockaddr *) &Sin,       /* sender address */
                &rlen);                         /* size of struct */
        fprintf(stderr, "%s:got response\n",
                argv[0]);
        exit(0);                        /* return other sys exist */

}
Comment 2 Trond Eivind Glomsrxd 2002-03-06 11:41:43 EST

*** This bug has been marked as a duplicate of 56487 ***

Note You need to log in before you can comment on or make changes to this bug.