@@ -779,87 +779,87 @@ static int aarp_rcv(struct sk_buff *skb, struct net_device *dev,
779779 }
780780
781781 switch (function ) {
782- case AARP_REPLY :
783- if (!unresolved_count ) /* Speed up */
784- break ;
785-
786- /* Find the entry. */
787- a = __aarp_find_entry (unresolved [hash ], dev , & sa );
788- if (!a || dev != a -> dev )
789- break ;
782+ case AARP_REPLY :
783+ if (!unresolved_count ) /* Speed up */
784+ break ;
790785
791- /* We can fill one in - this is good. */
792- memcpy (a -> hwaddr , ea -> hw_src , ETH_ALEN );
793- __aarp_resolved (& unresolved [hash ], a , hash );
794- if (!unresolved_count )
795- mod_timer (& aarp_timer ,
796- jiffies + sysctl_aarp_expiry_time );
786+ /* Find the entry. */
787+ a = __aarp_find_entry (unresolved [hash ], dev , & sa );
788+ if (!a || dev != a -> dev )
797789 break ;
798790
799- case AARP_REQUEST :
800- case AARP_PROBE :
791+ /* We can fill one in - this is good. */
792+ memcpy (a -> hwaddr , ea -> hw_src , ETH_ALEN );
793+ __aarp_resolved (& unresolved [hash ], a , hash );
794+ if (!unresolved_count )
795+ mod_timer (& aarp_timer ,
796+ jiffies + sysctl_aarp_expiry_time );
797+ break ;
798+
799+ case AARP_REQUEST :
800+ case AARP_PROBE :
801+
802+ /*
803+ * If it is my address set ma to my address and reply.
804+ * We can treat probe and request the same. Probe
805+ * simply means we shouldn't cache the querying host,
806+ * as in a probe they are proposing an address not
807+ * using one.
808+ *
809+ * Support for proxy-AARP added. We check if the
810+ * address is one of our proxies before we toss the
811+ * packet out.
812+ */
813+
814+ sa .s_node = ea -> pa_dst_node ;
815+ sa .s_net = ea -> pa_dst_net ;
816+
817+ /* See if we have a matching proxy. */
818+ ma = __aarp_proxy_find (dev , & sa );
819+ if (!ma )
820+ ma = & ifa -> address ;
821+ else { /* We need to make a copy of the entry. */
822+ da .s_node = sa .s_node ;
823+ da .s_net = sa .s_net ;
824+ ma = & da ;
825+ }
801826
827+ if (function == AARP_PROBE ) {
802828 /*
803- * If it is my address set ma to my address and reply.
804- * We can treat probe and request the same. Probe
805- * simply means we shouldn't cache the querying host,
806- * as in a probe they are proposing an address not
807- * using one.
808- *
809- * Support for proxy-AARP added. We check if the
810- * address is one of our proxies before we toss the
811- * packet out.
829+ * A probe implies someone trying to get an
830+ * address. So as a precaution flush any
831+ * entries we have for this address.
812832 */
833+ a = __aarp_find_entry (resolved [sa .s_node %
834+ (AARP_HASH_SIZE - 1 )],
835+ skb -> dev , & sa );
813836
814- sa .s_node = ea -> pa_dst_node ;
815- sa .s_net = ea -> pa_dst_net ;
816-
817- /* See if we have a matching proxy. */
818- ma = __aarp_proxy_find (dev , & sa );
819- if (!ma )
820- ma = & ifa -> address ;
821- else { /* We need to make a copy of the entry. */
822- da .s_node = sa .s_node ;
823- da .s_net = sa .s_net ;
824- ma = & da ;
825- }
826-
827- if (function == AARP_PROBE ) {
828- /*
829- * A probe implies someone trying to get an
830- * address. So as a precaution flush any
831- * entries we have for this address.
832- */
833- a = __aarp_find_entry (resolved [sa .s_node %
834- (AARP_HASH_SIZE - 1 )],
835- skb -> dev , & sa );
836-
837- /*
838- * Make it expire next tick - that avoids us
839- * getting into a probe/flush/learn/probe/
840- * flush/learn cycle during probing of a slow
841- * to respond host addr.
842- */
843- if (a ) {
844- a -> expires_at = jiffies - 1 ;
845- mod_timer (& aarp_timer , jiffies +
846- sysctl_aarp_tick_time );
847- }
837+ /*
838+ * Make it expire next tick - that avoids us
839+ * getting into a probe/flush/learn/probe/
840+ * flush/learn cycle during probing of a slow
841+ * to respond host addr.
842+ */
843+ if (a ) {
844+ a -> expires_at = jiffies - 1 ;
845+ mod_timer (& aarp_timer , jiffies +
846+ sysctl_aarp_tick_time );
848847 }
848+ }
849849
850- if (sa .s_node != ma -> s_node )
851- break ;
850+ if (sa .s_node != ma -> s_node )
851+ break ;
852852
853- if (sa .s_net && ma -> s_net && sa .s_net != ma -> s_net )
854- break ;
853+ if (sa .s_net && ma -> s_net && sa .s_net != ma -> s_net )
854+ break ;
855855
856- sa .s_node = ea -> pa_src_node ;
857- sa .s_net = ea -> pa_src_net ;
856+ sa .s_node = ea -> pa_src_node ;
857+ sa .s_net = ea -> pa_src_net ;
858858
859- /* aarp_my_address has found the address to use for us.
860- */
861- aarp_send_reply (dev , ma , & sa , ea -> hw_src );
862- break ;
859+ /* aarp_my_address has found the address to use for us.
860+ */
861+ aarp_send_reply (dev , ma , & sa , ea -> hw_src );
862+ break ;
863863 }
864864
865865unlock :
0 commit comments