|
@@ -2527,6 +2527,8 @@ static int process_ipsec(struct pktgen_dev *pkt_dev,
|
|
|
if (x) {
|
|
if (x) {
|
|
|
int ret;
|
|
int ret;
|
|
|
__u8 *eth;
|
|
__u8 *eth;
|
|
|
|
|
+ struct iphdr *iph;
|
|
|
|
|
+
|
|
|
nhead = x->props.header_len - skb_headroom(skb);
|
|
nhead = x->props.header_len - skb_headroom(skb);
|
|
|
if (nhead > 0) {
|
|
if (nhead > 0) {
|
|
|
ret = pskb_expand_head(skb, nhead, 0, GFP_ATOMIC);
|
|
ret = pskb_expand_head(skb, nhead, 0, GFP_ATOMIC);
|
|
@@ -2548,6 +2550,11 @@ static int process_ipsec(struct pktgen_dev *pkt_dev,
|
|
|
eth = (__u8 *) skb_push(skb, ETH_HLEN);
|
|
eth = (__u8 *) skb_push(skb, ETH_HLEN);
|
|
|
memcpy(eth, pkt_dev->hh, 12);
|
|
memcpy(eth, pkt_dev->hh, 12);
|
|
|
*(u16 *) ð[12] = protocol;
|
|
*(u16 *) ð[12] = protocol;
|
|
|
|
|
+
|
|
|
|
|
+ /* Update IPv4 header len as well as checksum value */
|
|
|
|
|
+ iph = ip_hdr(skb);
|
|
|
|
|
+ iph->tot_len = htons(skb->len - ETH_HLEN);
|
|
|
|
|
+ ip_send_check(iph);
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
return 1;
|
|
return 1;
|