diff options
author | YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org> | 2007-12-06 18:43:30 -0500 |
---|---|---|
committer | YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org> | 2008-03-04 01:18:24 -0500 |
commit | 95e41e93e18d8e1e272ce23d96bae4f17ce11d42 (patch) | |
tree | c3b138bc03f3cb04396b3326b4fed13689b0366d /net/ipv6/ndisc.c | |
parent | 5e5f3f0f801321078c897a5de0b4b4304f234da0 (diff) |
[IPV6]: Make ndisc_flow_init() common for later use.
For later use, this patch is renaming ndisc_flow_init() to
icmpv6_flow_init() and putting it in common place.
Signed-off-by: YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>
Diffstat (limited to 'net/ipv6/ndisc.c')
-rw-r--r-- | net/ipv6/ndisc.c | 23 |
1 files changed, 4 insertions, 19 deletions
diff --git a/net/ipv6/ndisc.c b/net/ipv6/ndisc.c index 1fc33c8c7232..8db5f4a419aa 100644 --- a/net/ipv6/ndisc.c +++ b/net/ipv6/ndisc.c | |||
@@ -441,21 +441,6 @@ static void pndisc_destructor(struct pneigh_entry *n) | |||
441 | /* | 441 | /* |
442 | * Send a Neighbour Advertisement | 442 | * Send a Neighbour Advertisement |
443 | */ | 443 | */ |
444 | |||
445 | static inline void ndisc_flow_init(struct flowi *fl, u8 type, | ||
446 | struct in6_addr *saddr, struct in6_addr *daddr, | ||
447 | int oif) | ||
448 | { | ||
449 | memset(fl, 0, sizeof(*fl)); | ||
450 | ipv6_addr_copy(&fl->fl6_src, saddr); | ||
451 | ipv6_addr_copy(&fl->fl6_dst, daddr); | ||
452 | fl->proto = IPPROTO_ICMPV6; | ||
453 | fl->fl_icmp_type = type; | ||
454 | fl->fl_icmp_code = 0; | ||
455 | fl->oif = oif; | ||
456 | security_sk_classify_flow(ndisc_socket->sk, fl); | ||
457 | } | ||
458 | |||
459 | static void __ndisc_send(struct net_device *dev, | 444 | static void __ndisc_send(struct net_device *dev, |
460 | struct neighbour *neigh, | 445 | struct neighbour *neigh, |
461 | struct in6_addr *daddr, struct in6_addr *saddr, | 446 | struct in6_addr *daddr, struct in6_addr *saddr, |
@@ -474,8 +459,8 @@ static void __ndisc_send(struct net_device *dev, | |||
474 | 459 | ||
475 | type = icmp6h->icmp6_type; | 460 | type = icmp6h->icmp6_type; |
476 | 461 | ||
477 | ndisc_flow_init(&fl, type, saddr, daddr, | 462 | icmpv6_flow_init(ndisc_socket->sk, &fl, type, |
478 | dev->ifindex); | 463 | saddr, daddr, dev->ifindex); |
479 | 464 | ||
480 | dst = ndisc_dst_alloc(dev, neigh, daddr, ip6_output); | 465 | dst = ndisc_dst_alloc(dev, neigh, daddr, ip6_output); |
481 | if (!dst) | 466 | if (!dst) |
@@ -1439,8 +1424,8 @@ void ndisc_send_redirect(struct sk_buff *skb, struct neighbour *neigh, | |||
1439 | return; | 1424 | return; |
1440 | } | 1425 | } |
1441 | 1426 | ||
1442 | ndisc_flow_init(&fl, NDISC_REDIRECT, &saddr_buf, &ipv6_hdr(skb)->saddr, | 1427 | icmpv6_flow_init(ndisc_socket->sk, &fl, NDISC_REDIRECT, |
1443 | dev->ifindex); | 1428 | &saddr_buf, &ipv6_hdr(skb)->saddr, dev->ifindex); |
1444 | 1429 | ||
1445 | dst = ip6_route_output(NULL, &fl); | 1430 | dst = ip6_route_output(NULL, &fl); |
1446 | if (dst == NULL) | 1431 | if (dst == NULL) |