Help re. ip6_route_add

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

I'm trying to configure a host based route in my module.

I imitated some code I saw elsewhere in the module that
I'm modifying, but when I type "ip -6 route" the route is
not there (and ethereal shows no event for the message I
am expecting). Can someone take a look and see if there are
any obvious errors? I've debugged the module and I know
that it executes this code.

Any packets bound for ptr->mn should go out the
interface that has the address ptr->fa.

-------------------------------------
static __inline__ void local_add_mn_route(struct fa_entry *ptr) {
  struct in6_rtmsg rtmsg;
  struct inet6_ifaddr *addr;

  addr = ipv6_get_ifaddr( &(ptr->fa), NULL);

  memset(&rtmsg, 0, sizeof(struct rtmsg));
  ipv6_addr_copy(&rtmsg.rtmsg_dst, &(ptr->mn));
  rtmsg.rtmsg_des_len = 128;
  ipv6_addr_copy(&rtmsg.rtmsg_src, &(prt->fa) );
  rtmsg.rtmsg_src_len = 128;
  rtmsg.rtmsg_metric = IP6_RT_PRIO_MIPV6;
  rtmsg.rtmsg_ifindex = addr->idev->dev->ifindex;
  rtmsg.rtmsg_info = 0xffffffff;
  rtmsg.rtmsg_flags = RTF_UP | RTF_EXPIRES;
  rtmsg.rtmsg_type = RTMSG_NEWROUTE;

  ip6_route_add(&rtmsg);
}

Thanx,
Bryan

-
: send the line "unsubscribe linux-net" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Netdev]     [Ethernet Bridging]     [Linux 802.1Q VLAN]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Git]     [Bugtraq]     [Yosemite News and Information]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux PCI]     [Linux Admin]     [Samba]

  Powered by Linux