Release 4.11 net/ipv6/xfrm6_output.c
/*
* xfrm6_output.c - Common IPsec encapsulation code for IPv6.
* Copyright (C) 2002 USAGI/WIDE Project
* Copyright (c) 2004 Herbert Xu <herbert@gondor.apana.org.au>
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
*/
#include <linux/if_ether.h>
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/skbuff.h>
#include <linux/icmpv6.h>
#include <linux/netfilter_ipv6.h>
#include <net/dst.h>
#include <net/ipv6.h>
#include <net/ip6_route.h>
#include <net/xfrm.h>
int xfrm6_find_1stfragopt(struct xfrm_state *x, struct sk_buff *skb,
u8 **prevhdr)
{
return ip6_find_1stfragopt(skb, prevhdr);
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Masahide Nakamura | 28 | 100.00% | 1 | 100.00% |
Total | 28 | 100.00% | 1 | 100.00% |
EXPORT_SYMBOL(xfrm6_find_1stfragopt);
static int xfrm6_local_dontfrag(struct sk_buff *skb)
{
int proto;
struct sock *sk = skb->sk;
if (sk) {
if (sk->sk_family != AF_INET6)
return 0;
proto = sk->sk_protocol;
if (proto == IPPROTO_UDP || proto == IPPROTO_RAW)
return inet6_sk(sk)->dontfrag;
}
return 0;
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Steffen Klassert | 56 | 83.58% | 1 | 50.00% |
Hannes Frederic Sowa | 11 | 16.42% | 1 | 50.00% |
Total | 67 | 100.00% | 2 | 100.00% |
static void xfrm6_local_rxpmtu(struct sk_buff *skb, u32 mtu)
{
struct flowi6 fl6;
struct sock *sk = skb->sk;
fl6.flowi6_oif = sk->sk_bound_dev_if;
fl6.daddr = ipv6_hdr(skb)->daddr;
ipv6_local_rxpmtu(sk, &fl6, mtu);
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Steffen Klassert | 55 | 98.21% | 1 | 50.00% |
Alexey Dobriyan | 1 | 1.79% | 1 | 50.00% |
Total | 56 | 100.00% | 2 | 100.00% |
void xfrm6_local_error(struct sk_buff *skb, u32 mtu)
{
struct flowi6 fl6;
const struct ipv6hdr *hdr;
struct sock *sk = skb->sk;
hdr = skb->encapsulation ? inner_ipv6_hdr(skb) : ipv6_hdr(skb);
fl6.fl6_dport = inet_sk(sk)->inet_dport;
fl6.daddr = hdr->daddr;
ipv6_local_error(sk, EMSGSIZE, &fl6, mtu);
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Steffen Klassert | 55 | 69.62% | 1 | 33.33% |
Hannes Frederic Sowa | 23 | 29.11% | 1 | 33.33% |
Alexey Dobriyan | 1 | 1.27% | 1 | 33.33% |
Total | 79 | 100.00% | 3 | 100.00% |
static int xfrm6_tunnel_check_size(struct sk_buff *skb)
{
int mtu, ret = 0;
struct dst_entry *dst = skb_dst(skb);
mtu = dst_mtu(dst);
if (mtu < IPV6_MIN_MTU)
mtu = IPV6_MIN_MTU;
if (!skb->ignore_df && skb->len > mtu) {
skb->dev = dst->dev;
skb->protocol = htons(ETH_P_IPV6);
if (xfrm6_local_dontfrag(skb))
xfrm6_local_rxpmtu(skb, mtu);
else if (skb->sk)
xfrm_local_error(skb, mtu);
else
icmpv6_send(skb, ICMPV6_PKT_TOOBIG, 0, mtu);
ret = -EMSGSIZE;
}
return ret;
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Herbert Xu | 83 | 66.40% | 4 | 44.44% |
Steffen Klassert | 37 | 29.60% | 2 | 22.22% |
Eric Dumazet | 3 | 2.40% | 1 | 11.11% |
Hannes Frederic Sowa | 1 | 0.80% | 1 | 11.11% |
Américo Wang | 1 | 0.80% | 1 | 11.11% |
Total | 125 | 100.00% | 9 | 100.00% |
int xfrm6_extract_output(struct xfrm_state *x, struct sk_buff *skb)
{
int err;
err = xfrm6_tunnel_check_size(skb);
if (err)
return err;
XFRM_MODE_SKB_CB(skb)->protocol = ipv6_hdr(skb)->nexthdr;
return xfrm6_extract_header(skb);
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Herbert Xu | 52 | 100.00% | 5 | 100.00% |
Total | 52 | 100.00% | 5 | 100.00% |
int xfrm6_prepare_output(struct xfrm_state *x, struct sk_buff *skb)
{
int err;
err = xfrm_inner_extract_output(x, skb);
if (err)
return err;
skb->ignore_df = 1;
skb->protocol = htons(ETH_P_IPV6);
return x->outer_mode->output2(x, skb);
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Herbert Xu | 45 | 73.77% | 4 | 50.00% |
Steffen Klassert | 14 | 22.95% | 2 | 25.00% |
Américo Wang | 1 | 1.64% | 1 | 12.50% |
Kazunori Miyazawa | 1 | 1.64% | 1 | 12.50% |
Total | 61 | 100.00% | 8 | 100.00% |
EXPORT_SYMBOL(xfrm6_prepare_output);
int xfrm6_output_finish(struct sock *sk, struct sk_buff *skb)
{
memset(IP6CB(skb), 0, sizeof(*IP6CB(skb)));
#ifdef CONFIG_NETFILTER
IP6CB(skb)->flags |= IP6SKB_XFRM_TRANSFORMED;
#endif
return xfrm_output(sk, skb);
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Steffen Klassert | 28 | 50.00% | 1 | 16.67% |
Herbert Xu | 16 | 28.57% | 3 | 50.00% |
David S. Miller | 7 | 12.50% | 1 | 16.67% |
Patrick McHardy | 5 | 8.93% | 1 | 16.67% |
Total | 56 | 100.00% | 6 | 100.00% |
static int __xfrm6_output_finish(struct net *net, struct sock *sk, struct sk_buff *skb)
{
struct xfrm_state *x = skb_dst(skb)->xfrm;
return x->outer_mode->afinfo->output_finish(sk, skb);
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Eric W. Biedermann | 47 | 100.00% | 1 | 100.00% |
Total | 47 | 100.00% | 1 | 100.00% |
static int __xfrm6_output(struct net *net, struct sock *sk, struct sk_buff *skb)
{
struct dst_entry *dst = skb_dst(skb);
struct xfrm_state *x = dst->xfrm;
int mtu;
bool toobig;
#ifdef CONFIG_NETFILTER
if (!x) {
IP6CB(skb)->flags |= IP6SKB_REROUTED;
return dst_output(net, sk, skb);
}
#endif
if (x->props.mode != XFRM_MODE_TUNNEL)
goto skip_frag;
if (skb->protocol == htons(ETH_P_IPV6))
mtu = ip6_skb_dst_mtu(skb);
else
mtu = dst_mtu(skb_dst(skb));
toobig = skb->len > mtu && !skb_is_gso(skb);
if (toobig && xfrm6_local_dontfrag(skb)) {
xfrm6_local_rxpmtu(skb, mtu);
return -EMSGSIZE;
} else if (!skb->ignore_df && toobig && skb->sk) {
xfrm_local_error(skb, mtu);
return -EMSGSIZE;
}
if (toobig || dst_allfrag(skb_dst(skb)))
return ip6_fragment(net, sk, skb,
__xfrm6_output_finish);
skip_frag:
return x->outer_mode->afinfo->output_finish(sk, skb);
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Steffen Klassert | 86 | 38.74% | 3 | 21.43% |
David L Stevens | 53 | 23.87% | 1 | 7.14% |
Herbert Xu | 32 | 14.41% | 1 | 7.14% |
Hannes Frederic Sowa | 28 | 12.61% | 3 | 21.43% |
David S. Miller | 11 | 4.95% | 1 | 7.14% |
Eric W. Biedermann | 11 | 4.95% | 4 | 28.57% |
Américo Wang | 1 | 0.45% | 1 | 7.14% |
Total | 222 | 100.00% | 14 | 100.00% |
int xfrm6_output(struct net *net, struct sock *sk, struct sk_buff *skb)
{
return NF_HOOK_COND(NFPROTO_IPV6, NF_INET_POST_ROUTING,
net, sk, skb, NULL, skb_dst(skb)->dev,
__xfrm6_output,
!(IP6CB(skb)->flags & IP6SKB_REROUTED));
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Patrick McHardy | 25 | 43.86% | 2 | 20.00% |
Steffen Klassert | 13 | 22.81% | 1 | 10.00% |
Eric Dumazet | 8 | 14.04% | 2 | 20.00% |
Eric W. Biedermann | 7 | 12.28% | 2 | 20.00% |
David S. Miller | 2 | 3.51% | 1 | 10.00% |
Jan Engelhardt | 1 | 1.75% | 1 | 10.00% |
David L Stevens | 1 | 1.75% | 1 | 10.00% |
Total | 57 | 100.00% | 10 | 100.00% |
Overall Contributors
Person | Tokens | Prop | Commits | CommitProp |
Steffen Klassert | 344 | 38.61% | 6 | 13.33% |
Herbert Xu | 255 | 28.62% | 15 | 33.33% |
Eric W. Biedermann | 65 | 7.30% | 6 | 13.33% |
Hannes Frederic Sowa | 63 | 7.07% | 4 | 8.89% |
David L Stevens | 57 | 6.40% | 1 | 2.22% |
Patrick McHardy | 35 | 3.93% | 3 | 6.67% |
Masahide Nakamura | 28 | 3.14% | 1 | 2.22% |
David S. Miller | 20 | 2.24% | 1 | 2.22% |
Eric Dumazet | 11 | 1.23% | 2 | 4.44% |
Hideaki Yoshifuji / 吉藤英明 | 6 | 0.67% | 2 | 4.44% |
Américo Wang | 3 | 0.34% | 1 | 2.22% |
Alexey Dobriyan | 2 | 0.22% | 1 | 2.22% |
Jan Engelhardt | 1 | 0.11% | 1 | 2.22% |
Kazunori Miyazawa | 1 | 0.11% | 1 | 2.22% |
Total | 891 | 100.00% | 45 | 100.00% |
Information contained on this website is for historical information purposes only and does not indicate or represent copyright ownership.