mirror of
https://gitlab.labs.nic.cz/labs/bird.git
synced 2024-05-11 16:54:54 +00:00
Implements support for link-local addresses in BGP.
Thanks Matthias Schiffer for the original patch.
This commit is contained in:
18
lib/printf.c
18
lib/printf.c
@@ -12,6 +12,8 @@
|
||||
|
||||
#include <errno.h>
|
||||
|
||||
#include "nest/iface.h"
|
||||
|
||||
/* we use this so that we can do without the ctype library */
|
||||
#define is_digit(c) ((c) >= '0' && (c) <= '9')
|
||||
|
||||
@@ -138,6 +140,7 @@ int bvsnprintf(char *buf, int size, const char *fmt, va_list args)
|
||||
char *str, *start;
|
||||
const char *s;
|
||||
char ipbuf[STD_ADDRESS_P_LENGTH+1];
|
||||
struct iface *iface;
|
||||
|
||||
int flags; /* flags to number() */
|
||||
|
||||
@@ -279,6 +282,21 @@ int bvsnprintf(char *buf, int size, const char *fmt, va_list args)
|
||||
s = ipbuf;
|
||||
goto str;
|
||||
|
||||
/* Interface scope after link-local IP address */
|
||||
case 'J':
|
||||
iface = va_arg(args, struct iface *);
|
||||
if (!iface)
|
||||
continue;
|
||||
if (!size)
|
||||
return -1;
|
||||
|
||||
*str++ = '%';
|
||||
start++;
|
||||
size--;
|
||||
|
||||
s = iface->name;
|
||||
goto str;
|
||||
|
||||
/* Router/Network ID - essentially IPv4 address in u32 value */
|
||||
case 'R':
|
||||
x = va_arg(args, u32);
|
||||
|
Reference in New Issue
Block a user