Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 89999
b: refs/heads/master
c: 95e41e9
h: refs/heads/master
i:
  89997: 1f618cc
  89995: 0347eca
  89991: f505c4b
  89983: d18b1fa
v: v3
  • Loading branch information
YOSHIFUJI Hideaki committed Mar 4, 2008
1 parent ef2725e commit b250759
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 20 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 5e5f3f0f801321078c897a5de0b4b4304f234da0
refs/heads/master: 95e41e93e18d8e1e272ce23d96bae4f17ce11d42
8 changes: 8 additions & 0 deletions trunk/include/linux/icmpv6.h
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,14 @@ extern int icmpv6_err_convert(int type, int code,
extern void icmpv6_cleanup(void);
extern void icmpv6_param_prob(struct sk_buff *skb,
int code, int pos);

struct flowi;
extern void icmpv6_flow_init(struct sock *sk,
struct flowi *fl,
u8 type,
const struct in6_addr *saddr,
const struct in6_addr *daddr,
int oif);
#endif

#endif
16 changes: 16 additions & 0 deletions trunk/net/ipv6/icmp.c
Original file line number Diff line number Diff line change
Expand Up @@ -777,6 +777,22 @@ static int icmpv6_rcv(struct sk_buff *skb)
return 0;
}

void icmpv6_flow_init(struct sock *sk, struct flowi *fl,
u8 type,
const struct in6_addr *saddr,
const struct in6_addr *daddr,
int oif)
{
memset(fl, 0, sizeof(*fl));
ipv6_addr_copy(&fl->fl6_src, saddr);
ipv6_addr_copy(&fl->fl6_dst, daddr);
fl->proto = IPPROTO_ICMPV6;
fl->fl_icmp_type = type;
fl->fl_icmp_code = 0;
fl->oif = oif;
security_sk_classify_flow(sk, fl);
}

/*
* Special lock-class for __icmpv6_sk:
*/
Expand Down
23 changes: 4 additions & 19 deletions trunk/net/ipv6/ndisc.c
Original file line number Diff line number Diff line change
Expand Up @@ -441,21 +441,6 @@ static void pndisc_destructor(struct pneigh_entry *n)
/*
* Send a Neighbour Advertisement
*/

static inline void ndisc_flow_init(struct flowi *fl, u8 type,
struct in6_addr *saddr, struct in6_addr *daddr,
int oif)
{
memset(fl, 0, sizeof(*fl));
ipv6_addr_copy(&fl->fl6_src, saddr);
ipv6_addr_copy(&fl->fl6_dst, daddr);
fl->proto = IPPROTO_ICMPV6;
fl->fl_icmp_type = type;
fl->fl_icmp_code = 0;
fl->oif = oif;
security_sk_classify_flow(ndisc_socket->sk, fl);
}

static void __ndisc_send(struct net_device *dev,
struct neighbour *neigh,
struct in6_addr *daddr, struct in6_addr *saddr,
Expand All @@ -474,8 +459,8 @@ static void __ndisc_send(struct net_device *dev,

type = icmp6h->icmp6_type;

ndisc_flow_init(&fl, type, saddr, daddr,
dev->ifindex);
icmpv6_flow_init(ndisc_socket->sk, &fl, type,
saddr, daddr, dev->ifindex);

dst = ndisc_dst_alloc(dev, neigh, daddr, ip6_output);
if (!dst)
Expand Down Expand Up @@ -1439,8 +1424,8 @@ void ndisc_send_redirect(struct sk_buff *skb, struct neighbour *neigh,
return;
}

ndisc_flow_init(&fl, NDISC_REDIRECT, &saddr_buf, &ipv6_hdr(skb)->saddr,
dev->ifindex);
icmpv6_flow_init(ndisc_socket->sk, &fl, NDISC_REDIRECT,
&saddr_buf, &ipv6_hdr(skb)->saddr, dev->ifindex);

dst = ip6_route_output(NULL, &fl);
if (dst == NULL)
Expand Down

0 comments on commit b250759

Please sign in to comment.