[PATCH 3/4] BGP: Add support for specifying interface names to allow peerings using link-local addresses

Matthias Schiffer mschiffer at universe-factory.net
Sat Dec 31 18:51:14 CET 2011


Okay, I'll fix that.

What about the neighbor.bound_iface field I introduced in my patch series? Should
I just allocate the interface name from the same slab the neighbor node itself is
allocated from, and free it before the neighbor is freed?

Matthias Schiffer


On 12/31/2011 02:13 PM, Martin Mares wrote:
> Hello!
> 
>> the limit to 15 characters for interface names is used all over bird
>> (look at 'struct iface' in nest/iface.h), as this is the limit imposed
>> by most Unix APIs, so I didn't see a reason not to use this limit.
> 
> Actually, it is not all over bird, but only in nest/iface.h (try grepping
> for '\[16]').
> 
> Using a hard-coded number (not even a named constant) for size of anything
> global is a mistake -- indeed, my own mistake somewhere in the distant past :)
> -- and I think we should get rid of it, not follow it in new code.
> 
>> Now that you mention bgp_reconfigure(), I see though that in my current
>> patch the comparision can behave strangely when a user has more than
>> one interface line in his BGP config, as the unused bytes of the interface string
>> are compared as well.
>>
>> I guess this isn't a big problem as such a config doesn't make sense, and the
>> comparison is still deterministic as the same bytes will be set in the interface
>> field for the same config. Still, it would be cleaner to zero out bgp_config.interface
>> before setting it. Comments?
> 
> I think that storing a pointer to the string gets rid of this problem nicely :)
> 
> 				Have a nice fortnight


-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 262 bytes
Desc: OpenPGP digital signature
URL: <http://trubka.network.cz/pipermail/bird-users/attachments/20111231/58df3218/attachment-0001.asc>


More information about the Bird-users mailing list