[LUGOS] Bind error

Damijan Vodopivec damijan.vodopivec at hit.si
Mon Aug 18 13:33:38 CEST 2003


Ker se bindam točno na določen IP sem malce sem se pregledal kodo pred
klicem bind-a:

Ta koda na RH6.2 dela na 7.3 ne dela:
-----------------------------------------------------------------
 sock=socket(PF_INET, SOCK_STREAM,0);
 name.sin_family=AF_INET;
 name.sin_port=htons(port);
 name.sin_addr.s_addr=htonl(inet_addr(bind_adr));
 if (bind(sock, (struct sockaddr *)&name, sizeof(name)) < 0) {
        write_error(1,"Can't bind local address ! ");
        exit(1);
        }

Na RH 7.3 pa dela tako popravljena koda:
------------------------------------------------
 sock=socket(PF_INET, SOCK_STREAM,0);
 name.sin_family=AF_INET;
 name.sin_port=htons(port);
 name.sin_addr.s_addr=inet_addr(bind_adr);
 if (bind(sock, (struct sockaddr *)&name, sizeof(name)) < 0) {
        write_error(1,"Can't bind local address ! ");
        exit(1);
        }


Na vem zakaj - mogoče pa bo še komu koristilo.

Hvala za pomoč.

lp,
Damijan

-----Original Message-----
From: Boris Sagadin [mailto:boris.sagadin at uni-mb.si]
Sent: Monday, August 18, 2003 1:04 PM
To: Damijan Vodopivec
Subject: Re: [LUGOS] Bind error


Damijan,

pomeni, da firewall ne bi smel bit ovira. Ali mogoce ze kaj druga
poslusa na omenjenem portu? netstat -an

Lahko probas tudi "strace ime_programa", pa bomo videli kje tocno se
zacikla.

lp,
B.

Monday, August 18, 2003, 12:36:02 PM, you wrote:

> Kaj pomeni če imam sledečo konfiguracijo iptables ?

> [root at lintest conf]# iptables -L
> Chain INPUT (policy ACCEPT)
> target     prot opt source               destination

> Chain FORWARD (policy ACCEPT)
> target     prot opt source               destination

> Chain OUTPUT (policy ACCEPT)
> target     prot opt source               destination




More information about the lugos-list mailing list