Release 4.11 net/ipv4/ip_output.c
/*
* INET An implementation of the TCP/IP protocol suite for the LINUX
* operating system. INET is implemented using the BSD Socket
* interface as the means of communication with the user level.
*
* The Internet Protocol (IP) output module.
*
* Authors: Ross Biro
* Fred N. van Kempen, <waltje@uWalt.NL.Mugnet.ORG>
* Donald Becker, <becker@super.org>
* Alan Cox, <Alan.Cox@linux.org>
* Richard Underwood
* Stefan Becker, <stefanb@yello.ping.de>
* Jorge Cwik, <jorge@laser.satlink.net>
* Arnt Gulbrandsen, <agulbra@nvg.unit.no>
* Hirokazu Takahashi, <taka@valinux.co.jp>
*
* See ip_input.c for original log
*
* Fixes:
* Alan Cox : Missing nonblock feature in ip_build_xmit.
* Mike Kilburn : htons() missing in ip_build_xmit.
* Bradford Johnson: Fix faulty handling of some frames when
* no route is found.
* Alexander Demenshin: Missing sk/skb free in ip_queue_xmit
* (in case if packet not accepted by
* output firewall rules)
* Mike McLagan : Routing by source
* Alexey Kuznetsov: use new route cache
* Andi Kleen: Fix broken PMTU recovery and remove
* some redundant tests.
* Vitaly E. Lavrov : Transparent proxy revived after year coma.
* Andi Kleen : Replace ip_reply with ip_send_reply.
* Andi Kleen : Split fast and slow ip_build_xmit path
* for decreased register pressure on x86
* and more readibility.
* Marc Boucher : When call_out_firewall returns FW_QUEUE,
* silently drop skb instead of failing with -EPERM.
* Detlev Wengorz : Copy protocol for fragments.
* Hirokazu Takahashi: HW checksumming for outgoing UDP
* datagrams.
* Hirokazu Takahashi: sendfile() on UDP works now.
*/
#include <linux/uaccess.h>
#include <linux/module.h>
#include <linux/types.h>
#include <linux/kernel.h>
#include <linux/mm.h>
#include <linux/string.h>
#include <linux/errno.h>
#include <linux/highmem.h>
#include <linux/slab.h>
#include <linux/socket.h>
#include <linux/sockios.h>
#include <linux/in.h>
#include <linux/inet.h>
#include <linux/netdevice.h>
#include <linux/etherdevice.h>
#include <linux/proc_fs.h>
#include <linux/stat.h>
#include <linux/init.h>
#include <net/snmp.h>
#include <net/ip.h>
#include <net/protocol.h>
#include <net/route.h>
#include <net/xfrm.h>
#include <linux/skbuff.h>
#include <net/sock.h>
#include <net/arp.h>
#include <net/icmp.h>
#include <net/checksum.h>
#include <net/inetpeer.h>
#include <net/lwtunnel.h>
#include <linux/bpf-cgroup.h>
#include <linux/igmp.h>
#include <linux/netfilter_ipv4.h>
#include <linux/netfilter_bridge.h>
#include <linux/netlink.h>
#include <linux/tcp.h>
static int
ip_fragment(struct net *net, struct sock *sk, struct sk_buff *skb,
unsigned int mtu,
int (*output)(struct net *, struct sock *, struct sk_buff *));
/* Generate a checksum for an outgoing IP datagram. */
void ip_send_check(struct iphdr *iph)
{
iph->check = 0;
iph->check = ip_fast_csum((unsigned char *)iph, iph->ihl);
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Linus Torvalds (pre-git) | 34 | 100.00% | 1 | 100.00% |
Total | 34 | 100.00% | 1 | 100.00% |
EXPORT_SYMBOL(ip_send_check);
int __ip_local_out(struct net *net, struct sock *sk, struct sk_buff *skb)
{
struct iphdr *iph = ip_hdr(skb);
iph->tot_len = htons(skb->len);
ip_send_check(iph);
/* if egress device is enslaved to an L3 master device pass the
* skb to its handler for processing
*/
skb = l3mdev_ip_out(sk, skb);
if (unlikely(!skb))
return 0;
skb->protocol = htons(ETH_P_IP);
return nf_hook(NFPROTO_IPV4, NF_INET_LOCAL_OUT,
net, sk, skb, NULL, skb_dst(skb)->dev,
dst_output);
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Herbert Xu | 47 | 46.53% | 1 | 9.09% |
David Ahern | 21 | 20.79% | 1 | 9.09% |
David S. Miller | 10 | 9.90% | 1 | 9.09% |
Eli Cooper | 9 | 8.91% | 1 | 9.09% |
Eric W. Biedermann | 9 | 8.91% | 4 | 36.36% |
Eric Dumazet | 3 | 2.97% | 1 | 9.09% |
Jan Engelhardt | 1 | 0.99% | 1 | 9.09% |
Patrick McHardy | 1 | 0.99% | 1 | 9.09% |
Total | 101 | 100.00% | 11 | 100.00% |
int ip_local_out(struct net *net, struct sock *sk, struct sk_buff *skb)
{
int err;
err = __ip_local_out(net, sk, skb);
if (likely(err == 1))
err = dst_output(net, sk, skb);
return err;
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Herbert Xu | 36 | 63.16% | 1 | 11.11% |
Eric W. Biedermann | 14 | 24.56% | 7 | 77.78% |
Eric Dumazet | 7 | 12.28% | 1 | 11.11% |
Total | 57 | 100.00% | 9 | 100.00% |
EXPORT_SYMBOL_GPL(ip_local_out);
static inline int ip_select_ttl(struct inet_sock *inet, struct dst_entry *dst)
{
int ttl = inet->uc_ttl;
if (ttl < 0)
ttl = ip4_dst_hoplimit(dst);
return ttl;
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
David S. Miller | 39 | 97.50% | 2 | 66.67% |
Arnaldo Carvalho de Melo | 1 | 2.50% | 1 | 33.33% |
Total | 40 | 100.00% | 3 | 100.00% |
/*
* Add an ip header to a skbuff and send it out.
*
*/
int ip_build_and_send_pkt(struct sk_buff *skb, const struct sock *sk,
__be32 saddr, __be32 daddr, struct ip_options_rcu *opt)
{
struct inet_sock *inet = inet_sk(sk);
struct rtable *rt = skb_rtable(skb);
struct net *net = sock_net(sk);
struct iphdr *iph;
/* Build the IP header. */
skb_push(skb, sizeof(struct iphdr) + (opt ? opt->opt.optlen : 0));
skb_reset_network_header(skb);
iph = ip_hdr(skb);
iph->version = 4;
iph->ihl = 5;
iph->tos = inet->tos;
iph->ttl = ip_select_ttl(inet, &rt->dst);
iph->daddr = (opt && opt->opt.srr ? opt->opt.faddr : daddr);
iph->saddr = saddr;
iph->protocol = sk->sk_protocol;
if (ip_dont_fragment(sk, &rt->dst)) {
iph->frag_off = htons(IP_DF);
iph->id = 0;
} else {
iph->frag_off = 0;
__ip_select_ident(net, iph, 1);
}
if (opt && opt->opt.optlen) {
iph->ihl += opt->opt.optlen>>2;
ip_options_build(skb, &opt->opt, daddr, rt, 0);
}
skb->priority = sk->sk_priority;
skb->mark = sk->sk_mark;
/* Send it out. */
return ip_local_out(net, skb->sk, skb);
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Linus Torvalds (pre-git) | 141 | 49.65% | 10 | 35.71% |
Eric Dumazet | 55 | 19.37% | 3 | 10.71% |
David S. Miller | 35 | 12.32% | 3 | 10.71% |
Arnaldo Carvalho de Melo | 17 | 5.99% | 4 | 14.29% |
Eric W. Biedermann | 17 | 5.99% | 3 | 10.71% |
Tóth László Attila | 8 | 2.82% | 1 | 3.57% |
Alexey Kuznetsov | 7 | 2.46% | 1 | 3.57% |
Al Viro | 2 | 0.70% | 1 | 3.57% |
Herbert Xu | 1 | 0.35% | 1 | 3.57% |
Hannes Frederic Sowa | 1 | 0.35% | 1 | 3.57% |
Total | 284 | 100.00% | 28 | 100.00% |
EXPORT_SYMBOL_GPL(ip_build_and_send_pkt);
static int ip_finish_output2(struct net *net, struct sock *sk, struct sk_buff *skb)
{
struct dst_entry *dst = skb_dst(skb);
struct rtable *rt = (struct rtable *)dst;
struct net_device *dev = dst->dev;
unsigned int hh_len = LL_RESERVED_SPACE(dev);
struct neighbour *neigh;
u32 nexthop;
if (rt->rt_type == RTN_MULTICAST) {
IP_UPD_PO_STATS(net, IPSTATS_MIB_OUTMCAST, skb->len);
} else if (rt->rt_type == RTN_BROADCAST)
IP_UPD_PO_STATS(net, IPSTATS_MIB_OUTBCAST, skb->len);
/* Be paranoid, rather than too clever. */
if (unlikely(skb_headroom(skb) < hh_len && dev->header_ops)) {
struct sk_buff *skb2;
skb2 = skb_realloc_headroom(skb, LL_RESERVED_SPACE(dev));
if (!skb2) {
kfree_skb(skb);
return -ENOMEM;
}
if (skb->sk)
skb_set_owner_w(skb2, skb->sk);
consume_skb(skb);
skb = skb2;
}
if (lwtunnel_xmit_redirect(dst->lwtstate)) {
int res = lwtunnel_xmit(skb);
if (res < 0 || res == LWTUNNEL_XMIT_DONE)
return res;
}
rcu_read_lock_bh();
nexthop = (__force u32) rt_nexthop(rt, ip_hdr(skb)->daddr);
neigh = __ipv4_neigh_lookup_noref(dev, nexthop);
if (unlikely(!neigh))
neigh = __neigh_create(&arp_tbl, &nexthop, dev, false);
if (!IS_ERR(neigh)) {
int res;
sock_confirm_neigh(skb, neigh);
res = neigh_output(neigh, skb);
rcu_read_unlock_bh();
return res;
}
rcu_read_unlock_bh();
net_dbg_ratelimited("%s: No header cache and no neighbour!\n",
__func__);
kfree_skb(skb);
return -EINVAL;
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Alexey Kuznetsov | 89 | 27.38% | 2 | 7.14% |
David S. Miller | 62 | 19.08% | 6 | 21.43% |
Linus Torvalds (pre-git) | 37 | 11.38% | 3 | 10.71% |
Mitsuru Chinen | 35 | 10.77% | 1 | 3.57% |
Roopa Prabhu | 32 | 9.85% | 1 | 3.57% |
Julian Anastasov | 20 | 6.15% | 3 | 10.71% |
Eric Dumazet | 16 | 4.92% | 3 | 10.71% |
Neil Horman | 14 | 4.31% | 1 | 3.57% |
Eric W. Biedermann | 7 | 2.15% | 2 | 7.14% |
Vasiliy Kulikov | 4 | 1.23% | 1 | 3.57% |
Joe Perches | 4 | 1.23% | 1 | 3.57% |
Pavel Emelyanov | 2 | 0.62% | 1 | 3.57% |
Chuck Lever | 1 | 0.31% | 1 | 3.57% |
Ian Morris | 1 | 0.31% | 1 | 3.57% |
Stephen Hemminger | 1 | 0.31% | 1 | 3.57% |
Total | 325 | 100.00% | 28 | 100.00% |
static int ip_finish_output_gso(struct net *net, struct sock *sk,
struct sk_buff *skb, unsigned int mtu)
{
netdev_features_t features;
struct sk_buff *segs;
int ret = 0;
/* common case: seglen is <= mtu
*/
if (skb_gso_validate_mtu(skb, mtu))
return ip_finish_output2(net, sk, skb);
/* Slowpath - GSO segment length exceeds the egress MTU.
*
* This can happen in several cases:
* - Forwarding of a TCP GRO skb, when DF flag is not set.
* - Forwarding of an skb that arrived on a virtualization interface
* (virtio-net/vhost/tap) with TSO/GSO size set by other network
* stack.
* - Local GSO skb transmitted on an NETIF_F_TSO tunnel stacked over an
* interface with a smaller MTU.
* - Arriving GRO skb (or GSO skb in a virtualized environment) that is
* bridged to a NETIF_F_TSO tunnel stacked over an interface with an
* insufficent MTU.
*/
features = netif_skb_features(skb);
BUILD_BUG_ON(sizeof(*IPCB(skb)) > SKB_SGO_CB_OFFSET);
segs = skb_gso_segment(skb, features & ~NETIF_F_GSO_MASK);
if (IS_ERR_OR_NULL(segs)) {
kfree_skb(skb);
return -ENOMEM;
}
consume_skb(skb);
do {
struct sk_buff *nskb = segs->next;
int err;
segs->next = NULL;
err = ip_fragment(net, sk, segs, mtu, ip_finish_output2);
if (err && ret == 0)
ret = err;
segs = nskb;
} while (segs);
return ret;
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Florian Westphal | 138 | 78.86% | 3 | 33.33% |
Konstantin Khlebnikov | 14 | 8.00% | 1 | 11.11% |
David S. Miller | 9 | 5.14% | 1 | 11.11% |
Eric W. Biedermann | 9 | 5.14% | 1 | 11.11% |
Marcelo Ricardo Leitner | 3 | 1.71% | 1 | 11.11% |
Lance Richardson | 2 | 1.14% | 2 | 22.22% |
Total | 175 | 100.00% | 9 | 100.00% |
static int ip_finish_output(struct net *net, struct sock *sk, struct sk_buff *skb)
{
unsigned int mtu;
int ret;
ret = BPF_CGROUP_RUN_PROG_INET_EGRESS(sk, skb);
if (ret) {
kfree_skb(skb);
return ret;
}
#if defined(CONFIG_NETFILTER) && defined(CONFIG_XFRM)
/* Policy lookup after SNAT yielded a new policy */
if (skb_dst(skb)->xfrm) {
IPCB(skb)->flags |= IPSKB_REROUTED;
return dst_output(net, sk, skb);
}
#endif
mtu = ip_skb_dst_mtu(sk, skb);
if (skb_is_gso(skb))
return ip_finish_output_gso(net, sk, skb, mtu);
if (skb->len > mtu || (IPCB(skb)->flags & IPSKB_FRAG_PMTU))
return ip_fragment(net, sk, skb, mtu, ip_finish_output2);
return ip_finish_output2(net, sk, skb);
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Patrick McHardy | 48 | 28.92% | 3 | 17.65% |
Florian Westphal | 40 | 24.10% | 3 | 17.65% |
Daniel Mack | 26 | 15.66% | 1 | 5.88% |
Linus Torvalds (pre-git) | 19 | 11.45% | 2 | 11.76% |
Eric W. Biedermann | 14 | 8.43% | 4 | 23.53% |
David S. Miller | 13 | 7.83% | 1 | 5.88% |
Eric Dumazet | 3 | 1.81% | 1 | 5.88% |
Shmulik Ladkani | 2 | 1.20% | 1 | 5.88% |
Adrian Bunk | 1 | 0.60% | 1 | 5.88% |
Total | 166 | 100.00% | 17 | 100.00% |
static int ip_mc_finish_output(struct net *net, struct sock *sk,
struct sk_buff *skb)
{
int ret;
ret = BPF_CGROUP_RUN_PROG_INET_EGRESS(sk, skb);
if (ret) {
kfree_skb(skb);
return ret;
}
return dev_loopback_xmit(net, sk, skb);
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Daniel Mack | 57 | 100.00% | 1 | 100.00% |
Total | 57 | 100.00% | 1 | 100.00% |
int ip_mc_output(struct net *net, struct sock *sk, struct sk_buff *skb)
{
struct rtable *rt = skb_rtable(skb);
struct net_device *dev = rt->dst.dev;
/*
* If the indicated interface is up and running, send the packet.
*/
IP_UPD_PO_STATS(net, IPSTATS_MIB_OUT, skb->len);
skb->dev = dev;
skb->protocol = htons(ETH_P_IP);
/*
* Multicasts are looped back for other local users
*/
if (rt->rt_flags&RTCF_MULTICAST) {
if (sk_mc_loop(sk)
#ifdef CONFIG_IP_MROUTE
/* Small optimization: do not loopback not local frames,
which returned after forwarding; they will be dropped
by ip_mr_input in any case.
Note, that local frames are looped back to be delivered
to local recipients.
This check is duplicated in ip_mr_input at the moment.
*/
&&
((rt->rt_flags & RTCF_LOCAL) ||
!(IPCB(skb)->flags & IPSKB_FORWARDED))
#endif
) {
struct sk_buff *newskb = skb_clone(skb, GFP_ATOMIC);
if (newskb)
NF_HOOK(NFPROTO_IPV4, NF_INET_POST_ROUTING,
net, sk, newskb, NULL, newskb->dev,
ip_mc_finish_output);
}
/* Multicasts with ttl 0 must not go beyond the host */
if (ip_hdr(skb)->ttl == 0) {
kfree_skb(skb);
return 0;
}
}
if (rt->rt_flags&RTCF_BROADCAST) {
struct sk_buff *newskb = skb_clone(skb, GFP_ATOMIC);
if (newskb)
NF_HOOK(NFPROTO_IPV4, NF_INET_POST_ROUTING,
net, sk, newskb, NULL, newskb->dev,
ip_mc_finish_output);
}
return NF_HOOK_COND(NFPROTO_IPV4, NF_INET_POST_ROUTING,
net, sk, skb, NULL, skb->dev,
ip_finish_output,
!(IPCB(skb)->flags & IPSKB_REROUTED));
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Linus Torvalds (pre-git) | 172 | 67.19% | 9 | 31.03% |
Patrick McHardy | 24 | 9.38% | 3 | 10.34% |
Eric W. Biedermann | 15 | 5.86% | 3 | 10.34% |
Eric Dumazet | 8 | 3.12% | 2 | 6.90% |
David S. Miller | 8 | 3.12% | 2 | 6.90% |
Linus Torvalds | 8 | 3.12% | 1 | 3.45% |
Neil Horman | 5 | 1.95% | 1 | 3.45% |
Alexey Kuznetsov | 4 | 1.56% | 1 | 3.45% |
Arnaldo Carvalho de Melo | 3 | 1.17% | 1 | 3.45% |
Jan Engelhardt | 3 | 1.17% | 1 | 3.45% |
Daniel Mack | 2 | 0.78% | 1 | 3.45% |
Pavel Emelyanov | 1 | 0.39% | 1 | 3.45% |
Herbert Xu | 1 | 0.39% | 1 | 3.45% |
Octavian Purdila | 1 | 0.39% | 1 | 3.45% |
Hideaki Yoshifuji / 吉藤英明 | 1 | 0.39% | 1 | 3.45% |
Total | 256 | 100.00% | 29 | 100.00% |
int ip_output(struct net *net, struct sock *sk, struct sk_buff *skb)
{
struct net_device *dev = skb_dst(skb)->dev;
IP_UPD_PO_STATS(net, IPSTATS_MIB_OUT, skb->len);
skb->dev = dev;
skb->protocol = htons(ETH_P_IP);
return NF_HOOK_COND(NFPROTO_IPV4, NF_INET_POST_ROUTING,
net, sk, skb, NULL, dev,
ip_finish_output,
!(IPCB(skb)->flags & IPSKB_REROUTED));
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Patrick McHardy | 38 | 42.22% | 3 | 16.67% |
Linus Torvalds (pre-git) | 15 | 16.67% | 3 | 16.67% |
Eric W. Biedermann | 10 | 11.11% | 3 | 16.67% |
Eric Dumazet | 8 | 8.89% | 2 | 11.11% |
Alexey Kuznetsov | 7 | 7.78% | 1 | 5.56% |
Neil Horman | 5 | 5.56% | 1 | 5.56% |
David S. Miller | 2 | 2.22% | 1 | 5.56% |
Ananda Raju | 2 | 2.22% | 1 | 5.56% |
Herbert Xu | 1 | 1.11% | 1 | 5.56% |
Pavel Emelyanov | 1 | 1.11% | 1 | 5.56% |
Jan Engelhardt | 1 | 1.11% | 1 | 5.56% |
Total | 90 | 100.00% | 18 | 100.00% |
/*
* copy saddr and daddr, possibly using 64bit load/stores
* Equivalent to :
* iph->saddr = fl4->saddr;
* iph->daddr = fl4->daddr;
*/
static void ip_copy_addrs(struct iphdr *iph, const struct flowi4 *fl4)
{
BUILD_BUG_ON(offsetof(typeof(*fl4), daddr) !=
offsetof(typeof(*fl4), saddr) + sizeof(fl4->saddr));
memcpy(&iph->saddr, &fl4->saddr,
sizeof(fl4->saddr) + sizeof(fl4->daddr));
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Eric Dumazet | 76 | 100.00% | 1 | 100.00% |
Total | 76 | 100.00% | 1 | 100.00% |
/* Note: skb->sk can be different from sk, in case of tunnels */
int ip_queue_xmit(struct sock *sk, struct sk_buff *skb, struct flowi *fl)
{
struct inet_sock *inet = inet_sk(sk);
struct net *net = sock_net(sk);
struct ip_options_rcu *inet_opt;
struct flowi4 *fl4;
struct rtable *rt;
struct iphdr *iph;
int res;
/* Skip all of this if the packet is already routed,
* f.e. by something like SCTP.
*/
rcu_read_lock();
inet_opt = rcu_dereference(inet->inet_opt);
fl4 = &fl->u.ip4;
rt = skb_rtable(skb);
if (rt)
goto packet_routed;
/* Make sure we can route this packet. */
rt = (struct rtable *)__sk_dst_check(sk, 0);
if (!rt) {
__be32 daddr;
/* Use correct destination address if we have options. */
daddr = inet->inet_daddr;
if (inet_opt && inet_opt->opt.srr)
daddr = inet_opt->opt.faddr;
/* If this fails, retransmit mechanism of transport layer will
* keep trying until route appears or the connection times
* itself out.
*/
rt = ip_route_output_ports(net, fl4, sk,
daddr, inet->inet_saddr,
inet->inet_dport,
inet->inet_sport,
sk->sk_protocol,
RT_CONN_FLAGS(sk),
sk->sk_bound_dev_if);
if (IS_ERR(rt))
goto no_route;
sk_setup_caps(sk, &rt->dst);
}
skb_dst_set_noref(skb, &rt->dst);
packet_routed:
if (inet_opt && inet_opt->opt.is_strictroute && rt->rt_uses_gateway)
goto no_route;
/* OK, we know where to send it, allocate and build IP header. */
skb_push(skb, sizeof(struct iphdr) + (inet_opt ? inet_opt->opt.optlen : 0));
skb_reset_network_header(skb);
iph = ip_hdr(skb);
*((__be16 *)iph) = htons((4 << 12) | (5 << 8) | (inet->tos & 0xff));
if (ip_dont_fragment(sk, &rt->dst) && !skb->ignore_df)
iph->frag_off = htons(IP_DF);
else
iph->frag_off = 0;
iph->ttl = ip_select_ttl(inet, &rt->dst);
iph->protocol = sk->sk_protocol;
ip_copy_addrs(iph, fl4);
/* Transport layer set skb->h.foo itself. */
if (inet_opt && inet_opt->opt.optlen) {
iph->ihl += inet_opt->opt.optlen >> 2;
ip_options_build(skb, &inet_opt->opt, inet->inet_daddr, rt, 0);
}
ip_select_ident_segs(net, skb, sk,
skb_shinfo(skb)->gso_segs ?: 1);
/* TODO : should we use skb->sk here instead of sk ? */
skb->priority = sk->sk_priority;
skb->mark = sk->sk_mark;
res = ip_local_out(net, sk, skb);
rcu_read_unlock();
return res;
no_route:
rcu_read_unlock();
IP_INC_STATS(net, IPSTATS_MIB_OUTNOROUTES);
kfree_skb(skb);
return -EHOSTUNREACH;
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Alexey Kuznetsov | 212 | 43.80% | 3 | 5.45% |
Eric Dumazet | 73 | 15.08% | 8 | 14.55% |
Linus Torvalds (pre-git) | 71 | 14.67% | 5 | 9.09% |
David S. Miller | 61 | 12.60% | 10 | 18.18% |
Eric W. Biedermann | 18 | 3.72% | 4 | 7.27% |
Arnaldo Carvalho de Melo | 16 | 3.31% | 5 | 9.09% |
Tóth László Attila | 8 | 1.65% | 1 | 1.82% |
Herbert Xu | 4 | 0.83% | 2 | 3.64% |
Hideaki Yoshifuji / 吉藤英明 | 3 | 0.62% | 2 | 3.64% |
Shan Wei | 2 | 0.41% | 1 | 1.82% |
Denis V. Lunev | 2 | 0.41% | 2 | 3.64% |
Sridhar Samudrala | 2 | 0.41% | 1 | 1.82% |
Venkat Yekkirala | 2 | 0.41% | 1 | 1.82% |
Al Viro | 2 | 0.41% | 2 | 3.64% |
Ian Morris | 1 | 0.21% | 1 | 1.82% |
Américo Wang | 1 | 0.21% | 1 | 1.82% |
Ansis Atteka | 1 | 0.21% | 1 | 1.82% |
Linus Torvalds | 1 | 0.21% | 1 | 1.82% |
Atis Elsts | 1 | 0.21% | 1 | 1.82% |
Hannes Frederic Sowa | 1 | 0.21% | 1 | 1.82% |
Pavel Emelyanov | 1 | 0.21% | 1 | 1.82% |
Julian Anastasov | 1 | 0.21% | 1 | 1.82% |
Total | 484 | 100.00% | 55 | 100.00% |
EXPORT_SYMBOL(ip_queue_xmit);
static void ip_copy_metadata(struct sk_buff *to, struct sk_buff *from)
{
to->pkt_type = from->pkt_type;
to->priority = from->priority;
to->protocol = from->protocol;
skb_dst_drop(to);
skb_dst_copy(to, from);
to->dev = from->dev;
to->mark = from->mark;
/* Copy the flags to each fragment. */
IPCB(to)->flags = IPCB(from)->flags;
#ifdef CONFIG_NET_SCHED
to->tc_index = from->tc_index;
#endif
nf_copy(to, from);
#if IS_ENABLED(CONFIG_IP_VS)
to->ipvs_property = from->ipvs_property;
#endif
skb_copy_secmark(to, from);
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Alexey Kuznetsov | 82 | 65.08% | 1 | 9.09% |
Julian Anastasov | 14 | 11.11% | 1 | 9.09% |
Thomas Graf | 8 | 6.35% | 1 | 9.09% |
James Morris | 7 | 5.56% | 1 | 9.09% |
Eric Dumazet | 5 | 3.97% | 2 | 18.18% |
Patrick McHardy | 4 | 3.17% | 1 | 9.09% |
Jozsef Kadlecsik | 3 | 2.38% | 2 | 18.18% |
Yasuyuki Kozakai | 2 | 1.59% | 1 | 9.09% |
Javier Martinez Canillas | 1 | 0.79% | 1 | 9.09% |
Total | 126 | 100.00% | 11 | 100.00% |
static int ip_fragment(struct net *net, struct sock *sk, struct sk_buff *skb,
unsigned int mtu,
int (*output)(struct net *, struct sock *, struct sk_buff *))
{
struct iphdr *iph = ip_hdr(skb);
if ((iph->frag_off & htons(IP_DF)) == 0)
return ip_do_fragment(net, sk, skb, output);
if (unlikely(!skb->ignore_df ||
(IPCB(skb)->frag_max_size &&
IPCB(skb)->frag_max_size > mtu))) {
IP_INC_STATS(net, IPSTATS_MIB_FRAGFAILS);
icmp_send(skb, ICMP_DEST_UNREACH, ICMP_FRAG_NEEDED,
htonl(mtu));
kfree_skb(skb);
return -EMSGSIZE;
}
return ip_do_fragment(net, sk, skb, output);
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Alexey Kuznetsov | 67 | 43.79% | 2 | 14.29% |
Florian Westphal | 21 | 13.73% | 2 | 14.29% |
Patrick McHardy | 18 | 11.76% | 1 | 7.14% |
Eric W. Biedermann | 14 | 9.15% | 2 | 14.29% |
Andy Zhou | 13 | 8.50% | 1 | 7.14% |
David S. Miller | 9 | 5.88% | 1 | 7.14% |
Wei Dong | 5 | 3.27% | 1 | 7.14% |
Eric Dumazet | 2 | 1.31% | 1 | 7.14% |
Hannes Frederic Sowa | 2 | 1.31% | 1 | 7.14% |
Pavel Emelyanov | 1 | 0.65% | 1 | 7.14% |
Américo Wang | 1 | 0.65% | 1 | 7.14% |
Total | 153 | 100.00% | 14 | 100.00% |
/*
* This IP datagram is too large to be sent in one piece. Break it up into
* smaller pieces (each of size equal to IP header plus
* a block of the data of the original IP data part) that will yet fit in a
* single device frame, and queue such a frame for sending.
*/
int ip_do_fragment(struct net *net, struct sock *sk, struct sk_buff *skb,
int (*output)(struct net *, struct sock *, struct sk_buff *))
{
struct iphdr *iph;
int ptr;
struct sk_buff *skb2;
unsigned int mtu, hlen, left, len, ll_rs;
int offset;
__be16 not_last_frag;
struct rtable *rt = skb_rtable(skb);
int err = 0;
/* for offloaded checksums cleanup checksum before fragmentation */
if (skb->ip_summed == CHECKSUM_PARTIAL &&
(err = skb_checksum_help(skb)))
goto fail;
/*
* Point into the IP datagram header.
*/
iph = ip_hdr(skb);
mtu = ip_skb_dst_mtu(sk, skb);
if (IPCB(skb)->frag_max_size && IPCB(skb)->frag_max_size < mtu)
mtu = IPCB(skb)->frag_max_size;
/*
* Setup starting values.
*/
hlen = iph->ihl * 4;
mtu = mtu - hlen; /* Size of data space */
IPCB(skb)->flags |= IPSKB_FRAG_COMPLETE;
/* When frag_list is given, use it. First, check its validity:
* some transformers could create wrong frag_list or break existing
* one, it is not prohibited. In this case fall back to copying.
*
* LATER: this step can be merged to real generation of fragments,
* we can switch to copy when see the first bad fragment.
*/
if (skb_has_frag_list(skb)) {
struct sk_buff *frag, *frag2;
unsigned int first_len = skb_pagelen(skb);
if (first_len - hlen > mtu ||
((first_len - hlen) & 7) ||
ip_is_fragment(iph) ||
skb_cloned(skb))
goto slow_path;
skb_walk_frags(skb, frag) {
/* Correct geometry. */
if (frag->len > mtu ||
((frag->len & 7) && frag->next) ||
skb_headroom(frag) < hlen)
goto slow_path_clean;
/* Partially cloned skb? */
if (skb_shared(frag))
goto slow_path_clean;
BUG_ON(frag->sk);
if (skb->sk) {
frag->sk = skb->sk;
frag->destructor = sock_wfree;
}
skb->truesize -= frag->truesize;
}
/* Everything is OK. Generate! */
err = 0;
offset = 0;
frag = skb_shinfo(skb)->frag_list;
skb_frag_list_init(skb);
skb->data_len = first_len - skb_headlen(skb);
skb->len = first_len;
iph->tot_len = htons(first_len);
iph->frag_off = htons(IP_MF);
ip_send_check(iph);
for (;;) {
/* Prepare header of the next frame,
* before previous one went down. */
if (frag) {
frag->ip_summed = CHECKSUM_NONE;
skb_reset_transport_header(frag);
__skb_push(frag, hlen);
skb_reset_network_header(frag);
memcpy(skb_network_header(frag), iph, hlen);
iph = ip_hdr(frag);
iph->tot_len = htons(frag->len);
ip_copy_metadata(frag, skb);
if (offset == 0)
ip_options_fragment(frag);
offset += skb->len - hlen;
iph->frag_off = htons(offset>>3);
if (frag->next)
iph->frag_off |= htons(IP_MF);
/* Ready, complete checksum */
ip_send_check(iph);
}
err = output(net, sk, skb);
if (!err)
IP_INC_STATS(net, IPSTATS_MIB_FRAGCREATES);
if (err || !frag)
break;
skb = frag;
frag = skb->next;
skb->next = NULL;
}
if (err == 0) {
IP_INC_STATS(net, IPSTATS_MIB_FRAGOKS);
return 0;
}
while (frag) {
skb = frag->next;
kfree_skb(frag);
frag = skb;
}
IP_INC_STATS(net, IPSTATS_MIB_FRAGFAILS);
return err;
slow_path_clean:
skb_walk_frags(skb, frag2) {
if (frag2 == frag)
break;
frag2->sk = NULL;
frag2->destructor = NULL;
skb->truesize += frag2->truesize;
}
}
slow_path:
iph = ip_hdr(skb);
left = skb->len - hlen; /* Space per frame */
ptr = hlen; /* Where to start from */
ll_rs = LL_RESERVED_SPACE(rt->dst.dev);
/*
* Fragment the datagram.
*/
offset = (ntohs(iph->frag_off) & IP_OFFSET) << 3;
not_last_frag = iph->frag_off & htons(IP_MF);
/*
* Keep copying data until we run out.
*/
while (left > 0) {
len = left;
/* IF: it doesn't fit, use 'mtu' - the data space left */
if (len > mtu)
len = mtu;
/* IF: we are not sending up to and including the packet end
then align the next start on an eight byte boundary */
if (len < left) {
len &= ~7;
}
/* Allocate buffer */
skb2 = alloc_skb(len + hlen + ll_rs, GFP_ATOMIC);
if (!skb2) {
err = -ENOMEM;
goto fail;
}
/*
* Set up data on packet
*/
ip_copy_metadata(skb2, skb);
skb_reserve(skb2, ll_rs);
skb_put(skb2, len + hlen);
skb_reset_network_header(skb2);
skb2->transport_header = skb2->network_header + hlen;
/*
* Charge the memory for the fragment to any owner
* it might possess
*/
if (skb->sk)
skb_set_owner_w(skb2, skb->sk);
/*
* Copy the packet header into the new buffer.
*/
skb_copy_from_linear_data(skb, skb_network_header(skb2), hlen);
/*
* Copy a block of the IP datagram.
*/
if (skb_copy_bits(skb, ptr, skb_transport_header(skb2), len))
BUG();
left -= len;
/*
* Fill in the new header fields.
*/
iph = ip_hdr(skb2);
iph->frag_off = htons((offset >> 3));
if (IPCB(skb)->flags & IPSKB_FRAG_PMTU)
iph->frag_off |= htons(IP_DF);
/* ANK: dirty, but effective trick. Upgrade options only if
* the segment to be fragmented was THE FIRST (otherwise,
* options are already fixed) and make it ONCE
* on the initial skb, so that all the following fragments
* will inherit fixed options.
*/
if (offset == 0)
ip_options_fragment(skb);
/*
* Added AC : If we are fragmenting a fragment that's not the
* last fragment then keep MF on each bit
*/
if (left > 0 || not_last_frag)
iph->frag_off |= htons(IP_MF);
ptr += len;
offset += len;
/*
* Put this fragment into the sending queue.
*/
iph->tot_len = htons(len + hlen);
ip_send_check(iph);
err = output(net, sk, skb2);
if (err)
goto fail;
IP_INC_STATS(net, IPSTATS_MIB_FRAGCREATES);
}
consume_skb(skb);
IP_INC_STATS(net, IPSTATS_MIB_FRAGOKS);
return err;
fail:
kfree_skb(skb);
IP_INC_STATS(net, IPSTATS_MIB_FRAGFAILS);
return err;
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Alexey Kuznetsov | 644 | 63.39% | 1 | 2.70% |
Andy Zhou | 90 | 8.86% | 1 | 2.70% |
Florian Westphal | 48 | 4.72% | 2 | 5.41% |
Herbert Xu | 48 | 4.72% | 4 | 10.81% |
Eric Dumazet | 47 | 4.63% | 2 | 5.41% |
Arnaldo Carvalho de Melo | 31 | 3.05% | 8 | 21.62% |
Hannes Frederic Sowa | 22 | 2.17% | 2 | 5.41% |
Eric W. Biedermann | 19 | 1.87% | 2 | 5.41% |
Wei Dong | 15 | 1.48% | 1 | 2.70% |
Bart De Schuymer | 11 | 1.08% | 1 | 2.70% |
David S. Miller | 10 | 0.98% | 3 | 8.11% |
Pravin B Shelar | 7 | 0.69% | 1 | 2.70% |
Pavel Emelyanov | 6 | 0.59% | 1 | 2.70% |
Joe Perches | 6 | 0.59% | 1 | 2.70% |
Hideaki Yoshifuji / 吉藤英明 | 4 | 0.39% | 1 | 2.70% |
Paul Gortmaker | 2 | 0.20% | 1 | 2.70% |
Shmulik Ladkani | 2 | 0.20% | 1 | 2.70% |
Alexey Dobriyan | 1 | 0.10% | 1 | 2.70% |
Stephen Hemminger | 1 | 0.10% | 1 | 2.70% |
Patrick McHardy | 1 | 0.10% | 1 | 2.70% |
Lucas De Marchi | 1 | 0.10% | 1 | 2.70% |
Total | 1016 | 100.00% | 37 | 100.00% |
EXPORT_SYMBOL(ip_do_fragment);
int
ip_generic_getfrag(void *from, char *to, int offset, int len, int odd, struct sk_buff *skb)
{
struct msghdr *msg = from;
if (skb->ip_summed == CHECKSUM_PARTIAL) {
if (!copy_from_iter_full(to, len, &msg->msg_iter))
return -EFAULT;
} else {
__wsum csum = 0;
if (!csum_and_copy_from_iter_full(to, len, &csum, &msg->msg_iter))
return -EFAULT;
skb->csum = csum_block_add(skb->csum, csum, odd);
}
return 0;
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Alexey Kuznetsov | 92 | 82.88% | 2 | 25.00% |
Al Viro | 18 | 16.22% | 5 | 62.50% |
Patrick McHardy | 1 | 0.90% | 1 | 12.50% |
Total | 111 | 100.00% | 8 | 100.00% |
EXPORT_SYMBOL(ip_generic_getfrag);
static inline __wsum
csum_page(struct page *page, int offset, int copy)
{
char *kaddr;
__wsum csum;
kaddr = kmap(page);
csum = csum_partial(kaddr + offset, copy, 0);
kunmap(page);
return csum;
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Alexey Kuznetsov | 40 | 75.47% | 1 | 11.11% |
Linus Torvalds (pre-git) | 11 | 20.75% | 7 | 77.78% |
Al Viro | 2 | 3.77% | 1 | 11.11% |
Total | 53 | 100.00% | 9 | 100.00% |
static inline int ip_ufo_append_data(struct sock *sk,
struct sk_buff_head *queue,
int getfrag(void *from, char *to, int offset, int len,
int odd, struct sk_buff *skb),
void *from, int length, int hh_len, int fragheaderlen,
int transhdrlen, int maxfraglen, unsigned int flags)
{
struct sk_buff *skb;
int err;
/* There is support for UDP fragmentation offload by network
* device, so create one single skb packet containing complete
* udp datagram
*/
skb = skb_peek_tail(queue);
if (!skb) {
skb = sock_alloc_send_skb(sk,
hh_len + fragheaderlen + transhdrlen + 20,
(flags & MSG_DONTWAIT), &err);
if (!skb)
return err;
/* reserve space for Hardware header */
skb_reserve(skb, hh_len);
/* create space for UDP/IP header */
skb_put(skb, fragheaderlen + transhdrlen);
/* initialize network header pointer */
skb_reset_network_header(skb);
/* initialize protocol header pointer */
skb->transport_header = skb->network_header + fragheaderlen;
skb->csum = 0;
if (flags & MSG_CONFIRM)
skb_set_dst_pending_confirm(skb, 1);
__skb_queue_tail(queue, skb);
} else if (skb_is_gso(skb)) {
goto append;
}
skb->ip_summed = CHECKSUM_PARTIAL;
/* specify the length of each IP datagram fragment */
skb_shinfo(skb)->gso_size = maxfraglen - fragheaderlen;
skb_shinfo(skb)->gso_type = SKB_GSO_UDP;
append:
return skb_append_datato_frags(sk, skb, getfrag, from,
(length - transhdrlen));
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Ananda Raju | 157 | 64.88% | 1 | 8.33% |
Jiri Pirko | 27 | 11.16% | 1 | 8.33% |
Herbert Xu | 16 | 6.61% | 3 | 25.00% |
Kostya Belezko | 15 | 6.20% | 1 | 8.33% |
Julian Anastasov | 13 | 5.37% | 1 | 8.33% |
Ian Morris | 6 | 2.48% | 1 | 8.33% |
Arnaldo Carvalho de Melo | 5 | 2.07% | 2 | 16.67% |
Bill Sommerfeld | 2 | 0.83% | 1 | 8.33% |
Adrian Bunk | 1 | 0.41% | 1 | 8.33% |
Total | 242 | 100.00% | 12 | 100.00% |
static int __ip_append_data(struct sock *sk,
struct flowi4 *fl4,
struct sk_buff_head *queue,
struct inet_cork *cork,
struct page_frag *pfrag,
int getfrag(void *from, char *to, int offset,
int len, int odd, struct sk_buff *skb),
void *from, int length, int transhdrlen,
unsigned int flags)
{
struct inet_sock *inet = inet_sk(sk);
struct sk_buff *skb;
struct ip_options *opt = cork->opt;
int hh_len;
int exthdrlen;
int mtu;
int copy;
int err;
int offset = 0;
unsigned int maxfraglen, fragheaderlen, maxnonfragsize;
int csummode = CHECKSUM_NONE;
struct rtable *rt = (struct rtable *)cork->dst;
u32 tskey = 0;
skb = skb_peek_tail(queue);
exthdrlen = !skb ? rt->dst.header_len : 0;
mtu = cork->fragsize;
if (cork->tx_flags & SKBTX_ANY_SW_TSTAMP &&
sk->sk_tsflags & SOF_TIMESTAMPING_OPT_ID)
tskey = sk->sk_tskey++;
hh_len = LL_RESERVED_SPACE(rt->dst.dev);
fragheaderlen = sizeof(struct iphdr) + (opt ? opt->optlen : 0);
maxfraglen = ((mtu - fragheaderlen) & ~7) + fragheaderlen;
maxnonfragsize = ip_sk_ignore_df(sk) ? 0xFFFF : mtu;
if (cork->length + length > maxnonfragsize - fragheaderlen) {
ip_local_error(sk, EMSGSIZE, fl4->daddr, inet->inet_dport,
mtu - (opt ? opt->optlen : 0));
return -EMSGSIZE;
}
/*
* transhdrlen > 0 means that this is the first fragment and we wish
* it won't be fragmented in the future.
*/
if (transhdrlen &&
length + fragheaderlen <= mtu &&
rt->dst.dev->features & (NETIF_F_HW_CSUM | NETIF_F_IP_CSUM) &&
!(flags & MSG_MORE) &&
!exthdrlen)
csummode = CHECKSUM_PARTIAL;
cork->length += length;
if ((((length + fragheaderlen) > mtu) || (skb && skb_is_gso(skb))) &&
(sk->sk_protocol == IPPROTO_UDP) &&
(rt->dst.dev->features & NETIF_F_UFO) && !dst_xfrm(&rt->dst) &&
(sk->sk_type == SOCK_DGRAM) && !sk->sk_no_check_tx) {
err = ip_ufo_append_data(sk, queue, getfrag, from, length,
hh_len, fragheaderlen, transhdrlen,
maxfraglen, flags);
if (err)
goto error;
return 0;
}
/* So, what's going on in the loop below?
*
* We use calculated fragment length to generate chained skb,
* each of segments is IP fragment ready for sending to network after
* adding appropriate IP header.
*/
if (!skb)
goto alloc_new_skb;
while (length > 0) {
/* Check if the remaining data fits into current packet. */
copy = mtu - skb->len;
if (copy < length)
copy = maxfraglen - skb->len;
if (copy <= 0) {
char *data;
unsigned int datalen;
unsigned int fraglen;
unsigned int fraggap;
unsigned int alloclen;
struct sk_buff *skb_prev;
alloc_new_skb:
skb_prev = skb;
if (skb_prev)
fraggap = skb_prev->len - maxfraglen;
else
fraggap = 0;
/*
* If remaining data exceeds the mtu,
* we know we need more fragment(s).
*/
datalen = length + fraggap;
if (datalen > mtu - fragheaderlen)
datalen = maxfraglen - fragheaderlen;
fraglen = datalen + fragheaderlen;
if ((flags & MSG_MORE) &&
!(rt->dst.dev->features&NETIF_F_SG))
alloclen = mtu;
else
alloclen = fraglen;
alloclen += exthdrlen;
/* The last fragment gets additional space at tail.
* Note, with MSG_MORE we overallocate on fragments,
* because we have no idea what fragment will be
* the last.
*/
if (datalen == length + fraggap)
alloclen += rt->dst.trailer_len;
if (transhdrlen) {
skb = sock_alloc_send_skb(sk,
alloclen + hh_len + 15,
(flags & MSG_DONTWAIT), &err);
} else {
skb = NULL;
if (atomic_read(&sk->sk_wmem_alloc) <=
2 * sk->sk_sndbuf)
skb = sock_wmalloc(sk,
alloclen + hh_len + 15, 1,
sk->sk_allocation);
if (unlikely(!skb))
err = -ENOBUFS;
}
if (!skb)
goto error;
/*
* Fill in the control structures
*/
skb->ip_summed = csummode;
skb->csum = 0;
skb_reserve(skb, hh_len);
/* only the initial fragment is time stamped */
skb_shinfo(skb)->tx_flags = cork->tx_flags;
cork->tx_flags = 0;
skb_shinfo(skb)->tskey = tskey;
tskey = 0;
/*
* Find where to start putting bytes.
*/
data = skb_put(skb, fraglen + exthdrlen);
skb_set_network_header(skb, exthdrlen);
skb->transport_header = (skb->network_header +
fragheaderlen);
data += fragheaderlen + exthdrlen;
if (fraggap) {
skb->csum = skb_copy_and_csum_bits(
skb_prev, maxfraglen,
data + transhdrlen, fraggap, 0);
skb_prev->csum = csum_sub(skb_prev->csum,
skb->csum);
data += fraggap;
pskb_trim_unique(skb_prev, maxfraglen);
}
copy = datalen - transhdrlen - fraggap;
if (copy > 0 && getfrag(from, data + transhdrlen, offset, copy, fraggap, skb) < 0) {
err = -EFAULT;
kfree_skb(skb);
goto error;
}
offset += copy;
length -= datalen - fraggap;
transhdrlen = 0;
exthdrlen = 0;
csummode = CHECKSUM_NONE;
if ((flags & MSG_CONFIRM) && !skb_prev)
skb_set_dst_pending_confirm(skb, 1);
/*
* Put the packet on the pending queue.
*/
__skb_queue_tail(queue, skb);
continue;
}
if (copy > length)
copy = length;
if (!(rt->dst.dev->features&NETIF_F_SG)) {
unsigned int off;
off = skb->len;
if (getfrag(from, skb_put(skb, copy),
offset, copy, off, skb) < 0) {
__skb_trim(skb, off);
err = -EFAULT;
goto error;
}
} else {
int i = skb_shinfo(skb)->nr_frags;
err = -ENOMEM;
if (!sk_page_frag_refill(sk, pfrag))
goto error;
if (!skb_can_coalesce(skb, i, pfrag->page,
pfrag->offset)) {
err = -EMSGSIZE;
if (i == MAX_SKB_FRAGS)
goto error;
__skb_fill_page_desc(skb, i, pfrag->page,
pfrag->offset, 0);
skb_shinfo(skb)->nr_frags = ++i;
get_page(pfrag->page);
}
copy = min_t(int, copy, pfrag->size - pfrag->offset);
if (getfrag(from,
page_address(pfrag->page) + pfrag->offset,
offset, copy, skb->len, skb) < 0)
goto error_efault;
pfrag->offset += copy;
skb_frag_size_add(&skb_shinfo(skb)->frags[i - 1], copy);
skb->len += copy;
skb->data_len += copy;
skb->truesize += copy;
atomic_add(copy, &sk->sk_wmem_alloc);
}
offset += copy;
length -= copy;
}
return 0;
error_efault:
err = -EFAULT;
error:
cork->length -= length;
IP_INC_STATS(sock_net(sk), IPSTATS_MIB_OUTDISCARDS);
return err;
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Herbert Xu | 516 | 40.95% | 6 | 10.17% |
Alexey Kuznetsov | 285 | 22.62% | 4 | 6.78% |
Linus Torvalds (pre-git) | 115 | 9.13% | 11 | 18.64% |
Eric Dumazet | 96 | 7.62% | 4 | 6.78% |
Willem de Bruijn | 46 | 3.65% | 2 | 3.39% |
David S. Miller | 30 | 2.38% | 4 | 6.78% |
Hannes Frederic Sowa | 29 | 2.30% | 4 | 6.78% |
Hideaki Yoshifuji / 吉藤英明 | 26 | 2.06% | 2 | 3.39% |
Steffen Klassert | 22 | 1.75% | 3 | 5.08% |
Julian Anastasov | 18 | 1.43% | 1 | 1.69% |
Michal Kubeček | 13 | 1.03% | 2 | 3.39% |
Ananda Raju | 13 | 1.03% | 1 | 1.69% |
Krishna Kumar | 10 | 0.79% | 1 | 1.69% |
John Heffner | 8 | 0.63% | 1 | 1.69% |
Patrick McHardy | 7 | 0.56% | 2 | 3.39% |
Tom Herbert | 5 | 0.40% | 1 | 1.69% |
Alexey Kodanev | 4 | 0.32% | 1 | 1.69% |
Julien Tinnes | 4 | 0.32% | 1 | 1.69% |
Zheng Li | 4 | 0.32% | 1 | 1.69% |
Ian Campbell | 2 | 0.16% | 1 | 1.69% |
Ian Morris | 2 | 0.16% | 1 | 1.69% |
Arnaldo Carvalho de Melo | 1 | 0.08% | 1 | 1.69% |
Bill Sommerfeld | 1 | 0.08% | 1 | 1.69% |
Américo Wang | 1 | 0.08% | 1 | 1.69% |
Kostya Belezko | 1 | 0.08% | 1 | 1.69% |
Linus Torvalds | 1 | 0.08% | 1 | 1.69% |
Total | 1260 | 100.00% | 59 | 100.00% |
static int ip_setup_cork(struct sock *sk, struct inet_cork *cork,
struct ipcm_cookie *ipc, struct rtable **rtp)
{
struct ip_options_rcu *opt;
struct rtable *rt;
/*
* setup for corking.
*/
opt = ipc->opt;
if (opt) {
if (!cork->opt) {
cork->opt = kmalloc(sizeof(struct ip_options) + 40,
sk->sk_allocation);
if (unlikely(!cork->opt))
return -ENOBUFS;
}
memcpy(cork->opt, &opt->opt, sizeof(struct ip_options) + opt->opt.optlen);
cork->flags |= IPCORK_OPT;
cork->addr = ipc->addr;
}
rt = *rtp;
if (unlikely(!rt))
return -EFAULT;
/*
* We steal reference to this route, caller should not release it
*/
*rtp = NULL;
cork->fragsize = ip_sk_use_pmtu(sk) ?
dst_mtu(&rt->dst) : rt->dst.dev->mtu;
cork->dst = &rt->dst;
cork->length = 0;
cork->ttl = ipc->ttl;
cork->tos = ipc->tos;
cork->priority = ipc->priority;
cork->tx_flags = ipc->tx_flags;
return 0;
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Herbert Xu | 183 | 80.26% | 1 | 16.67% |
Francesco Fusco | 24 | 10.53% | 1 | 16.67% |
Hannes Frederic Sowa | 12 | 5.26% | 1 | 16.67% |
Eric Dumazet | 6 | 2.63% | 1 | 16.67% |
Ian Morris | 2 | 0.88% | 1 | 16.67% |
Steffen Klassert | 1 | 0.44% | 1 | 16.67% |
Total | 228 | 100.00% | 6 | 100.00% |
/*
* ip_append_data() and ip_append_page() can make one large IP datagram
* from many pieces of data. Each pieces will be holded on the socket
* until ip_push_pending_frames() is called. Each piece can be a page
* or non-page data.
*
* Not only UDP, other transport protocols - e.g. raw sockets - can use
* this interface potentially.
*
* LATER: length must be adjusted by pad at tail, when it is required.
*/
int ip_append_data(struct sock *sk, struct flowi4 *fl4,
int getfrag(void *from, char *to, int offset, int len,
int odd, struct sk_buff *skb),
void *from, int length, int transhdrlen,
struct ipcm_cookie *ipc, struct rtable **rtp,
unsigned int flags)
{
struct inet_sock *inet = inet_sk(sk);
int err;
if (flags&MSG_PROBE)
return 0;
if (skb_queue_empty(&sk->sk_write_queue)) {
err = ip_setup_cork(sk, &inet->cork.base, ipc, rtp);
if (err)
return err;
} else {
transhdrlen = 0;
}
return __ip_append_data(sk, fl4, &sk->sk_write_queue, &inet->cork.base,
sk_page_frag(sk), getfrag,
from, length, transhdrlen, flags);
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Herbert Xu | 134 | 80.24% | 2 | 15.38% |
David S. Miller | 11 | 6.59% | 2 | 15.38% |
Linus Torvalds (pre-git) | 10 | 5.99% | 6 | 46.15% |
Alexey Kuznetsov | 6 | 3.59% | 1 | 7.69% |
Eric Dumazet | 5 | 2.99% | 1 | 7.69% |
Pavel Emelyanov | 1 | 0.60% | 1 | 7.69% |
Total | 167 | 100.00% | 13 | 100.00% |
ssize_t ip_append_page(struct sock *sk, struct flowi4 *fl4, struct page *page,
int offset, size_t size, int flags)
{
struct inet_sock *inet = inet_sk(sk);
struct sk_buff *skb;
struct rtable *rt;
struct ip_options *opt = NULL;
struct inet_cork *cork;
int hh_len;
int mtu;
int len;
int err;
unsigned int maxfraglen, fragheaderlen, fraggap, maxnonfragsize;
if (inet->hdrincl)
return -EPERM;
if (flags&MSG_PROBE)
return 0;
if (skb_queue_empty(&sk->sk_write_queue))
return -EINVAL;
cork = &inet->cork.base;
rt = (struct rtable *)cork->dst;
if (cork->flags & IPCORK_OPT)
opt = cork->opt;
if (!(rt->dst.dev->features&NETIF_F_SG))
return -EOPNOTSUPP;
hh_len = LL_RESERVED_SPACE(rt->dst.dev);
mtu = cork->fragsize;
fragheaderlen = sizeof(struct iphdr) + (opt ? opt->optlen : 0);
maxfraglen = ((mtu - fragheaderlen) & ~7) + fragheaderlen;
maxnonfragsize = ip_sk_ignore_df(sk) ? 0xFFFF : mtu;
if (cork->length + size > maxnonfragsize - fragheaderlen) {
ip_local_error(sk, EMSGSIZE, fl4->daddr, inet->inet_dport,
mtu - (opt ? opt->optlen : 0));
return -EMSGSIZE;
}
skb = skb_peek_tail(&sk->sk_write_queue);
if (!skb)
return -EINVAL;
if ((size + skb->len > mtu) &&
(sk->sk_protocol == IPPROTO_UDP) &&
(rt->dst.dev->features & NETIF_F_UFO)) {
if (skb->ip_summed != CHECKSUM_PARTIAL)
return -EOPNOTSUPP;
skb_shinfo(skb)->gso_size = mtu - fragheaderlen;
skb_shinfo(skb)->gso_type = SKB_GSO_UDP;
}
cork->length += size;
while (size > 0) {
if (skb_is_gso(skb)) {
len = size;
} else {
/* Check if the remaining data fits into current packet. */
len = mtu - skb->len;
if (len < size)
len = maxfraglen - skb->len;
}
if (len <= 0) {
struct sk_buff *skb_prev;
int alloclen;
skb_prev = skb;
fraggap = skb_prev->len - maxfraglen;
alloclen = fragheaderlen + hh_len + fraggap + 15;
skb = sock_wmalloc(sk, alloclen, 1, sk->sk_allocation);
if (unlikely(!skb)) {
err = -ENOBUFS;
goto error;
}
/*
* Fill in the control structures
*/
skb->ip_summed = CHECKSUM_NONE;
skb->csum = 0;
skb_reserve(skb, hh_len);
/*
* Find where to start putting bytes.
*/
skb_put(skb, fragheaderlen + fraggap);
skb_reset_network_header(skb);
skb->transport_header = (skb->network_header +
fragheaderlen);
if (fraggap) {
skb->csum = skb_copy_and_csum_bits(skb_prev,
maxfraglen,
skb_transport_header(skb),
fraggap, 0);
skb_prev->csum = csum_sub(skb_prev->csum,
skb->csum);
pskb_trim_unique(skb_prev, maxfraglen);
}
/*
* Put the packet on the pending queue.
*/
__skb_queue_tail(&sk->sk_write_queue, skb);
continue;
}
if (len > size)
len = size;
if (skb_append_pagefrags(skb, page, offset, len)) {
err = -EMSGSIZE;
goto error;
}
if (skb->ip_summed == CHECKSUM_NONE) {
__wsum csum;
csum = csum_page(page, offset, len);
skb->csum = csum_block_add(skb->csum, csum, skb->len);
}
skb->len += len;
skb->data_len += len;
skb->truesize += len;
atomic_add(len, &sk->sk_wmem_alloc);
offset += len;
size -= len;
}
return 0;
error:
cork->length -= size;
IP_INC_STATS(sock_net(sk), IPSTATS_MIB_OUTDISCARDS);
return err;
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Alexey Kuznetsov | 258 | 35.59% | 2 | 3.85% |
Linus Torvalds (pre-git) | 145 | 20.00% | 14 | 26.92% |
David S. Miller | 105 | 14.48% | 6 | 11.54% |
Herbert Xu | 46 | 6.34% | 7 | 13.46% |
Ananda Raju | 45 | 6.21% | 1 | 1.92% |
Hannes Frederic Sowa | 44 | 6.07% | 5 | 9.62% |
Hideaki Yoshifuji / 吉藤英明 | 28 | 3.86% | 3 | 5.77% |
Arnaldo Carvalho de Melo | 22 | 3.03% | 6 | 11.54% |
Patrick McHardy | 16 | 2.21% | 1 | 1.92% |
Pavel Emelyanov | 5 | 0.69% | 1 | 1.92% |
Ian Morris | 5 | 0.69% | 1 | 1.92% |
Eric Dumazet | 3 | 0.41% | 2 | 3.85% |
Al Viro | 1 | 0.14% | 1 | 1.92% |
Linus Torvalds | 1 | 0.14% | 1 | 1.92% |
Américo Wang | 1 | 0.14% | 1 | 1.92% |
Total | 725 | 100.00% | 52 | 100.00% |
static void ip_cork_release(struct inet_cork *cork)
{
cork->flags &= ~IPCORK_OPT;
kfree(cork->opt);
cork->opt = NULL;
dst_release(cork->dst);
cork->dst = NULL;
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Pavel Emelyanov | 34 | 77.27% | 1 | 33.33% |
Herbert Xu | 7 | 15.91% | 1 | 33.33% |
Hideaki Yoshifuji / 吉藤英明 | 3 | 6.82% | 1 | 33.33% |
Total | 44 | 100.00% | 3 | 100.00% |
/*
* Combined all pending IP fragments on the socket as one IP datagram
* and push them out.
*/
struct sk_buff *__ip_make_skb(struct sock *sk,
struct flowi4 *fl4,
struct sk_buff_head *queue,
struct inet_cork *cork)
{
struct sk_buff *skb, *tmp_skb;
struct sk_buff **tail_skb;
struct inet_sock *inet = inet_sk(sk);
struct net *net = sock_net(sk);
struct ip_options *opt = NULL;
struct rtable *rt = (struct rtable *)cork->dst;
struct iphdr *iph;
__be16 df = 0;
__u8 ttl;
skb = __skb_dequeue(queue);
if (!skb)
goto out;
tail_skb = &(skb_shinfo(skb)->frag_list);
/* move skb->data to ip header from ext header */
if (skb->data < skb_network_header(skb))
__skb_pull(skb, skb_network_offset(skb));
while ((tmp_skb = __skb_dequeue(queue)) != NULL) {
__skb_pull(tmp_skb, skb_network_header_len(skb));
*tail_skb = tmp_skb;
tail_skb = &(tmp_skb->next);
skb->len += tmp_skb->len;
skb->data_len += tmp_skb->len;
skb->truesize += tmp_skb->truesize;
tmp_skb->destructor = NULL;
tmp_skb->sk = NULL;
}
/* Unless user demanded real pmtu discovery (IP_PMTUDISC_DO), we allow
* to fragment the frame generated here. No matter, what transforms
* how transforms change size of the packet, it will come out.
*/
skb->ignore_df = ip_sk_ignore_df(sk);
/* DF bit is set when we want to see DF on outgoing frames.
* If ignore_df is set too, we still allow to fragment this frame
* locally. */
if (inet->pmtudisc == IP_PMTUDISC_DO ||
inet->pmtudisc == IP_PMTUDISC_PROBE ||
(skb->len <= dst_mtu(&rt->dst) &&
ip_dont_fragment(sk, &rt->dst)))
df = htons(IP_DF);
if (cork->flags & IPCORK_OPT)
opt = cork->opt;
if (cork->ttl != 0)
ttl = cork->ttl;
else if (rt->rt_type == RTN_MULTICAST)
ttl = inet->mc_ttl;
else
ttl = ip_select_ttl(inet, &rt->dst);
iph = ip_hdr(skb);
iph->version = 4;
iph->ihl = 5;
iph->tos = (cork->tos != -1) ? cork->tos : inet->tos;
iph->frag_off = df;
iph->ttl = ttl;
iph->protocol = sk->sk_protocol;
ip_copy_addrs(iph, fl4);
ip_select_ident(net, skb, sk);
if (opt) {
iph->ihl += opt->optlen>>2;
ip_options_build(skb, opt, cork->addr, rt, 0);
}
skb->priority = (cork->tos != -1) ? cork->priority: sk->sk_priority;
skb->mark = sk->sk_mark;
/*
* Steal rt from cork.dst to avoid a pair of atomic_inc/atomic_dec
* on dst refcount
*/
cork->dst = NULL;
skb_dst_set(skb, &rt->dst);
if (iph->protocol == IPPROTO_ICMP)
icmp_out_count(net, ((struct icmphdr *)
skb_transport_header(skb))->type);
ip_cork_release(cork);
out:
return skb;
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Alexey Kuznetsov | 175 | 33.59% | 3 | 6.98% |
Linus Torvalds (pre-git) | 80 | 15.36% | 7 | 16.28% |
David S. Miller | 64 | 12.28% | 4 | 9.30% |
Francesco Fusco | 41 | 7.87% | 1 | 2.33% |
Herbert Xu | 40 | 7.68% | 3 | 6.98% |
David L Stevens | 25 | 4.80% | 1 | 2.33% |
Eric Dumazet | 20 | 3.84% | 4 | 9.30% |
Linus Torvalds | 14 | 2.69% | 4 | 9.30% |
Hannes Frederic Sowa | 12 | 2.30% | 3 | 6.98% |
Arnaldo Carvalho de Melo | 12 | 2.30% | 5 | 11.63% |
Pavel Emelyanov | 12 | 2.30% | 1 | 2.33% |
Tóth László Attila | 7 | 1.34% | 1 | 2.33% |
Hideaki Yoshifuji / 吉藤英明 | 6 | 1.15% | 1 | 2.33% |
Ian Morris | 5 | 0.96% | 1 | 2.33% |
Ansis Atteka | 4 | 0.77% | 2 | 4.65% |
Américo Wang | 3 | 0.58% | 1 | 2.33% |
Alexey Dobriyan | 1 | 0.19% | 1 | 2.33% |
Total | 521 | 100.00% | 43 | 100.00% |
int ip_send_skb(struct net *net, struct sk_buff *skb)
{
int err;
err = ip_local_out(net, skb->sk, skb);
if (err) {
if (err > 0)
err = net_xmit_errno(err);
if (err)
IP_INC_STATS(net, IPSTATS_MIB_OUTDISCARDS);
}
return err;
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Alexey Kuznetsov | 21 | 32.81% | 1 | 10.00% |
Herbert Xu | 17 | 26.56% | 2 | 20.00% |
Linus Torvalds (pre-git) | 12 | 18.75% | 2 | 20.00% |
Eric W. Biedermann | 6 | 9.38% | 2 | 20.00% |
Eric Dumazet | 5 | 7.81% | 1 | 10.00% |
Pavel Emelyanov | 2 | 3.12% | 1 | 10.00% |
Hideaki Yoshifuji / 吉藤英明 | 1 | 1.56% | 1 | 10.00% |
Total | 64 | 100.00% | 10 | 100.00% |
int ip_push_pending_frames(struct sock *sk, struct flowi4 *fl4)
{
struct sk_buff *skb;
skb = ip_finish_skb(sk, fl4);
if (!skb)
return 0;
/* Netfilter gets whole the not fragmented skb. */
return ip_send_skb(sock_net(sk), skb);
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Herbert Xu | 37 | 75.51% | 2 | 50.00% |
David S. Miller | 7 | 14.29% | 1 | 25.00% |
Eric Dumazet | 5 | 10.20% | 1 | 25.00% |
Total | 49 | 100.00% | 4 | 100.00% |
/*
* Throw away all pending data on the socket.
*/
static void __ip_flush_pending_frames(struct sock *sk,
struct sk_buff_head *queue,
struct inet_cork *cork)
{
struct sk_buff *skb;
while ((skb = __skb_dequeue_tail(queue)) != NULL)
kfree_skb(skb);
ip_cork_release(cork);
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Alexey Kuznetsov | 25 | 51.02% | 1 | 20.00% |
Herbert Xu | 17 | 34.69% | 1 | 20.00% |
Linus Torvalds (pre-git) | 6 | 12.24% | 2 | 40.00% |
Pavel Emelyanov | 1 | 2.04% | 1 | 20.00% |
Total | 49 | 100.00% | 5 | 100.00% |
void ip_flush_pending_frames(struct sock *sk)
{
__ip_flush_pending_frames(sk, &sk->sk_write_queue, &inet_sk(sk)->cork.base);
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Herbert Xu | 21 | 70.00% | 1 | 20.00% |
Alexey Kuznetsov | 3 | 10.00% | 1 | 20.00% |
Pavel Emelyanov | 3 | 10.00% | 1 | 20.00% |
David S. Miller | 2 | 6.67% | 1 | 20.00% |
Linus Torvalds (pre-git) | 1 | 3.33% | 1 | 20.00% |
Total | 30 | 100.00% | 5 | 100.00% |
struct sk_buff *ip_make_skb(struct sock *sk,
struct flowi4 *fl4,
int getfrag(void *from, char *to, int offset,
int len, int odd, struct sk_buff *skb),
void *from, int length, int transhdrlen,
struct ipcm_cookie *ipc, struct rtable **rtp,
unsigned int flags)
{
struct inet_cork cork;
struct sk_buff_head queue;
int err;
if (flags & MSG_PROBE)
return NULL;
__skb_queue_head_init(&queue);
cork.flags = 0;
cork.addr = 0;
cork.opt = NULL;
err = ip_setup_cork(sk, &cork, ipc, rtp);
if (err)
return ERR_PTR(err);
err = __ip_append_data(sk, fl4, &queue, &cork,
¤t->task_frag, getfrag,
from, length, transhdrlen, flags);
if (err) {
__ip_flush_pending_frames(sk, &queue, &cork);
return ERR_PTR(err);
}
return __ip_make_skb(sk, fl4, &queue, &cork);
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Herbert Xu | 171 | 84.24% | 1 | 16.67% |
David S. Miller | 27 | 13.30% | 4 | 66.67% |
Eric Dumazet | 5 | 2.46% | 1 | 16.67% |
Total | 203 | 100.00% | 6 | 100.00% |
/*
* Fetch data from kernel space and fill in checksum if needed.
*/
static int ip_reply_glue_bits(void *dptr, char *to, int offset,
int len, int odd, struct sk_buff *skb)
{
__wsum csum;
csum = csum_partial_copy_nocheck(dptr+offset, to, len, 0);
skb->csum = csum_block_add(skb->csum, csum, odd);
return 0;
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Linus Torvalds (pre-git) | 45 | 70.31% | 1 | 25.00% |
Alexey Kuznetsov | 18 | 28.12% | 2 | 50.00% |
Al Viro | 1 | 1.56% | 1 | 25.00% |
Total | 64 | 100.00% | 4 | 100.00% |
/*
* Generic function to send a packet as reply to another packet.
* Used to send some TCP resets/acks so far.
*/
void ip_send_unicast_reply(struct sock *sk, struct sk_buff *skb,
const struct ip_options *sopt,
__be32 daddr, __be32 saddr,
const struct ip_reply_arg *arg,
unsigned int len)
{
struct ip_options_data replyopts;
struct ipcm_cookie ipc;
struct flowi4 fl4;
struct rtable *rt = skb_rtable(skb);
struct net *net = sock_net(sk);
struct sk_buff *nskb;
int err;
int oif;
if (__ip_options_echo(&replyopts.opt.opt, skb, sopt))
return;
ipc.addr = daddr;
ipc.opt = NULL;
ipc.tx_flags = 0;
ipc.ttl = 0;
ipc.tos = -1;
if (replyopts.opt.opt.optlen) {
ipc.opt = &replyopts.opt;
if (replyopts.opt.opt.srr)
daddr = replyopts.opt.opt.faddr;
}
oif = arg->bound_dev_if;
if (!oif && netif_index_is_l3_master(net, skb->skb_iif))
oif = skb->skb_iif;
flowi4_init_output(&fl4, oif,
IP4_REPLY_MARK(net, skb->mark),
RT_TOS(arg->tos),
RT_SCOPE_UNIVERSE, ip_hdr(skb)->protocol,
ip_reply_arg_flowi_flags(arg),
daddr, saddr,
tcp_hdr(skb)->source, tcp_hdr(skb)->dest,
arg->uid);
security_skb_classify_flow(skb, flowi4_to_flowi(&fl4));
rt = ip_route_output_key(net, &fl4);
if (IS_ERR(rt))
return;
inet_sk(sk)->tos = arg->tos;
sk->sk_priority = skb->priority;
sk->sk_protocol = ip_hdr(skb)->protocol;
sk->sk_bound_dev_if = arg->bound_dev_if;
sk->sk_sndbuf = sysctl_wmem_default;
sk->sk_mark = fl4.flowi4_mark;
err = ip_append_data(sk, &fl4, ip_reply_glue_bits, arg->iov->iov_base,
len, 0, &ipc, &rt, MSG_DONTWAIT);
if (unlikely(err)) {
ip_flush_pending_frames(sk);
goto out;
}
nskb = skb_peek(&sk->sk_write_queue);
if (nskb) {
if (arg->csumoffset >= 0)
*((__sum16 *)skb_transport_header(nskb) +
arg->csumoffset) = csum_fold(csum_add(nskb->csum,
arg->csum));
nskb->ip_summed = CHECKSUM_NONE;
ip_push_pending_frames(sk, &fl4);
}
out:
ip_rt_put(rt);
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Linus Torvalds (pre-git) | 137 | 29.91% | 8 | 17.39% |
Eric Dumazet | 67 | 14.63% | 7 | 15.22% |
David S. Miller | 63 | 13.76% | 9 | 19.57% |
Alexey Kuznetsov | 62 | 13.54% | 2 | 4.35% |
David Ahern | 30 | 6.55% | 3 | 6.52% |
Vasily Averin | 24 | 5.24% | 1 | 2.17% |
Arnaldo Carvalho de Melo | 14 | 3.06% | 4 | 8.70% |
Francesco Fusco | 13 | 2.84% | 1 | 2.17% |
Lorenzo Colitti | 12 | 2.62% | 2 | 4.35% |
Patrick McHardy | 8 | 1.75% | 1 | 2.17% |
Pau Espin Pedrol | 8 | 1.75% | 1 | 2.17% |
Venkat Yekkirala | 7 | 1.53% | 1 | 2.17% |
Patrick Ohly | 5 | 1.09% | 1 | 2.17% |
Changli Gao | 2 | 0.44% | 1 | 2.17% |
Denis V. Lunev | 2 | 0.44% | 1 | 2.17% |
KOVACS Krisztian | 2 | 0.44% | 1 | 2.17% |
Al Viro | 1 | 0.22% | 1 | 2.17% |
Oliver Hartkopp | 1 | 0.22% | 1 | 2.17% |
Total | 458 | 100.00% | 46 | 100.00% |
void __init ip_init(void)
{
ip_rt_init();
inet_initpeers();
#if defined(CONFIG_IP_MULTICAST)
igmp_mc_init();
#endif
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Linus Torvalds (pre-git) | 16 | 64.00% | 5 | 55.56% |
Stephen Hemminger | 5 | 20.00% | 1 | 11.11% |
David L Stevens | 2 | 8.00% | 1 | 11.11% |
Américo Wang | 1 | 4.00% | 1 | 11.11% |
Hideaki Yoshifuji / 吉藤英明 | 1 | 4.00% | 1 | 11.11% |
Total | 25 | 100.00% | 9 | 100.00% |
Overall Contributors
Person | Tokens | Prop | Commits | CommitProp |
Alexey Kuznetsov | 2099 | 26.49% | 7 | 2.30% |
Herbert Xu | 1348 | 17.01% | 19 | 6.23% |
Linus Torvalds (pre-git) | 1152 | 14.54% | 33 | 10.82% |
David S. Miller | 567 | 7.15% | 38 | 12.46% |
Eric Dumazet | 533 | 6.73% | 26 | 8.52% |
Florian Westphal | 251 | 3.17% | 5 | 1.64% |
Ananda Raju | 217 | 2.74% | 1 | 0.33% |
Patrick McHardy | 173 | 2.18% | 13 | 4.26% |
Eric W. Biedermann | 162 | 2.04% | 17 | 5.57% |
Andy Zhou | 135 | 1.70% | 1 | 0.33% |
Arnaldo Carvalho de Melo | 133 | 1.68% | 20 | 6.56% |
Hannes Frederic Sowa | 123 | 1.55% | 10 | 3.28% |
Daniel Mack | 88 | 1.11% | 1 | 0.33% |
Francesco Fusco | 78 | 0.98% | 1 | 0.33% |
Hideaki Yoshifuji / 吉藤英明 | 74 | 0.93% | 8 | 2.62% |
Pavel Emelyanov | 70 | 0.88% | 3 | 0.98% |
Julian Anastasov | 66 | 0.83% | 5 | 1.64% |
David Ahern | 51 | 0.64% | 4 | 1.31% |
Willem de Bruijn | 46 | 0.58% | 2 | 0.66% |
Roopa Prabhu | 35 | 0.44% | 1 | 0.33% |
Mitsuru Chinen | 35 | 0.44% | 1 | 0.33% |
Al Viro | 30 | 0.38% | 11 | 3.61% |
Jiri Pirko | 27 | 0.34% | 1 | 0.33% |
David L Stevens | 27 | 0.34% | 2 | 0.66% |
Linus Torvalds | 26 | 0.33% | 6 | 1.97% |
Neil Horman | 24 | 0.30% | 1 | 0.33% |
Vasily Averin | 24 | 0.30% | 1 | 0.33% |
Steffen Klassert | 23 | 0.29% | 3 | 0.98% |
Tóth László Attila | 23 | 0.29% | 1 | 0.33% |
Ian Morris | 22 | 0.28% | 1 | 0.33% |
Wei Dong | 20 | 0.25% | 2 | 0.66% |
Kostya Belezko | 16 | 0.20% | 1 | 0.33% |
Bart De Schuymer | 14 | 0.18% | 1 | 0.33% |
Konstantin Khlebnikov | 14 | 0.18% | 1 | 0.33% |
Michal Kubeček | 13 | 0.16% | 2 | 0.66% |
Lorenzo Colitti | 12 | 0.15% | 2 | 0.66% |
Krishna Kumar | 10 | 0.13% | 1 | 0.33% |
Joe Perches | 10 | 0.13% | 2 | 0.66% |
Venkat Yekkirala | 9 | 0.11% | 1 | 0.33% |
Eli Cooper | 9 | 0.11% | 1 | 0.33% |
Américo Wang | 8 | 0.10% | 2 | 0.66% |
Thomas Graf | 8 | 0.10% | 1 | 0.33% |
Pau Espin Pedrol | 8 | 0.10% | 1 | 0.33% |
John Heffner | 8 | 0.10% | 1 | 0.33% |
Stephen Hemminger | 7 | 0.09% | 3 | 0.98% |
Pravin B Shelar | 7 | 0.09% | 1 | 0.33% |
James Morris | 7 | 0.09% | 1 | 0.33% |
Patrick Ohly | 5 | 0.06% | 1 | 0.33% |
Ansis Atteka | 5 | 0.06% | 2 | 0.66% |
Jan Engelhardt | 5 | 0.06% | 1 | 0.33% |
Tom Herbert | 5 | 0.06% | 1 | 0.33% |
Denis V. Lunev | 4 | 0.05% | 3 | 0.98% |
Shmulik Ladkani | 4 | 0.05% | 1 | 0.33% |
Julien Tinnes | 4 | 0.05% | 1 | 0.33% |
Vasiliy Kulikov | 4 | 0.05% | 1 | 0.33% |
Alexey Kodanev | 4 | 0.05% | 1 | 0.33% |
Zheng Li | 4 | 0.05% | 1 | 0.33% |
Bill Sommerfeld | 3 | 0.04% | 1 | 0.33% |
Tejun Heo | 3 | 0.04% | 1 | 0.33% |
Jozsef Kadlecsik | 3 | 0.04% | 2 | 0.66% |
Marcelo Ricardo Leitner | 3 | 0.04% | 1 | 0.33% |
Adrian Bunk | 3 | 0.04% | 3 | 0.98% |
Alexey Dobriyan | 2 | 0.03% | 2 | 0.66% |
Lance Richardson | 2 | 0.03% | 2 | 0.66% |
KOVACS Krisztian | 2 | 0.03% | 1 | 0.33% |
Shan Wei | 2 | 0.03% | 1 | 0.33% |
Ian Campbell | 2 | 0.03% | 1 | 0.33% |
Changli Gao | 2 | 0.03% | 1 | 0.33% |
Paul Gortmaker | 2 | 0.03% | 1 | 0.33% |
Yasuyuki Kozakai | 2 | 0.03% | 1 | 0.33% |
Sridhar Samudrala | 2 | 0.03% | 1 | 0.33% |
Octavian Purdila | 1 | 0.01% | 1 | 0.33% |
Atis Elsts | 1 | 0.01% | 1 | 0.33% |
Lucas De Marchi | 1 | 0.01% | 1 | 0.33% |
Oliver Hartkopp | 1 | 0.01% | 1 | 0.33% |
Javier Martinez Canillas | 1 | 0.01% | 1 | 0.33% |
Chuck Lever | 1 | 0.01% | 1 | 0.33% |
Total | 7925 | 100.00% | 305 | 100.00% |
Information contained on this website is for historical information purposes only and does not indicate or represent copyright ownership.