lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAF2d9jjqF=MaZtN5znWqNOCmYocLzPV_g6i-PWYye3CcYy0g6Q@mail.gmail.com>
Date:	Tue, 6 Oct 2015 18:24:06 -0700
From:	Mahesh Bandewar <maheshb@...gle.com>
To:	"Eric W. Biederman" <ebiederm@...ssion.com>
Cc:	David Miller <davem@...emloft.net>,
	netfilter-devel@...r.kernel.org,
	linux-netdev <netdev@...r.kernel.org>,
	Nicolas Dichtel <nicolas.dichtel@...nd.com>,
	lvs-devel@...r.kernel.org
Subject: Re: [PATCH net-next 12/15] ipvlan: Cache net in ipvlan_process_v4_outbound
 and ipvlan_process_v6_outbound

On Tue, Oct 6, 2015 at 6:19 PM, Mahesh Bandewar <maheshb@...gle.com> wrote:
> On Tue, Oct 6, 2015 at 11:53 AM, Eric W. Biederman
> <ebiederm@...ssion.com> wrote:
>> 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.
>>
> It's used exactly once at this moment so don't know what "next time"
> is. Do you have any additional patch(es) planned?
>
OK. Got it! I was little early in sending that and did not look at the
entire patch-series.

>> Signed-off-by: "Eric W. Biederman" <ebiederm@...ssion.com>
>> ---
>>  drivers/net/ipvlan/ipvlan_core.c | 6 ++++--
>>  1 file changed, 4 insertions(+), 2 deletions(-)
>>
>> diff --git a/drivers/net/ipvlan/ipvlan_core.c b/drivers/net/ipvlan/ipvlan_core.c
>> index 75dcf36c0366..976f30b291f6 100644
>> --- a/drivers/net/ipvlan/ipvlan_core.c
>> +++ b/drivers/net/ipvlan/ipvlan_core.c
>> @@ -344,6 +344,7 @@ static int ipvlan_process_v4_outbound(struct sk_buff *skb)
>>  {
>>         const struct iphdr *ip4h = ip_hdr(skb);
>>         struct net_device *dev = skb->dev;
>> +       struct net *net = dev_net(dev);
>>         struct rtable *rt;
>>         int err, ret = NET_XMIT_DROP;
>>         struct flowi4 fl4 = {
>> @@ -354,7 +355,7 @@ static int ipvlan_process_v4_outbound(struct sk_buff *skb)
>>                 .saddr = ip4h->saddr,
>>         };
>>
>> -       rt = ip_route_output_flow(dev_net(dev), &fl4, NULL);
>> +       rt = ip_route_output_flow(net, &fl4, NULL);
>>         if (IS_ERR(rt))
>>                 goto err;
>>
>> @@ -381,6 +382,7 @@ static int ipvlan_process_v6_outbound(struct sk_buff *skb)
>>  {
>>         const struct ipv6hdr *ip6h = ipv6_hdr(skb);
>>         struct net_device *dev = skb->dev;
>> +       struct net *net = dev_net(dev);
>>         struct dst_entry *dst;
>>         int err, ret = NET_XMIT_DROP;
>>         struct flowi6 fl6 = {
>> @@ -393,7 +395,7 @@ static int ipvlan_process_v6_outbound(struct sk_buff *skb)
>>                 .flowi6_proto = ip6h->nexthdr,
>>         };
>>
>> -       dst = ip6_route_output(dev_net(dev), NULL, &fl6);
>> +       dst = ip6_route_output(net, NULL, &fl6);
>>         if (dst->error) {
>>                 ret = dst->error;
>>                 dst_release(dst);
>> --
>> 2.2.1
>>
>> --
>> To unsubscribe from this list: send the line "unsubscribe netdev" in
>> the body of a message to majordomo@...r.kernel.org
>> More majordomo info at  http://vger.kernel.org/majordomo-info.html
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