截止目前为止,还能够正常使用wide-dhcp6c。 原因,暂时找不到原因在哪里。 只有通过打印日志来看。 一直怀疑是配置文件出错了,但是也没看到过一个可以使用的配置文件,dhcp6c.conf. 都是example等等,附加e文和缩写。 虽然看过,也是很粗糙的理解其意思。
先修改一下cftoken.l,将yywrap在cfdebug_print函数之前补上,这样make clean ,再make的时候,就不用再生成的cftoken.c 里面加了。
int yywrap()
{
return 1;
}
static void
cfdebug_print(w, t, l)
char *w, *t;
int l;
{
if (w) {
dprintf(LOG_DEBUG, FNAME,
"<%d>%s [%s] (%d)", yy_start, w, t, l);
} else {
dprintf(LOG_DEBUG, FNAME,
"<%d>[%s] (%d)", yy_start, t, l);
}
}
另外将YYDEBUG这个宏打开,设置为1。 同时将全局变量yydebug 也在最开始的地方赋值为1. 这样就可以看到过程中哪里分析错误了。
root@vc0718t-evm:/usrfs# ./dhcp6c -c ./dhcp6c.conf -Df eth0
Jan/01/2000 06:11:10: get_duid: extracted an existing DUID from /usr/share/dhcp6c_duid: 00:01:00:01:00:00:3a:35:00:16:8e:a7:8c:f6
Jan/01/2000 06:11:10: dhcp6_ctl_authinit: failed to open /usr/share/dhcp6cctlkey: No such file or directory
Jan/01/2000 06:11:10: client6_init: failed initialize control message authentication282
Jan/01/2000 06:11:10: client6_init: skip opening control port375
5
should !
Starting parse
no should !
Entering state 0
Reducing stack by rule 1 (line 149):
-> $$ = nterm statements ()
Stack now 0
Entering state 1
Reading a token: Next token is token INTERFACE ()
Shifting token INTERFACE ()
Entering state 3
Reading a token: Next token is token IFNAME ()
Shifting token IFNAME ()
Entering state 20
Reading a token: Next token is token BCL ()
Shifting token BCL ()
Entering state 40
Reducing