Commit 9124a20d authored by Joe Perches's avatar Joe Perches Committed by Pablo Neira Ayuso

netfilter: ebt_stp: Use generic functions for comparisons

Instead of unnecessary const declarations, use the generic functions to
save a little object space.

$ size net/bridge/netfilter/ebt_stp.o*
   text	   data	    bss	    dec	    hex	filename
   1250	    144	      0	   1394	    572	net/bridge/netfilter/ebt_stp.o.new
   1344	    144	      0	   1488	    5d0	net/bridge/netfilter/ebt_stp.o.old
Signed-off-by: default avatarJoe Perches <joe@perches.com>
Signed-off-by: default avatarPablo Neira Ayuso <pablo@netfilter.org>
parent 19b351f1
...@@ -153,8 +153,6 @@ ebt_stp_mt(const struct sk_buff *skb, struct xt_action_param *par) ...@@ -153,8 +153,6 @@ ebt_stp_mt(const struct sk_buff *skb, struct xt_action_param *par)
static int ebt_stp_mt_check(const struct xt_mtchk_param *par) static int ebt_stp_mt_check(const struct xt_mtchk_param *par)
{ {
const struct ebt_stp_info *info = par->matchinfo; const struct ebt_stp_info *info = par->matchinfo;
const u8 bridge_ula[6] = {0x01, 0x80, 0xc2, 0x00, 0x00, 0x00};
const u8 msk[6] = {0xff, 0xff, 0xff, 0xff, 0xff, 0xff};
const struct ebt_entry *e = par->entryinfo; const struct ebt_entry *e = par->entryinfo;
if (info->bitmask & ~EBT_STP_MASK || info->invflags & ~EBT_STP_MASK || if (info->bitmask & ~EBT_STP_MASK || info->invflags & ~EBT_STP_MASK ||
...@@ -162,8 +160,8 @@ static int ebt_stp_mt_check(const struct xt_mtchk_param *par) ...@@ -162,8 +160,8 @@ static int ebt_stp_mt_check(const struct xt_mtchk_param *par)
return -EINVAL; return -EINVAL;
/* Make sure the match only receives stp frames */ /* Make sure the match only receives stp frames */
if (!par->nft_compat && if (!par->nft_compat &&
(!ether_addr_equal(e->destmac, bridge_ula) || (!ether_addr_equal(e->destmac, eth_stp_addr) ||
!ether_addr_equal(e->destmsk, msk) || !is_broadcast_ether_addr(e->destmsk) ||
!(e->bitmask & EBT_DESTMAC))) !(e->bitmask & EBT_DESTMAC)))
return -EINVAL; return -EINVAL;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment