Re: [PATCH] Networking: send-to-self [link to non-broken patch this time]

From: Ben Greear (
Date: Wed Sep 18 2002 - 22:04:44 EST

David S. Miller wrote:
> From: Ben Greear <>
> Date: Wed, 18 Sep 2002 19:07:33 -0700
> David S. Miller wrote:
> > I mean put the ifdefs in a header file such as tcp.h, not in the *.c
> > code.
> Would you object to me just removing all of them and having the patch
> unconditionally compiled in?
> Your comments say that SIOCBINDTODEVICE behavior is changed, how can
> we legitimately do that all the time without breaking apps?

The old way is broken, it sets the bound-device to 0 when sending
the syn-ack. I am not sure exactly how this worked before, or
if it even worked at all. I changed it to use the bound_dev_if of the
parent socket, which I believe is more correct.

--- linux-2.4.19/net/ipv4/ip_output.c Tue Sep 17 23:55:48 2002
+++ Sun Sep 15 21:19:45 2002
@@ -975,7 +975,11 @@
                          daddr = replyopts.opt.faddr;

+ if (ip_route_output(&rt, daddr, rt->rt_spec_dst, RT_TOS(skb->nh.iph->tos), sk->bound_dev_if))
          if (ip_route_output(&rt, daddr, rt->rt_spec_dst, RT_TOS(skb->nh.iph->tos), 0))

          /* And let IP do all the hard work.

It also failed due to the hashing issue, but with the current code,
packets to self from self will be dropped before reaching the IP
code, so that is not really a bug in the current code.


Ben Greear <>       <Ben_Greear AT>
President of Candela Technologies Inc

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to More majordomo info at Please read the FAQ at

This archive was generated by hypermail 2b29 : Mon Sep 23 2002 - 22:00:25 EST