Network protocol (IP,IPv6,...) and TC actions

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

I started to write a new TC action (ACT_CSUM) in order to be able to
force a checksum update after a packet alteration done with ACT_PEDIT.

I would like to provide this action at least on IPv4 and IPv6.

My first solution wasn't to try to discover the network protocol (IPv4,
IPv6 or another one) used inside the struct sk_buff argument got when
the TC actions are called. I preferred to let the user specify the
assumed network protocol when the TC action is defined using
iproute2/tc.

However, I discover after (it's my first work in the network Linux
source code ;-) the struct sk_buff has a .protocol member which could
contain the ETH_P_IP or ETH_P_IPV6 values according to the network
protocol. Good news, I could use this member to avoid to ask the users
to give an assumed network protocol ... but,

As this .protocol member seems to be used at different moments when a
packet is received, forwared or sent, and could contain something like
ETH_P_8021Q which isn't a network protocol Id, can we say the struct
sk_buff .protocol member is guaranteed to contain a network protocol Id
in the struct sb_buff used in the TC action executions ?

Maybe another way exsits to "discover" the network protocol used in the
TC actions case.

With the same idea, checking the other TC actions, I suppose the struct
sk_buff .len member contains the network layer length
(header+data(+trailer)). Is it a mistake from me ?

Thanks in advance.

Regards,

Grégoire Baron
--
To unsubscribe from this list: send the line "unsubscribe linux-net" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Netdev]     [Ethernet Bridging]     [Linux 802.1Q VLAN]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Git]     [Bugtraq]     [Yosemite News and Information]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux PCI]     [Linux Admin]     [Samba]

  Powered by Linux