macvlan.c (dd1a175695edf662615e422d1c85eae875a411b2) macvlan.c (b13ba1b83f524732523db1079e56478b32c85c96)
1/*
2 * Copyright (c) 2007 Patrick McHardy <kaber@trash.net>
3 *
4 * This program is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU General Public License as
6 * published by the Free Software Foundation; either version 2 of
7 * the License, or (at your option) any later version.
8 *

--- 324 unchanged lines hidden (view full) ---

333static const struct header_ops macvlan_hard_header_ops = {
334 .create = macvlan_hard_header,
335 .rebuild = eth_rebuild_header,
336 .parse = eth_header_parse,
337 .cache = eth_header_cache,
338 .cache_update = eth_header_cache_update,
339};
340
1/*
2 * Copyright (c) 2007 Patrick McHardy <kaber@trash.net>
3 *
4 * This program is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU General Public License as
6 * published by the Free Software Foundation; either version 2 of
7 * the License, or (at your option) any later version.
8 *

--- 324 unchanged lines hidden (view full) ---

333static const struct header_ops macvlan_hard_header_ops = {
334 .create = macvlan_hard_header,
335 .rebuild = eth_rebuild_header,
336 .parse = eth_header_parse,
337 .cache = eth_header_cache,
338 .cache_update = eth_header_cache_update,
339};
340
341static struct rtnl_link_ops macvlan_link_ops;
342
341static int macvlan_open(struct net_device *dev)
342{
343 struct macvlan_dev *vlan = netdev_priv(dev);
344 struct net_device *lowerdev = vlan->lowerdev;
345 int err;
346
347 if (vlan->port->passthru) {
348 if (!(vlan->flags & MACVLAN_FLAG_NOPROMISC)) {
349 err = dev_set_promiscuity(lowerdev, 1);
350 if (err < 0)
351 goto out;
352 }
353 goto hash_add;
354 }
355
343static int macvlan_open(struct net_device *dev)
344{
345 struct macvlan_dev *vlan = netdev_priv(dev);
346 struct net_device *lowerdev = vlan->lowerdev;
347 int err;
348
349 if (vlan->port->passthru) {
350 if (!(vlan->flags & MACVLAN_FLAG_NOPROMISC)) {
351 err = dev_set_promiscuity(lowerdev, 1);
352 if (err < 0)
353 goto out;
354 }
355 goto hash_add;
356 }
357
356 if (lowerdev->features & NETIF_F_HW_L2FW_DOFFLOAD) {
358 if (lowerdev->features & NETIF_F_HW_L2FW_DOFFLOAD &&
359 dev->rtnl_link_ops == &macvlan_link_ops) {
357 vlan->fwd_priv =
358 lowerdev->netdev_ops->ndo_dfwd_add_station(lowerdev, dev);
359
360 /* If we get a NULL pointer back, or if we get an error
361 * then we should just fall through to the non accelerated path
362 */
363 if (IS_ERR_OR_NULL(vlan->fwd_priv)) {
364 vlan->fwd_priv = NULL;

--- 721 unchanged lines hidden ---
360 vlan->fwd_priv =
361 lowerdev->netdev_ops->ndo_dfwd_add_station(lowerdev, dev);
362
363 /* If we get a NULL pointer back, or if we get an error
364 * then we should just fall through to the non accelerated path
365 */
366 if (IS_ERR_OR_NULL(vlan->fwd_priv)) {
367 vlan->fwd_priv = NULL;

--- 721 unchanged lines hidden ---