Hello All,
I am trying to add xfrm policy using C code. and have also succeed to add. But the problem is it is not doing the job what i want to. I am trying add following rule
src 192.168.200.1/32 dst 0.0.0.0/0
dir fwd priority 0 ptype main
tmpl src 192.168.211.1 dst 192.168.211.203
proto esp spi 0x1ac3b45d reqid 0 mode tunnel
when I am adding this rule using command line by
"ip xfrm policy add src 192.168.200.1/32 dst 0.0.0.0/0 dir fwd tmpl src 192.168.211.1 dst 192.168.211.203 proto esp spi 0x1ac3b45d mode tunnel" . Then it is working correctly i.e. forwarding the packet through default gateway after decrypting ESP packet but when I am adding the rule in C code it is not forwarding the packet after decrypting. I am sure about that it decrypting correctly because I am seeing the decrypted packet by running tcpdump.
Is there any kind of flag or attribute in xfrm_userpolicy_info or xfrm_user_tmpl which I am not setting thats why it is not forwarding the packet through default gateway?? Please , I need a quick help...
