summaryrefslogtreecommitdiffstats
path: root/drivers/net/bonding/bonding.h
diff options
context:
space:
mode:
authorVeaceslav Falico2014-05-15 21:39:56 +0200
committerDavid S. Miller2014-05-16 22:34:32 +0200
commit2807a9feb2393648f4db114fdf3fa99860ff6a36 (patch)
tree90a3995c88e73f5fc82ccf339d25676e3aa5def9 /drivers/net/bonding/bonding.h
parentbonding: create a macro for bond mode and use it (diff)
downloadkernel-qcow2-linux-2807a9feb2393648f4db114fdf3fa99860ff6a36.tar.gz
kernel-qcow2-linux-2807a9feb2393648f4db114fdf3fa99860ff6a36.tar.xz
kernel-qcow2-linux-2807a9feb2393648f4db114fdf3fa99860ff6a36.zip
bonding: make IS_IP_TARGET_UNUSABLE_ADDRESS an inline function
Also, use standard IP primitives to check the address. CC: Jay Vosburgh <j.vosburgh@gmail.com> CC: Andy Gospodarek <andy@greyhouse.net> Signed-off-by: Veaceslav Falico <vfalico@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/bonding/bonding.h')
-rw-r--r--drivers/net/bonding/bonding.h8
1 files changed, 5 insertions, 3 deletions
diff --git a/drivers/net/bonding/bonding.h b/drivers/net/bonding/bonding.h
index bb663a4db137..ac75b0fbf768 100644
--- a/drivers/net/bonding/bonding.h
+++ b/drivers/net/bonding/bonding.h
@@ -54,9 +54,6 @@
((slave)->link == BOND_LINK_UP) && \
bond_is_active_slave(slave))
-#define IS_IP_TARGET_UNUSABLE_ADDRESS(a) \
- ((htonl(INADDR_BROADCAST) == a) || \
- ipv4_is_zeronet(a))
/*
* Less bad way to call ioctl from within the kernel; this needs to be
* done some other way to get the call out of interrupt context.
@@ -406,6 +403,11 @@ static inline int slave_do_arp_validate_only(struct bonding *bond)
return bond->params.arp_validate & BOND_ARP_FILTER;
}
+static inline int bond_is_ip_target_ok(__be32 addr)
+{
+ return !ipv4_is_lbcast(addr) && !ipv4_is_zeronet(addr);
+}
+
/* Get the oldest arp which we've received on this slave for bond's
* arp_targets.
*/