]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/commit - include/linux/netdevice.h
net-next: add dev_loopback_xmit() to avoid duplicate code
authorMichel Machado <michel@digirati.com.br>
Tue, 12 Jun 2012 10:16:35 +0000 (10:16 +0000)
committerDavid S. Miller <davem@davemloft.net>
Wed, 13 Jun 2012 01:51:09 +0000 (18:51 -0700)
commit95603e2293de556de7e82221649bfd7fd98b64a3
treed90e7570b072f62ee4fefa619b93ec771bfd9f95
parentde063b7040dcd9fbc9a1847fa44f0af13e19d6de
net-next: add dev_loopback_xmit() to avoid duplicate code

Add dev_loopback_xmit() in order to deduplicate functions
ip_dev_loopback_xmit() (in net/ipv4/ip_output.c) and
ip6_dev_loopback_xmit() (in net/ipv6/ip6_output.c).

I was about to reinvent the wheel when I noticed that
ip_dev_loopback_xmit() and ip6_dev_loopback_xmit() do exactly what I
need and are not IP-only functions, but they were not available to reuse
elsewhere.

ip6_dev_loopback_xmit() does not have line "skb_dst_force(skb);", but I
understand that this is harmless, and should be in dev_loopback_xmit().

Signed-off-by: Michel Machado <michel@digirati.com.br>
CC: "David S. Miller" <davem@davemloft.net>
CC: Alexey Kuznetsov <kuznet@ms2.inr.ac.ru>
CC: James Morris <jmorris@namei.org>
CC: Hideaki YOSHIFUJI <yoshfuji@linux-ipv6.org>
CC: Patrick McHardy <kaber@trash.net>
CC: Eric Dumazet <edumazet@google.com>
CC: Jiri Pirko <jpirko@redhat.com>
CC: "Michał Mirosław" <mirq-linux@rere.qmqm.pl>
CC: Ben Hutchings <bhutchings@solarflare.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
include/linux/netdevice.h
net/core/dev.c
net/ipv4/ip_output.c
net/ipv6/ip6_output.c