diff -urN -X /usr/src/misc/xkdiff linux-2.5.7.orig/include/net/route.h linux-2.5.7-w1/include/net/route.h --- linux-2.5.7.orig/include/net/route.h Sun Mar 24 12:26:19 2002 +++ linux-2.5.7-w1/include/net/route.h Sun Mar 24 21:03:13 2002 @@ -132,16 +132,6 @@ extern void ip_rt_get_source(u8 *src, struct rtable *rt); extern int ip_rt_dump(struct sk_buff *skb, struct netlink_callback *cb); -/* Deprecated: use ip_route_output_key directly */ -static inline int ip_route_output(struct rtable **rp, - u32 daddr, u32 saddr, u32 tos, int oif) -{ - struct rt_key key = { dst:daddr, src:saddr, oif:oif, tos:tos }; - - return ip_route_output_key(rp, &key); -} - - static inline void ip_rt_put(struct rtable * rt) { if (rt) @@ -160,14 +150,16 @@ static inline int ip_route_connect(struct rtable **rp, u32 dst, u32 src, u32 tos, int oif) { int err; - err = ip_route_output(rp, dst, src, tos, oif); + struct rt_key key = { dst:dst, src:src, tos:tos, oif:oif }; + + err = ip_route_output_key(rp, &key); if (err || (dst && src)) return err; - dst = (*rp)->rt_dst; - src = (*rp)->rt_src; + key.dst = (*rp)->rt_dst; + key.src = (*rp)->rt_src; ip_rt_put(*rp); *rp = NULL; - return ip_route_output(rp, dst, src, tos, oif); + return ip_route_output_key(rp, &key); } extern void rt_bind_peer(struct rtable *rt, int create); diff -urN -X /usr/src/misc/xkdiff linux-2.5.7.orig/net/atm/clip.c linux-2.5.7-w1/net/atm/clip.c --- linux-2.5.7.orig/net/atm/clip.c Wed Jul 4 21:27:31 2001 +++ linux-2.5.7-w1/net/atm/clip.c Sun Mar 24 20:45:54 2002 @@ -510,6 +510,7 @@ int error; struct clip_vcc *clip_vcc; struct rtable *rt; + struct rt_key key = { dst:ip, tos:1 }; if (vcc->push != clip_push) { printk(KERN_WARNING "clip_setentry: non-CLIP VCC\n"); @@ -525,7 +526,7 @@ unlink_clip_vcc(clip_vcc); return 0; } - error = ip_route_output(&rt,ip,0,1,0); + error = ip_route_output_key(&rt,&key); if (error) return error; neigh = __neigh_lookup(&clip_tbl,&ip,rt->u.dst.dev,1); ip_rt_put(rt); diff -urN -X /usr/src/misc/xkdiff linux-2.5.7.orig/net/ipv4/arp.c linux-2.5.7-w1/net/ipv4/arp.c --- linux-2.5.7.orig/net/ipv4/arp.c Sun Mar 24 12:30:00 2002 +++ linux-2.5.7-w1/net/ipv4/arp.c Sun Mar 24 20:55:28 2002 @@ -350,8 +350,9 @@ struct rtable *rt; int flag = 0; /*unsigned long now; */ + struct rt_key key = { dst:sip, src:tip }; - if (ip_route_output(&rt, sip, tip, 0, 0) < 0) + if (ip_route_output_key(&rt, &key)) return 1; if (rt->u.dst.dev != dev) { NET_INC_STATS_BH(ArpFilter); @@ -893,7 +894,8 @@ r->arp_flags |= ATF_COM; if (dev == NULL) { struct rtable * rt; - if ((err = ip_route_output(&rt, ip, 0, RTO_ONLINK, 0)) != 0) + struct rt_key key = { dst:ip, tos:RTO_ONLINK }; + if ((err = ip_route_output_key(&rt, &key)) != 0) return err; dev = rt->u.dst.dev; ip_rt_put(rt); @@ -976,7 +978,8 @@ if (dev == NULL) { struct rtable * rt; - if ((err = ip_route_output(&rt, ip, 0, RTO_ONLINK, 0)) != 0) + struct rt_key key = { dst:ip, tos:RTO_ONLINK }; + if ((err = ip_route_output_key(&rt, &key)) != 0) return err; dev = rt->u.dst.dev; ip_rt_put(rt); diff -urN -X /usr/src/misc/xkdiff linux-2.5.7.orig/net/ipv4/icmp.c linux-2.5.7-w1/net/ipv4/icmp.c --- linux-2.5.7.orig/net/ipv4/icmp.c Sun Mar 24 12:26:19 2002 +++ linux-2.5.7-w1/net/ipv4/icmp.c Sun Mar 24 20:56:35 2002 @@ -341,7 +341,7 @@ struct inet_opt *inet = inet_sk(sk); struct ipcm_cookie ipc; struct rtable *rt = (struct rtable*)skb->dst; - u32 daddr; + struct rt_key key = { 0 }; if (ip_options_echo(&icmp_param->replyopts, skb)) return; @@ -354,14 +354,16 @@ icmp_out_count(icmp_param->data.icmph.type); inet->tos = skb->nh.iph->tos; - daddr = ipc.addr = rt->rt_src; + key.dst = ipc.addr = rt->rt_src; ipc.opt = NULL; if (icmp_param->replyopts.optlen) { ipc.opt = &icmp_param->replyopts; if (ipc.opt->srr) - daddr = icmp_param->replyopts.faddr; + key.dst = icmp_param->replyopts.faddr; } - if (ip_route_output(&rt, daddr, rt->rt_spec_dst, RT_TOS(skb->nh.iph->tos), 0)) + key.src = rt->rt_spec_dst; + key.tos = RT_TOS(skb->nh.iph->tos); + if (ip_route_output_key(&rt, &key)) goto out; if (icmpv4_xrlim_allow(rt, icmp_param->data.icmph.type, icmp_param->data.icmph.code)) { @@ -392,8 +394,8 @@ struct icmp_bxm icmp_param; struct rtable *rt = (struct rtable*)skb_in->dst; struct ipcm_cookie ipc; - u32 saddr; u8 tos; + struct rt_key key = { 0 }; if (!rt) return; @@ -470,15 +472,18 @@ } #endif - saddr = iph->daddr; + key.src = iph->daddr; if (!(rt->rt_flags & RTCF_LOCAL)) - saddr = 0; + key.src = 0; tos = icmp_pointers[type].error ? ((iph->tos & IPTOS_TOS_MASK) | IPTOS_PREC_INTERNETCONTROL) : iph->tos; - if (ip_route_output(&rt, iph->saddr, saddr, RT_TOS(tos), 0)) + key.dst = iph->saddr; + key.tos = RT_TOS(tos); + + if (ip_route_output_key(&rt, &key)) goto out; if (ip_options_echo(&icmp_param.replyopts, skb_in)) @@ -502,7 +507,9 @@ ipc.opt = &icmp_param.replyopts; if (icmp_param.replyopts.srr) { ip_rt_put(rt); - if (ip_route_output(&rt, icmp_param.replyopts.faddr, saddr, RT_TOS(tos), 0)) + key.dst = icmp_param.replyopts.faddr; + + if (ip_route_output_key(&rt, &key)) goto out; } diff -urN -X /usr/src/misc/xkdiff linux-2.5.7.orig/net/ipv4/igmp.c linux-2.5.7-w1/net/ipv4/igmp.c --- linux-2.5.7.orig/net/ipv4/igmp.c Sun Mar 24 12:26:19 2002 +++ linux-2.5.7-w1/net/ipv4/igmp.c Sun Mar 24 20:57:38 2002 @@ -198,16 +198,18 @@ struct iphdr *iph; struct igmphdr *ih; struct rtable *rt; - u32 dst; + struct rt_key key = { 0 }; /* According to IGMPv2 specs, LEAVE messages are * sent to all-routers group. */ - dst = group; + key.dst = group; if (type == IGMP_HOST_LEAVE_MESSAGE) - dst = IGMP_ALL_ROUTER; + key.dst = IGMP_ALL_ROUTER; - if (ip_route_output(&rt, dst, 0, 0, dev->ifindex)) + key.oif = dev->ifindex; + + if (ip_route_output_key(&rt, &key)) return -1; if (rt->rt_src == 0) { ip_rt_put(rt); @@ -231,7 +233,7 @@ iph->tos = 0; iph->frag_off = __constant_htons(IP_DF); iph->ttl = 1; - iph->daddr = dst; + iph->daddr = key.dst; iph->saddr = rt->rt_src; iph->protocol = IPPROTO_IGMP; iph->tot_len = htons(IGMP_SIZE); @@ -614,6 +616,7 @@ struct rtable *rt; struct net_device *dev = NULL; struct in_device *idev = NULL; + struct rt_key key = { dst:imr->imr_multiaddr.s_addr }; if (imr->imr_address.s_addr) { dev = ip_dev_find(imr->imr_address.s_addr); @@ -622,7 +625,7 @@ __dev_put(dev); } - if (!dev && !ip_route_output(&rt, imr->imr_multiaddr.s_addr, 0, 0, 0)) { + if (!dev && !ip_route_output_key(&rt, &key)) { dev = rt->u.dst.dev; ip_rt_put(rt); } diff -urN -X /usr/src/misc/xkdiff linux-2.5.7.orig/net/ipv4/ip_gre.c linux-2.5.7-w1/net/ipv4/ip_gre.c --- linux-2.5.7.orig/net/ipv4/ip_gre.c Thu Nov 8 13:15:19 2001 +++ linux-2.5.7-w1/net/ipv4/ip_gre.c Sun Mar 24 21:38:32 2002 @@ -411,6 +411,7 @@ int grehlen = (iph->ihl<<2) + 4; struct sk_buff *skb2; struct rtable *rt; + struct rt_key key = { 0 }; if (p[1] != __constant_htons(ETH_P_IP)) return; @@ -486,7 +487,9 @@ skb2->nh.raw = skb2->data; /* Try to guess incoming interface */ - if (ip_route_output(&rt, eiph->saddr, 0, RT_TOS(eiph->tos), 0)) { + key.dst = eiph->saddr; + key.tos = RT_TOS(eiph->tos); + if (ip_route_output_key(&rt, &key)) { kfree_skb(skb2); return; } @@ -496,7 +499,9 @@ if (rt->rt_flags&RTCF_LOCAL) { ip_rt_put(rt); rt = NULL; - if (ip_route_output(&rt, eiph->daddr, eiph->saddr, eiph->tos, 0) || + key.dst = eiph->daddr; + key.src = eiph->saddr; + if (ip_route_output_key(&rt, &key) || rt->u.dst.dev->type != ARPHRD_IPGRE) { ip_rt_put(rt); kfree_skb(skb2); @@ -686,7 +691,8 @@ int gre_hlen; u32 dst; int mtu; - + struct rt_key key = { 0 }; + if (tunnel->recursion++) { tunnel->stat.collisions++; goto tx_error; @@ -747,7 +753,11 @@ tos &= ~1; } - if (ip_route_output(&rt, dst, tiph->saddr, RT_TOS(tos), tunnel->parms.link)) { + key.dst = dst; + key.src = tiph->saddr; + key.tos = tos; + key.oif = tunnel->parms.link; + if (ip_route_output_key(&rt, &key)) { tunnel->stat.tx_carrier_errors++; goto tx_error; } @@ -1100,9 +1110,9 @@ MOD_INC_USE_COUNT; if (MULTICAST(t->parms.iph.daddr)) { struct rtable *rt; - if (ip_route_output(&rt, t->parms.iph.daddr, - t->parms.iph.saddr, RT_TOS(t->parms.iph.tos), - t->parms.link)) { + struct rt_key key = { dst:t->parms.iph.daddr, src:t->parms.iph.saddr, + tos:RT_TOS(t->parms.iph.tos), oif:t->parms.link }; + if (ip_route_output_key(&rt, &key)) { MOD_DEC_USE_COUNT; return -EADDRNOTAVAIL; } @@ -1173,7 +1183,9 @@ if (iph->daddr) { struct rtable *rt; - if (!ip_route_output(&rt, iph->daddr, iph->saddr, RT_TOS(iph->tos), tunnel->parms.link)) { + struct rt_key key = { dst:iph->daddr, src:iph->saddr, + tos:RT_TOS(iph->tos), oif:tunnel->parms.link }; + if (!ip_route_output_key(&rt, &key)) { tdev = rt->u.dst.dev; ip_rt_put(rt); } diff -urN -X /usr/src/misc/xkdiff linux-2.5.7.orig/net/ipv4/ip_output.c linux-2.5.7-w1/net/ipv4/ip_output.c --- linux-2.5.7.orig/net/ipv4/ip_output.c Sun Mar 24 12:30:00 2002 +++ linux-2.5.7-w1/net/ipv4/ip_output.c Sun Mar 24 21:44:42 2002 @@ -354,20 +354,21 @@ /* Make sure we can route this packet. */ rt = (struct rtable *)__sk_dst_check(sk, 0); if (rt == NULL) { - u32 daddr; + struct rt_key key = { 0 }; /* Use correct destination address if we have options. */ - daddr = inet->daddr; + key.dst = inet->daddr; if(opt && opt->srr) - daddr = opt->faddr; + key.dst = opt->faddr; /* If this fails, retransmit mechanism of transport layer will * keep trying until route appears or the connection times itself * out. */ - if (ip_route_output(&rt, daddr, inet->saddr, - RT_CONN_FLAGS(sk), - sk->bound_dev_if)) + key.src = inet->saddr; + key.tos = RT_CONN_FLAGS(sk); + key.oif = sk->bound_dev_if; + if (ip_route_output_key(&rt, &key)) goto no_route; __sk_dst_set(sk, &rt->u.dst); sk->route_caps = rt->u.dst.dev->features; @@ -956,6 +957,7 @@ struct ipcm_cookie ipc; u32 daddr; struct rtable *rt = (struct rtable*)skb->dst; + struct rt_key key = { 0 }; if (ip_options_echo(&replyopts.opt, skb)) return; @@ -970,7 +972,11 @@ daddr = replyopts.opt.faddr; } - if (ip_route_output(&rt, daddr, rt->rt_spec_dst, RT_TOS(skb->nh.iph->tos), 0)) + key.dst = daddr; + key.src = rt->rt_spec_dst; + key.tos = RT_TOS(skb->nh.iph->tos); + + if (ip_route_output_key(&rt, &key)) return; /* And let IP do all the hard work. diff -urN -X /usr/src/misc/xkdiff linux-2.5.7.orig/net/ipv4/ipip.c linux-2.5.7-w1/net/ipv4/ipip.c --- linux-2.5.7.orig/net/ipv4/ipip.c Fri Oct 26 15:09:38 2001 +++ linux-2.5.7-w1/net/ipv4/ipip.c Sun Mar 24 21:52:14 2002 @@ -356,6 +356,7 @@ int rel_info = 0; struct sk_buff *skb2; struct rtable *rt; + struct rt_key key = { 0 }; if (len < hlen + sizeof(struct iphdr)) return; @@ -417,7 +418,9 @@ skb2->nh.raw = skb2->data; /* Try to guess incoming interface */ - if (ip_route_output(&rt, eiph->saddr, 0, RT_TOS(eiph->tos), 0)) { + key.dst = eiph->saddr; + key.tos = RT_TOS(eiph->tos); + if (ip_route_output_key(&rt, &key)) { kfree_skb(skb2); return; } @@ -427,7 +430,9 @@ if (rt->rt_flags&RTCF_LOCAL) { ip_rt_put(rt); rt = NULL; - if (ip_route_output(&rt, eiph->daddr, eiph->saddr, eiph->tos, 0) || + key.dst = eiph->daddr; + key.src = eiph->saddr; + if (ip_route_output_key(&rt, &key) || rt->u.dst.dev->type != ARPHRD_IPGRE) { ip_rt_put(rt); kfree_skb(skb2); @@ -538,6 +543,7 @@ int max_headroom; /* The extra header space needed */ u32 dst = tiph->daddr; int mtu; + struct rt_key key = { 0 }; if (tunnel->recursion++) { tunnel->stat.collisions++; @@ -560,7 +566,11 @@ goto tx_error_icmp; } - if (ip_route_output(&rt, dst, tiph->saddr, RT_TOS(tos), tunnel->parms.link)) { + key.dst = dst; + key.src = tiph->saddr; + key.tos = RT_TOS(tos); + key.oif = tunnel->parms.link; + if (ip_route_output_key(&rt, &key)) { tunnel->stat.tx_carrier_errors++; goto tx_error_icmp; } @@ -819,7 +829,9 @@ if (iph->daddr) { struct rtable *rt; - if (!ip_route_output(&rt, iph->daddr, iph->saddr, RT_TOS(iph->tos), tunnel->parms.link)) { + struct rt_key key = { dst:iph->daddr, src:iph->saddr, + tos:RT_TOS(iph->tos), oif:tunnel->parms.link }; + if (!ip_route_output_key(&rt, &key)) { tdev = rt->u.dst.dev; ip_rt_put(rt); } diff -urN -X /usr/src/misc/xkdiff linux-2.5.7.orig/net/ipv4/ipmr.c linux-2.5.7-w1/net/ipv4/ipmr.c --- linux-2.5.7.orig/net/ipv4/ipmr.c Sun Mar 24 12:30:00 2002 +++ linux-2.5.7-w1/net/ipv4/ipmr.c Sun Mar 24 15:12:15 2002 @@ -1141,11 +1141,14 @@ #endif if (vif->flags&VIFF_TUNNEL) { - if (ip_route_output(&rt, vif->remote, vif->local, RT_TOS(iph->tos), vif->link)) + struct rt_key key = { dst:vif->remote, src:vif->local, + tos:RT_TOS(iph->tos), oif:vif->link }; + if (ip_route_output_key(&rt, &key)) return; encap = sizeof(struct iphdr); } else { - if (ip_route_output(&rt, iph->daddr, 0, RT_TOS(iph->tos), vif->link)) + struct rt_key key = { dst:iph->daddr, tos:RT_TOS(iph->tos), oif:vif->link }; + if (ip_route_output_key(&rt, &key)) return; } diff -urN -X /usr/src/misc/xkdiff linux-2.5.7.orig/net/ipv4/netfilter/ip_fw_compat_masq.c linux-2.5.7-w1/net/ipv4/netfilter/ip_fw_compat_masq.c --- linux-2.5.7.orig/net/ipv4/netfilter/ip_fw_compat_masq.c Sun Mar 24 12:24:49 2002 +++ linux-2.5.7-w1/net/ipv4/netfilter/ip_fw_compat_masq.c Sun Mar 24 20:35:01 2002 @@ -70,10 +70,11 @@ u_int32_t newsrc; struct rtable *rt; struct ip_nat_multi_range range; + struct rt_key key = { dst:iph->daddr }; /* Pass 0 instead of saddr, since it's going to be changed anyway. */ - if (ip_route_output(&rt, iph->daddr, 0, 0, 0) != 0) { + if (ip_route_output_key(&rt, &key) != 0) { DEBUGP("ipnat_rule_masquerade: Can't reroute.\n"); return NF_DROP; } diff -urN -X /usr/src/misc/xkdiff linux-2.5.7.orig/net/ipv4/netfilter/ip_nat_core.c linux-2.5.7-w1/net/ipv4/netfilter/ip_nat_core.c --- linux-2.5.7.orig/net/ipv4/netfilter/ip_nat_core.c Sun Mar 24 12:30:00 2002 +++ linux-2.5.7-w1/net/ipv4/netfilter/ip_nat_core.c Sun Mar 24 20:34:53 2002 @@ -204,9 +204,10 @@ do_extra_mangle(u_int32_t var_ip, u_int32_t *other_ipp) { struct rtable *rt; + struct rt_key key = { dst:var_ip }; /* FIXME: IPTOS_TOS(iph->tos) --RR */ - if (ip_route_output(&rt, var_ip, 0, 0, 0) != 0) { + if (ip_route_output_key(&rt, &key) != 0) { DEBUGP("do_extra_mangle: Can't get route to %u.%u.%u.%u\n", NIPQUAD(var_ip)); return 0; diff -urN -X /usr/src/misc/xkdiff linux-2.5.7.orig/net/ipv4/netfilter/ipt_MIRROR.c linux-2.5.7-w1/net/ipv4/netfilter/ipt_MIRROR.c --- linux-2.5.7.orig/net/ipv4/netfilter/ipt_MIRROR.c Wed Jan 16 01:24:52 2002 +++ linux-2.5.7-w1/net/ipv4/netfilter/ipt_MIRROR.c Sun Mar 24 20:37:05 2002 @@ -45,13 +45,12 @@ { struct iphdr *iph = skb->nh.iph; struct rtable *rt; + struct rt_key key = { dst:iph->saddr, src:iph->daddr, + tos:RT_TOS(iph->tos) | RTO_CONN }; /* Backwards */ - if (ip_route_output(&rt, iph->saddr, iph->daddr, - RT_TOS(iph->tos) | RTO_CONN, - 0)) { + if (ip_route_output_key(&rt, &key)) return 0; - } /* check if the interface we are leaving by is the same as the one we arrived on */ diff -urN -X /usr/src/misc/xkdiff linux-2.5.7.orig/net/ipv4/netfilter/ipt_REJECT.c linux-2.5.7-w1/net/ipv4/netfilter/ipt_REJECT.c --- linux-2.5.7.orig/net/ipv4/netfilter/ipt_REJECT.c Sun Mar 24 12:30:00 2002 +++ linux-2.5.7-w1/net/ipv4/netfilter/ipt_REJECT.c Sun Mar 24 20:40:13 2002 @@ -41,6 +41,7 @@ unsigned int otcplen; u_int16_t tmp; int needs_ack; + struct rt_key key = { 0 }; /* IP header checks: fragment, too short. */ if (oldskb->nh.iph->frag_off & htons(IP_OFFSET) @@ -127,10 +128,11 @@ nskb->nh.iph->ihl); /* Routing: if not headed for us, route won't like source */ - if (ip_route_output(&rt, nskb->nh.iph->daddr, - local ? nskb->nh.iph->saddr : 0, - RT_TOS(nskb->nh.iph->tos) | RTO_CONN, - 0) != 0) + key.dst = nskb->nh.iph->daddr; + key.src = local ? nskb->nh.iph->saddr : 0; + key.tos = RT_TOS(nskb->nh.iph->tos) | RTO_CONN; + + if (ip_route_output_key(&rt, &key) != 0) goto free_nskb; dst_release(nskb->dst); @@ -160,6 +162,7 @@ int hh_len, length; struct rtable *rt = (struct rtable*)skb_in->dst; unsigned char *data; + struct rt_key key = { 0 }; if (!rt) return; @@ -203,7 +206,11 @@ tos = (iph->tos & IPTOS_TOS_MASK) | IPTOS_PREC_INTERNETCONTROL; - if (ip_route_output(&rt, iph->saddr, saddr, RT_TOS(tos), 0)) + key.dst = iph->saddr; + key.src = saddr; + key.tos = RT_TOS(tos); + + if (ip_route_output_key(&rt, &key)) return; /* RFC says return as much as we can without exceeding 576 bytes. */ diff -urN -X /usr/src/misc/xkdiff linux-2.5.7.orig/net/ipv4/raw.c linux-2.5.7-w1/net/ipv4/raw.c --- linux-2.5.7.orig/net/ipv4/raw.c Sun Mar 24 12:30:00 2002 +++ linux-2.5.7-w1/net/ipv4/raw.c Sun Mar 24 15:09:59 2002 @@ -315,6 +315,7 @@ u32 daddr; u8 tos; int err; + struct rt_key key = { 0 }; /* This check is ONLY to check for arithmetic overflow on integer(!) len. Not more! Real check will be made @@ -412,7 +413,12 @@ rfh.saddr = inet->mc_addr; } - err = ip_route_output(&rt, daddr, rfh.saddr, tos, ipc.oif); + key.dst = daddr; + key.src = rfh.saddr; + key.tos = tos; + key.oif = ipc.oif; + + err = ip_route_output_key(&rt, &key); if (err) goto done; diff -urN -X /usr/src/misc/xkdiff linux-2.5.7.orig/net/ipv4/route.c linux-2.5.7-w1/net/ipv4/route.c --- linux-2.5.7.orig/net/ipv4/route.c Sun Mar 24 12:24:49 2002 +++ linux-2.5.7-w1/net/ipv4/route.c Sun Mar 24 20:48:56 2002 @@ -2151,10 +2151,10 @@ if (!err && rt->u.dst.error) err = -rt->u.dst.error; } else { - int oif = 0; + struct rt_key key = { dst:dst, src:src, tos:rtm->rtm_tos }; if (rta[RTA_OIF - 1]) - memcpy(&oif, RTA_DATA(rta[RTA_OIF - 1]), sizeof(int)); - err = ip_route_output(&rt, dst, src, rtm->rtm_tos, oif); + memcpy(&key.oif, RTA_DATA(rta[RTA_OIF - 1]), sizeof(int)); + err = ip_route_output_key(&rt, &key); } if (err) { kfree_skb(skb); diff -urN -X /usr/src/misc/xkdiff linux-2.5.7.orig/net/ipv4/syncookies.c linux-2.5.7-w1/net/ipv4/syncookies.c --- linux-2.5.7.orig/net/ipv4/syncookies.c Sun Mar 24 12:26:19 2002 +++ linux-2.5.7-w1/net/ipv4/syncookies.c Sun Mar 24 20:32:55 2002 @@ -121,6 +121,7 @@ int mss; struct rtable *rt; __u8 rcv_wscale; + struct rt_key key = { 0 }; if (!sysctl_tcp_syncookies || !skb->h.th->ack) goto out; @@ -173,12 +174,11 @@ * hasn't changed since we received the original syn, but I see * no easy way to do this. */ - if (ip_route_output(&rt, - opt && - opt->srr ? opt->faddr : req->af.v4_req.rmt_addr, - req->af.v4_req.loc_addr, - RT_CONN_FLAGS(sk), - 0)) { + key.dst = opt && opt->srr ? opt->faddr : req->af.v4_req.rmt_addr; + key.src = req->af.v4_req.loc_addr; + key.tos = RT_CONN_FLAGS(sk); + + if (ip_route_output_key(&rt, &key)) { tcp_openreq_free(req); goto out; } diff -urN -X /usr/src/misc/xkdiff linux-2.5.7.orig/net/ipv4/tcp_ipv4.c linux-2.5.7-w1/net/ipv4/tcp_ipv4.c --- linux-2.5.7.orig/net/ipv4/tcp_ipv4.c Sun Mar 24 12:30:00 2002 +++ linux-2.5.7-w1/net/ipv4/tcp_ipv4.c Sun Mar 24 15:20:20 2002 @@ -1167,14 +1167,12 @@ static struct dst_entry* tcp_v4_route_req(struct sock *sk, struct open_request *req) { struct rtable *rt; - struct ip_options *opt; - - opt = req->af.v4_req.opt; - if(ip_route_output(&rt, ((opt && opt->srr) ? - opt->faddr : - req->af.v4_req.rmt_addr), - req->af.v4_req.loc_addr, - RT_CONN_FLAGS(sk), sk->bound_dev_if)) { + struct ip_options *opt = req->af.v4_req.opt; + struct rt_key key = { dst:((opt && opt->srr) ? opt->faddr : req->af.v4_req.rmt_addr), + src: req->af.v4_req.loc_addr, + tos:RT_CONN_FLAGS(sk), oif:sk->bound_dev_if }; + + if(ip_route_output_key(&rt, &key)) { IP_INC_STATS_BH(IpOutNoRoutes); return NULL; } @@ -1796,20 +1794,23 @@ { struct inet_opt *inet = inet_sk(sk); struct rtable *rt = (struct rtable *)__sk_dst_check(sk, 0); - u32 daddr; int err; + struct rt_key key = { 0 }; /* Route is OK, nothing to do. */ if (rt != NULL) return 0; /* Reroute. */ - daddr = inet->daddr; + key.dst = inet->daddr; if (inet->opt && inet->opt->srr) - daddr = inet->opt->faddr; + key.dst = inet->opt->faddr; - err = ip_route_output(&rt, daddr, inet->saddr, - RT_CONN_FLAGS(sk), sk->bound_dev_if); + key.src = inet->saddr; + key.tos = RT_CONN_FLAGS(sk); + key.oif = sk->bound_dev_if; + + err = ip_route_output_key(&rt, &key); if (!err) { __sk_dst_set(sk, &rt->u.dst); sk->route_caps = rt->u.dst.dev->features; diff -urN -X /usr/src/misc/xkdiff linux-2.5.7.orig/net/ipv4/udp.c linux-2.5.7-w1/net/ipv4/udp.c --- linux-2.5.7.orig/net/ipv4/udp.c Sun Mar 24 12:30:00 2002 +++ linux-2.5.7-w1/net/ipv4/udp.c Sun Mar 24 20:55:04 2002 @@ -528,7 +528,9 @@ rt = (struct rtable*)sk_dst_check(sk, 0); if (rt == NULL) { - err = ip_route_output(&rt, daddr, ufh.saddr, tos, ipc.oif); + struct rt_key key = { dst:daddr, src:ufh.saddr, tos:tos, oif:ipc.oif }; + + err = ip_route_output_key(&rt, &key); if (err) goto out; diff -urN -X /usr/src/misc/xkdiff linux-2.5.7.orig/net/ipv6/sit.c linux-2.5.7-w1/net/ipv6/sit.c --- linux-2.5.7.orig/net/ipv6/sit.c Thu Oct 11 19:18:00 2001 +++ linux-2.5.7-w1/net/ipv6/sit.c Sun Mar 24 20:43:31 2002 @@ -463,6 +463,7 @@ int mtu; struct in6_addr *addr6; int addr_type; + struct rt_key key = { 0 }; if (tunnel->recursion++) { tunnel->stat.collisions++; @@ -500,8 +501,13 @@ dst = addr6->s6_addr32[3]; } - - if (ip_route_output(&rt, dst, tiph->saddr, RT_TOS(tos), tunnel->parms.link)) { + + key.dst = dst; + key.src = tiph->saddr; + key.tos = RT_TOS(tos); + key.oif = tunnel->parms.link; + + if (ip_route_output_key(&rt, &key)) { tunnel->stat.tx_carrier_errors++; goto tx_error_icmp; } @@ -773,7 +779,9 @@ if (iph->daddr) { struct rtable *rt; - if (!ip_route_output(&rt, iph->daddr, iph->saddr, RT_TOS(iph->tos), tunnel->parms.link)) { + struct rt_key key = { dst:iph->daddr, src:iph->saddr, + tos:RT_TOS(iph->tos), oif:tunnel->parms.link }; + if (!ip_route_output_key(&rt, &key)) { tdev = rt->u.dst.dev; ip_rt_put(rt); }