fff-babeld: Only select first list entry from router_ip #200

Closed
fbl wants to merge 2 commits from fbl/firmware:rip-fix into master
Owner

The router_ip option can be a list of multiple ip addresses. It is also
possible to specify a subnet using a CIDR mask.

Only a single ip is required for peering interfaces, so select only the
first list entry and remove the CIDR mask.

Fixes: #197

While at it, use variable substitution for other CIDR mask removals as well.

The router_ip option can be a list of multiple ip addresses. It is also possible to specify a subnet using a CIDR mask. Only a single ip is required for peering interfaces, so select only the first list entry and remove the CIDR mask. Fixes: #197 While at it, use variable substitution for other CIDR mask removals as well.
fbl added this to the 20220405-beta milestone 2022-01-04 12:09:51 +01:00
fbl added the
bug
layer3
labels 2022-01-04 12:09:51 +01:00
fbl added 2 commits 2022-01-04 12:09:51 +01:00
815acc6600 fff-babeld: Only select first list entry from router_ip
The router_ip option can be a list of multiple ip addresses. It is also
possible to specify a subnet using a CIDR mask.

Only a single ip is required for peering interfaces, so select only the
first list entry and remove the CIDR mask.

Fixes: #197

Signed-off-by: Fabian Bläse <fabian@blaese.de>
34de39ff41 fff-babeld: Simplify CIDR mask removal
The removal of CIDR masks from ip addresses is changed to utilize
variable substitutions, which simplifies the expression.

Signed-off-by: Fabian Bläse <fabian@blaese.de>
jkimmel reviewed 2022-01-04 12:49:22 +01:00
@ -42,0 +41,4 @@
ip=$router_ip
# use only first ip
ip=${ip%% *}
Owner

Der nächste Befehl löscht sowieso alles ab dem ersten /. Richtig nötig ist die Zeile also nicht. Kann man aber zur Not auch behalten, weil es möglicherweise etwas einfacher ist zu verfolgen.

Der nächste Befehl löscht sowieso alles ab dem ersten `/`. Richtig nötig ist die Zeile also nicht. Kann man aber zur Not auch behalten, weil es möglicherweise etwas einfacher ist zu verfolgen.
Author
Owner

Die Zeile ist nötig, denn es ist nicht erforderlich, dass die router_ip eine Netzmaske enthält.

Das uci Trennzeichen für Listen ist nunmal ein ' ', in so fern ist das auch die einzige saubere Lösung, selbst wenn ein späterer Regex aus einem vollkommen anderen Grund den gleichen Effekt hätte.

Die Zeile ist nötig, denn es ist nicht erforderlich, dass die router_ip eine Netzmaske enthält. Das uci Trennzeichen für Listen ist nunmal ein ' ', in so fern ist das auch die einzige saubere Lösung, selbst wenn ein späterer Regex aus einem vollkommen anderen Grund den gleichen Effekt hätte.
Owner

Ah! Jap, daran hab ich in dem Moment nicht gesacht.

Ah! Jap, daran hab ich in dem Moment nicht gesacht.
jkimmel marked this conversation as resolved
jkimmel approved these changes 2022-01-04 15:13:02 +01:00
Owner

Reviewed-by: Johannes Kimmel <fff@bareminimum.eu>

`Reviewed-by: Johannes Kimmel <fff@bareminimum.eu>`
Author
Owner

Applied.

Applied.
fbl closed this pull request 2022-01-06 01:08:07 +01:00

Pull request closed

Sign in to join this conversation.
No description provided.