I2P Address: [http://git.idk.i2p]

Skip to content
Snippets Groups Projects
Commit ff94b242 authored by idk's avatar idk
Browse files

account for RAP vs RAR in multihomeCache

parent 2a3d4e94
No related branches found
No related tags found
No related merge requests found
apps/routerconsole/jsp/themes/console/images/notblob.png

7.04 KiB | W: | H:

apps/routerconsole/jsp/themes/console/images/notblob.png

7.63 KiB | W: | H:

apps/routerconsole/jsp/themes/console/images/notblob.png
apps/routerconsole/jsp/themes/console/images/notblob.png
apps/routerconsole/jsp/themes/console/images/notblob.png
apps/routerconsole/jsp/themes/console/images/notblob.png
  • 2-up
  • Swipe
  • Onion skin
apps/routerconsole/jsp/themes/console/images/ramble.png

8.08 KiB | W: | H:

apps/routerconsole/jsp/themes/console/images/ramble.png

6.36 KiB | W: | H:

apps/routerconsole/jsp/themes/console/images/ramble.png
apps/routerconsole/jsp/themes/console/images/ramble.png
apps/routerconsole/jsp/themes/console/images/ramble.png
apps/routerconsole/jsp/themes/console/images/ramble.png
  • 2-up
  • Swipe
  • Onion skin
......@@ -163,10 +163,7 @@ public class HandleDatabaseLookupMessageJob extends JobImpl {
getContext().statManager().addRateData("netDb.lookupsMatchedLocalClosest", 1);
sendData(searchKey, ls, fromKey, toTunnel);
} else if (possibleMultihomed != null) {
if (possibleMultihomed.isCurrent(Router.CLOCK_FUDGE_FACTOR / 4)) {
// If it's in the possibleMultihomed cache, then it was definitely stored to us meaning it is effectively
// always recievedAsPublished. No need to decide whether or not to answer the request like above, just
// answer it so it doesn't look different from other stores.
if (possibleMultihomed.isCurrent(Router.CLOCK_FUDGE_FACTOR / 4) && possibleMultihomed.getReceivedAsPublished()) {
if (_log.shouldLog(Log.INFO))
_log.info("We have local LS, possibly from a multihomed router " + searchKey + ", and somebody requested it back from us. Answering query, as if in our keyspace, to avoid attack.");
getContext().statManager().addRateData("netDb.lookupsMatchedLocalMultihome", 1);
......@@ -192,10 +189,7 @@ public class HandleDatabaseLookupMessageJob extends JobImpl {
} else {
LeaseSet possibleMultihomed = getContext().clientMessagePool().getCache().multihomedCache.get(searchKey);
if (possibleMultihomed != null) {
if (possibleMultihomed.isCurrent(Router.CLOCK_FUDGE_FACTOR / 4)) {
// If it's in the possibleMultihomed cache, then it was definitely stored to us meaning it is effectively
// always recievedAsPublished. No need to decide whether or not to answer the request like above, just
// answer it so it doesn't look different from other stores.
if (possibleMultihomed.isCurrent(Router.CLOCK_FUDGE_FACTOR / 4) && possibleMultihomed.getReceivedAsPublished()) {
if (_log.shouldLog(Log.INFO))
_log.info("We have local LS, possibly from a multihomed router " + searchKey + ", and somebody requested it back from us. Answering query, as if in our keyspace, to avoid attack.");
getContext().statManager().addRateData("netDb.lookupsMatchedLocalMultihome", 1);
......
......@@ -92,6 +92,16 @@ class HandleFloodfillDatabaseStoreMessageJob extends JobImpl {
// This could happen with multihoming - where it's really important to prevent
// storing the other guy's leaseset, it will confuse us badly.
LeaseSet ls = (LeaseSet) entry;
// If this was received as a response to a query,
// FloodOnlyLookupMatchJob called setReceivedAsReply(),
// and we are seeing this only as a duplicate,
// so we don't set the receivedAsPublished() flag.
// Otherwise, mark it as something we received unsolicited, so we'll answer queries
// for it. This flag must NOT get set on entries that we
// receive in response to our own lookups.
// See ../HDLMJ for more info
if (!ls.getReceivedAsReply())
ls.setReceivedAsPublished();
if (getContext().clientManager().isLocal(key)) {
getContext().statManager().addRateData("netDb.storeLocalLeaseSetAttempt", 1, 0);
// throw rather than return, so that we send the ack below (prevent easy attack)
......@@ -111,16 +121,7 @@ class HandleFloodfillDatabaseStoreMessageJob extends JobImpl {
}
//boolean oldrar = ls.getReceivedAsReply();
//boolean oldrap = ls.getReceivedAsPublished();
// If this was received as a response to a query,
// FloodOnlyLookupMatchJob called setReceivedAsReply(),
// and we are seeing this only as a duplicate,
// so we don't set the receivedAsPublished() flag.
// Otherwise, mark it as something we received unsolicited, so we'll answer queries
// for it. This flag must NOT get set on entries that we
// receive in response to our own lookups.
// See ../HDLMJ for more info
if (!ls.getReceivedAsReply())
ls.setReceivedAsPublished();
//boolean rap = ls.getReceivedAsPublished();
//if (_log.shouldLog(Log.INFO))
// _log.info("oldrap? " + oldrap + " oldrar? " + oldrar + " newrap? " + rap);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment