Lines 58-64
Link Here
|
58 |
unsigned int preferred, unsigned int valid, void *vparam); |
58 |
unsigned int preferred, unsigned int valid, void *vparam); |
59 |
static int iface_search(struct in6_addr *local, int prefix, |
59 |
static int iface_search(struct in6_addr *local, int prefix, |
60 |
int scope, int if_index, int flags, |
60 |
int scope, int if_index, int flags, |
61 |
int prefered, int valid, void *vparam); |
61 |
unsigned int prefered, unsigned int valid, void *vparam); |
62 |
static int add_lla(int index, unsigned int type, char *mac, size_t maclen, void *parm); |
62 |
static int add_lla(int index, unsigned int type, char *mac, size_t maclen, void *parm); |
63 |
static void new_timeout(struct dhcp_context *context, char *iface_name, time_t now); |
63 |
static void new_timeout(struct dhcp_context *context, char *iface_name, time_t now); |
64 |
static unsigned int calc_lifetime(struct ra_interface *ra); |
64 |
static unsigned int calc_lifetime(struct ra_interface *ra); |
Lines 307-313
Link Here
|
307 |
|
307 |
|
308 |
/* If no link-local address then we can't advertise since source address of |
308 |
/* If no link-local address then we can't advertise since source address of |
309 |
advertisement must be link local address: RFC 4861 para 6.1.2. */ |
309 |
advertisement must be link local address: RFC 4861 para 6.1.2. */ |
310 |
if (!iface_enumerate(AF_INET6, &parm, add_prefixes) || |
310 |
if (!iface_enumerate(AF_INET6, &parm, (callback_t){.af_inet6=add_prefixes}) || |
311 |
parm.link_pref_time == 0) |
311 |
parm.link_pref_time == 0) |
312 |
return; |
312 |
return; |
313 |
|
313 |
|
Lines 449-455
Link Here
|
449 |
put_opt6_long(mtu); |
449 |
put_opt6_long(mtu); |
450 |
} |
450 |
} |
451 |
|
451 |
|
452 |
iface_enumerate(AF_LOCAL, &send_iface, add_lla); |
452 |
iface_enumerate(AF_LOCAL, &send_iface, (callback_t){.af_local=add_lla}); |
453 |
|
453 |
|
454 |
/* RDNSS, RFC 6106, use relevant DHCP6 options */ |
454 |
/* RDNSS, RFC 6106, use relevant DHCP6 options */ |
455 |
(void)option_filter(parm.tags, NULL, daemon->dhcp_opts6); |
455 |
(void)option_filter(parm.tags, NULL, daemon->dhcp_opts6); |
Lines 823-829
Link Here
|
823 |
param.iface = context->if_index; |
823 |
param.iface = context->if_index; |
824 |
new_timeout(context, param.name, now); |
824 |
new_timeout(context, param.name, now); |
825 |
} |
825 |
} |
826 |
else if (iface_enumerate(AF_INET6, ¶m, iface_search)) |
826 |
else if (iface_enumerate(AF_INET6, ¶m, (callback_t){.af_inet6=iface_search})) |
827 |
/* There's a context overdue, but we can't find an interface |
827 |
/* There's a context overdue, but we can't find an interface |
828 |
associated with it, because it's for a subnet we dont |
828 |
associated with it, because it's for a subnet we dont |
829 |
have an interface on. Probably we're doing DHCP on |
829 |
have an interface on. Probably we're doing DHCP on |
Lines 856-862
Link Here
|
856 |
aparam.iface = param.iface; |
856 |
aparam.iface = param.iface; |
857 |
aparam.alias_ifs = NULL; |
857 |
aparam.alias_ifs = NULL; |
858 |
aparam.num_alias_ifs = 0; |
858 |
aparam.num_alias_ifs = 0; |
859 |
iface_enumerate(AF_LOCAL, &aparam, send_ra_to_aliases); |
859 |
iface_enumerate(AF_LOCAL, &aparam, (callback_t){.af_local=send_ra_to_aliases}); |
860 |
my_syslog(MS_DHCP | LOG_INFO, "RTR-ADVERT(%s) %s => %d alias(es)", |
860 |
my_syslog(MS_DHCP | LOG_INFO, "RTR-ADVERT(%s) %s => %d alias(es)", |
861 |
param.name, daemon->addrbuff, aparam.num_alias_ifs); |
861 |
param.name, daemon->addrbuff, aparam.num_alias_ifs); |
862 |
|
862 |
|
Lines 871-877
Link Here
|
871 |
those. */ |
871 |
those. */ |
872 |
aparam.max_alias_ifs = aparam.num_alias_ifs; |
872 |
aparam.max_alias_ifs = aparam.num_alias_ifs; |
873 |
aparam.num_alias_ifs = 0; |
873 |
aparam.num_alias_ifs = 0; |
874 |
iface_enumerate(AF_LOCAL, &aparam, send_ra_to_aliases); |
874 |
iface_enumerate(AF_LOCAL, &aparam, (callback_t){.af_local=send_ra_to_aliases}); |
875 |
for (; aparam.num_alias_ifs; aparam.num_alias_ifs--) |
875 |
for (; aparam.num_alias_ifs; aparam.num_alias_ifs--) |
876 |
{ |
876 |
{ |
877 |
my_syslog(MS_DHCP | LOG_INFO, "RTR-ADVERT(%s) %s => i/f %d", |
877 |
my_syslog(MS_DHCP | LOG_INFO, "RTR-ADVERT(%s) %s => i/f %d", |
Lines 920-926
Link Here
|
920 |
|
920 |
|
921 |
static int iface_search(struct in6_addr *local, int prefix, |
921 |
static int iface_search(struct in6_addr *local, int prefix, |
922 |
int scope, int if_index, int flags, |
922 |
int scope, int if_index, int flags, |
923 |
int preferred, int valid, void *vparam) |
923 |
unsigned int preferred, unsigned int valid, void *vparam) |
924 |
{ |
924 |
{ |
925 |
struct search_param *param = vparam; |
925 |
struct search_param *param = vparam; |
926 |
struct dhcp_context *context; |
926 |
struct dhcp_context *context; |