aboutsummaryrefslogtreecommitdiffstats
path: root/net/appletalk/aarp.c
diff options
context:
space:
mode:
authorJoe Perches <joe@perches.com>2011-07-01 05:43:02 -0400
committerDavid S. Miller <davem@davemloft.net>2011-07-01 19:11:15 -0400
commit4a9e4b09326baa6db30ae35e3521bf5259b238f5 (patch)
tree4f7bf882d15ccc515de67c83e4fcae561e1ca80b /net/appletalk/aarp.c
parent4e985adaa504c1c1a05c8e013777ea0791a17b4d (diff)
appletalk: Reduce switch/case indent
Make the case labels the same indent as the switch. (git diff -w net/appletalk shows no difference) Signed-off-by: Joe Perches <joe@perches.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/appletalk/aarp.c')
-rw-r--r--net/appletalk/aarp.c138
1 files changed, 69 insertions, 69 deletions
diff --git a/net/appletalk/aarp.c b/net/appletalk/aarp.c
index 50dce7981321..1acc69576df8 100644
--- a/net/appletalk/aarp.c
+++ b/net/appletalk/aarp.c
@@ -779,87 +779,87 @@ static int aarp_rcv(struct sk_buff *skb, struct net_device *dev,
779 } 779 }
780 780
781 switch (function) { 781 switch (function) {
782 case AARP_REPLY: 782 case AARP_REPLY:
783 if (!unresolved_count) /* Speed up */ 783 if (!unresolved_count) /* Speed up */
784 break; 784 break;
785
786 /* Find the entry. */
787 a = __aarp_find_entry(unresolved[hash], dev, &sa);
788 if (!a || dev != a->dev)
789 break;
790 785
791 /* We can fill one in - this is good. */ 786 /* Find the entry. */
792 memcpy(a->hwaddr, ea->hw_src, ETH_ALEN); 787 a = __aarp_find_entry(unresolved[hash], dev, &sa);
793 __aarp_resolved(&unresolved[hash], a, hash); 788 if (!a || dev != a->dev)
794 if (!unresolved_count)
795 mod_timer(&aarp_timer,
796 jiffies + sysctl_aarp_expiry_time);
797 break; 789 break;
798 790
799 case AARP_REQUEST: 791 /* We can fill one in - this is good. */
800 case AARP_PROBE: 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 }
801 826
827 if (function == AARP_PROBE) {
802 /* 828 /*
803 * If it is my address set ma to my address and reply. 829 * A probe implies someone trying to get an
804 * We can treat probe and request the same. Probe 830 * address. So as a precaution flush any
805 * simply means we shouldn't cache the querying host, 831 * entries we have for this address.
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 */ 832 */
833 a = __aarp_find_entry(resolved[sa.s_node %
834 (AARP_HASH_SIZE - 1)],
835 skb->dev, &sa);
813 836
814 sa.s_node = ea->pa_dst_node; 837 /*
815 sa.s_net = ea->pa_dst_net; 838 * Make it expire next tick - that avoids us
816 839 * getting into a probe/flush/learn/probe/
817 /* See if we have a matching proxy. */ 840 * flush/learn cycle during probing of a slow
818 ma = __aarp_proxy_find(dev, &sa); 841 * to respond host addr.
819 if (!ma) 842 */
820 ma = &ifa->address; 843 if (a) {
821 else { /* We need to make a copy of the entry. */ 844 a->expires_at = jiffies - 1;
822 da.s_node = sa.s_node; 845 mod_timer(&aarp_timer, jiffies +
823 da.s_net = sa.s_net; 846 sysctl_aarp_tick_time);
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 }
848 } 847 }
848 }
849 849
850 if (sa.s_node != ma->s_node) 850 if (sa.s_node != ma->s_node)
851 break; 851 break;
852 852
853 if (sa.s_net && ma->s_net && sa.s_net != ma->s_net) 853 if (sa.s_net && ma->s_net && sa.s_net != ma->s_net)
854 break; 854 break;
855 855
856 sa.s_node = ea->pa_src_node; 856 sa.s_node = ea->pa_src_node;
857 sa.s_net = ea->pa_src_net; 857 sa.s_net = ea->pa_src_net;
858 858
859 /* aarp_my_address has found the address to use for us. 859 /* aarp_my_address has found the address to use for us.
860 */ 860 */
861 aarp_send_reply(dev, ma, &sa, ea->hw_src); 861 aarp_send_reply(dev, ma, &sa, ea->hw_src);
862 break; 862 break;
863 } 863 }
864 864
865unlock: 865unlock: