nnew.data= new->data + sizeof(struct ether_header);
nold.length= old->length - sizeof(struct ether_header);
nnew.length= new->length - sizeof(struct ether_header);
+ nnew.h=new->h;
+ nold.h=old->h;
/*Select Next Protocol*/
switch(ntohs(ethh->ether_type)){
case ETHERTYPE_IP:
- nnew.h=new->h;
- nold.h=old->h;
if(!ipv4_encap(&nnew, &nold)){
return 0;
}
nnew.data= new->data +iph->ihl*4;
nold.length= old->length -iph->ihl*4;
nnew.length= new->length -iph->ihl*4;
+ nnew.h=new->h;
+ nold.h=old->h;
/*Confirm that this is IPv4*/
if(iph->version!=4){
switch(iph->protocol){
case 0x21:
/*DCCP*/
- nnew.h=new->h;
- nold.h=old->h;
nnew.src_id=iph->saddr;
nnew.dest_id=iph->daddr;
if(!convert_packet(&nnew, &nold)){
}
/*Adjust IPv4 header to account for packet's total length*/
- iph->tot_len=htons(nnew.length);
+ iph->tot_len=htons(new->length);
return 1;
}
nnew.data= new->data + sizeof(struct sll_header);
nold.length= old->length - sizeof(struct sll_header);
nnew.length= new->length- sizeof(struct sll_header);
+ nnew.h=new->h;
+ nold.h=old->h;
/*Confirm that this is SLL*/
if(ntohs(slh->sll_pkttype) > 4){
/*Select Next Protocol*/
switch(ntohs(slh->sll_protocol)){
case ETHERTYPE_IP:
- nnew.h=new->h;
- nold.h=old->h;
if(!ipv4_encap(&nnew, &nold)){
return 0;
}