<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux/drivers/net/ipvlan/ipvlan_core.c, branch v4.9</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/
</subtitle>
<id>https://git.shady.money/linux/atom?h=v4.9</id>
<link rel='self' href='https://git.shady.money/linux/atom?h=v4.9'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/'/>
<updated>2016-09-19T05:25:22Z</updated>
<entry>
<title>ipvlan: Introduce l3s mode</title>
<updated>2016-09-19T05:25:22Z</updated>
<author>
<name>Mahesh Bandewar</name>
<email>maheshb@google.com</email>
</author>
<published>2016-09-16T19:59:19Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=4fbae7d83c98c30efcf0a2a2ac55fbb75ef5a1a5'/>
<id>urn:sha1:4fbae7d83c98c30efcf0a2a2ac55fbb75ef5a1a5</id>
<content type='text'>
In a typical IPvlan L3 setup where master is in default-ns and
each slave is into different (slave) ns. In this setup egress
packet processing for traffic originating from slave-ns will
hit all NF_HOOKs in slave-ns as well as default-ns. However same
is not true for ingress processing. All these NF_HOOKs are
hit only in the slave-ns skipping them in the default-ns.
IPvlan in L3 mode is restrictive and if admins want to deploy
iptables rules in default-ns, this asymmetric data path makes it
impossible to do so.

This patch makes use of the l3_rcv() (added as part of l3mdev
enhancements) to perform input route lookup on RX packets without
changing the skb-&gt;dev and then uses nf_hook at NF_INET_LOCAL_IN
to change the skb-&gt;dev just before handing over skb to L4.

Signed-off-by: Mahesh Bandewar &lt;maheshb@google.com&gt;
CC: David Ahern &lt;dsa@cumulusnetworks.com&gt;
Reviewed-by: David Ahern &lt;dsa@cumulusnetworks.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>ipvlan: Scrub skb before crossing the namespace boundry</title>
<updated>2016-07-26T04:47:26Z</updated>
<author>
<name>Mahesh Bandewar</name>
<email>maheshb@google.com</email>
</author>
<published>2016-07-25T21:38:16Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=b93dd49c1a35884864027abd707889b795637f7a'/>
<id>urn:sha1:b93dd49c1a35884864027abd707889b795637f7a</id>
<content type='text'>
The earlier patch c3aaa06d5a63 (ipvlan: scrub skb before routing
in L3 mode.) did this but only for TX path in L3 mode. This
patch extends it for both the modes for TX/RX path.

Signed-off-by: Mahesh Bandewar &lt;maheshb@google.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>ipvlan: misc changes</title>
<updated>2016-02-22T03:43:24Z</updated>
<author>
<name>Mahesh Bandewar</name>
<email>maheshb@google.com</email>
</author>
<published>2016-02-21T03:31:41Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=ab5b7013db3cc637a8f19e00d71310e40db75bf6'/>
<id>urn:sha1:ab5b7013db3cc637a8f19e00d71310e40db75bf6</id>
<content type='text'>
1. scope correction for few functions that are used in single file.
2. Adjust variables that are used in fast-path to fit into single cacheline
3. Update rcv_frame() to skip shared check for frames coming over wire

Signed-off-by: Mahesh Bandewar &lt;maheshb@google.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>ipvlan: scrub skb before routing in L3 mode.</title>
<updated>2016-02-22T03:43:24Z</updated>
<author>
<name>Mahesh Bandewar</name>
<email>maheshb@google.com</email>
</author>
<published>2016-02-21T03:31:32Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=c3aaa06d5a63609641b7ad62ee0956f3de86c1cd'/>
<id>urn:sha1:c3aaa06d5a63609641b7ad62ee0956f3de86c1cd</id>
<content type='text'>
Scrub skb before hitting the iptable hooks to ensure packets hit
these hooks. Set the xnet param only when the packet is crossing the
ns boundry so if the IPvlan slave and master belong to the same ns,
the param will be set to false.

Signed-off-by: Mahesh Bandewar &lt;maheshb@google.com&gt;
CC: Cong Wang &lt;xiyou.wangcong@gmail.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>ipvlan: fix use after free of skb</title>
<updated>2015-11-17T19:39:29Z</updated>
<author>
<name>Sabrina Dubroca</name>
<email>sd@queasysnail.net</email>
</author>
<published>2015-11-16T21:44:53Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=a534dc529853c69e94994aa47c1d80a03ce2c11d'/>
<id>urn:sha1:a534dc529853c69e94994aa47c1d80a03ce2c11d</id>
<content type='text'>
ipvlan_handle_frame is a rx_handler, and when it returns a value other
than RX_HANDLER_CONSUMED (here, NET_RX_DROP aka RX_HANDLER_ANOTHER),
__netif_receive_skb_core expects that the skb still exists and will
process it further, but we just freed it.

