Commit aef83fc
net: if: Allow selecting deprecated IPv6 address as src addr
This adjust the IPv6 source address selection so that it is possible
to select deprecated IPv6 address if no better preferred address is found.
From RFC 6724 chapter 5:
Rule 3: Avoid deprecated addresses.
If one of the two source addresses is "preferred" and one of them is
"deprecated" (in the RFC 4862 sense), then prefer the one that is
"preferred".
Rule 8: Use longest matching prefix.
If CommonPrefixLen(SA, D) > CommonPrefixLen(SB, D), then prefer SA.
Similarly, if CommonPrefixLen(SB, D) > CommonPrefixLen(SA, D), then
prefer SB.
So the fix allows deprecated address to be selected if it is a better
match than the preferred one. The reasoning here is that an address with
a longer matching prefix is generally considered topologically closer to
the destination. Using such a source address can lead to more efficient
routing, as it's more likely that the source and destination are within
the same network segment or a closely related one.
Signed-off-by: Jukka Rissanen <[email protected]>1 parent 1b7eae4 commit aef83fc
1 file changed
+33
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3085 | 3085 | | |
3086 | 3086 | | |
3087 | 3087 | | |
3088 | | - | |
3089 | | - | |
| 3088 | + | |
3090 | 3089 | | |
3091 | | - | |
| 3090 | + | |
| 3091 | + | |
| 3092 | + | |
| 3093 | + | |
3092 | 3094 | | |
3093 | 3095 | | |
3094 | 3096 | | |
| |||
3122 | 3124 | | |
3123 | 3125 | | |
3124 | 3126 | | |
| 3127 | + | |
3125 | 3128 | | |
3126 | 3129 | | |
3127 | 3130 | | |
| |||
3179 | 3182 | | |
3180 | 3183 | | |
3181 | 3184 | | |
| 3185 | + | |
| 3186 | + | |
| 3187 | + | |
| 3188 | + | |
| 3189 | + | |
| 3190 | + | |
| 3191 | + | |
| 3192 | + | |
| 3193 | + | |
| 3194 | + | |
| 3195 | + | |
| 3196 | + | |
| 3197 | + | |
| 3198 | + | |
| 3199 | + | |
| 3200 | + | |
| 3201 | + | |
| 3202 | + | |
| 3203 | + | |
3182 | 3204 | | |
3183 | 3205 | | |
3184 | 3206 | | |
| |||
3228 | 3250 | | |
3229 | 3251 | | |
3230 | 3252 | | |
| 3253 | + | |
| 3254 | + | |
| 3255 | + | |
| 3256 | + | |
| 3257 | + | |
| 3258 | + | |
| 3259 | + | |
| 3260 | + | |
3231 | 3261 | | |
3232 | 3262 | | |
3233 | 3263 | | |
| |||
0 commit comments