changed port

This is a discussion on changed port within the Linux Networking forums, part of the Linux Forums category; Hi All, I am new in linux so the question may be easy, I have an app which is listening ...


Go Back   Usenet Forums > Linux Forums > Linux Networking

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 04-16-2004
Serge Blokhin
 
Posts: n/a
Default changed port

Hi All,
I am new in linux so the question may be easy,
I have an app which is listening specific port for incoming
connections.
I run it on AIX ,HPUX, Solaris it all worked fine, but on linux (RH
7.2 ) it's not working.
When i run netstat -l it shows that my app is listening 25115 port,
which is kinda strange 'cause I wanted it to listen 7010...
If i try to connect to the linux box on 25115 port i get the
connection but non on 7010. So it looks like somehow linux changes
listening port for my app...
Can somebody explain me why it is happening?
Thanks
Serge
Reply With Quote
  #2 (permalink)  
Old 04-16-2004
Alex Harsch
 
Posts: n/a
Default Re: changed port

Serge Blokhin wrote:

> Hi All,
> I am new in linux so the question may be easy,
> I have an app which is listening specific port for incoming
> connections.
> I run it on AIX ,HPUX, Solaris it all worked fine, but on linux (RH
> 7.2 ) it's not working.
> When i run netstat -l it shows that my app is listening 25115 port,
> which is kinda strange 'cause I wanted it to listen 7010...
> If i try to connect to the linux box on 25115 port i get the
> connection but non on 7010. So it looks like somehow linux changes
> listening port for my app...
> Can somebody explain me why it is happening?
> Thanks
> Serge

Hi,

on some Linux Systems, you are not allowed to use the registered ports. Port
7010 is used for
ups-onlinet 7010/tcp # onlinet uninterruptable power supplies
ups-onlinet 7010/udp # onlinet uninterruptable power supplies


Alex
Reply With Quote
  #3 (permalink)  
Old 04-16-2004
Serge Blokhin
 
Posts: n/a
Default Re: changed port

Alex Harsch <infodude@gmx.de> wrote in message news:<c5n5d9$10vd$1@ulysses.news.tiscali.de>...

Hi Alex,

> Hi,
>
> on some Linux Systems, you are not allowed to use the registered ports. Port
> 7010 is used for
> ups-onlinet 7010/tcp # onlinet uninterruptable power supplies
> ups-onlinet 7010/udp # onlinet uninterruptable power supplies
>
>
> Alex


Well, tried other ports, same thing.
Something changes ports...
Serge
Reply With Quote
  #4 (permalink)  
Old 04-16-2004
Alex Harsch
 
Posts: n/a
Default Re: changed port

Serge Blokhin wrote:

> Alex Harsch <infodude@gmx.de> wrote in message
> news:<c5n5d9$10vd$1@ulysses.news.tiscali.de>...
>
> Hi Alex,
>
>> Hi,
>>
>> on some Linux Systems, you are not allowed to use the registered ports.
>> Port 7010 is used for
>> ups-onlinet 7010/tcp # onlinet uninterruptable power supplies
>> ups-onlinet 7010/udp # onlinet uninterruptable power supplies
>>
>>
>> Alex

>
> Well, tried other ports, same thing.
> Something changes ports...
> Serge

Hi Serge,

have you already tried a private port?
The Dynamic and/or Private Ports are those from 49152 through 65535.

They are for private use, and I guess your system will let you use one of
these.
Regards, Alex
Reply With Quote
  #5 (permalink)  
Old 04-17-2004
Serge Blokhin
 
Posts: n/a
Default Re: changed port

Hi Alex,
I think I know what's going....
I guess it all comes to playing with big-endian/little-endian stuff.
so my problem has nothing to do with linux itself...
Thanks for your help anyway.
Serge

> Serge Blokhin wrote:
>
> > Alex Harsch <infodude@gmx.de> wrote in message
> > news:<c5n5d9$10vd$1@ulysses.news.tiscali.de>...
> >
> > Hi Alex,
> >
> >> Hi,
> >>
> >> on some Linux Systems, you are not allowed to use the registered ports.
> >> Port 7010 is used for
> >> ups-onlinet 7010/tcp # onlinet uninterruptable power supplies
> >> ups-onlinet 7010/udp # onlinet uninterruptable power supplies
> >>
> >>
> >> Alex

> >
> > Well, tried other ports, same thing.
> > Something changes ports...
> > Serge

> Hi Serge,
>
> have you already tried a private port?
> The Dynamic and/or Private Ports are those from 49152 through 65535.
>
> They are for private use, and I guess your system will let you use one of
> these.
> Regards, Alex

Reply With Quote
  #6 (permalink)  
Old 04-25-2004
Juha Laiho
 
Posts: n/a
Default Re: changed port

sergey.blokhin@ca.com (Serge Blokhin) said:
>I have an app which is listening specific port for incoming
>connections.
>I run it on AIX ,HPUX, Solaris it all worked fine, but on linux (RH
>7.2 ) it's not working.
>When i run netstat -l it shows that my app is listening 25115 port,
>which is kinda strange 'cause I wanted it to listen 7010...


You found out correct, this is because of endian issues.
So, showing the 7010 in hexadecimal gives 1B62. With the endian
mismatch, this gets interpreted as 621B, which is 25115 decimal.

To solve this for port numbers, the applications should always use
htons() to transform the port number from the host byte order to
network byte order. Similarly, some data retrieved form the network
interface functions must be converted back to host byte order with
ntohs(). These practices make the same code work on all platforms.
--
Wolf a.k.a. Juha Laiho Espoo, Finland
(GC 3.0) GIT d- s+: a C++ ULSH++++$ P++@ L+++ E- W+$@ N++ !K w !O !M V
PS(+) PE Y+ PGP(+) t- 5 !X R !tv b+ !DI D G e+ h---- r+++ y++++
"...cancel my subscription to the resurrection!" (Jim Morrison)
Reply With Quote
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT +1. The time now is 01:51 AM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0