Skip to content

Commit

Permalink
ipv6: Convert to use flowi6 where applicable.
Browse files Browse the repository at this point in the history
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
David S. Miller committed Mar 12, 2011
1 parent 9cce96d commit 4c9483b
Show file tree
Hide file tree
Showing 35 changed files with 632 additions and 630 deletions.
18 changes: 9 additions & 9 deletions drivers/infiniband/core/addr.c
Original file line number Diff line number Diff line change
Expand Up @@ -231,28 +231,28 @@ static int addr6_resolve(struct sockaddr_in6 *src_in,
struct sockaddr_in6 *dst_in,
struct rdma_dev_addr *addr)
{
struct flowi fl;
struct flowi6 fl6;
struct neighbour *neigh;
struct dst_entry *dst;
int ret;

memset(&fl, 0, sizeof fl);
ipv6_addr_copy(&fl.fl6_dst, &dst_in->sin6_addr);
ipv6_addr_copy(&fl.fl6_src, &src_in->sin6_addr);
fl.flowi_oif = addr->bound_dev_if;
memset(&fl6, 0, sizeof fl6);
ipv6_addr_copy(&fl6.daddr, &dst_in->sin6_addr);
ipv6_addr_copy(&fl6.saddr, &src_in->sin6_addr);
fl6.flowi6_oif = addr->bound_dev_if;

dst = ip6_route_output(&init_net, NULL, &fl);
dst = ip6_route_output(&init_net, NULL, &fl6);
if ((ret = dst->error))
goto put;

if (ipv6_addr_any(&fl.fl6_src)) {
if (ipv6_addr_any(&fl6.saddr)) {
ret = ipv6_dev_get_saddr(&init_net, ip6_dst_idev(dst)->dev,
&fl.fl6_dst, 0, &fl.fl6_src);
&fl6.daddr, 0, &fl6.saddr);
if (ret)
goto put;

src_in->sin6_family = AF_INET6;
ipv6_addr_copy(&src_in->sin6_addr, &fl.fl6_src);
ipv6_addr_copy(&src_in->sin6_addr, &fl6.saddr);
}

if (dst->dev->flags & IFF_LOOPBACK) {
Expand Down
12 changes: 6 additions & 6 deletions drivers/net/cnic.c
Original file line number Diff line number Diff line change
Expand Up @@ -3424,14 +3424,14 @@ static int cnic_get_v6_route(struct sockaddr_in6 *dst_addr,
struct dst_entry **dst)
{
#if defined(CONFIG_IPV6) || (defined(CONFIG_IPV6_MODULE) && defined(MODULE))
struct flowi fl;
struct flowi6 fl6;

memset(&fl, 0, sizeof(fl));
ipv6_addr_copy(&fl.fl6_dst, &dst_addr->sin6_addr);
if (ipv6_addr_type(&fl.fl6_dst) & IPV6_ADDR_LINKLOCAL)
fl.flowi_oif = dst_addr->sin6_scope_id;
memset(&fl6, 0, sizeof(fl6));
ipv6_addr_copy(&fl6.daddr, &dst_addr->sin6_addr);
if (ipv6_addr_type(&fl6.daddr) & IPV6_ADDR_LINKLOCAL)
fl6.flowi6_oif = dst_addr->sin6_scope_id;

*dst = ip6_route_output(&init_net, NULL, &fl);
*dst = ip6_route_output(&init_net, NULL, &fl6);
if (*dst)
return 0;
#endif
Expand Down
4 changes: 2 additions & 2 deletions include/linux/icmpv6.h
Original file line number Diff line number Diff line change
Expand Up @@ -183,10 +183,10 @@ extern void icmpv6_cleanup(void);
extern void icmpv6_param_prob(struct sk_buff *skb,
u8 code, int pos);

struct flowi;
struct flowi6;
struct in6_addr;
extern void icmpv6_flow_init(struct sock *sk,
struct flowi *fl,
struct flowi6 *fl6,
u8 type,
const struct in6_addr *saddr,
const struct in6_addr *daddr,
Expand Down
4 changes: 2 additions & 2 deletions include/net/ip6_fib.h
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ struct fib6_table {

typedef struct rt6_info *(*pol_lookup_t)(struct net *,
struct fib6_table *,
struct flowi *, int);
struct flowi6 *, int);

/*
* exported functions
Expand All @@ -192,7 +192,7 @@ typedef struct rt6_info *(*pol_lookup_t)(struct net *,
extern struct fib6_table *fib6_get_table(struct net *net, u32 id);
extern struct fib6_table *fib6_new_table(struct net *net, u32 id);
extern struct dst_entry *fib6_rule_lookup(struct net *net,
struct flowi *fl, int flags,
struct flowi6 *fl6, int flags,
pol_lookup_t lookup);

extern struct fib6_node *fib6_lookup(struct fib6_node *root,
Expand Down
2 changes: 1 addition & 1 deletion include/net/ip6_route.h
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ extern void ip6_route_input(struct sk_buff *skb);

extern struct dst_entry * ip6_route_output(struct net *net,
struct sock *sk,
struct flowi *fl);
struct flowi6 *fl6);

extern int ip6_route_init(void);
extern void ip6_route_cleanup(void);
Expand Down
16 changes: 8 additions & 8 deletions include/net/ipv6.h
Original file line number Diff line number Diff line change
Expand Up @@ -492,7 +492,7 @@ extern int ip6_rcv_finish(struct sk_buff *skb);
*/
extern int ip6_xmit(struct sock *sk,
struct sk_buff *skb,
struct flowi *fl,
struct flowi6 *fl6,
struct ipv6_txoptions *opt);

extern int ip6_nd_hdr(struct sock *sk,
Expand All @@ -512,7 +512,7 @@ extern int ip6_append_data(struct sock *sk,
int hlimit,
int tclass,
struct ipv6_txoptions *opt,
struct flowi *fl,
struct flowi6 *fl6,
struct rt6_info *rt,
unsigned int flags,
int dontfrag);
Expand All @@ -523,13 +523,13 @@ extern void ip6_flush_pending_frames(struct sock *sk);

extern int ip6_dst_lookup(struct sock *sk,
struct dst_entry **dst,
struct flowi *fl);
struct flowi6 *fl6);
extern struct dst_entry * ip6_dst_lookup_flow(struct sock *sk,
struct flowi *fl,
struct flowi6 *fl6,
const struct in6_addr *final_dst,
bool can_sleep);
extern struct dst_entry * ip6_sk_dst_lookup_flow(struct sock *sk,
struct flowi *fl,
struct flowi6 *fl6,
const struct in6_addr *final_dst,
bool can_sleep);
extern struct dst_entry * ip6_blackhole_route(struct net *net,
Expand Down Expand Up @@ -566,7 +566,7 @@ extern int ipv6_ext_hdr(u8 nexthdr);

extern int ipv6_find_tlv(struct sk_buff *skb, int offset, int type);

extern struct in6_addr *fl6_update_dst(struct flowi *fl,
extern struct in6_addr *fl6_update_dst(struct flowi6 *fl6,
const struct ipv6_txoptions *opt,
struct in6_addr *orig);

Expand Down Expand Up @@ -600,8 +600,8 @@ extern int ipv6_recv_error(struct sock *sk, struct msghdr *msg, int len);
extern int ipv6_recv_rxpmtu(struct sock *sk, struct msghdr *msg, int len);
extern void ipv6_icmp_error(struct sock *sk, struct sk_buff *skb, int err, __be16 port,
u32 info, u8 *payload);
extern void ipv6_local_error(struct sock *sk, int err, struct flowi *fl, u32 info);
extern void ipv6_local_rxpmtu(struct sock *sk, struct flowi *fl, u32 mtu);
extern void ipv6_local_error(struct sock *sk, int err, struct flowi6 *fl6, u32 info);
extern void ipv6_local_rxpmtu(struct sock *sk, struct flowi6 *fl6, u32 mtu);

extern int inet6_release(struct socket *sock);
extern int inet6_bind(struct socket *sock, struct sockaddr *uaddr,
Expand Down
4 changes: 2 additions & 2 deletions include/net/transp_v6.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ extern struct proto udpv6_prot;
extern struct proto udplitev6_prot;
extern struct proto tcpv6_prot;

struct flowi;
struct flowi6;

/* extention headers */
extern int ipv6_exthdrs_init(void);
Expand Down Expand Up @@ -42,7 +42,7 @@ extern int datagram_recv_ctl(struct sock *sk,

extern int datagram_send_ctl(struct net *net,
struct msghdr *msg,
struct flowi *fl,
struct flowi6 *fl6,
struct ipv6_txoptions *opt,
int *hlimit, int *tclass,
int *dontfrag);
Expand Down
Loading

0 comments on commit 4c9483b

Please sign in to comment.