diff mbox

[1/2] vlan: add neigh_setup

Message ID 20090107121659.385897000@de.ibm.com
State Accepted, archived
Delegated to: David Miller
Headers show

Commit Message

frank.blaschka@de.ibm.com Jan. 7, 2009, 12:15 p.m. UTC
From: Frank Blaschka <frank.blaschka@de.ibm.com>

In case the real device has a neigh_setup function, this
neigh_setup function should be used for the vlan device.

Signed-off-by: Frank Blaschka <frank.blaschka@de.ibm.com>
---
 net/8021q/vlan_dev.c |   14 ++++++++++++++
 1 file changed, 14 insertions(+)

Comments

David Miller Jan. 8, 2009, 6:50 p.m. UTC | #1
From: frank.blaschka@de.ibm.com
Date: Wed, 07 Jan 2009 13:15:51 +0100

> In case the real device has a neigh_setup function, this
> neigh_setup function should be used for the vlan device.
> 
> Signed-off-by: Frank Blaschka <frank.blaschka@de.ibm.com>

This looks fine, 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

Index: git_linus/net/8021q/vlan_dev.c
===================================================================
--- git_linus.orig/net/8021q/vlan_dev.c
+++ git_linus/net/8021q/vlan_dev.c
@@ -546,6 +546,18 @@  static int vlan_dev_ioctl(struct net_dev
 	return err;
 }
 
+static int vlan_dev_neigh_setup(struct net_device *dev, struct neigh_parms *pa)
+{
+	struct net_device *real_dev = vlan_dev_info(dev)->real_dev;
+	const struct net_device_ops *ops = real_dev->netdev_ops;
+	int err = 0;
+
+	if (netif_device_present(real_dev) && ops->ndo_neigh_setup)
+		err = ops->ndo_neigh_setup(dev, pa);
+
+	return err;
+}
+
 static void vlan_dev_change_rx_flags(struct net_device *dev, int change)
 {
 	struct net_device *real_dev = vlan_dev_info(dev)->real_dev;
@@ -713,6 +725,7 @@  static const struct net_device_ops vlan_
 	.ndo_set_multicast_list	= vlan_dev_set_rx_mode,
 	.ndo_change_rx_flags	= vlan_dev_change_rx_flags,
 	.ndo_do_ioctl		= vlan_dev_ioctl,
+	.ndo_neigh_setup	= vlan_dev_neigh_setup,
 };
 
 static const struct net_device_ops vlan_netdev_accel_ops = {
@@ -728,6 +741,7 @@  static const struct net_device_ops vlan_
 	.ndo_set_multicast_list	= vlan_dev_set_rx_mode,
 	.ndo_change_rx_flags	= vlan_dev_change_rx_flags,
 	.ndo_do_ioctl		= vlan_dev_ioctl,
+	.ndo_neigh_setup	= vlan_dev_neigh_setup,
 };
 
 void vlan_setup(struct net_device *dev)