Commit 2817a33
net: skb_checksum: allow custom update/combine for walking skb
Currently, skb_checksum walks over 1) linearized, 2) frags[], and
3) frag_list data and calculats the one's complement, a 32 bit
result suitable for feeding into itself or csum_tcpudp_magic(),
but unsuitable for SCTP as we're calculating CRC32c there.
Hence, in order to not re-implement the very same function in
SCTP (and maybe other protocols) over and over again, use an
update() + combine() callback internally to allow for walking
over the skb with different algorithms.
Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>1 parent efba721 commit 2817a33
3 files changed
+37
-13
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2360 | 2360 | | |
2361 | 2361 | | |
2362 | 2362 | | |
2363 | | - | |
2364 | | - | |
2365 | 2363 | | |
2366 | 2364 | | |
2367 | 2365 | | |
| |||
2373 | 2371 | | |
2374 | 2372 | | |
2375 | 2373 | | |
2376 | | - | |
2377 | 2374 | | |
2378 | 2375 | | |
| 2376 | + | |
| 2377 | + | |
| 2378 | + | |
| 2379 | + | |
| 2380 | + | |
| 2381 | + | |
| 2382 | + | |
| 2383 | + | |
| 2384 | + | |
| 2385 | + | |
2379 | 2386 | | |
2380 | 2387 | | |
2381 | 2388 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
78 | 78 | | |
79 | 79 | | |
80 | 80 | | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
81 | 87 | | |
82 | 88 | | |
83 | 89 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1928 | 1928 | | |
1929 | 1929 | | |
1930 | 1930 | | |
1931 | | - | |
1932 | | - | |
1933 | | - | |
| 1931 | + | |
| 1932 | + | |
1934 | 1933 | | |
1935 | 1934 | | |
1936 | 1935 | | |
| |||
1941 | 1940 | | |
1942 | 1941 | | |
1943 | 1942 | | |
1944 | | - | |
| 1943 | + | |
1945 | 1944 | | |
1946 | 1945 | | |
1947 | 1946 | | |
| |||
1962 | 1961 | | |
1963 | 1962 | | |
1964 | 1963 | | |
1965 | | - | |
1966 | | - | |
| 1964 | + | |
| 1965 | + | |
1967 | 1966 | | |
1968 | | - | |
| 1967 | + | |
1969 | 1968 | | |
1970 | 1969 | | |
1971 | 1970 | | |
| |||
1984 | 1983 | | |
1985 | 1984 | | |
1986 | 1985 | | |
1987 | | - | |
1988 | | - | |
1989 | | - | |
| 1986 | + | |
| 1987 | + | |
| 1988 | + | |
1990 | 1989 | | |
1991 | 1990 | | |
1992 | 1991 | | |
| |||
1998 | 1997 | | |
1999 | 1998 | | |
2000 | 1999 | | |
| 2000 | + | |
| 2001 | + | |
| 2002 | + | |
| 2003 | + | |
| 2004 | + | |
| 2005 | + | |
| 2006 | + | |
| 2007 | + | |
| 2008 | + | |
| 2009 | + | |
| 2010 | + | |
| 2011 | + | |
2001 | 2012 | | |
2002 | 2013 | | |
2003 | 2014 | | |
| |||
0 commit comments