From: Sergey Matveev Date: Thu, 8 Jul 2021 10:42:00 +0000 (+0300) Subject: Do not relay to area message's originator X-Git-Tag: v7.2.0^2~1 X-Git-Url: http://www.git.cypherpunks.ru/?p=nncp.git;a=commitdiff_plain;h=df6cf416c4cd79d9a32f36561f30773fc0c7f536 Do not relay to area message's originator --- diff --git a/doc/multicast.texi b/doc/multicast.texi index c14f58e..36e8bf9 100644 --- a/doc/multicast.texi +++ b/doc/multicast.texi @@ -137,9 +137,6 @@ If @code{nodeD} will receive packet from the @code{nodeB} first, it will relay it to the @code{nodeA} also, that will silently remove it when tossing, because it was already seen. -@strong{TODO}: we must not relay packet to the node also presenting as -the sender of the area's message. Obviously it has seen it. - @item When @code{nodeC} sends message to the area, then @code{nodeA} will receive it twice from @code{nodeB} and @code{nodeD}, ignoring one of diff --git a/doc/news.ru.texi b/doc/news.ru.texi index d2eae5b..4f87e64 100644 --- a/doc/news.ru.texi +++ b/doc/news.ru.texi @@ -12,6 +12,10 @@ Если у целевой ноды транзитного пакета задан @option{via} маршрут, то использовать его, а не игнорировать. +@item +Не отправлять multicast пакет оригинатору сообщения, очевидно точно +видящего свой собственный пакет. + @end itemize @node Релиз 7.1.1 diff --git a/doc/news.texi b/doc/news.texi index 6f0a8c3..ba822d2 100644 --- a/doc/news.texi +++ b/doc/news.texi @@ -14,6 +14,10 @@ See also this page @ref{Новости, on russian}. If destination node of transitional packet has non empty @option{via} route, then do not ignore, but use it. +@item +Do not relay multicast packet to area message's originator, that +obviously has seen its own packet. + @end itemize @node Release 7_1_1 diff --git a/src/toss.go b/src/toss.go index 4a447ce..dc5573b 100644 --- a/src/toss.go +++ b/src/toss.go @@ -729,7 +729,7 @@ func jobProcess( }) continue } - if nodeId != sender.Id { + if nodeId != sender.Id && nodeId != pktEnc.Sender { ctx.LogI("rx-area-echo", lesEcho, logMsgNode) if _, err = ctx.Tx( node, &pkt, nice, int64(pktSize), 0, fullPipeR, pktName, nil,