Hello All,<br>    I have attached the code snippet for extending tproxy to support sctp functionality.<br><br>    For the socket lookup I use:<br>     <br>struct sock *nf_tproxy_get_sock_sctp4(const struct sk_buff *skb){<br>
<br> struct sctp_association *asoc;<br> union sctp_addr *saddr , *daddr;<br> struct sctp_transport **transport;<br> struct sctphdr *sh;<br> struct sock *sk;<br><br> void *temp;<br> void *temp1;<br><br> memset(saddr,0,sizeof(saddr));<br>
 memset(daddr,0,sizeof(daddr));<br><br> saddr-&gt;v4.sin_family = AF_INET;<br> daddr-&gt;v4.sin_family = AF_INET;<br><br> sh = sctp_hdr(skb);<br><br> temp=&amp;ip_hdr(skb)-&gt;saddr;<br> temp1=&amp;ip_hdr(skb)-&gt;daddr;<br>
<br> memcpy(&amp;saddr-&gt;v4.sin_addr.s_addr,temp, sizeof(struct in_addr));<br> memcpy(&amp;daddr-&gt;v4.sin_addr.s_addr,temp1, sizeof(struct in_addr));<br><br><br> asoc = __sctp_get_association(saddr, daddr, transport);<br>
         if (!asoc)<br>             sk=NULL;<br>       sk = asoc-&gt;<a href="http://base.sk">base.sk</a>;<br><br>return sk;<br>}<br><br>This function I plan to invoke from both xt_TPROXY.c and xt_socket.c for sctp instead of the existing function for tcp and udp.<br>
<br>if(iph-&gt;protocol == IPPROTO_TCP || iph-&gt;protocol == IPPROTO_UDP){<br>        sk = nf_tproxy_get_sock_v4(dev_net(skb-&gt;dev), iph-&gt;protocol,<br>                                   iph-&gt;saddr, tgi-&gt;laddr ? tgi-&gt;laddr : iph-&gt;daddr,<br>
                                   hp-&gt;source, tgi-&gt;lport ? tgi-&gt;lport : hp-&gt;dest,<br>                                   par-&gt;in, true);<br>        }<br><br>        else<br>          if(iph-&gt;protocol == IPPROTO_SCTP){<br>
               sk = nf_tproxy_get_sock_sctp4(skb);<br>          }<br><br>Have I missed out any condition during the socket lookup ?<br>What about the icmp support?Can I just reuse the existing functionality by adding sctp to the list of protocols?<br>
<br>Thanks and Regards,<br>     Maria<br><br>