HPE GreenLake Administration
- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- How to bind client ports
Operating System - HP-UX
1826562
Members
3767
Online
109695
Solutions
Forums
Categories
Company
Local Language
back
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
back
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Blogs
Information
Community
Resources
Community Language
Language
Forums
Blogs
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-28-2005 08:41 PM
11-28-2005 08:41 PM
How to bind client ports
I have a client and a server processes which makes use of the TCP socket. I want to fix the client ports to a specifc port so that i can check when a new connection comes to the server , whether it is from the client port or not. thus validating the port.
Another small question,
inside the sockaddr_in sin_zero, is it possible to fill in some data(say a key) and send it through to the server during the connect() call.
is is possible that the data sent through connect using sin_zero is obtained at the other end of the server.
Another small question,
inside the sockaddr_in sin_zero, is it possible to fill in some data(say a key) and send it through to the server during the connect() call.
is is possible that the data sent through connect using sin_zero is obtained at the other end of the server.
1 REPLY 1
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-29-2005 01:45 AM
11-29-2005 01:45 AM
Re: How to bind client ports
How to bind client ports:
What programming language are you using?
In C, just add a bind() system call with appropriate arguments before the connect() call. It is very rare for the client programs to do this, but it is certainly possible.
By the way, please learn why the rsh/rlogin/rexec protocols are considered obsolete and bad for security today: the client port number does not prove anything if the connection comes from any non-Unix host, or any untrusted host at all. Besides, several many-to-one NAT schemes (but not all of them) will cause the client port number to change and so they will break your "validation".
About sin_zero in struct sockaddr_in:
Looks like the sin_zero is just padding, or perhaps it reserves some space for OS internal things. I don't see anything that would suggest that the content of sin_zero would ever be sent anywhere.
Furthermore, even if it was sent somehow, the content of sin_zero would have to be transmitted somewhere outside the TCP/UDP packet's payload area. This would make it a non-standard extension to the protocol, and there is no guarantee that any firewall, NAT box or even a router would allow such an odd packet to go through.
What programming language are you using?
In C, just add a bind() system call with appropriate arguments before the connect() call. It is very rare for the client programs to do this, but it is certainly possible.
By the way, please learn why the rsh/rlogin/rexec protocols are considered obsolete and bad for security today: the client port number does not prove anything if the connection comes from any non-Unix host, or any untrusted host at all. Besides, several many-to-one NAT schemes (but not all of them) will cause the client port number to change and so they will break your "validation".
About sin_zero in struct sockaddr_in:
Looks like the sin_zero is just padding, or perhaps it reserves some space for OS internal things. I don't see anything that would suggest that the content of sin_zero would ever be sent anywhere.
Furthermore, even if it was sent somehow, the content of sin_zero would have to be transmitted somewhere outside the TCP/UDP packet's payload area. This would make it a non-standard extension to the protocol, and there is no guarantee that any firewall, NAT box or even a router would allow such an odd packet to go through.
MK
The opinions expressed above are the personal opinions of the authors, not of Hewlett Packard Enterprise. By using this site, you accept the Terms of Use and Rules of Participation.
Company
Support
Events and news
Customer resources
© Copyright 2025 Hewlett Packard Enterprise Development LP