Should ICMP echo responses be 'bound to the interface' of the incoming ICMP echo request?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Question about the icmp_reply() routine in linux/net/ipv4/icmp.c:

The routine does not seem that the ICMP echo response goes out of the same interface where the ICMP echo request was received. Is that correct behavior?

I've tried to modify the icmp_reply() in my sandbox (see attached) to force the icmp echo reply out of the same interface where the request was received, but I think there's something wrong with my modification, as it does not seem to work right. Or perhaps the modification is right, but skb->skb_iif is set wrong. Can anyone offer advice? Please cc any response to iubica2@xxxxxxxxxx Thanks,

Andrei


diff -c -r1.2 icmp.c
*** icmp.c    28 Oct 2010 18:48:00 -0000    1.2
--- icmp.c    5 Apr 2011 20:25:53 -0000
***************
*** 384,390 ****
              daddr = icmp_param->replyopts.faddr;
      }
      {
!         struct flowi fl = { .nl_u = { .ip4_u =
                            { .daddr = daddr,
                          .saddr = rt->rt_spec_dst,
                          .tos = RT_TOS(ip_hdr(skb)->tos) } },
--- 384,391 ----
              daddr = icmp_param->replyopts.faddr;
      }
      {
!         struct flowi fl = { .oif = skb->skb_iif,
!                     .nl_u = { .ip4_u =
                            { .daddr = daddr,
                          .saddr = rt->rt_spec_dst,
                          .tos = RT_TOS(ip_hdr(skb)->tos) } },



--
To unsubscribe from this list: send the line "unsubscribe linux-net" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Netdev]     [Ethernet Bridging]     [Linux 802.1Q VLAN]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Git]     [Bugtraq]     [Yosemite News and Information]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux PCI]     [Linux Admin]     [Samba]

  Powered by Linux