This is a discussion on Re: TCP-Programming: Port connects to itself? Why is this possible? within the Linux Networking forums, part of the Linux Forums category; > I just noticed that it is possible to open a TCP-socket and connect it to > itself ... I ...
|
|||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
> I just noticed that it is possible to open a TCP-socket and connect it to
> itself ... I don't see how / why this makes sense. Shouldn't the kernel > deny this? > If I do a netstat I see the following: > > mhpa9rec:~# netstat -p | grep 3000 > tcp 0 0 mhpa9rec:3000 mhpa9rec:3000 ESTABLISHED1351/sock > I fail to see why the kernel needs to deny this? If I were to create a port blocker your example woult fit nicely when clarifying how to do this (without reading and writing of course). In this way I would be able to programmatically occupy different ports without using many resources, thus controlling which ports are free for other (possible malicious) sockets. Do I make sense? It is a long time ago I did this kind of lowlevel programming... thank god for IPTables :) Sincerely, Dennis Petersen |