aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/s390
diff options
context:
space:
mode:
authorDavid Miller <davem@davemloft.net>2012-02-01 05:49:17 -0500
committerDavid S. Miller <davem@davemloft.net>2012-02-02 16:47:41 -0500
commit87e7597b5a3f99238d95d63c44c9f872a41b37ae (patch)
tree9cb2d094188260bedc9644c4697e6bc2477066c8 /drivers/s390
parent57b9bef0d6990d088a5e840c88ae137d8e76202c (diff)
qeth: Move away from using neighbour entries in qeth_l3_fill_header()
We've moving to a model where dst_entry objects to not have a reference to the associated neighbour entry, instead such neighbours must be looked up on-demand. Here in qeth_l3_fill_header() it's actually much simpler to use the information in the route itself. The code is already conditionalized upon protocol type. Signed-off-by: David S. Miller <davem@davemloft.net> Tested-by: Ursula Braun <ubraun@linux.vnet.ibm.com>
Diffstat (limited to 'drivers/s390')
-rw-r--r--drivers/s390/net/qeth_l3_main.c35
1 files changed, 16 insertions, 19 deletions
diff --git a/drivers/s390/net/qeth_l3_main.c b/drivers/s390/net/qeth_l3_main.c
index 9648e4e68337..25cd3799a76c 100644
--- a/drivers/s390/net/qeth_l3_main.c
+++ b/drivers/s390/net/qeth_l3_main.c
@@ -28,6 +28,8 @@
28 28
29#include <net/ip.h> 29#include <net/ip.h>
30#include <net/arp.h> 30#include <net/arp.h>
31#include <net/route.h>
32#include <net/ip6_fib.h>
31#include <net/ip6_checksum.h> 33#include <net/ip6_checksum.h>
32#include <net/iucv/af_iucv.h> 34#include <net/iucv/af_iucv.h>
33 35
@@ -2832,7 +2834,6 @@ static void qeth_l3_fill_af_iucv_hdr(struct qeth_card *card,
2832static void qeth_l3_fill_header(struct qeth_card *card, struct qeth_hdr *hdr, 2834static void qeth_l3_fill_header(struct qeth_card *card, struct qeth_hdr *hdr,
2833 struct sk_buff *skb, int ipv, int cast_type) 2835 struct sk_buff *skb, int ipv, int cast_type)
2834{ 2836{
2835 struct neighbour *n = NULL;
2836 struct dst_entry *dst; 2837 struct dst_entry *dst;
2837 2838
2838 memset(hdr, 0, sizeof(struct qeth_hdr)); 2839 memset(hdr, 0, sizeof(struct qeth_hdr));
@@ -2855,33 +2856,29 @@ static void qeth_l3_fill_header(struct qeth_card *card, struct qeth_hdr *hdr,
2855 2856
2856 rcu_read_lock(); 2857 rcu_read_lock();
2857 dst = skb_dst(skb); 2858 dst = skb_dst(skb);
2858 if (dst)
2859 n = dst_get_neighbour_noref(dst);
2860 if (ipv == 4) { 2859 if (ipv == 4) {
2860 struct rtable *rt = (struct rtable *) dst;
2861 __be32 *pkey = &ip_hdr(skb)->daddr;
2862
2863 if (rt->rt_gateway)
2864 pkey = &rt->rt_gateway;
2865
2861 /* IPv4 */ 2866 /* IPv4 */
2862 hdr->hdr.l3.flags = qeth_l3_get_qeth_hdr_flags4(cast_type); 2867 hdr->hdr.l3.flags = qeth_l3_get_qeth_hdr_flags4(cast_type);
2863 memset(hdr->hdr.l3.dest_addr, 0, 12); 2868 memset(hdr->hdr.l3.dest_addr, 0, 12);
2864 if (n) { 2869 *((__be32 *) (&hdr->hdr.l3.dest_addr[12])) = *pkey;
2865 *((u32 *) (&hdr->hdr.l3.dest_addr[12])) =
2866 *((u32 *) n->primary_key);
2867 } else {
2868 /* fill in destination address used in ip header */
2869 *((u32 *) (&hdr->hdr.l3.dest_addr[12])) =
2870 ip_hdr(skb)->daddr;
2871 }
2872 } else if (ipv == 6) { 2870 } else if (ipv == 6) {
2871 struct rt6_info *rt = (struct rt6_info *) dst;
2872 struct in6_addr *pkey = &ipv6_hdr(skb)->daddr;
2873
2874 if (!ipv6_addr_any(&rt->rt6i_gateway))
2875 pkey = &rt->rt6i_gateway;
2876
2873 /* IPv6 */ 2877 /* IPv6 */
2874 hdr->hdr.l3.flags = qeth_l3_get_qeth_hdr_flags6(cast_type); 2878 hdr->hdr.l3.flags = qeth_l3_get_qeth_hdr_flags6(cast_type);
2875 if (card->info.type == QETH_CARD_TYPE_IQD) 2879 if (card->info.type == QETH_CARD_TYPE_IQD)
2876 hdr->hdr.l3.flags &= ~QETH_HDR_PASSTHRU; 2880 hdr->hdr.l3.flags &= ~QETH_HDR_PASSTHRU;
2877 if (n) { 2881 memcpy(hdr->hdr.l3.dest_addr, pkey, 16);
2878 memcpy(hdr->hdr.l3.dest_addr,
2879 n->primary_key, 16);
2880 } else {
2881 /* fill in destination address used in ip header */
2882 memcpy(hdr->hdr.l3.dest_addr,
2883 &ipv6_hdr(skb)->daddr, 16);
2884 }
2885 } else { 2882 } else {
2886 /* passthrough */ 2883 /* passthrough */
2887 if ((skb->dev->type == ARPHRD_IEEE802_TR) && 2884 if ((skb->dev->type == ARPHRD_IEEE802_TR) &&