问题描述
- sk_buff:源IP/mac 和目标ip/mac 调换,我这么做对么
- /* mac layer /
struct ethhdr *eth *temp_eth;
eth = eth_hdr(skb);
temp_eth = eth_hdr(skb);
ether_addr_copy(eth->h_source temp_eth->h_dest);
ether_addr_copy(eth->h_dest temp_eth->h_source);
/ ip layer */
struct iphdr *nh*temp_nh;
nh = ip_hdr(skb);
temp_nh = ip_hdr(skb);
nh->daddr = temp_nh->saddr;
nh->saddr = temp_nh->daddr;
int sent = ovs_vport_send(p skb);语法上没错误,但是好像没有成功调换,是不是没有找到指针?
时间: 2024-11-11 21:26:59