diff mbox

[net-next,03/16] vlan: add link to upper device

Message ID 1344871635-1052-4-git-send-email-jiri@resnulli.us (mailing list archive)
State Not Applicable
Headers show

Commit Message

Jiri Pirko Aug. 13, 2012, 3:27 p.m. UTC
Signed-off-by: Jiri Pirko <jiri@resnulli.us>
---
 net/8021q/vlan.c |   10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

Comments

Flavio Leitner Aug. 13, 2012, 7:04 p.m. UTC | #1
On Mon, 13 Aug 2012 17:27:02 +0200
Jiri Pirko <jiri@resnulli.us> wrote:

> Signed-off-by: Jiri Pirko <jiri@resnulli.us>
> ---
>  net/8021q/vlan.c |   10 +++++++++-
>  1 file changed, 9 insertions(+), 1 deletion(-)
> 
> diff --git a/net/8021q/vlan.c b/net/8021q/vlan.c
> index 9096bcb..739665e 100644
> --- a/net/8021q/vlan.c
> +++ b/net/8021q/vlan.c
> @@ -105,6 +105,8 @@ void unregister_vlan_dev(struct net_device *dev, struct list_head *head)
>  	 */
>  	unregister_netdevice_queue(dev, head);
>  
> +	netdev_upper_dev_unlink(real_dev, dev);
> +
>  	if (grp->nr_vlan_devs == 0)
>  		vlan_gvrp_uninit_applicant(real_dev);
>  
> @@ -162,9 +164,13 @@ int register_vlan_dev(struct net_device *dev)
>  	if (err < 0)
>  		goto out_uninit_applicant;
>  
> +	err = netdev_upper_dev_link(real_dev, dev);
> +	if (err)
> +		goto out_uninit_applicant;
> +
>  	err = register_netdevice(dev);
>  	if (err < 0)
> -		goto out_uninit_applicant;
> +		goto out_upper_dev_unlink;
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^
see below:

>  
>  	/* Account for reference in struct vlan_dev_priv */
>  	dev_hold(real_dev);
> @@ -180,6 +186,8 @@ int register_vlan_dev(struct net_device *dev)
>  
>  	return 0;
>  
> +upper_dev_unlink:
^^^^^^^^^^^^^^^^^^^
should be out_upper_dev_unlink:

fbl

> +	netdev_upper_dev_unlink(real_dev, dev);
>  out_uninit_applicant:
>  	if (grp->nr_vlan_devs == 0)
>  		vlan_gvrp_uninit_applicant(real_dev);

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Jiri Pirko Aug. 14, 2012, 7:24 a.m. UTC | #2
Mon, Aug 13, 2012 at 09:04:21PM CEST, fbl@redhat.com wrote:
>On Mon, 13 Aug 2012 17:27:02 +0200
>Jiri Pirko <jiri@resnulli.us> wrote:
>
>> Signed-off-by: Jiri Pirko <jiri@resnulli.us>
>> ---
>>  net/8021q/vlan.c |   10 +++++++++-
>>  1 file changed, 9 insertions(+), 1 deletion(-)
>> 
>> diff --git a/net/8021q/vlan.c b/net/8021q/vlan.c
>> index 9096bcb..739665e 100644
>> --- a/net/8021q/vlan.c
>> +++ b/net/8021q/vlan.c
>> @@ -105,6 +105,8 @@ void unregister_vlan_dev(struct net_device *dev, struct list_head *head)
>>  	 */
>>  	unregister_netdevice_queue(dev, head);
>>  
>> +	netdev_upper_dev_unlink(real_dev, dev);
>> +
>>  	if (grp->nr_vlan_devs == 0)
>>  		vlan_gvrp_uninit_applicant(real_dev);
>>  
>> @@ -162,9 +164,13 @@ int register_vlan_dev(struct net_device *dev)
>>  	if (err < 0)
>>  		goto out_uninit_applicant;
>>  
>> +	err = netdev_upper_dev_link(real_dev, dev);
>> +	if (err)
>> +		goto out_uninit_applicant;
>> +
>>  	err = register_netdevice(dev);
>>  	if (err < 0)
>> -		goto out_uninit_applicant;
>> +		goto out_upper_dev_unlink;
>                ^^^^^^^^^^^^^^^^^^^^^^^^^^^
>see below:
>
>>  
>>  	/* Account for reference in struct vlan_dev_priv */
>>  	dev_hold(real_dev);
>> @@ -180,6 +186,8 @@ int register_vlan_dev(struct net_device *dev)
>>  
>>  	return 0;
>>  
>> +upper_dev_unlink:
>^^^^^^^^^^^^^^^^^^^
>should be out_upper_dev_unlink:

fixed.

Thanks!

>
>fbl
>
>> +	netdev_upper_dev_unlink(real_dev, dev);
>>  out_uninit_applicant:
>>  	if (grp->nr_vlan_devs == 0)
>>  		vlan_gvrp_uninit_applicant(real_dev);
>
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/net/8021q/vlan.c b/net/8021q/vlan.c
index 9096bcb..739665e 100644
--- a/net/8021q/vlan.c
+++ b/net/8021q/vlan.c
@@ -105,6 +105,8 @@  void unregister_vlan_dev(struct net_device *dev, struct list_head *head)
 	 */
 	unregister_netdevice_queue(dev, head);
 
+	netdev_upper_dev_unlink(real_dev, dev);
+
 	if (grp->nr_vlan_devs == 0)
 		vlan_gvrp_uninit_applicant(real_dev);
 
@@ -162,9 +164,13 @@  int register_vlan_dev(struct net_device *dev)
 	if (err < 0)
 		goto out_uninit_applicant;
 
+	err = netdev_upper_dev_link(real_dev, dev);
+	if (err)
+		goto out_uninit_applicant;
+
 	err = register_netdevice(dev);
 	if (err < 0)
-		goto out_uninit_applicant;
+		goto out_upper_dev_unlink;
 
 	/* Account for reference in struct vlan_dev_priv */
 	dev_hold(real_dev);
@@ -180,6 +186,8 @@  int register_vlan_dev(struct net_device *dev)
 
 	return 0;
 
+upper_dev_unlink:
+	netdev_upper_dev_unlink(real_dev, dev);
 out_uninit_applicant:
 	if (grp->nr_vlan_devs == 0)
 		vlan_gvrp_uninit_applicant(real_dev);