summaryrefslogtreecommitdiffstats
path: root/include/net/ip_fib.h
diff options
context:
space:
mode:
authorDavid Ahern <dsahern@gmail.com>2019-04-23 17:48:09 +0200
committerDavid S. Miller <davem@davemloft.net>2019-04-24 04:44:18 +0200
commitecc5663cce8c7d7e4eba32af4e1e3cab296c64b9 (patch)
tree603721eb5458c0346038f29141f1842db7b31e67 /include/net/ip_fib.h
parentlwtunnel: Pass encap and encap type attributes to lwtunnel_fill_encap (diff)
downloadlinux-ecc5663cce8c7d7e4eba32af4e1e3cab296c64b9.tar.xz
linux-ecc5663cce8c7d7e4eba32af4e1e3cab296c64b9.zip
net: Change nhc_flags to unsigned char
nhc_flags holds the RTNH_F flags for a given nexthop (fib{6}_nh). All of the RTNH_F_ flags fit in an unsigned char, and since the API to userspace (rtnh_flags and lower byte of rtm_flags) is 1 byte it can not grow. Make nhc_flags in fib_nh_common an unsigned char and shrink the size of the struct by 8, from 56 to 48 bytes. Update the flags arguments for up netdevice events and fib_nexthop_info which determines the RTNH_F flags to return on a dump/event. The RTNH_F flags are passed in the lower byte of rtm_flags which is an unsigned int so use a temp variable for the flags to fib_nexthop_info and combine with rtm_flags in the caller. Signed-off-by: David Ahern <dsahern@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/net/ip_fib.h')
-rw-r--r--include/net/ip_fib.h8
1 files changed, 4 insertions, 4 deletions
diff --git a/include/net/ip_fib.h b/include/net/ip_fib.h
index d8195c77e247..772a9e61bd84 100644
--- a/include/net/ip_fib.h
+++ b/include/net/ip_fib.h
@@ -83,11 +83,11 @@ struct fnhe_hash_bucket {
struct fib_nh_common {
struct net_device *nhc_dev;
int nhc_oif;
- unsigned int nhc_flags;
- struct lwtunnel_state *nhc_lwtstate;
unsigned char nhc_scope;
u8 nhc_family;
u8 nhc_gw_family;
+ unsigned char nhc_flags;
+ struct lwtunnel_state *nhc_lwtstate;
union {
__be32 ipv4;
@@ -425,7 +425,7 @@ int fib_unmerge(struct net *net);
int ip_fib_check_default(__be32 gw, struct net_device *dev);
int fib_sync_down_dev(struct net_device *dev, unsigned long event, bool force);
int fib_sync_down_addr(struct net_device *dev, __be32 local);
-int fib_sync_up(struct net_device *dev, unsigned int nh_flags);
+int fib_sync_up(struct net_device *dev, unsigned char nh_flags);
void fib_sync_mtu(struct net_device *dev, u32 orig_mtu);
#ifdef CONFIG_IP_ROUTE_MULTIPATH
@@ -500,7 +500,7 @@ int ip_valid_fib_dump_req(struct net *net, const struct nlmsghdr *nlh,
struct netlink_callback *cb);
int fib_nexthop_info(struct sk_buff *skb, const struct fib_nh_common *nh,
- unsigned int *flags, bool skip_oif);
+ unsigned char *flags, bool skip_oif);
int fib_add_nexthop(struct sk_buff *skb, const struct fib_nh_common *nh,
int nh_weight);
#endif /* _NET_FIB_H */