Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > socket send help

Reply
Thread Tools

socket send help

 
 
Gabriel Genellina
Guest
Posts: n/a
 
      01-06-2009
En Mon, 05 Jan 2009 22:59:46 -0200, James Mills
<> escribió:
> On Tue, Jan 6, 2009 at 10:49 AM, Bryan Olson <>
> wrote:
>>> I thought a firewall would block an attempt to bind to any routeable
>>> address, but not to localhost. So using INADDR_ANY would be rejected.

>
> No.
>
>> My understanding is that firewalls block network traffic, not system
>> calls.

>
> This is correct. Firewalls (real firewalls) can only act on incoming
> and outgoing traffic on the IP level.


That's true for hardware firewalls (those found in a router, by example).
They can at most analyze traffic at the application layer but have no idea
of the applications (processes) behind.
A "software firewall" may react not just to traffic but to *who* is doing
that; it may block *processes* when they try to bind/listen to any port,
even before any packet is sent or received. See
http://www.securityfocus.com/infocus/1839
(One may argue whether those are *real* firewalls or not, but that's their
common name...)
(Also note that I'm far for being an expert on these topics)

--
Gabriel Genellina

 
Reply With Quote
 
 
 
 
Bryan Olson
Guest
Posts: n/a
 
      01-07-2009
Gabriel Genellina wrote:
> James Mills escribió:
>> Bryan Olson wrote:
>>>> I thought a firewall would block an attempt to bind to any routeable
>>>> address, but not to localhost. So using INADDR_ANY would be rejected.

>>
>> No.
>>
>>> My understanding is that firewalls block network traffic, not system
>>> calls.

>>
>> This is correct. Firewalls (real firewalls) can only act on incoming
>> and outgoing traffic on the IP level.

>
> That's true for hardware firewalls (those found in a router, by
> example). They can at most analyze traffic at the application layer but
> have no idea of the applications (processes) behind.
> A "software firewall" may react not just to traffic but to *who* is
> doing that; it may block *processes* when they try to bind/listen to any
> port, even before any packet is sent or received. See
> http://www.securityfocus.com/infocus/1839
> (One may argue whether those are *real* firewalls or not, but that's
> their common name...)


Even if one's 'firewall' product is one of "the rather useless ones that
merely hook socket calls" (in the words of the linked article), I still
don't see failing a bind() to INADDR_ANY while allowing a bind() to
127.0.0.1. INADDR_ANY means all available adapters. If some physical
network adapter should be unavailable while the loopback is allowed,
fine; passing INADDR_ANY should work and bind to the loopback adapter.

> (Also note that I'm far for being an expert on these topics)


Sure. I was mostly just making a couple points because at one time they
confused me. Python's socket.bind() treats the empty string as
INADDR_ANY, which means all available adapters. It's a fine address
parameter for bind(), and ought to work at least as well as any. The
time to bind() to localhost is when we specifically do not want to be
available on an external network adapter.

Now don't get me started on the vagaries of passing INADDR_ANY to connect().

--
--Bryan
 
Reply With Quote
 
 
 
Reply

Thread Tools

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 On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: socket.unbind or socket.unlisten? - socket.error: (48, 'Addressalready in use') Steve Holden Python 1 02-03-2009 06:20 AM
Re: socket.unbind or socket.unlisten? - socket.error: (48, 'Addressalready in use') Steve Holden Python 0 02-01-2009 12:45 PM
Re: socket.unbind or socket.unlisten? - socket.error: (48, 'Addressalready in use') Laszlo Nagy Python 0 02-01-2009 07:37 AM
socket.unbind or socket.unlisten? - socket.error: (48, 'Addressalready in use') Laszlo Nagy Python 1 01-27-2009 05:05 PM
Re: socket.unbind or socket.unlisten? - socket.error: (48,'Address already in use') Jean-Paul Calderone Python 0 01-27-2009 01:41 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57