diff mbox

[2/2,V2] macvlan fdb replace support

Message ID 1374247208-8226-2-git-send-email-tmricht@linux.vnet.ibm.com
State Accepted, archived
Delegated to: David Miller
Headers show

Commit Message

Thomas Richter July 19, 2013, 3:20 p.m. UTC
Add support for iproute2 command 'bridge fdb replace ...'.
The rtnletlink call back function ndo_fdb_add will be called
with the NLM_F_REPLACE flag set.
Simply return -EOPNOTSUP.

Resubmitted because net-next was closed last week.

Signed-off-by: Thomas Richter <tmricht@linux.vnet.ibm.com>
---
 drivers/net/macvlan.c | 3 +++
 1 file changed, 3 insertions(+)

Comments

Stephen Hemminger July 19, 2013, 4:18 p.m. UTC | #1
On Fri, 19 Jul 2013 17:20:08 +0200
Thomas Richter <tmricht@linux.vnet.ibm.com> wrote:

> Add support for iproute2 command 'bridge fdb replace ...'.
> The rtnletlink call back function ndo_fdb_add will be called
> with the NLM_F_REPLACE flag set.
> Simply return -EOPNOTSUP.
> 
> Resubmitted because net-next was closed last week.
> 
> Signed-off-by: Thomas Richter <tmricht@linux.vnet.ibm.com>
> ---
>  drivers/net/macvlan.c | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/drivers/net/macvlan.c b/drivers/net/macvlan.c
> index 18373b6..74907f5 100644
> --- a/drivers/net/macvlan.c
> +++ b/drivers/net/macvlan.c
> @@ -597,6 +597,9 @@ static int macvlan_fdb_add(struct ndmsg *ndm, struct nlattr *tb[],
>  	if (!vlan->port->passthru)
>  		return -EOPNOTSUPP;
>  
> +	if (flags & NLM_F_REPLACE)
> +		return -EOPNOTSUPP;
> +
>  	if (is_unicast_ether_addr(addr))
>  		err = dev_uc_add_excl(dev, addr);
>  	else if (is_multicast_ether_addr(addr))

What about bridge that also uses netlink FDB interface?
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Thomas Richter July 22, 2013, 1:16 p.m. UTC | #2
On 07/19/2013 06:18 PM, Stephen Hemminger wrote:
> On Fri, 19 Jul 2013 17:20:08 +0200
> Thomas Richter <tmricht@linux.vnet.ibm.com> wrote:
> 
>> Add support for iproute2 command 'bridge fdb replace ...'.
>> The rtnletlink call back function ndo_fdb_add will be called
>> with the NLM_F_REPLACE flag set.
>> Simply return -EOPNOTSUP.
>>
>> Resubmitted because net-next was closed last week.
>>
>> Signed-off-by: Thomas Richter <tmricht@linux.vnet.ibm.com>
>> ---
>>  drivers/net/macvlan.c | 3 +++
>>  1 file changed, 3 insertions(+)
>>
>> diff --git a/drivers/net/macvlan.c b/drivers/net/macvlan.c
>> index 18373b6..74907f5 100644
>> --- a/drivers/net/macvlan.c
>> +++ b/drivers/net/macvlan.c
>> @@ -597,6 +597,9 @@ static int macvlan_fdb_add(struct ndmsg *ndm, struct nlattr *tb[],
>>  	if (!vlan->port->passthru)
>>  		return -EOPNOTSUPP;
>>  
>> +	if (flags & NLM_F_REPLACE)
>> +		return -EOPNOTSUPP;
>> +
>>  	if (is_unicast_ether_addr(addr))
>>  		err = dev_uc_add_excl(dev, addr);
>>  	else if (is_multicast_ether_addr(addr))
> 
> What about bridge that also uses netlink FDB interface?
> 
The bridge function br_fdb_add() calls fdb_add_entry().
There is no need to check flag NLM_F_REPLACE.
The code already changes an entry if it is found
in the fdb. If the entry is missing in the
fdb, it is added when flag NLM_F_CREATE is set.
David Miller July 23, 2013, 11:36 p.m. UTC | #3
From: Thomas Richter <tmricht@linux.vnet.ibm.com>
Date: Fri, 19 Jul 2013 17:20:08 +0200

> Add support for iproute2 command 'bridge fdb replace ...'.
> The rtnletlink call back function ndo_fdb_add will be called
> with the NLM_F_REPLACE flag set.
> Simply return -EOPNOTSUP.
> 
> Resubmitted because net-next was closed last week.
> 
> Signed-off-by: Thomas Richter <tmricht@linux.vnet.ibm.com>

Applied.
--
To unsubscribe from this list: send the line "unsubscribe netdev" 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/drivers/net/macvlan.c b/drivers/net/macvlan.c
index 18373b6..74907f5 100644
--- a/drivers/net/macvlan.c
+++ b/drivers/net/macvlan.c
@@ -597,6 +597,9 @@  static int macvlan_fdb_add(struct ndmsg *ndm, struct nlattr *tb[],
 	if (!vlan->port->passthru)
 		return -EOPNOTSUPP;
 
+	if (flags & NLM_F_REPLACE)
+		return -EOPNOTSUPP;
+
 	if (is_unicast_ether_addr(addr))
 		err = dev_uc_add_excl(dev, addr);
 	else if (is_multicast_ether_addr(addr))