Setting the skb->mark field from application

Anton Danilov littlesmilingcloud at gmail.com
Mon Jun 2 06:55:43 EDT 2014


Hello.

Yes, you can do it with SO_MARK socket option.
>From socket man:
       SO_MARK (since Linux 2.6.25)
              Set the mark for each packet sent through this socket (similar
              to the netfilter MARK target but socket-based).  Changing the
              mark can be used for mark-based routing without netfilter or
              for packet filtering.  Setting this option requires the
              CAP_NET_ADMIN capability.


2014-06-02 14:25 GMT+04:00 Vishwas Srivastava <vishu.kernel at gmail.com>:
> Hi all,
>          Is it possible to set the skb->mark flied of the linux socket
> buffer from the application?
>
> Suppose application is using the Raw socket of Ethernet interface and it
> sends and receive packets to that interface. However, application wants to
> set the skb->mark filed of the socket buffer which in turn is honoured by
> the ethernet driver. I could not find any option in the api "setsockopt"
> which will allow to set the skb->mark field.
>
> Anybody having any idea if it can be done from the application?
> thanks,
> Vishwas S
>
> _______________________________________________
> Kernelnewbies mailing list
> Kernelnewbies at kernelnewbies.org
> http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
>



-- 
Anton.



More information about the Kernelnewbies mailing list