File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -494,14 +494,6 @@ static int mark_source_chains(const struct xt_table_info *newinfo,
494494 return 1 ;
495495}
496496
497- static inline int check_entry (const struct arpt_entry * e )
498- {
499- if (!arp_checkentry (& e -> arp ))
500- return - EINVAL ;
501-
502- return xt_check_entry_offsets (e , e -> target_offset , e -> next_offset );
503- }
504-
505497static inline int check_target (struct arpt_entry * e , const char * name )
506498{
507499 struct xt_entry_target * t = arpt_get_target (e );
@@ -597,7 +589,10 @@ static inline int check_entry_size_and_hooks(struct arpt_entry *e,
597589 return - EINVAL ;
598590 }
599591
600- err = check_entry (e );
592+ if (!arp_checkentry (& e -> arp ))
593+ return - EINVAL ;
594+
595+ err = xt_check_entry_offsets (e , e -> target_offset , e -> next_offset );
601596 if (err )
602597 return err ;
603598
@@ -1255,8 +1250,10 @@ check_compat_entry_size_and_hooks(struct compat_arpt_entry *e,
12551250 return - EINVAL ;
12561251 }
12571252
1258- /* For purposes of check_entry casting the compat entry is fine */
1259- ret = check_entry ((struct arpt_entry * )e );
1253+ if (!arp_checkentry (& e -> arp ))
1254+ return - EINVAL ;
1255+
1256+ ret = xt_check_entry_offsets (e , e -> target_offset , e -> next_offset );
12601257 if (ret )
12611258 return ret ;
12621259
Original file line number Diff line number Diff line change @@ -587,15 +587,6 @@ static void cleanup_match(struct xt_entry_match *m, struct net *net)
587587 module_put (par .match -> me );
588588}
589589
590- static int
591- check_entry (const struct ipt_entry * e )
592- {
593- if (!ip_checkentry (& e -> ip ))
594- return - EINVAL ;
595-
596- return xt_check_entry_offsets (e , e -> target_offset , e -> next_offset );
597- }
598-
599590static int
600591check_match (struct xt_entry_match * m , struct xt_mtchk_param * par )
601592{
@@ -760,7 +751,10 @@ check_entry_size_and_hooks(struct ipt_entry *e,
760751 return - EINVAL ;
761752 }
762753
763- err = check_entry (e );
754+ if (!ip_checkentry (& e -> ip ))
755+ return - EINVAL ;
756+
757+ err = xt_check_entry_offsets (e , e -> target_offset , e -> next_offset );
764758 if (err )
765759 return err ;
766760
@@ -1515,8 +1509,10 @@ check_compat_entry_size_and_hooks(struct compat_ipt_entry *e,
15151509 return - EINVAL ;
15161510 }
15171511
1518- /* For purposes of check_entry casting the compat entry is fine */
1519- ret = check_entry ((struct ipt_entry * )e );
1512+ if (!ip_checkentry (& e -> ip ))
1513+ return - EINVAL ;
1514+
1515+ ret = xt_check_entry_offsets (e , e -> target_offset , e -> next_offset );
15201516 if (ret )
15211517 return ret ;
15221518
Original file line number Diff line number Diff line change @@ -599,15 +599,6 @@ static void cleanup_match(struct xt_entry_match *m, struct net *net)
599599 module_put (par .match -> me );
600600}
601601
602- static int
603- check_entry (const struct ip6t_entry * e )
604- {
605- if (!ip6_checkentry (& e -> ipv6 ))
606- return - EINVAL ;
607-
608- return xt_check_entry_offsets (e , e -> target_offset , e -> next_offset );
609- }
610-
611602static int check_match (struct xt_entry_match * m , struct xt_mtchk_param * par )
612603{
613604 const struct ip6t_ip6 * ipv6 = par -> entryinfo ;
@@ -772,7 +763,10 @@ check_entry_size_and_hooks(struct ip6t_entry *e,
772763 return - EINVAL ;
773764 }
774765
775- err = check_entry (e );
766+ if (!ip6_checkentry (& e -> ipv6 ))
767+ return - EINVAL ;
768+
769+ err = xt_check_entry_offsets (e , e -> target_offset , e -> next_offset );
776770 if (err )
777771 return err ;
778772
@@ -1527,8 +1521,10 @@ check_compat_entry_size_and_hooks(struct compat_ip6t_entry *e,
15271521 return - EINVAL ;
15281522 }
15291523
1530- /* For purposes of check_entry casting the compat entry is fine */
1531- ret = check_entry ((struct ip6t_entry * )e );
1524+ if (!ip6_checkentry (& e -> ipv6 ))
1525+ return - EINVAL ;
1526+
1527+ ret = xt_check_entry_offsets (e , e -> target_offset , e -> next_offset );
15321528 if (ret )
15331529 return ret ;
15341530
You can’t perform that action at this time.
0 commit comments