能工作时候的状况如下,
Breakpoint 4, ns3::NetlinkSocket::DoRouteMessage (this=0x7fffec02d920, nlmsg=..., type=24, family=2 '\002') at ../netlink/netlink-socket.cc:1186 1186 RouteMessage rtmsg = nlmsg.GetRouteMessage (); (gdb) bt #0 ns3::NetlinkSocket::DoRouteMessage (this=0x7fffec02d920, nlmsg=..., type=24, family=2 '\002') at ../netlink/netlink-socket.cc:1186 #1 0x00007ffff7694046 in ns3::NetlinkSocket::DoNetlinkRouteMessage (this=0x7fffec02d920, nlmsg=..., type=24, family=2 '\002') at ../netlink/netlink-socket.cc:727 #2 0x00007ffff7693882 in ns3::NetlinkSocket::HandleNetlinkRouteMessage (this=0x7fffec02d920, nlmsg=...) at ../netlink/netlink-socket.cc:664 #3 0x00007ffff76932ee in ns3::NetlinkSocket::HandleMessage (this=0x7fffec02d920, nlmsg=...) at ../netlink/netlink-socket.cc:612 #4 0x00007ffff76914c2 in ns3::NetlinkSocket::SendTo (this=0x7fffec02d920, p=..., flags=0, toAddress=...) at ../netlink/netlink-socket.cc:443 #5 0x00007ffff7a4d008 in ns3::UnixDatagramSocketFd::MainSendTo (this=0x7fffec02da70, r=0x7ffff726514c, p=..., f=0, ad=...) at ../model/unix-datagram-socket-fd.cc:510 #6 0x00007ffff7a4d99b in ns3::EventImpl* ns3::MakeEvent<void (ns3::UnixDatagramSocketFd::*)(int*, ns3::Ptr<ns3::Packet>, unsigned int, ns3::Address), ns3::UnixDatagramSocketFd*, int*, ns3::Ptr<ns3::Packet>, int, ns3::Address>(void (ns3::UnixDatagramSocketFd::*)(int*, ns3::Ptr<ns3::Packet>, unsigned int, ns3::Address), ns3::UnixDatagramSocketFd*, int*, ns3::Ptr<ns3::Packet>, int, ns3::Address)::EventMemberImpl4::Notify() (this=0x7fffec0308b0) at /home/z/old/dce/build/include/ns3.23/ns3/make-event.h:452 #7 0x00007ffff73465e7 in ns3::EventImpl::Invoke (this=0x7fffec0308b0) at ../src/core/model/event-impl.cc:51 #8 0x00007ffff7a927b2 in ns3::TaskManager::Schedule (this=0x76ac90) at ../model/task-manager.cc:441 #9 0x00007ffff7a947a5 in ns3::EventImpl* ns3::MakeEvent<void (ns3::TaskManager::*)(), ns3::TaskManager*>(void (ns3::TaskManager::*)(), ns3::TaskManager*)::EventMemberImpl0::Notify() (this=0x6ffc40) at /home/z/old/dce/build/include/ns3.23/ns3/make-event.h:323 #10 0x00007ffff73465e7 in ns3::EventImpl::Invoke (this=0x6ffc40) at ../src/core/model/event-impl.cc:51 #11 0x00007ffff734b2ac in ns3::DefaultSimulatorImpl::ProcessOneEvent (this=0x6b5f10) at ../src/core/model/default-simulator-impl.cc:147 #12 0x00007ffff734b638 in ns3::DefaultSimulatorImpl::Run (this=0x6b5f10) at ../src/core/model/default-simulator-impl.cc:200 #13 0x00007ffff7347378 in ns3::Simulator::Run () at ../src/core/model/simulator.cc:204 #14 0x0000000000427f65 in main (argc=5, argv=0x7fffffffdb88) at ../myscripts/ns-3-dce-quagga/example/dce-zebra-simple.cc:824 (gdb)
消息来自于
Breakpoint 5, netlink_route_multipath (cmd=24, p=0x7ffff0758e58, rib=0x7ffff0758cd8, family=2) at rt_netlink.c:1660 1660 struct nexthop *nexthop = NULL, *tnexthop; (gdb) bt #0 netlink_route_multipath (cmd=24, p=0x7ffff0758e58, rib=0x7ffff0758cd8, family=2) at rt_netlink.c:1660 #1 0x00007ffff0a04af5 in kernel_add_ipv4 (p=0x7ffff0758e58, rib=0x7ffff0758cd8) at rt_netlink.c:1837 #2 0x00007ffff09e8bd7 in rib_install_kernel (rn=0x7ffff0758e58, rib=0x7ffff0758cd8) at zebra_rib.c:1227 #3 0x00007ffff09e9624 in rib_process (rn=0x7ffff0758e58) at zebra_rib.c:1544 #4 0x00007ffff09e9773 in process_subq (subq=0x7ffff09b9438, qindex=2 '\002') at zebra_rib.c:1581 #5 0x00007ffff09e9807 in meta_queue_process (dummy=0x7ffff09b9298, data=0x7ffff09b9378) at zebra_rib.c:1610 #6 0x00007ffff0a31f3b in work_queue_run (thread=0x7ffff7269b00) at workqueue.c:293 #7 0x00007ffff0a183dd in thread_call (thread=0x7ffff7269b00) at thread.c:1252 #8 0x00007ffff09e25e5 in main (argc=5, argv=0x6ffef0) at main.c:410 #9 0x00007ffff7a0708f in ns3::DceManager::DoStartProcess (context=0x821010) at ../model/dce-manager.cc:283 #10 0x00007ffff7a907fc in ns3::TaskManager::Trampoline (context=0x6d5130) at ../model/task-manager.cc:274 #11 0x00007ffff7a8c7d7 in ns3::PthreadFiberManager::Run (arg=0x821300) at ../model/pthread-fiber-manager.cc:402 #12 0x000000318b2079d1 in start_thread () from /lib64/libpthread.so.0 #13 0x000000318a6e88fd in clone () from /lib64/libc.so.6 (gdb)
Breakpoint 7, rib_queue_add (zebra=0x7ffff0c6b720 <zebrad>, rn=0x7fffd3e6a708) at zebra_rib.c:1673 1673 assert (zebra && rn); (gdb) bt #0 rib_queue_add (zebra=0x7ffff0c6b720 <zebrad>, rn=0x7fffd3e6a708) at zebra_rib.c:1673 #1 0x00007ffff09e9e33 in rib_link (rn=0x7fffd3e6a708, rib=0x7fffd3e6a588) at zebra_rib.c:1831 #2 0x00007ffff09e9ec4 in rib_addnode (rn=0x7fffd3e6a708, rib=0x7fffd3e6a588) at zebra_rib.c:1848 #3 0x00007ffff09eab0a in rib_add_ipv4_multipath (p=0x7ffff074f890, rib=0x7fffd3e6a588, safi=1 '\001') at zebra_rib.c:2209 #4 0x00007ffff09e0364 in zread_ipv4_add (client=0x7ffff06abcf8, length=23) at zserv.c:893 #5 0x00007ffff09e1455 in zebra_client_read (thread=0x7ffff074fb00) at zserv.c:1409 #6 0x00007ffff0a183dd in thread_call (thread=0x7ffff074fb00) at thread.c:1252 #7 0x00007ffff09e25e5 in main (argc=5, argv=0x70ecd0) at main.c:410 #8 0x00007ffff7a0708f in ns3::DceManager::DoStartProcess (context=0x821b30) at ../model/dce-manager.cc:283 #9 0x00007ffff7a907fc in ns3::TaskManager::Trampoline (context=0x821d10) at ../model/task-manager.cc:274 #10 0x00007ffff7a8c7d7 in ns3::PthreadFiberManager::Run (arg=0x821eb0) at ../model/pthread-fiber-manager.cc:402 #11 0x000000318b2079d1 in start_thread () from /lib64/libpthread.so.0 #12 0x000000318a6e88fd in clone () from /lib64/libc.so.6 (gdb)
zapi_ipv4_route(ZEBRA_IPV4_ROUTE_ADD, zclient, p, &api);
扔给kernel的路由信息
Breakpoint 2, netlink_route_multipath (cmd=24, p=0x7ffff0758c58, rib=0x7ffff0758ad8, family=2) at rt_netlink.c:1660 1660 struct nexthop *nexthop = NULL, *tnexthop; (gdb) bt #0 netlink_route_multipath (cmd=24, p=0x7ffff0758c58, rib=0x7ffff0758ad8, family=2) at rt_netlink.c:1660 #1 0x00007ffff0a04af5 in kernel_add_ipv4 (p=0x7ffff0758c58, rib=0x7ffff0758ad8) at rt_netlink.c:1837 #2 0x00007ffff09e8bd7 in rib_install_kernel (rn=0x7ffff0758c58, rib=0x7ffff0758ad8) at zebra_rib.c:1227 #3 0x00007ffff09e9624 in rib_process (rn=0x7ffff0758c58) at zebra_rib.c:1544 #4 0x00007ffff09e9773 in process_subq (subq=0x7ffff09b9438, qindex=2 '\002') at zebra_rib.c:1581 #5 0x00007ffff09e9807 in meta_queue_process (dummy=0x7ffff09b9298, data=0x7ffff09b9378) at zebra_rib.c:1610 #6 0x00007ffff0a31f3b in work_queue_run (thread=0x7ffff7269b00) at workqueue.c:293 #7 0x00007ffff0a183dd in thread_call (thread=0x7ffff7269b00) at thread.c:1252 #8 0x00007ffff09e25e5 in main (argc=5, argv=0x6ffef0) at main.c:410 #9 0x00007ffff7a0708f in ns3::DceManager::DoStartProcess (context=0x821010) at ../model/dce-manager.cc:283 #10 0x00007ffff7a907fc in ns3::TaskManager::Trampoline (context=0x6d5130) at ../model/task-manager.cc:274 #11 0x00007ffff7a8c7d7 in ns3::PthreadFiberManager::Run (arg=0x821300) at ../model/pthread-fiber-manager.cc:402 #12 0x000000318b2079d1 in start_thread () from /lib64/libpthread.so.0 #13 0x000000318a6e88fd in clone () from /lib64/libc.so.6 (gdb)
现在不能工作。