File tree Expand file tree Collapse file tree 4 files changed +20
-10
lines changed Expand file tree Collapse file tree 4 files changed +20
-10
lines changed Original file line number Diff line number Diff line change @@ -25,6 +25,7 @@ struct ipv4_devconf
2525 int arp_filter ;
2626 int arp_announce ;
2727 int arp_ignore ;
28+ int arp_accept ;
2829 int medium_id ;
2930 int no_xfrm ;
3031 int no_policy ;
Original file line number Diff line number Diff line change 456456 NET_IPV4_CONF_ARP_ANNOUNCE = 18 ,
457457 NET_IPV4_CONF_ARP_IGNORE = 19 ,
458458 NET_IPV4_CONF_PROMOTE_SECONDARIES = 20 ,
459+ NET_IPV4_CONF_ARP_ACCEPT = 21 ,
459460 __NET_IPV4_CONF_MAX
460461};
461462
Original file line number Diff line number Diff line change @@ -879,16 +879,16 @@ static int arp_process(struct sk_buff *skb)
879879
880880 n = __neigh_lookup (& arp_tbl , & sip , dev , 0 );
881881
882- #ifdef CONFIG_IP_ACCEPT_UNSOLICITED_ARP
883- /* Unsolicited ARP is not accepted by default.
884- It is possible, that this option should be enabled for some
885- devices (strip is candidate)
886- */
887- if (n == NULL &&
888- arp -> ar_op == htons (ARPOP_REPLY ) &&
889- inet_addr_type (sip ) == RTN_UNICAST )
890- n = __neigh_lookup (& arp_tbl , & sip , dev , -1 );
891- #endif
882+ if ( ipv4_devconf . arp_accept ) {
883+ /* Unsolicited ARP is not accepted by default.
884+ It is possible, that this option should be enabled for some
885+ devices (strip is candidate)
886+ */
887+ if (n == NULL &&
888+ arp -> ar_op == htons (ARPOP_REPLY ) &&
889+ inet_addr_type (sip ) == RTN_UNICAST )
890+ n = __neigh_lookup (& arp_tbl , & sip , dev , -1 );
891+ }
892892
893893 if (n ) {
894894 int state = NUD_REACHABLE ;
Original file line number Diff line number Diff line change @@ -1393,6 +1393,14 @@ static struct devinet_sysctl_table {
13931393 .mode = 0644 ,
13941394 .proc_handler = & proc_dointvec ,
13951395 },
1396+ {
1397+ .ctl_name = NET_IPV4_CONF_ARP_ACCEPT ,
1398+ .procname = "arp_accept" ,
1399+ .data = & ipv4_devconf .arp_accept ,
1400+ .maxlen = sizeof (int ),
1401+ .mode = 0644 ,
1402+ .proc_handler = & proc_dointvec ,
1403+ },
13961404 {
13971405 .ctl_name = NET_IPV4_CONF_NOXFRM ,
13981406 .procname = "disable_xfrm" ,
You can’t perform that action at this time.
0 commit comments