bird4 scope link

Amadeus Alfa amadeus at freehop.mooo.com
Thu Feb 26 18:46:42 CET 2015


Hi Ondrej,

thanks for clarification. Since we are using more than 1 interface the solution suggested will not work for us.

I have created a small patch that works for our problem, but of course does not apply to others:

--- lib/ipv4.h	2014-04-01 11:24:10.000000000 +0200
+++ lib/ipv4.h	2015-02-26 18:13:10.741542610 +0100
@@ -74,8 +74,12 @@
 u32 ipv4_class_mask(u32);
 byte *ipv4_skip_header(byte *, int *);

-static inline int ipv4_has_link_scope(u32 a UNUSED)
+static inline int ipv4_has_link_scope(u32 a)
 {
+  if (((a >> 24) & 0xFF) == 169 && ((a >> 16) & 0xFF) == 254) {
+    return 1;
+  }
+
   return 0;
 }

Best wishes,
Amadeus


> On 23 Feb 2015, at 21:09, Ondrej Zajicek <santiago at crfreenet.org> wrote:
> 
> On Mon, Feb 23, 2015 at 08:34:39PM +0100, Amadeus Alfa wrote:
>> Hello list,
>> 
>> I have checked the implementation again and it seems ‘ipv4_has_link_scope()’ is not implemented:
> 
> Hi
> 
> IPv4 link-local addresses are not supported in BIRD because AFAIK
> there are no real link-local addresses in IPv4. There is reserved range
> (169.254.0.0/16), but in the sockets API, these addresses are handled as
> any other IPv4 addresses (compared to IPv6 link-local addresses, where
> you may and also must specify interface as scope).
> 
> If you have one interface, just don't use the interface name. We
> currently do not handle well having the same IPv4 address range on
> multiple interfaces, but when this will be fixed, it would work in the
> same way for 169.254.0.0/16 and any other IPv4 prefix.
> 
> Note that it is not a good idea to have completely numeric interface name,
> it will be parsed as number and would not work even with IPv6 address
> in BIRD. That can be fixed by using '' (as in your original post).
> 
> -- 
> Elen sila lumenn' omentielvo
> 
> Ondrej 'Santiago' Zajicek (email: santiago at crfreenet.org)
> OpenPGP encrypted e-mails preferred (KeyID 0x11DEADC3, wwwkeys.pgp.net)
> "To err is human -- to blame it on a computer is even more so."




More information about the Bird-users mailing list