diff options
author | Kozlov Dmitry <xeb@mail.ru> | 2011-08-29 00:17:53 +0400 |
---|---|---|
committer | Kozlov Dmitry <xeb@mail.ru> | 2011-08-29 00:17:53 +0400 |
commit | f53638854c99e4b6b4b1c167c44fbb6dbfd0c6e7 (patch) | |
tree | cee88728fb81d74c1aec712cba785ee383829652 /accel-pppd/ppp | |
parent | 059b8b24df39591b96ef10dba735e9c2ad7e118c (diff) | |
download | accel-ppp-f53638854c99e4b6b4b1c167c44fbb6dbfd0c6e7.tar.gz accel-ppp-f53638854c99e4b6b4b1c167c44fbb6dbfd0c6e7.zip |
ipv6_dhcp: add routes to delegated prefixes
Diffstat (limited to 'accel-pppd/ppp')
-rw-r--r-- | accel-pppd/ppp/ipv6cp_opt_intfid.c | 6 | ||||
-rw-r--r-- | accel-pppd/ppp/ppp.c | 5 | ||||
-rw-r--r-- | accel-pppd/ppp/ppp.h | 1 | ||||
-rw-r--r-- | accel-pppd/ppp/ppp_ipv6cp.c | 3 |
4 files changed, 10 insertions, 5 deletions
diff --git a/accel-pppd/ppp/ipv6cp_opt_intfid.c b/accel-pppd/ppp/ipv6cp_opt_intfid.c index cc7ce364..389880a6 100644 --- a/accel-pppd/ppp/ipv6cp_opt_intfid.c +++ b/accel-pppd/ppp/ipv6cp_opt_intfid.c @@ -37,7 +37,6 @@ struct in6_ifreq { }; static int urandom_fd; -static int sock6_fd; static struct ipv6cp_option_t *ipaddr_init(struct ppp_ipv6cp_t *ipv6cp); static void ipaddr_free(struct ppp_ipv6cp_t *ipv6cp, struct ipv6cp_option_t *opt); @@ -372,11 +371,8 @@ static void load_config(void) static void init() { - sock6_fd = socket(AF_INET6, SOCK_DGRAM, 0); - if (!sock6_fd) { - log_warn("ppp:ipv6cp: kernel doesn't support ipv6\n"); + if (sock6_fd < 0) return; - } urandom_fd = open("/dev/urandom", O_RDONLY); diff --git a/accel-pppd/ppp/ppp.c b/accel-pppd/ppp/ppp.c index a0f65f1d..e6d97887 100644 --- a/accel-pppd/ppp/ppp.c +++ b/accel-pppd/ppp/ppp.c @@ -32,6 +32,7 @@ pthread_rwlock_t __export ppp_lock = PTHREAD_RWLOCK_INITIALIZER; __export LIST_HEAD(ppp_list); int __export sock_fd; +int __export sock6_fd; int __export ppp_shutdown; @@ -744,6 +745,10 @@ static void init(void) _exit(EXIT_FAILURE); } + sock6_fd = socket(AF_INET6, SOCK_DGRAM, 0); + if (sock6_fd < 0) + log_warn("ppp: kernel doesn't support ipv6\n"); + opt = conf_get_opt("ppp", "seq-file"); if (!opt) opt = "/var/run/accel-ppp/seq"; diff --git a/accel-pppd/ppp/ppp.h b/accel-pppd/ppp/ppp.h index 4d3fccd6..5246a3e0 100644 --- a/accel-pppd/ppp/ppp.h +++ b/accel-pppd/ppp/ppp.h @@ -200,4 +200,5 @@ extern struct list_head ppp_list; extern struct ppp_stat_t ppp_stat; extern int sock_fd; // internet socket for ioctls +extern int sock6_fd; // internet socket for ioctls #endif diff --git a/accel-pppd/ppp/ppp_ipv6cp.c b/accel-pppd/ppp/ppp_ipv6cp.c index 816abc42..d60575a8 100644 --- a/accel-pppd/ppp/ppp_ipv6cp.c +++ b/accel-pppd/ppp/ppp_ipv6cp.c @@ -811,6 +811,9 @@ static void load_config(void) static void ipv6cp_init(void) { + if (sock6_fd < 0) + return; + load_config(); triton_event_register_handler(EV_CONFIG_RELOAD, (triton_event_func)load_config); |