Loading include/linux/etherdevice.h +12 −0 Original line number Original line Diff line number Diff line Loading @@ -171,6 +171,18 @@ static inline unsigned compare_ether_addr(const u8 *addr1, const u8 *addr2) return ((a[0] ^ b[0]) | (a[1] ^ b[1]) | (a[2] ^ b[2])) != 0; return ((a[0] ^ b[0]) | (a[1] ^ b[1]) | (a[2] ^ b[2])) != 0; } } /** * ether_addr_equal - Compare two Ethernet addresses * @addr1: Pointer to a six-byte array containing the Ethernet address * @addr2: Pointer other six-byte array containing the Ethernet address * * Compare two ethernet addresses, returns true if equal */ static inline bool ether_addr_equal(const u8 *addr1, const u8 *addr2) { return !compare_ether_addr(addr1, addr2); } static inline unsigned long zap_last_2bytes(unsigned long value) static inline unsigned long zap_last_2bytes(unsigned long value) { { #ifdef __BIG_ENDIAN #ifdef __BIG_ENDIAN Loading include/linux/netfilter/xt_HMARK.h 0 → 100644 +45 −0 Original line number Original line Diff line number Diff line #ifndef XT_HMARK_H_ #define XT_HMARK_H_ #include <linux/types.h> enum { XT_HMARK_SADDR_MASK, XT_HMARK_DADDR_MASK, XT_HMARK_SPI, XT_HMARK_SPI_MASK, XT_HMARK_SPORT, XT_HMARK_DPORT, XT_HMARK_SPORT_MASK, XT_HMARK_DPORT_MASK, XT_HMARK_PROTO_MASK, XT_HMARK_RND, XT_HMARK_MODULUS, XT_HMARK_OFFSET, XT_HMARK_CT, XT_HMARK_METHOD_L3, XT_HMARK_METHOD_L3_4, }; #define XT_HMARK_FLAG(flag) (1 << flag) union hmark_ports { struct { __u16 src; __u16 dst; } p16; __u32 v32; }; struct xt_hmark_info { union nf_inet_addr src_mask; union nf_inet_addr dst_mask; union hmark_ports port_mask; union hmark_ports port_set; __u32 flags; __u16 proto_mask; __u32 hashrnd; __u32 hmodulus; __u32 hoffset; /* Mark offset to start from */ }; #endif /* XT_HMARK_H_ */ include/linux/netfilter/xt_hashlimit.h +9 −1 Original line number Original line Diff line number Diff line Loading @@ -6,7 +6,11 @@ /* timings are in milliseconds. */ /* timings are in milliseconds. */ #define XT_HASHLIMIT_SCALE 10000 #define XT_HASHLIMIT_SCALE 10000 /* 1/10,000 sec period => max of 10,000/sec. Min rate is then 429490 /* 1/10,000 sec period => max of 10,000/sec. Min rate is then 429490 seconds, or one every 59 hours. */ * seconds, or one packet every 59 hours. */ /* packet length accounting is done in 16-byte steps */ #define XT_HASHLIMIT_BYTE_SHIFT 4 /* details of this structure hidden by the implementation */ /* details of this structure hidden by the implementation */ struct xt_hashlimit_htable; struct xt_hashlimit_htable; Loading @@ -17,6 +21,10 @@ enum { XT_HASHLIMIT_HASH_SIP = 1 << 2, XT_HASHLIMIT_HASH_SIP = 1 << 2, XT_HASHLIMIT_HASH_SPT = 1 << 3, XT_HASHLIMIT_HASH_SPT = 1 << 3, XT_HASHLIMIT_INVERT = 1 << 4, XT_HASHLIMIT_INVERT = 1 << 4, XT_HASHLIMIT_BYTES = 1 << 5, #ifdef __KERNEL__ XT_HASHLIMIT_MAX = 1 << 6, #endif }; }; struct hashlimit_cfg { struct hashlimit_cfg { Loading include/linux/netfilter_ipv6/ip6_tables.h +6 −1 Original line number Original line Diff line number Diff line Loading @@ -298,9 +298,14 @@ ip6t_ext_hdr(u8 nexthdr) (nexthdr == IPPROTO_DSTOPTS); (nexthdr == IPPROTO_DSTOPTS); } } enum { IP6T_FH_F_FRAG = (1 << 0), IP6T_FH_F_AUTH = (1 << 1), }; /* find specified header and get offset to it */ /* find specified header and get offset to it */ extern int ipv6_find_hdr(const struct sk_buff *skb, unsigned int *offset, extern int ipv6_find_hdr(const struct sk_buff *skb, unsigned int *offset, int target, unsigned short *fragoff); int target, unsigned short *fragoff, int *fragflg); #ifdef CONFIG_COMPAT #ifdef CONFIG_COMPAT #include <net/compat.h> #include <net/compat.h> Loading net/802/stp.c +1 −1 Original line number Original line Diff line number Diff line Loading @@ -46,7 +46,7 @@ static int stp_pdu_rcv(struct sk_buff *skb, struct net_device *dev, proto = rcu_dereference(garp_protos[eh->h_dest[5] - proto = rcu_dereference(garp_protos[eh->h_dest[5] - GARP_ADDR_MIN]); GARP_ADDR_MIN]); if (proto && if (proto && compare_ether_addr(eh->h_dest, proto->group_address)) !ether_addr_equal(eh->h_dest, proto->group_address)) goto err; goto err; } else } else proto = rcu_dereference(stp_proto); proto = rcu_dereference(stp_proto); Loading Loading
include/linux/etherdevice.h +12 −0 Original line number Original line Diff line number Diff line Loading @@ -171,6 +171,18 @@ static inline unsigned compare_ether_addr(const u8 *addr1, const u8 *addr2) return ((a[0] ^ b[0]) | (a[1] ^ b[1]) | (a[2] ^ b[2])) != 0; return ((a[0] ^ b[0]) | (a[1] ^ b[1]) | (a[2] ^ b[2])) != 0; } } /** * ether_addr_equal - Compare two Ethernet addresses * @addr1: Pointer to a six-byte array containing the Ethernet address * @addr2: Pointer other six-byte array containing the Ethernet address * * Compare two ethernet addresses, returns true if equal */ static inline bool ether_addr_equal(const u8 *addr1, const u8 *addr2) { return !compare_ether_addr(addr1, addr2); } static inline unsigned long zap_last_2bytes(unsigned long value) static inline unsigned long zap_last_2bytes(unsigned long value) { { #ifdef __BIG_ENDIAN #ifdef __BIG_ENDIAN Loading
include/linux/netfilter/xt_HMARK.h 0 → 100644 +45 −0 Original line number Original line Diff line number Diff line #ifndef XT_HMARK_H_ #define XT_HMARK_H_ #include <linux/types.h> enum { XT_HMARK_SADDR_MASK, XT_HMARK_DADDR_MASK, XT_HMARK_SPI, XT_HMARK_SPI_MASK, XT_HMARK_SPORT, XT_HMARK_DPORT, XT_HMARK_SPORT_MASK, XT_HMARK_DPORT_MASK, XT_HMARK_PROTO_MASK, XT_HMARK_RND, XT_HMARK_MODULUS, XT_HMARK_OFFSET, XT_HMARK_CT, XT_HMARK_METHOD_L3, XT_HMARK_METHOD_L3_4, }; #define XT_HMARK_FLAG(flag) (1 << flag) union hmark_ports { struct { __u16 src; __u16 dst; } p16; __u32 v32; }; struct xt_hmark_info { union nf_inet_addr src_mask; union nf_inet_addr dst_mask; union hmark_ports port_mask; union hmark_ports port_set; __u32 flags; __u16 proto_mask; __u32 hashrnd; __u32 hmodulus; __u32 hoffset; /* Mark offset to start from */ }; #endif /* XT_HMARK_H_ */
include/linux/netfilter/xt_hashlimit.h +9 −1 Original line number Original line Diff line number Diff line Loading @@ -6,7 +6,11 @@ /* timings are in milliseconds. */ /* timings are in milliseconds. */ #define XT_HASHLIMIT_SCALE 10000 #define XT_HASHLIMIT_SCALE 10000 /* 1/10,000 sec period => max of 10,000/sec. Min rate is then 429490 /* 1/10,000 sec period => max of 10,000/sec. Min rate is then 429490 seconds, or one every 59 hours. */ * seconds, or one packet every 59 hours. */ /* packet length accounting is done in 16-byte steps */ #define XT_HASHLIMIT_BYTE_SHIFT 4 /* details of this structure hidden by the implementation */ /* details of this structure hidden by the implementation */ struct xt_hashlimit_htable; struct xt_hashlimit_htable; Loading @@ -17,6 +21,10 @@ enum { XT_HASHLIMIT_HASH_SIP = 1 << 2, XT_HASHLIMIT_HASH_SIP = 1 << 2, XT_HASHLIMIT_HASH_SPT = 1 << 3, XT_HASHLIMIT_HASH_SPT = 1 << 3, XT_HASHLIMIT_INVERT = 1 << 4, XT_HASHLIMIT_INVERT = 1 << 4, XT_HASHLIMIT_BYTES = 1 << 5, #ifdef __KERNEL__ XT_HASHLIMIT_MAX = 1 << 6, #endif }; }; struct hashlimit_cfg { struct hashlimit_cfg { Loading
include/linux/netfilter_ipv6/ip6_tables.h +6 −1 Original line number Original line Diff line number Diff line Loading @@ -298,9 +298,14 @@ ip6t_ext_hdr(u8 nexthdr) (nexthdr == IPPROTO_DSTOPTS); (nexthdr == IPPROTO_DSTOPTS); } } enum { IP6T_FH_F_FRAG = (1 << 0), IP6T_FH_F_AUTH = (1 << 1), }; /* find specified header and get offset to it */ /* find specified header and get offset to it */ extern int ipv6_find_hdr(const struct sk_buff *skb, unsigned int *offset, extern int ipv6_find_hdr(const struct sk_buff *skb, unsigned int *offset, int target, unsigned short *fragoff); int target, unsigned short *fragoff, int *fragflg); #ifdef CONFIG_COMPAT #ifdef CONFIG_COMPAT #include <net/compat.h> #include <net/compat.h> Loading
net/802/stp.c +1 −1 Original line number Original line Diff line number Diff line Loading @@ -46,7 +46,7 @@ static int stp_pdu_rcv(struct sk_buff *skb, struct net_device *dev, proto = rcu_dereference(garp_protos[eh->h_dest[5] - proto = rcu_dereference(garp_protos[eh->h_dest[5] - GARP_ADDR_MIN]); GARP_ADDR_MIN]); if (proto && if (proto && compare_ether_addr(eh->h_dest, proto->group_address)) !ether_addr_equal(eh->h_dest, proto->group_address)) goto err; goto err; } else } else proto = rcu_dereference(stp_proto); proto = rcu_dereference(stp_proto); Loading