[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <4AB7BF47.2030404@hp.com>
Date: Mon, 21 Sep 2009 14:00:39 -0400
From: Brian Haley <brian.haley@...com>
To: Balazs Scheidler <bazsi@...abit.hu>
CC: netfilter-devel@...r.kernel.org, netdev@...r.kernel.org
Subject: Re: [PATCH 13/13] TProxy: use the interface primary IP address as
a default value for --on-ip
Balazs Scheidler wrote:
> #if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE)
> +
> +static inline const struct in6_addr *
> +tproxy_laddr6(struct sk_buff *skb, const struct in6_addr *user_laddr, const struct in6_addr *daddr)
> +{
> + struct inet6_dev *indev;
> + struct inet6_ifaddr *ifa;
> + struct in6_addr *laddr;
> +
> + if (!ipv6_addr_any(user_laddr))
> + return user_laddr;
> +
> + laddr = NULL;
> + rcu_read_lock();
> + indev = __in6_dev_get(skb->dev);
> + if (indev && (ifa = indev->addr_list)) {
> + laddr = &ifa->addr;
> + }
> + rcu_read_unlock();
> +
> + return laddr ? laddr : daddr;
> +}
You should call ipv6_dev_get_saddr() to get a source address based on the target
destination address.
-Brian
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists