Permalink
Browse files

- Set discard_incompatible_packets to true by default

- Discarding packets from different version in TCPConnectionMap (https://issues.jboss.org/browse/JGRP-1464)
  • Loading branch information...
1 parent 7422d94 commit a81223f6951cd0309c87bf2c5a88ba0f30c95bb4 @belaban committed May 16, 2012
Showing with 6 additions and 11 deletions.
  1. +4 −9 src/org/jgroups/blocks/TCPConnectionMap.java
  2. +2 −2 src/org/jgroups/protocols/TP.java
View
13 src/org/jgroups/blocks/TCPConnectionMap.java
@@ -514,15 +514,10 @@ private Address readPeerAddress(Socket client_sock) throws Exception {
+ " does not match own cookie; terminating connection");
// then read the version
short version=in.readShort();
-
- if(!Version.isBinaryCompatible(version) ) {
- if(log.isWarnEnabled())
- log.warn(new StringBuilder("packet from ").append(client_sock.getInetAddress())
- .append(':').append(client_sock.getPort()).append(" has different version (")
- .append(Version.print(version)).append(") from ours (")
- .append(Version.printVersion())
- .append("). This may cause problems").toString());
- }
+ if(!Version.isBinaryCompatible(version))
+ throw new IOException("packet from " + client_sock.getInetAddress() + ":" + client_sock.getPort() +
+ " has different version (" + Version.print(version) +
+ ") from ours (" + Version.printVersion() + "); discarding it");
Address client_peer_addr=new IpAddress();
client_peer_addr.readFrom(in);
View
4 src/org/jgroups/protocols/TP.java
@@ -135,8 +135,8 @@
* Discard packets with a different version. Usually minor version differences are okay. Setting this property
* to true means that we expect the exact same version on all incoming packets
*/
- @Property(description="Discard packets with a different version if true. Default is false")
- protected boolean discard_incompatible_packets=false;
+ @Property(description="Discard packets with a different version if true")
+ protected boolean discard_incompatible_packets=true;
@Property(description="Thread naming pattern for threads in this channel. Default is cl")

0 comments on commit a81223f

Please sign in to comment.