[Xorp-hackers] gre tunnel problem

Pavlin Radoslavov pavlin at ICSI.Berkeley.EDU
Thu Feb 21 12:14:52 PST 2008


>     I still have problem.
>     Thus gre interface have 2 addresses one is public ip and
>     another is tunnel ip, when enable igmp or pim on gre
>     interface, sometimes it register the public ip causing erro
>     "Address already in use". I found that vif store ip addresses
>     in a map which is not ordered (the first item is not the one
>     inserted first).

What is the output of "ip addr" Linux command and "show interfaces"
xorpsh command?
I am a bit surprised that the gre interface itself lists the public
IP address as one of its own addresses.

Also, what your "interfaces" section looks like?
If you are using the "default-system-config" statement,
you can try to explicitly configure/specify the tunnel IP address
for the GRE interface.

Regards,
Pavlin


>     in ./fea/data_plane/io/io_ip_socket.cc
> 
>     case AF_INET:
>     {
>         struct ip_mreq mreq;
>         struct in_addr in_addr;
> 
>         // Find the first address
>         IfTreeVif::IPv4Map::const_iterator ai = vifp->ipv4addrs().begin();
>         if (ai == vifp->ipv4addrs().end()) {
>             error_msg = c_format("Cannot join group %s on interface %s vif %s: "
>                                  "interface/vif has no address",
>                                  cstring(group),
>                                  if_name.c_str(),
>                                  vif_name.c_str());
>             return (XORP_ERROR);
>         }
>         const IfTreeAddr4& fa = ai->second;
> 
>         fa.addr().copy_out(in_addr);
>         group.copy_out(mreq.imr_multiaddr);
>         mreq.imr_interface.s_addr = in_addr.s_addr;
> 
>         if (setsockopt(_proto_socket_in, IPPROTO_IP, IP_ADD_MEMBERSHIP,
>                        XORP_SOCKOPT_CAST(&mreq), sizeof(mreq)) < 0) {
>             error_msg = c_format("Cannot join group %s on interface %s vif %s: %s",
>                                  cstring(group),
>                                  if_name.c_str(),
>                                  vif_name.c_str(),
>                                  strerror(errno));
>             return (XORP_ERROR);
>         }
>     }
>     break;
> 
>     Here primary ip address should be used, but sometimes the first one in IPv4Map isn't the primary ip. I don't know how to fix this problem. Maybe a lot of changes should be taken.
> 
> 
> > Zealot <zealot0630 at gmail.com> wrote:
> > 
> >> Hi, all:
> >>     Xorp seems can not get ip address from p2p interface. There is a patch to fix this.
> >>     It may cause some other problem, but at least it works
> > 
> > Yes, this is a bug, and your solution appears correct.
> > Applied in CVS:
> > xorp/fea/data_plane/ifconfig/ifconfig_parse_netlink_socket.cc
> > rev. 1.16
> > 
> > BTW, what program and command did you use to create the p2p tunnel
> > and to trigger the problem? This piece of information could be
> > useful for future testing of the p2p cases.
> > 
> > Thanks,
> > Pavlin
> > 
> >> --- xorp-1.5~cvs.20080128.orig/fea/data_plane/ifconfig/ifconfig_parse_netlink_socket.cc
> >> +++ xorp-1.5~cvs.20080128/fea/data_plane/ifconfig/ifconfig_parse_netlink_socket.cc
> >> @@ -688,7 +688,7 @@
> >>      if (vifp->point_to_point()) {
> >>         if ((rta_array[IFA_ADDRESS] != NULL) && !is_ifa_address_reassigned) {
> >>             if (rta_array[IFA_ADDRESS] != NULL) {
> >> -               if (nlm_decode_ipvx_address(family, rta_array[IFA_BROADCAST],
> >> +               if (nlm_decode_ipvx_address(family, rta_array[IFA_ADDRESS],
> >>                                             peer_addr, has_peer_addr,
> >>                                             error_msg)
> >>                     != XORP_OK) {
> >>
> >> _______________________________________________
> >> Xorp-hackers mailing list
> >> Xorp-hackers at icir.org
> >> http://mailman.ICSI.Berkeley.EDU/mailman/listinfo/xorp-hackers
> 
> _______________________________________________
> Xorp-hackers mailing list
> Xorp-hackers at icir.org
> http://mailman.ICSI.Berkeley.EDU/mailman/listinfo/xorp-hackers



More information about the Xorp-hackers mailing list