[prev in list] [next in list] [prev in thread] [next in thread] 

List:       zebra
Subject:    [zebra 1103] Re: bgpd linklocal peer selection broke global-address connection on KAME
From:       itojun () iijlab ! net
Date:       1999-07-30 5:26:36
[Download RAW message or body]


>I found the problem.  In lib/sockunion.c I use
> if (IN6_IS_ADDR_LINKLOCAL(&su.sin6.sin6_addr) && ifindex)
>   SET_IN6_LINKLOCAL_IFINDEX (su.sin6.sin6_addr, ifindex);
>macro without paren.  But SET_IN6_LINKLOCAL_IFINDEX expand to 
>#define SET_IN6_LINKLOCAL_IFINDEX(a, i) \
>  (a).s6_addr8[2] = ((i) >> 8) & 0xff; \
>  (a).s6_addr8[3] = (i) & 0xff
>So any situation, second statement executed...
>I think current CVS fixed the problem.  Would you mind to check it?

	I see.  I saw the fix but I suggest changing macro like this for more
	safety.

itojun


--

#define SET_IN6_LINKLOCAL_IFINDEX(a, i) \
  do { \
    (a).s6_addr8[2] = ((i) >> 8) & 0xff; \
    (a).s6_addr8[3] = (i) & 0xff; \
  } while (0)

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic