next up previous
Next: TCP Up: Tagging incoming packets Previous: ICMP

UDP

For UDP packets, the tag of the packet is set to the tag of the connection, if such a tag exists. Otherwise, the destination port of the packet is extracted, and the UDP socket waiting on this destination port looked up. If such a socket is found, then it indicates that the incoming packet is the first packet of the connection, but that it is claimed by a particular slice. The tag of the packet is then set to the xid of the socket.


\begin{lstlisting}
sk = udp4_lib_lookup(src_ip, src_port, ip, port,dif, udp_hash);
if (sk && hooknum==NF_IP_LOCAL_IN) {
mark=sk->sk_nid;
}
\end{lstlisting}



2008-09-17