kernel/include/net/esp.h
.. .. @@ -11,6 +11,22 @@ 11 11 return (struct ip_esp_hdr *)skb_transport_header(skb); 12 12 } 13 13 14 +static inline void esp_output_fill_trailer(u8 *tail, int tfclen, int plen, __u8 proto)15 +{16 + /* Fill padding... */17 + if (tfclen) {18 + memset(tail, 0, tfclen);19 + tail += tfclen;20 + }21 + do {22 + int i;23 + for (i = 0; i < plen - 2; i++)24 + tail[i] = i + 1;25 + } while (0);26 + tail[plen - 2] = plen - 2;27 + tail[plen - 1] = proto;28 +}29 +14 30 struct esp_info { 15 31 struct ip_esp_hdr *esph; 16 32 __be64 seqno;