Re: ip_dynaddr broken in 2.4.0-test1 ?

From: Christian Nautze (christian@nautze.de)
Date: Mon Jun 05 2000 - 17:17:53 EST


Hi Malware,

Malware wrote:
>
> That was always the case for locally generated packets. The function
> tcp_v4_rebuild_header is only called on retransmit. So you have to wait
> for the retransmission of the SYN.
>
> Malware
>

Okay, you are right. I thought i had done the test with ping but it was
indeed
xboard which uses telnet. And this one does not work although it
retransmitted
its syn packet. tcpdump -ni output:

User level filter, protocol ALL, datagram packet socket
tcpdump: listening on ippp0
23:58:34.343440 > 149.225.99.83.32768 > 164.58.253.13.5000: S
4246946548:4246946
548(0) win 31856 <mss 1460,sackOK,timestamp 14235 0,nop,wscale 0> (DF)
23:58:36.954855 > 149.225.99.83.32768 > 164.58.253.13.5000: S
4246946548:4246946
548(0) win 31856 <mss 1460,sackOK,timestamp 14235 0,nop,wscale 0> (DF)
23:58:36.970333 > 149.225.99.83.32768 > 164.58.253.13.5000: S
4246946548:4246946
548(0) win 31856 <mss 1460,sackOK,timestamp 14235 0,nop,wscale 0> (DF)
23:58:36.983338 > 149.225.99.83.32768 > 164.58.253.13.5000: S
4246946548:4246946
548(0) win 31856 <mss 1460,sackOK,timestamp 14235 0,nop,wscale 0> (DF)
23:58:37.003837 > 149.225.99.83.32768 > 164.58.253.13.5000: S
4246946548:4246946
548(0) win 31856 <mss 1460,sackOK,timestamp 14235 0,nop,wscale 0> (DF)
23:58:37.026584 > 149.225.99.83.32768 > 164.58.253.13.5000: S
4246946548:4246946
548(0) win 31856 <mss 1460,sackOK,timestamp 14235 0,nop,wscale 0> (DF)
23:58:37.029332 > 149.225.99.83.32768 > 164.58.253.13.5000: S
4246946548:4246946
548(0) win 31856 <mss 1460,sackOK,timestamp 14235 0,nop,wscale 0> (DF)
23:58:37.038333 > 149.225.99.83.32768 > 164.58.253.13.5000: S
4246946548:4246946
548(0) win 31856 <mss 1460,sackOK,timestamp 14235 0,nop,wscale 0> (DF)
23:58:37.049480 > 149.225.99.83.32768 > 164.58.253.13.5000: S
4246946548:4246946
548(0) win 31856 <mss 1460,sackOK,timestamp 14235 0,nop,wscale 0> (DF)
23:58:37.083135 > 149.225.99.83.32768 > 164.58.253.13.5000: S
4246946548:4246946
548(0) win 31856 <mss 1460,sackOK,timestamp 14235 0,nop,wscale 0> (DF)

i added some printk's to the original 2.4.0-test1 code:

int tcp_v4_rebuild_header(struct sock *sk)
{
        struct rtable *rt = (struct rtable *)__sk_dst_check(sk, 0);
        __u32 new_saddr;
        int want_rewrite = sysctl_ip_dynaddr && sk->state ==
TCP_SYN_SENT;
>> printk(KERN_INFO "rt_new: %p, old: %p\n", rt, sk->dst_cache);
>> printk(KERN_INFO "want rewrite %d\n", want_rewrite);
        if (rt == NULL) {
                int err;

                u32 daddr = sk->daddr;

                if(sk->protinfo.af_inet.opt &&
sk->protinfo.af_inet.opt->srr)
                        daddr = sk->protinfo.af_inet.opt->faddr;

                err = ip_route_output(&rt, daddr, sk->saddr,
                                      RT_TOS(sk->protinfo.af_inet.tos) |
RTO_CON
N | sk->localroute,
                                      sk->bound_dev_if);
>> printk(KERN_INFO "error: %d\n", err);
                if (err) {
                        sk->err_soft=-err;
                        sk->error_report(sk);
                        return -1;
                }

And my syslog file has this output:
(old is the method used to get rt in 2.2.14)

<log for successfull dialin deleted>
Jun 5 23:58:37 beastieboys ipppd[584]: local IP address 149.225.37.21
Jun 5 23:58:37 beastieboys ipppd[584]: remote IP address
149.227.160.133
Jun 5 23:58:37 beastieboys kernel: rt_new: 00000000, old: 00000000
Jun 5 23:58:37 beastieboys kernel: want rewrite 1
Jun 5 23:58:37 beastieboys kernel: error: -22
Jun 5 23:58:43 beastieboys kernel: rt_new: 00000000, old: 00000000
Jun 5 23:58:43 beastieboys kernel: want rewrite 1
Jun 5 23:58:43 beastieboys kernel: error: -22
Jun 5 23:58:55 beastieboys kernel: rt_new: 00000000, old: 00000000
Jun 5 23:58:55 beastieboys kernel: want rewrite 1
Jun 5 23:58:55 beastieboys kernel: error: -22
Jun 5 23:59:19 beastieboys kernel: rt_new: 00000000, old: 00000000
Jun 5 23:59:19 beastieboys kernel: want rewrite 1
Jun 5 23:59:19 beastieboys kernel: error: -22

so the rewriting will never be done because something is not okay
with the routing table. (route add default ippp0 which should
be okay for auto dialup to work). If i start xboard after
the connection is established everythings works perfect.

Any hints are welcome.

Christian

PS: i checked Documentation/Changes and have the apropriate versions
installed

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Wed Jun 07 2000 - 21:00:23 EST