You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@qpid.apache.org by Andrew Stitcher <as...@apache.org> on 2012/11/15 16:22:08 UTC
Review Request: Allow qpidd configuration options to restrict the
interfaces/addresses that are listened to for incoming connections
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/8076/
-----------------------------------------------------------
Review request for qpid.
Description
-------
This change introduces a new --interface option to the qpid c++ broker which allows you to specify either:
* An interface name
* A literal IP address - IPv6 literal addresses should be enclosed in '['...']'
* A resolvable name
If one (or more) of these options are specified they will restrict what the broker listens to only be those interfaces/addresses.
If the option is not specified the current behaviour is unchanged.
This current change is the first part of the work and only restricts listening to the existing --port and --ssl-port on the specified interfaces. There is no way to additionally specify extra ports to listen for, that will come in the next part of the work and requires some refactoring of the existing code.
This current patch is designed for minimal impact and no refactoring. Because of this there is some element of duplicated code which should really be factored into a new file. This will happen in the next phase of work.
Limitation of this current change: You can't specify interfaces by name under windows, although you can specify individual interface addresses.
[This change also incidentally removes ans unused function call from SystemInfo]
A broken down version of this change can be found on github: http://github.com/astitcher/qpid/commits/netinterfaces
This addresses bug qpid-3351.
https://issues.apache.org/jira/browse/qpid-3351
Diffs
-----
/trunk/qpid/cpp/include/qpid/sys/SystemInfo.h 1408983
/trunk/qpid/cpp/src/qpid/broker/Broker.h 1408983
/trunk/qpid/cpp/src/qpid/broker/Broker.cpp 1408983
/trunk/qpid/cpp/src/qpid/broker/windows/SslProtocolFactory.cpp 1408983
/trunk/qpid/cpp/src/qpid/sys/SslPlugin.cpp 1408983
/trunk/qpid/cpp/src/qpid/sys/TCPIOPlugin.cpp 1408983
/trunk/qpid/cpp/src/qpid/sys/posix/SystemInfo.cpp 1408983
/trunk/qpid/cpp/src/qpid/sys/windows/SystemInfo.cpp 1408983
/trunk/qpid/cpp/src/tests/SystemInfo.cpp 1408983
Diff: https://reviews.apache.org/r/8076/diff/
Testing
-------
Tested manually by restricting the listening to either loopback, ethernet, or a virtual bridge in various combinations using regular and SSL connections and seeing that connections are correctly refused.
Thanks,
Andrew Stitcher
Re: Review Request: Allow qpidd configuration options to restrict the
interfaces/addresses that are listened to for incoming connections
Posted by Andrew Stitcher <as...@apache.org>.
> On Nov. 15, 2012, 4:51 p.m., Alan Conway wrote:
> >
Well because of the way the code is structured it is _possible_ (but admittedly unlikely) that some other protocol might still be able to run. As a simple example rdma could still run even if TCP couldn't. In point of fact because of the way the code is currently structured this case can't actually happen anyway! (It should be possible when refactored though).
- Andrew
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/8076/#review13473
-----------------------------------------------------------
On Nov. 15, 2012, 3:22 p.m., Andrew Stitcher wrote:
>
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/8076/
> -----------------------------------------------------------
>
> (Updated Nov. 15, 2012, 3:22 p.m.)
>
>
> Review request for qpid.
>
>
> Description
> -------
>
> This change introduces a new --interface option to the qpid c++ broker which allows you to specify either:
> * An interface name
> * A literal IP address - IPv6 literal addresses should be enclosed in '['...']'
> * A resolvable name
> If one (or more) of these options are specified they will restrict what the broker listens to only be those interfaces/addresses.
>
> If the option is not specified the current behaviour is unchanged.
>
> This current change is the first part of the work and only restricts listening to the existing --port and --ssl-port on the specified interfaces. There is no way to additionally specify extra ports to listen for, that will come in the next part of the work and requires some refactoring of the existing code.
>
> This current patch is designed for minimal impact and no refactoring. Because of this there is some element of duplicated code which should really be factored into a new file. This will happen in the next phase of work.
>
> Limitation of this current change: You can't specify interfaces by name under windows, although you can specify individual interface addresses.
>
> [This change also incidentally removes ans unused function call from SystemInfo]
>
> A broken down version of this change can be found on github: http://github.com/astitcher/qpid/commits/netinterfaces
>
>
> This addresses bug qpid-3351.
> https://issues.apache.org/jira/browse/qpid-3351
>
>
> Diffs
> -----
>
> /trunk/qpid/cpp/include/qpid/sys/SystemInfo.h 1408983
> /trunk/qpid/cpp/src/qpid/broker/Broker.h 1408983
> /trunk/qpid/cpp/src/qpid/broker/Broker.cpp 1408983
> /trunk/qpid/cpp/src/qpid/broker/windows/SslProtocolFactory.cpp 1408983
> /trunk/qpid/cpp/src/qpid/sys/SslPlugin.cpp 1408983
> /trunk/qpid/cpp/src/qpid/sys/TCPIOPlugin.cpp 1408983
> /trunk/qpid/cpp/src/qpid/sys/posix/SystemInfo.cpp 1408983
> /trunk/qpid/cpp/src/qpid/sys/windows/SystemInfo.cpp 1408983
> /trunk/qpid/cpp/src/tests/SystemInfo.cpp 1408983
>
> Diff: https://reviews.apache.org/r/8076/diff/
>
>
> Testing
> -------
>
> Tested manually by restricting the listening to either loopback, ethernet, or a virtual bridge in various combinations using regular and SSL connections and seeing that connections are correctly refused.
>
>
> Thanks,
>
> Andrew Stitcher
>
>
Re: Review Request: Allow qpidd configuration options to restrict the
interfaces/addresses that are listened to for incoming connections
Posted by Alan Conway <ac...@redhat.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/8076/#review13473
-----------------------------------------------------------
Ship it!
/trunk/qpid/cpp/src/qpid/broker/windows/SslProtocolFactory.cpp
<https://reviews.apache.org/r/8076/#comment28878>
Perhaps this case should cause the broker to exit, rather than start up listening to nothing?
/
- Alan Conway
On Nov. 15, 2012, 3:22 p.m., Andrew Stitcher wrote:
>
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/8076/
> -----------------------------------------------------------
>
> (Updated Nov. 15, 2012, 3:22 p.m.)
>
>
> Review request for qpid.
>
>
> Description
> -------
>
> This change introduces a new --interface option to the qpid c++ broker which allows you to specify either:
> * An interface name
> * A literal IP address - IPv6 literal addresses should be enclosed in '['...']'
> * A resolvable name
> If one (or more) of these options are specified they will restrict what the broker listens to only be those interfaces/addresses.
>
> If the option is not specified the current behaviour is unchanged.
>
> This current change is the first part of the work and only restricts listening to the existing --port and --ssl-port on the specified interfaces. There is no way to additionally specify extra ports to listen for, that will come in the next part of the work and requires some refactoring of the existing code.
>
> This current patch is designed for minimal impact and no refactoring. Because of this there is some element of duplicated code which should really be factored into a new file. This will happen in the next phase of work.
>
> Limitation of this current change: You can't specify interfaces by name under windows, although you can specify individual interface addresses.
>
> [This change also incidentally removes ans unused function call from SystemInfo]
>
> A broken down version of this change can be found on github: http://github.com/astitcher/qpid/commits/netinterfaces
>
>
> This addresses bug qpid-3351.
> https://issues.apache.org/jira/browse/qpid-3351
>
>
> Diffs
> -----
>
> /trunk/qpid/cpp/include/qpid/sys/SystemInfo.h 1408983
> /trunk/qpid/cpp/src/qpid/broker/Broker.h 1408983
> /trunk/qpid/cpp/src/qpid/broker/Broker.cpp 1408983
> /trunk/qpid/cpp/src/qpid/broker/windows/SslProtocolFactory.cpp 1408983
> /trunk/qpid/cpp/src/qpid/sys/SslPlugin.cpp 1408983
> /trunk/qpid/cpp/src/qpid/sys/TCPIOPlugin.cpp 1408983
> /trunk/qpid/cpp/src/qpid/sys/posix/SystemInfo.cpp 1408983
> /trunk/qpid/cpp/src/qpid/sys/windows/SystemInfo.cpp 1408983
> /trunk/qpid/cpp/src/tests/SystemInfo.cpp 1408983
>
> Diff: https://reviews.apache.org/r/8076/diff/
>
>
> Testing
> -------
>
> Tested manually by restricting the listening to either loopback, ethernet, or a virtual bridge in various combinations using regular and SSL connections and seeing that connections are correctly refused.
>
>
> Thanks,
>
> Andrew Stitcher
>
>
Re: Review Request: Allow qpidd configuration options to restrict the
interfaces/addresses that are listened to for incoming connections
Posted by Kenneth Giusti <kg...@apache.org>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/8076/#review13566
-----------------------------------------------------------
Ship it!
Ship It!
- Kenneth Giusti
On Nov. 15, 2012, 3:22 p.m., Andrew Stitcher wrote:
>
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/8076/
> -----------------------------------------------------------
>
> (Updated Nov. 15, 2012, 3:22 p.m.)
>
>
> Review request for qpid.
>
>
> Description
> -------
>
> This change introduces a new --interface option to the qpid c++ broker which allows you to specify either:
> * An interface name
> * A literal IP address - IPv6 literal addresses should be enclosed in '['...']'
> * A resolvable name
> If one (or more) of these options are specified they will restrict what the broker listens to only be those interfaces/addresses.
>
> If the option is not specified the current behaviour is unchanged.
>
> This current change is the first part of the work and only restricts listening to the existing --port and --ssl-port on the specified interfaces. There is no way to additionally specify extra ports to listen for, that will come in the next part of the work and requires some refactoring of the existing code.
>
> This current patch is designed for minimal impact and no refactoring. Because of this there is some element of duplicated code which should really be factored into a new file. This will happen in the next phase of work.
>
> Limitation of this current change: You can't specify interfaces by name under windows, although you can specify individual interface addresses.
>
> [This change also incidentally removes ans unused function call from SystemInfo]
>
> A broken down version of this change can be found on github: http://github.com/astitcher/qpid/commits/netinterfaces
>
>
> This addresses bug qpid-3351.
> https://issues.apache.org/jira/browse/qpid-3351
>
>
> Diffs
> -----
>
> /trunk/qpid/cpp/include/qpid/sys/SystemInfo.h 1408983
> /trunk/qpid/cpp/src/qpid/broker/Broker.h 1408983
> /trunk/qpid/cpp/src/qpid/broker/Broker.cpp 1408983
> /trunk/qpid/cpp/src/qpid/broker/windows/SslProtocolFactory.cpp 1408983
> /trunk/qpid/cpp/src/qpid/sys/SslPlugin.cpp 1408983
> /trunk/qpid/cpp/src/qpid/sys/TCPIOPlugin.cpp 1408983
> /trunk/qpid/cpp/src/qpid/sys/posix/SystemInfo.cpp 1408983
> /trunk/qpid/cpp/src/qpid/sys/windows/SystemInfo.cpp 1408983
> /trunk/qpid/cpp/src/tests/SystemInfo.cpp 1408983
>
> Diff: https://reviews.apache.org/r/8076/diff/
>
>
> Testing
> -------
>
> Tested manually by restricting the listening to either loopback, ethernet, or a virtual bridge in various combinations using regular and SSL connections and seeing that connections are correctly refused.
>
>
> Thanks,
>
> Andrew Stitcher
>
>
Re: Review Request: Allow qpidd configuration options to restrict
the interfaces/addresses that are listened to for incoming connections
Posted by Andrew Stitcher <as...@redhat.com>.
On Thu, 2012-11-15 at 16:33 +0100, Emmanuel Bourg wrote:
> Le 15/11/2012 16:22, Andrew Stitcher a écrit :
>
> > * A literal IP address - IPv6 literal addresses should be enclosed in '['...']'
>
> Is the enclosing for IPv6 addresses really necessary? It should be
> possible to guess the type reliably from the input value (either
> xxx.xxx.xxx.xxx for IPv4, otherwise it's IPv6).
Unfortunately it will be necessary for the "port" syntax that's coming
in the next part of the work.
This will use ':' to signify the port to listen to so that IPv6
addresses might become ambiguous ie fe80::456:4564:67 - is that address
fe80::456:4564 and port 67 or address fe80::456:4564:67 with the default
ports. So I decided to use the same solution that the url spec does as
it is (or should be) well known [fe80::456:4564]:67 or
[fe80::456:4564:67].
In the current code the '[',']' as actually just stripped away, but in
the next phase we will search for the port following a ':'.
Note that as you can also specify a DNS name for the interface addresses
too, in which case you will get all the addresses that name refers to
(IPv4 or v6).
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@qpid.apache.org
For additional commands, e-mail: dev-help@qpid.apache.org
Re: Review Request: Allow qpidd configuration options to restrict
the interfaces/addresses that are listened to for incoming connections
Posted by Emmanuel Bourg <eb...@apache.org>.
Le 15/11/2012 16:22, Andrew Stitcher a écrit :
> * A literal IP address - IPv6 literal addresses should be enclosed in '['...']'
Is the enclosing for IPv6 addresses really necessary? It should be
possible to guess the type reliably from the input value (either
xxx.xxx.xxx.xxx for IPv4, otherwise it's IPv6).
That would be slightly easier to use.
Emmanuel Bourg