aboutsummaryrefslogtreecommitdiffstats
path: root/net/decnet
diff options
context:
space:
mode:
Diffstat (limited to 'net/decnet')
-rw-r--r--net/decnet/af_decnet.c4
-rw-r--r--net/decnet/dn_fib.c4
-rw-r--r--net/decnet/dn_nsp_out.c4
-rw-r--r--net/decnet/dn_route.c96
4 files changed, 56 insertions, 52 deletions
diff --git a/net/decnet/af_decnet.c b/net/decnet/af_decnet.c
index 2af15b15d1fa..aafd15a01575 100644
--- a/net/decnet/af_decnet.c
+++ b/net/decnet/af_decnet.c
@@ -948,11 +948,11 @@ static int __dn_connect(struct sock *sk, struct sockaddr_dn *addr, int addrlen,
948 948
949 err = -EHOSTUNREACH; 949 err = -EHOSTUNREACH;
950 memset(&fl, 0, sizeof(fl)); 950 memset(&fl, 0, sizeof(fl));
951 fl.oif = sk->sk_bound_dev_if; 951 fl.flowi_oif = sk->sk_bound_dev_if;
952 fl.fld_dst = dn_saddr2dn(&scp->peer); 952 fl.fld_dst = dn_saddr2dn(&scp->peer);
953 fl.fld_src = dn_saddr2dn(&scp->addr); 953 fl.fld_src = dn_saddr2dn(&scp->addr);
954 dn_sk_ports_copy(&fl, scp); 954 dn_sk_ports_copy(&fl, scp);
955 fl.proto = DNPROTO_NSP; 955 fl.flowi_proto = DNPROTO_NSP;
956 if (dn_route_output_sock(&sk->sk_dst_cache, &fl, sk, flags) < 0) 956 if (dn_route_output_sock(&sk->sk_dst_cache, &fl, sk, flags) < 0)
957 goto out; 957 goto out;
958 sk->sk_route_caps = sk->sk_dst_cache->dev->features; 958 sk->sk_route_caps = sk->sk_dst_cache->dev->features;
diff --git a/net/decnet/dn_fib.c b/net/decnet/dn_fib.c
index 0ef0a81bcd72..4dfffa0b67a8 100644
--- a/net/decnet/dn_fib.c
+++ b/net/decnet/dn_fib.c
@@ -223,7 +223,7 @@ static int dn_fib_check_nh(const struct rtmsg *r, struct dn_fib_info *fi, struct
223 223
224 memset(&fl, 0, sizeof(fl)); 224 memset(&fl, 0, sizeof(fl));
225 fl.fld_dst = nh->nh_gw; 225 fl.fld_dst = nh->nh_gw;
226 fl.oif = nh->nh_oif; 226 fl.flowi_oif = nh->nh_oif;
227 fl.fld_scope = r->rtm_scope + 1; 227 fl.fld_scope = r->rtm_scope + 1;
228 228
229 if (fl.fld_scope < RT_SCOPE_LINK) 229 if (fl.fld_scope < RT_SCOPE_LINK)
@@ -424,7 +424,7 @@ int dn_fib_semantic_match(int type, struct dn_fib_info *fi, const struct flowi *
424 for_nexthops(fi) { 424 for_nexthops(fi) {
425 if (nh->nh_flags & RTNH_F_DEAD) 425 if (nh->nh_flags & RTNH_F_DEAD)
426 continue; 426 continue;
427 if (!fl->oif || fl->oif == nh->nh_oif) 427 if (!fl->flowi_oif || fl->flowi_oif == nh->nh_oif)
428 break; 428 break;
429 } 429 }
430 if (nhsel < fi->fib_nhs) { 430 if (nhsel < fi->fib_nhs) {
diff --git a/net/decnet/dn_nsp_out.c b/net/decnet/dn_nsp_out.c
index 2ef115277bea..b3d66742a01f 100644
--- a/net/decnet/dn_nsp_out.c
+++ b/net/decnet/dn_nsp_out.c
@@ -92,11 +92,11 @@ try_again:
92 } 92 }
93 93
94 memset(&fl, 0, sizeof(fl)); 94 memset(&fl, 0, sizeof(fl));
95 fl.oif = sk->sk_bound_dev_if; 95 fl.flowi_oif = sk->sk_bound_dev_if;
96 fl.fld_src = dn_saddr2dn(&scp->addr); 96 fl.fld_src = dn_saddr2dn(&scp->addr);
97 fl.fld_dst = dn_saddr2dn(&scp->peer); 97 fl.fld_dst = dn_saddr2dn(&scp->peer);
98 dn_sk_ports_copy(&fl, scp); 98 dn_sk_ports_copy(&fl, scp);
99 fl.proto = DNPROTO_NSP; 99 fl.flowi_proto = DNPROTO_NSP;
100 if (dn_route_output_sock(&sk->sk_dst_cache, &fl, sk, 0) == 0) { 100 if (dn_route_output_sock(&sk->sk_dst_cache, &fl, sk, 0) == 0) {
101 dst = sk_dst_get(sk); 101 dst = sk_dst_get(sk);
102 sk->sk_route_caps = dst->dev->features; 102 sk->sk_route_caps = dst->dev->features;
diff --git a/net/decnet/dn_route.c b/net/decnet/dn_route.c
index 484fdbf92bd8..d74d34b93f80 100644
--- a/net/decnet/dn_route.c
+++ b/net/decnet/dn_route.c
@@ -286,10 +286,10 @@ static inline int compare_keys(struct flowi *fl1, struct flowi *fl2)
286{ 286{
287 return ((fl1->fld_dst ^ fl2->fld_dst) | 287 return ((fl1->fld_dst ^ fl2->fld_dst) |
288 (fl1->fld_src ^ fl2->fld_src) | 288 (fl1->fld_src ^ fl2->fld_src) |
289 (fl1->mark ^ fl2->mark) | 289 (fl1->flowi_mark ^ fl2->flowi_mark) |
290 (fl1->fld_scope ^ fl2->fld_scope) | 290 (fl1->fld_scope ^ fl2->fld_scope) |
291 (fl1->oif ^ fl2->oif) | 291 (fl1->flowi_oif ^ fl2->flowi_oif) |
292 (fl1->iif ^ fl2->iif)) == 0; 292 (fl1->flowi_iif ^ fl2->flowi_iif)) == 0;
293} 293}
294 294
295static int dn_insert_route(struct dn_route *rt, unsigned hash, struct dn_route **rp) 295static int dn_insert_route(struct dn_route *rt, unsigned hash, struct dn_route **rp)
@@ -905,12 +905,14 @@ static inline __le16 dn_fib_rules_map_destination(__le16 daddr, struct dn_fib_re
905 905
906static int dn_route_output_slow(struct dst_entry **pprt, const struct flowi *oldflp, int try_hard) 906static int dn_route_output_slow(struct dst_entry **pprt, const struct flowi *oldflp, int try_hard)
907{ 907{
908 struct flowi fl = { .fld_dst = oldflp->fld_dst, 908 struct flowi fl = {
909 .fld_src = oldflp->fld_src, 909 .fld_dst = oldflp->fld_dst,
910 .fld_scope = RT_SCOPE_UNIVERSE, 910 .fld_src = oldflp->fld_src,
911 .mark = oldflp->mark, 911 .fld_scope = RT_SCOPE_UNIVERSE,
912 .iif = init_net.loopback_dev->ifindex, 912 .flowi_mark = oldflp->flowi_mark,
913 .oif = oldflp->oif }; 913 .flowi_iif = init_net.loopback_dev->ifindex,
914 .flowi_oif = oldflp->flowi_oif,
915 };
914 struct dn_route *rt = NULL; 916 struct dn_route *rt = NULL;
915 struct net_device *dev_out = NULL, *dev; 917 struct net_device *dev_out = NULL, *dev;
916 struct neighbour *neigh = NULL; 918 struct neighbour *neigh = NULL;
@@ -926,11 +928,11 @@ static int dn_route_output_slow(struct dst_entry **pprt, const struct flowi *old
926 "dn_route_output_slow: dst=%04x src=%04x mark=%d" 928 "dn_route_output_slow: dst=%04x src=%04x mark=%d"
927 " iif=%d oif=%d\n", le16_to_cpu(oldflp->fld_dst), 929 " iif=%d oif=%d\n", le16_to_cpu(oldflp->fld_dst),
928 le16_to_cpu(oldflp->fld_src), 930 le16_to_cpu(oldflp->fld_src),
929 oldflp->mark, init_net.loopback_dev->ifindex, oldflp->oif); 931 oldflp->flowi_mark, init_net.loopback_dev->ifindex, oldflp->flowi_oif);
930 932
931 /* If we have an output interface, verify its a DECnet device */ 933 /* If we have an output interface, verify its a DECnet device */
932 if (oldflp->oif) { 934 if (oldflp->flowi_oif) {
933 dev_out = dev_get_by_index(&init_net, oldflp->oif); 935 dev_out = dev_get_by_index(&init_net, oldflp->flowi_oif);
934 err = -ENODEV; 936 err = -ENODEV;
935 if (dev_out && dev_out->dn_ptr == NULL) { 937 if (dev_out && dev_out->dn_ptr == NULL) {
936 dev_put(dev_out); 938 dev_put(dev_out);
@@ -988,7 +990,7 @@ source_ok:
988 if (!fl.fld_dst) 990 if (!fl.fld_dst)
989 goto out; 991 goto out;
990 } 992 }
991 fl.oif = init_net.loopback_dev->ifindex; 993 fl.flowi_oif = init_net.loopback_dev->ifindex;
992 res.type = RTN_LOCAL; 994 res.type = RTN_LOCAL;
993 goto make_route; 995 goto make_route;
994 } 996 }
@@ -998,7 +1000,7 @@ source_ok:
998 "dn_route_output_slow: initial checks complete." 1000 "dn_route_output_slow: initial checks complete."
999 " dst=%o4x src=%04x oif=%d try_hard=%d\n", 1001 " dst=%o4x src=%04x oif=%d try_hard=%d\n",
1000 le16_to_cpu(fl.fld_dst), le16_to_cpu(fl.fld_src), 1002 le16_to_cpu(fl.fld_dst), le16_to_cpu(fl.fld_src),
1001 fl.oif, try_hard); 1003 fl.flowi_oif, try_hard);
1002 1004
1003 /* 1005 /*
1004 * N.B. If the kernel is compiled without router support then 1006 * N.B. If the kernel is compiled without router support then
@@ -1023,8 +1025,8 @@ source_ok:
1023 if (!try_hard) { 1025 if (!try_hard) {
1024 neigh = neigh_lookup_nodev(&dn_neigh_table, &init_net, &fl.fld_dst); 1026 neigh = neigh_lookup_nodev(&dn_neigh_table, &init_net, &fl.fld_dst);
1025 if (neigh) { 1027 if (neigh) {
1026 if ((oldflp->oif && 1028 if ((oldflp->flowi_oif &&
1027 (neigh->dev->ifindex != oldflp->oif)) || 1029 (neigh->dev->ifindex != oldflp->flowi_oif)) ||
1028 (oldflp->fld_src && 1030 (oldflp->fld_src &&
1029 (!dn_dev_islocal(neigh->dev, 1031 (!dn_dev_islocal(neigh->dev,
1030 oldflp->fld_src)))) { 1032 oldflp->fld_src)))) {
@@ -1078,7 +1080,7 @@ select_source:
1078 if (fl.fld_src == 0 && res.type != RTN_LOCAL) 1080 if (fl.fld_src == 0 && res.type != RTN_LOCAL)
1079 goto e_addr; 1081 goto e_addr;
1080 } 1082 }
1081 fl.oif = dev_out->ifindex; 1083 fl.flowi_oif = dev_out->ifindex;
1082 goto make_route; 1084 goto make_route;
1083 } 1085 }
1084 free_res = 1; 1086 free_res = 1;
@@ -1093,14 +1095,14 @@ select_source:
1093 dev_put(dev_out); 1095 dev_put(dev_out);
1094 dev_out = init_net.loopback_dev; 1096 dev_out = init_net.loopback_dev;
1095 dev_hold(dev_out); 1097 dev_hold(dev_out);
1096 fl.oif = dev_out->ifindex; 1098 fl.flowi_oif = dev_out->ifindex;
1097 if (res.fi) 1099 if (res.fi)
1098 dn_fib_info_put(res.fi); 1100 dn_fib_info_put(res.fi);
1099 res.fi = NULL; 1101 res.fi = NULL;
1100 goto make_route; 1102 goto make_route;
1101 } 1103 }
1102 1104
1103 if (res.fi->fib_nhs > 1 && fl.oif == 0) 1105 if (res.fi->fib_nhs > 1 && fl.flowi_oif == 0)
1104 dn_fib_select_multipath(&fl, &res); 1106 dn_fib_select_multipath(&fl, &res);
1105 1107
1106 /* 1108 /*
@@ -1115,7 +1117,7 @@ select_source:
1115 dev_put(dev_out); 1117 dev_put(dev_out);
1116 dev_out = DN_FIB_RES_DEV(res); 1118 dev_out = DN_FIB_RES_DEV(res);
1117 dev_hold(dev_out); 1119 dev_hold(dev_out);
1118 fl.oif = dev_out->ifindex; 1120 fl.flowi_oif = dev_out->ifindex;
1119 gateway = DN_FIB_RES_GW(res); 1121 gateway = DN_FIB_RES_GW(res);
1120 1122
1121make_route: 1123make_route:
@@ -1131,9 +1133,9 @@ make_route:
1131 1133
1132 rt->fl.fld_src = oldflp->fld_src; 1134 rt->fl.fld_src = oldflp->fld_src;
1133 rt->fl.fld_dst = oldflp->fld_dst; 1135 rt->fl.fld_dst = oldflp->fld_dst;
1134 rt->fl.oif = oldflp->oif; 1136 rt->fl.flowi_oif = oldflp->flowi_oif;
1135 rt->fl.iif = 0; 1137 rt->fl.flowi_iif = 0;
1136 rt->fl.mark = oldflp->mark; 1138 rt->fl.flowi_mark = oldflp->flowi_mark;
1137 1139
1138 rt->rt_saddr = fl.fld_src; 1140 rt->rt_saddr = fl.fld_src;
1139 rt->rt_daddr = fl.fld_dst; 1141 rt->rt_daddr = fl.fld_dst;
@@ -1201,9 +1203,9 @@ static int __dn_route_output_key(struct dst_entry **pprt, const struct flowi *fl
1201 rt = rcu_dereference_bh(rt->dst.dn_next)) { 1203 rt = rcu_dereference_bh(rt->dst.dn_next)) {
1202 if ((flp->fld_dst == rt->fl.fld_dst) && 1204 if ((flp->fld_dst == rt->fl.fld_dst) &&
1203 (flp->fld_src == rt->fl.fld_src) && 1205 (flp->fld_src == rt->fl.fld_src) &&
1204 (flp->mark == rt->fl.mark) && 1206 (flp->flowi_mark == rt->fl.flowi_mark) &&
1205 dn_is_output_route(rt) && 1207 dn_is_output_route(rt) &&
1206 (rt->fl.oif == flp->oif)) { 1208 (rt->fl.flowi_oif == flp->flowi_oif)) {
1207 dst_use(&rt->dst, jiffies); 1209 dst_use(&rt->dst, jiffies);
1208 rcu_read_unlock_bh(); 1210 rcu_read_unlock_bh();
1209 *pprt = &rt->dst; 1211 *pprt = &rt->dst;
@@ -1221,7 +1223,7 @@ static int dn_route_output_key(struct dst_entry **pprt, struct flowi *flp, int f
1221 int err; 1223 int err;
1222 1224
1223 err = __dn_route_output_key(pprt, flp, flags); 1225 err = __dn_route_output_key(pprt, flp, flags);
1224 if (err == 0 && flp->proto) { 1226 if (err == 0 && flp->flowi_proto) {
1225 *pprt = xfrm_lookup(&init_net, *pprt, flp, NULL, 0); 1227 *pprt = xfrm_lookup(&init_net, *pprt, flp, NULL, 0);
1226 if (IS_ERR(*pprt)) { 1228 if (IS_ERR(*pprt)) {
1227 err = PTR_ERR(*pprt); 1229 err = PTR_ERR(*pprt);
@@ -1236,9 +1238,9 @@ int dn_route_output_sock(struct dst_entry **pprt, struct flowi *fl, struct sock
1236 int err; 1238 int err;
1237 1239
1238 err = __dn_route_output_key(pprt, fl, flags & MSG_TRYHARD); 1240 err = __dn_route_output_key(pprt, fl, flags & MSG_TRYHARD);
1239 if (err == 0 && fl->proto) { 1241 if (err == 0 && fl->flowi_proto) {
1240 if (!(flags & MSG_DONTWAIT)) 1242 if (!(flags & MSG_DONTWAIT))
1241 fl->flags |= FLOWI_FLAG_CAN_SLEEP; 1243 fl->flowi_flags |= FLOWI_FLAG_CAN_SLEEP;
1242 *pprt = xfrm_lookup(&init_net, *pprt, fl, sk, 0); 1244 *pprt = xfrm_lookup(&init_net, *pprt, fl, sk, 0);
1243 if (IS_ERR(*pprt)) { 1245 if (IS_ERR(*pprt)) {
1244 err = PTR_ERR(*pprt); 1246 err = PTR_ERR(*pprt);
@@ -1260,11 +1262,13 @@ static int dn_route_input_slow(struct sk_buff *skb)
1260 int flags = 0; 1262 int flags = 0;
1261 __le16 gateway = 0; 1263 __le16 gateway = 0;
1262 __le16 local_src = 0; 1264 __le16 local_src = 0;
1263 struct flowi fl = { .fld_dst = cb->dst, 1265 struct flowi fl = {
1264 .fld_src = cb->src, 1266 .fld_dst = cb->dst,
1265 .fld_scope = RT_SCOPE_UNIVERSE, 1267 .fld_src = cb->src,
1266 .mark = skb->mark, 1268 .fld_scope = RT_SCOPE_UNIVERSE,
1267 .iif = skb->dev->ifindex }; 1269 .flowi_mark = skb->mark,
1270 .flowi_iif = skb->dev->ifindex,
1271 };
1268 struct dn_fib_res res = { .fi = NULL, .type = RTN_UNREACHABLE }; 1272 struct dn_fib_res res = { .fi = NULL, .type = RTN_UNREACHABLE };
1269 int err = -EINVAL; 1273 int err = -EINVAL;
1270 int free_res = 0; 1274 int free_res = 0;
@@ -1343,7 +1347,7 @@ static int dn_route_input_slow(struct sk_buff *skb)
1343 if (dn_db->parms.forwarding == 0) 1347 if (dn_db->parms.forwarding == 0)
1344 goto e_inval; 1348 goto e_inval;
1345 1349
1346 if (res.fi->fib_nhs > 1 && fl.oif == 0) 1350 if (res.fi->fib_nhs > 1 && fl.flowi_oif == 0)
1347 dn_fib_select_multipath(&fl, &res); 1351 dn_fib_select_multipath(&fl, &res);
1348 1352
1349 /* 1353 /*
@@ -1408,9 +1412,9 @@ make_route:
1408 1412
1409 rt->fl.fld_src = cb->src; 1413 rt->fl.fld_src = cb->src;
1410 rt->fl.fld_dst = cb->dst; 1414 rt->fl.fld_dst = cb->dst;
1411 rt->fl.oif = 0; 1415 rt->fl.flowi_oif = 0;
1412 rt->fl.iif = in_dev->ifindex; 1416 rt->fl.flowi_iif = in_dev->ifindex;
1413 rt->fl.mark = fl.mark; 1417 rt->fl.flowi_mark = fl.flowi_mark;
1414 1418
1415 rt->dst.flags = DST_HOST; 1419 rt->dst.flags = DST_HOST;
1416 rt->dst.neighbour = neigh; 1420 rt->dst.neighbour = neigh;
@@ -1482,9 +1486,9 @@ static int dn_route_input(struct sk_buff *skb)
1482 rt = rcu_dereference(rt->dst.dn_next)) { 1486 rt = rcu_dereference(rt->dst.dn_next)) {
1483 if ((rt->fl.fld_src == cb->src) && 1487 if ((rt->fl.fld_src == cb->src) &&
1484 (rt->fl.fld_dst == cb->dst) && 1488 (rt->fl.fld_dst == cb->dst) &&
1485 (rt->fl.oif == 0) && 1489 (rt->fl.flowi_oif == 0) &&
1486 (rt->fl.mark == skb->mark) && 1490 (rt->fl.flowi_mark == skb->mark) &&
1487 (rt->fl.iif == cb->iif)) { 1491 (rt->fl.flowi_iif == cb->iif)) {
1488 dst_use(&rt->dst, jiffies); 1492 dst_use(&rt->dst, jiffies);
1489 rcu_read_unlock(); 1493 rcu_read_unlock();
1490 skb_dst_set(skb, (struct dst_entry *)rt); 1494 skb_dst_set(skb, (struct dst_entry *)rt);
@@ -1541,7 +1545,7 @@ static int dn_rt_fill_info(struct sk_buff *skb, u32 pid, u32 seq,
1541 rt->dst.error) < 0) 1545 rt->dst.error) < 0)
1542 goto rtattr_failure; 1546 goto rtattr_failure;
1543 if (dn_is_input_route(rt)) 1547 if (dn_is_input_route(rt))
1544 RTA_PUT(skb, RTA_IIF, sizeof(int), &rt->fl.iif); 1548 RTA_PUT(skb, RTA_IIF, sizeof(int), &rt->fl.flowi_iif);
1545 1549
1546 nlh->nlmsg_len = skb_tail_pointer(skb) - b; 1550 nlh->nlmsg_len = skb_tail_pointer(skb) - b;
1547 return skb->len; 1551 return skb->len;
@@ -1570,7 +1574,7 @@ static int dn_cache_getroute(struct sk_buff *in_skb, struct nlmsghdr *nlh, void
1570 return -EINVAL; 1574 return -EINVAL;
1571 1575
1572 memset(&fl, 0, sizeof(fl)); 1576 memset(&fl, 0, sizeof(fl));
1573 fl.proto = DNPROTO_NSP; 1577 fl.flowi_proto = DNPROTO_NSP;
1574 1578
1575 skb = alloc_skb(NLMSG_GOODSIZE, GFP_KERNEL); 1579 skb = alloc_skb(NLMSG_GOODSIZE, GFP_KERNEL);
1576 if (skb == NULL) 1580 if (skb == NULL)
@@ -1583,11 +1587,11 @@ static int dn_cache_getroute(struct sk_buff *in_skb, struct nlmsghdr *nlh, void
1583 if (rta[RTA_DST-1]) 1587 if (rta[RTA_DST-1])
1584 memcpy(&fl.fld_dst, RTA_DATA(rta[RTA_DST-1]), 2); 1588 memcpy(&fl.fld_dst, RTA_DATA(rta[RTA_DST-1]), 2);
1585 if (rta[RTA_IIF-1]) 1589 if (rta[RTA_IIF-1])
1586 memcpy(&fl.iif, RTA_DATA(rta[RTA_IIF-1]), sizeof(int)); 1590 memcpy(&fl.flowi_iif, RTA_DATA(rta[RTA_IIF-1]), sizeof(int));
1587 1591
1588 if (fl.iif) { 1592 if (fl.flowi_iif) {
1589 struct net_device *dev; 1593 struct net_device *dev;
1590 if ((dev = dev_get_by_index(&init_net, fl.iif)) == NULL) { 1594 if ((dev = dev_get_by_index(&init_net, fl.flowi_iif)) == NULL) {
1591 kfree_skb(skb); 1595 kfree_skb(skb);
1592 return -ENODEV; 1596 return -ENODEV;
1593 } 1597 }
@@ -1611,7 +1615,7 @@ static int dn_cache_getroute(struct sk_buff *in_skb, struct nlmsghdr *nlh, void
1611 int oif = 0; 1615 int oif = 0;
1612 if (rta[RTA_OIF - 1]) 1616 if (rta[RTA_OIF - 1])
1613 memcpy(&oif, RTA_DATA(rta[RTA_OIF - 1]), sizeof(int)); 1617 memcpy(&oif, RTA_DATA(rta[RTA_OIF - 1]), sizeof(int));
1614 fl.oif = oif; 1618 fl.flowi_oif = oif;
1615 err = dn_route_output_key((struct dst_entry **)&rt, &fl, 0); 1619 err = dn_route_output_key((struct dst_entry **)&rt, &fl, 0);
1616 } 1620 }
1617 1621