static int rocker_port_switch_fib_ipv4_add(struct net_device *dev,
__be32 dst, int dst_len,
struct fib_info *fi,
- u8 tos, u8 type, u32 tb_id)
+ u8 tos, u8 type,
+ u32 nlflags, u32 tb_id)
{
struct rocker_port *rocker_port = netdev_priv(dev);
int flags = 0;
* state change.
* int (*ndo_sw_parent_fib_ipv4_add)(struct net_device *dev, __be32 dst,
* int dst_len, struct fib_info *fi,
- * u8 tos, u8 type, u32 tb_id);
+ * u8 tos, u8 type, u32 nlflags, u32 tb_id);
* Called to add/modify IPv4 route to switch device.
* int (*ndo_sw_parent_fib_ipv4_del)(struct net_device *dev, __be32 dst,
* int dst_len, struct fib_info *fi,
int dst_len,
struct fib_info *fi,
u8 tos, u8 type,
+ u32 nlflags,
u32 tb_id);
int (*ndo_switch_fib_ipv4_del)(struct net_device *dev,
__be32 dst,
/*
* include/net/switchdev.h - Switch device API
* Copyright (c) 2014 Jiri Pirko <jiri@resnulli.us>
+ * Copyright (c) 2014-2015 Scott Feldman <sfeldma@gmail.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
int ndo_dflt_netdev_switch_port_bridge_setlink(struct net_device *dev,
struct nlmsghdr *nlh, u16 flags);
int netdev_switch_fib_ipv4_add(u32 dst, int dst_len, struct fib_info *fi,
- u8 tos, u8 type, u32 tb_id);
+ u8 tos, u8 type, u32 nlflags, u32 tb_id);
int netdev_switch_fib_ipv4_del(u32 dst, int dst_len, struct fib_info *fi,
u8 tos, u8 type, u32 tb_id);
void netdev_switch_fib_ipv4_abort(struct fib_info *fi);
static inline int netdev_switch_fib_ipv4_add(u32 dst, int dst_len,
struct fib_info *fi,
- u8 tos, u8 type, u32 tb_id)
+ u8 tos, u8 type,
+ u32 nlflags, u32 tb_id)
{
return 0;
}
err = netdev_switch_fib_ipv4_add(key, plen, fi,
new_fa->fa_tos,
cfg->fc_type,
+ cfg->fc_nlflags,
tb->tb_id);
if (err) {
netdev_switch_fib_ipv4_abort(fi);
/* (Optionally) offload fib entry to switch hardware. */
err = netdev_switch_fib_ipv4_add(key, plen, fi, tos,
- cfg->fc_type, tb->tb_id);
+ cfg->fc_type,
+ cfg->fc_nlflags,
+ tb->tb_id);
if (err) {
netdev_switch_fib_ipv4_abort(fi);
goto out_free_new_fa;
/*
* net/switchdev/switchdev.c - Switch device API
* Copyright (c) 2014 Jiri Pirko <jiri@resnulli.us>
+ * Copyright (c) 2014-2015 Scott Feldman <sfeldma@gmail.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* @fi: route FIB info structure
* @tos: route TOS
* @type: route type
+ * @nlflags: netlink flags passed in (NLM_F_*)
* @tb_id: route table ID
*
* Add IPv4 route entry to switch device.
*/
int netdev_switch_fib_ipv4_add(u32 dst, int dst_len, struct fib_info *fi,
- u8 tos, u8 type, u32 tb_id)
+ u8 tos, u8 type, u32 nlflags, u32 tb_id)
{
struct net_device *dev;
const struct net_device_ops *ops;
if (ops->ndo_switch_fib_ipv4_add) {
err = ops->ndo_switch_fib_ipv4_add(dev, htonl(dst), dst_len,
- fi, tos, type, tb_id);
+ fi, tos, type, nlflags,
+ tb_id);
if (!err)
fi->fib_flags |= RTNH_F_EXTERNAL;
}