- 论坛徽章:
- 0
|
- linux 2.6.0 ipsec-tools-0.2.2. 版本是老了点,呵呵;不过正常运行; 但是当我把racoon源代码改了下,重新编译安装,第一阶段交换过程中却出现了段错误:
-
- 输出的调试信息:
- [root@localhost racoon]# env LD_LIBRARY_PATH=/usr/local/lib racoon -d -F -f /us
- : r/local/etc/racoon/racoon.conf
- : Foreground mode.
- : 2005-09-12 10:33:14: INFO: main.c:174:main(): @(#)racoon 20001216 20001216 sakan
- : e@kame.net
- : 2005-09-12 10:33:14: INFO: main.c:175:main(): @(#)This product linked OpenSSL
- 0.
- : 9.7a Feb 19 2003 (http://www.openssl.org/)
- : 2005-09-12 10:33:14: DEBUG: pfkey.c:370:pfkey_init(): call pfkey_send_register f
- : or AH
- : 2005-09-12 10:33:14: DEBUG: pfkey.c:370:pfkey_init(): call pfkey_send_register f
- : or ESP
- : 2005-09-12 10:33:14: DEBUG: pfkey.c:370:pfkey_init(): call pfkey_send_register f
- : or IPCOMP
- : ..........................
- ....................................
- 2005-09-12 10:40:25: DEBUG: ipsec_doi.c:247:get_ph1approval(): an acceptable proposal found.
- : ident_i2recv
- : 2005-09-12 10:40:25: DEBUG: isakmp.c:628:ph1_main(): ===
- : 2005-09-12 10:40:25: DEBUG: oakley.c:256:oakley_dh_generate(): compute DH's private.
- : 2005-09-12 10:40:25: DEBUG: plog.c:193:plogdump():
- : 79a07688 b3197d6d d938168e ed09b67e e6f1c465 11bd6122 e1e7078e e619c0c8
- : 6ea9a52d a01ded16 684516d3 d46ee0ee 2f3670c8 4d644a4d 419644b2 618f5f87
- : be987185 f47f81b9 41819fd3 cdea98c5 4b607f9f 293008ef 52cff7d4 548371ca
- : 2d21021f 41301b08 45dc7cce a28044d5 349596d7 e6d7b9bc e9027b69 6e0aa592
- : 2005-09-12 10:40:25: DEBUG: oakley.c:258:oakley_dh_generate(): compute DH's public.
- : 2005-09-12 10:40:25: DEBUG: plog.c:193:plogdump():
- : 2d73defa 9494e7e4 52d5aa4d f2c50e34 656fd601 d57f84d2 492c2af0 c1d46c90
- : 42a6a0f0 4f5f55a1 4309703d 5c40fe87 5192a19c 5025570b cdb1a9ef 222b411b
- : 82deac43 73277356 88d5cd5d 7108df6f f1680923 b3d18e0b f31811dd 9a23b37e
- : d91df4cb 61e59db6 19bc551b 810df926 af4c19c9 8fb1db53 5c5646fc 8280bead
- : 段错误
复制代码
利用printf函数定位,后调试信息如下:
- root@localhost racoon]# env LD_LIBRARY_PATH=/usr/local/lib racoon -d -F -f /usr/local/etc/racoon/racoon.conf
- Foreground mode.
-
- ...................
- ...................
-
- next is by yvonne
-
- begin getpskbyaddr function
- begin getpsk funtion
-
- read cunchun
-
- end getpsk
-
- 段错误;
复制代码
经我改动的出错代码如下:
- #iffdef CYH
- printf("\nnext is by yvonne\n");
- #endif
- /* by yvonne */
- if(iph1->;side==INITIATOR&&iph1->;approval->;authmethod==OAKLEY_ATTR_AUTH_METHOD_PSKEY&&iph1->;etype == ISAKMP_ETYPE_IDENT)
- {
- //取psk,给hpsk赋值
- #ifdef CYH
- printf("\nbegin getpskbyaddr function");
- #endif
-
- if(NULL==(hpsk=getpskbyaddr(iph1->;remote)))//原函数在下面
- printf("\nhpsk is NULL\n");
-
- #ifdef CYH
- printf("\nend getpskbyaddr, begin eay_md5_one function");
- #endif
- .......
- ......
- }
复制代码
- vchar_t *
- getpskbyaddr(remote)
- struct sockaddr *remote;
- {
- vchar_t *key = NULL;
- char addr[NI_MAXHOST], port[NI_MAXSERV];
-
- GETNAMEINFO(remote, addr, port);
- #ifdef CYH
- printf("\n begin getpsk funtion\n");
- #endif
- key = getpsk(addr, strlen(addr));
- #ifdef CYH
- if(NULL==key)printf("\n key is NULL\n");
- printf("\n end getpsk\n");
- #endif
- return key;
- }
复制代码 |
|