diff options
author | YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org> | 2007-12-07 00:43:30 +0100 |
---|---|---|
committer | YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org> | 2008-03-04 07:18:24 +0100 |
commit | 95e41e93e18d8e1e272ce23d96bae4f17ce11d42 (patch) | |
tree | c3b138bc03f3cb04396b3326b4fed13689b0366d /net/ipv6/icmp.c | |
parent | [IPV6] ADDRCONF: Convert ipv6_get_saddr() to ipv6_dev_get_saddr(). (diff) | |
download | linux-95e41e93e18d8e1e272ce23d96bae4f17ce11d42.tar.xz linux-95e41e93e18d8e1e272ce23d96bae4f17ce11d42.zip |
[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/icmp.c')
-rw-r--r-- | net/ipv6/icmp.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/net/ipv6/icmp.c b/net/ipv6/icmp.c index 12c0b85d6c46..cff74127ea32 100644 --- a/net/ipv6/icmp.c +++ b/net/ipv6/icmp.c @@ -777,6 +777,22 @@ drop_no_count: 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: */ |