are u doin some sort of tunneling ?<br><br><div class="gmail_quote">On Fri, Apr 6, 2012 at 6:03 AM, Sri Ram Vemulpali <span dir="ltr"><<a href="mailto:sri.ram.gmu06@gmail.com">sri.ram.gmu06@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Whenever you manipulate the packet before PRE_ROUTING point in the<br>
stack, the kernel will decide whether to route the packet to LOCAL or<br>
FORWARD. If you have pointer pointing to right IP header kernel will<br>
use it to route. You really do not have to write routing code.<br>
<br>
Also, when you say inner and outer header what do you mean by it. I<br>
did not encounter this.<br>
<br>
Thanks,<br>
Sri.<br>
<br>
On Thu, Apr 5, 2012 at 5:00 AM, SaNtosh kuLkarni<br>
<<a href="mailto:santosh.yesoptus@gmail.com">santosh.yesoptus@gmail.com</a>> wrote:<br>
> i had a similar problem where in i was using SKB_PUSH to add extra<br>
> header,,,, i used this... structure called flowi.... which can be used to<br>
> define a sort of traffic class...based on some combination of fields<br>
><br>
><br>
> iph->daddr =htonl(xxxxxx);<br>
> {<br>
> struct rtable *rt;<br>
> struct flowi fl;<br>
> memset(&fl, 0x0, sizeof(struct flowi));<br>
> fl.fl4_dst = htonl(xxxxxxx);<br>
> fl.proto = IPPROTO_TCP;<br>
> if (!ip_route_output_key(&init_net, &rt, &fl))<br>
> {<br>
> iph->saddr= htonl(ntohl(rt->rt_src));<br>
><br>
> skb_dst_set(skb2, &rt->u.dst);<br>
><br>
> }<br>
><br>
> }<br>
><br>
><br>
> On Mon, Apr 2, 2012 at 2:12 PM, Kesava Srinivas <<a href="mailto:vunnavafuture@gmail.com">vunnavafuture@gmail.com</a>><br>
> wrote:<br>
>><br>
>> HI Friends,<br>
>> Looking for a Confirmation on my analysis.<br>
>><br>
>> Once after Capturing the Socket Buffer in PRE_ROUTING Hook; Manipulated<br>
>> the Socket Buffer by using the "skb_pull" Kernel Function. Using skb_pull;<br>
>> stripped 28 bytes (IP+UDP) which are the Part of outer UDP/IP Header. Now;<br>
>> My intention was to route the skb based on the Inner IP Header which is<br>
>> sitting after stripping 28 bytes. At the END; returned NF_ACCEPT.<br>
>><br>
>> Even though; skb_pull worked Fine., Kernel's Stack is still looking in to<br>
>> Outer Header only for Routing the Packet.I expected ;Kernel will look the<br>
>> Inner Header (As data Pointer was incremented by 28 bytes via skb_pull) and<br>
>> Take decision based on the Inner one. But; that didn't happened. It looks<br>
>> to me like; we need to always use NF_STOLEN & should write our own code to<br>
>> route based on the INNER HEADER. Was my conclusion correct ??<br>
>><br>
>> -Thanks in Advance,<br>
>> VKS<br>
>><br>
>><br>
>><br>
>> _______________________________________________<br>
>> Kernelnewbies mailing list<br>
>> <a href="mailto:Kernelnewbies@kernelnewbies.org">Kernelnewbies@kernelnewbies.org</a><br>
>> <a href="http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies" target="_blank">http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies</a><br>
>><br>
><br>
><br>
> _______________________________________________<br>
> Kernelnewbies mailing list<br>
> <a href="mailto:Kernelnewbies@kernelnewbies.org">Kernelnewbies@kernelnewbies.org</a><br>
> <a href="http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies" target="_blank">http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies</a><br>
><br>
<span class="HOEnZb"><font color="#888888"><br>
<br>
<br>
--<br>
Regards,<br>
Sri.<br>
</font></span></blockquote></div><br>