Fixes: 2ad7bf363841 ("ipvlan: Initial check-in of the IPVLAN driver.")
Signed-off-by: Sabrina Dubroca &lt;sd@queasysnail.net&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>ipvlan: fix leak in ipvlan_rcv_frame</title>
<updated>2015-11-17T19:39:28Z</updated>
<author>
<name>Sabrina Dubroca</name>
<email>sd@queasysnail.net</email>
</author>
<published>2015-11-16T21:34:26Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=cf554ada0be7077906aa9a17faf151ff66e3cb8e'/>
<id>urn:sha1:cf554ada0be7077906aa9a17faf151ff66e3cb8e</id>
<content type='text'>
Pass a **skb to ipvlan_rcv_frame so that if skb_share_check returns a
new skb, we actually use it during further processing.

It's safe to ignore the new skb in the ipvlan_xmit_* functions, because
they call ipvlan_rcv_frame with local == true, so that dev_forward_skb
is called and always takes ownership of the skb.

Fixes: 2ad7bf363841 ("ipvlan: Initial check-in of the IPVLAN driver.")
Signed-off-by: Sabrina Dubroca &lt;sd@queasysnail.net&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>ipvlan: read direct ifindex instead of iflink</title>
<updated>2015-10-22T13:39:08Z</updated>
<author>
<name>Brenden Blanco</name>
<email>bblanco@plumgrid.com</email>
</author>
<published>2015-10-20T23:47:33Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=63b11e757d6dae570bc22450ec58a5b68cdf5c3c'/>
<id>urn:sha1:63b11e757d6dae570bc22450ec58a5b68cdf5c3c</id>
<content type='text'>
In the ipv4 outbound path of an ipvlan device in l3 mode, the ifindex is
being grabbed from dev_get_iflink. This works for the physical device
case, since as the documentation of that function notes: "Physical
interfaces have the same 'ifindex' and 'iflink' values.".  However, if
the master device is a veth, and the pairs are in separate net
namespaces, the route lookup will fail with -ENODEV due to outer veth
pair being in a separate namespace from the ipvlan master/routing
namespace.

  ns0    |   ns1    |   ns2
 veth0a--|--veth0b--|--ipvl0

In ipvlan_process_v4_outbound(), a packet sent from ipvl0 in the above
configuration will pass fl.flowi4_oif == veth0a to
ip_route_output_flow(), but *net == ns1.

Notice also that ipv6 processing is not using iflink. Since there is a
discrepancy in usage, fixup both v4 and v6 case to use local dev
variable.

Tested this with l3 ipvlan on top of veth, as well as with single
physical interface in the top namespace.

Signed-off-by: Brenden Blanco &lt;bblanco@plumgrid.com&gt;
Reviewed-by: Jiri Benc &lt;jbenc@redhat.com&gt;
Acked-by: Mahesh Bandewar &lt;maheshb@google.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>ipv4, ipv6: Pass net into ip_local_out and ip6_local_out</title>
<updated>2015-10-08T11:27:02Z</updated>
<author>
<name>Eric W. Biederman</name>
<email>ebiederm@xmission.com</email>
</author>
<published>2015-10-07T21:48:46Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=33224b16ffccb49cf798317670389e0bfba0024c'/>
<id>urn:sha1:33224b16ffccb49cf798317670389e0bfba0024c</id>
<content type='text'>
Signed-off-by: "Eric W. Biederman" &lt;ebiederm@xmission.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>ipvlan: Cache net in ipvlan_process_v4_outbound and ipvlan_process_v6_outbound</title>
<updated>2015-10-08T11:27:01Z</updated>
<author>
<name>Eric W. Biederman</name>
<email>ebiederm@xmission.com</email>
</author>
<published>2015-10-07T21:48:44Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=57c4bf859cad9d6c4f73d8c98a95e00f156301e0'/>
<id>urn:sha1:57c4bf859cad9d6c4f73d8c98a95e00f156301e0</id>
<content type='text'>
Compute net once in ipvlan_process_v4_outbound and
ipvlan_process_v6_outbound and store it in a variable so that net does
not need to be recomputed next time it is used.

Signed-off-by: "Eric W. Biederman" &lt;ebiederm@xmission.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>ipv6: Merge ip6_local_out and ip6_local_out_sk</title>
<updated>2015-10-08T11:26:58Z</updated>
<author>
<name>Eric W. Biederman</name>
<email>ebiederm@xmission.com</email>
</author>
<published>2015-10-07T21:48:40Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=792883303cdb3a7edd16017d7aba53926189ef41'/>
<id>urn:sha1:792883303cdb3a7edd16017d7aba53926189ef41</id>
<content type='text'>
Stop hidding the sk parameter with an inline helper function and make
all of the callers pass it, so that it is clear what the function is
doing.

Signed-off-by: "Eric W. Biederman" &lt;ebiederm@xmission.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
</feed>
