fix nasmesh kernel 4.15
This commit is contained in:
@@ -53,17 +53,14 @@ void nas_COMMON_receive(uint16_t dlen,
|
||||
struct sk_buff *skb;
|
||||
struct ipversion *ipv;
|
||||
struct nas_priv *gpriv=netdev_priv(nasdev[inst]);
|
||||
uint32_t odaddr,osaddr;
|
||||
|
||||
//int i;
|
||||
|
||||
unsigned char protocol;
|
||||
|
||||
unsigned char /**addr,*/ *daddr,*saddr,*ifaddr /*,sn*/;
|
||||
|
||||
//struct udphdr *uh;
|
||||
//struct tcphdr *th;
|
||||
uint16_t *cksum,check;
|
||||
|
||||
struct iphdr *network_header;
|
||||
|
||||
@@ -114,11 +111,12 @@ void nas_COMMON_receive(uint16_t dlen,
|
||||
// Make the third byte of both the source and destination equal to the fourth of the destination
|
||||
|
||||
|
||||
|
||||
unsigned char * ifaddr, *saddr, daddr;
|
||||
daddr = (unsigned char *)&((struct iphdr *)skb->data)->daddr;
|
||||
odaddr = ((struct iphdr *)skb->data)->daddr;
|
||||
// sn = addr[3];
|
||||
saddr = (unsigned char *)&((struct iphdr *)skb->data)->saddr;
|
||||
uint32_t odaddr,osaddr;
|
||||
osaddr = ((struct iphdr *)skb->data)->saddr;
|
||||
|
||||
if (daddr[0] == saddr[0]) {// same network
|
||||
@@ -219,6 +217,7 @@ void nas_COMMON_receive(uint16_t dlen,
|
||||
|
||||
case IPPROTO_TCP:
|
||||
|
||||
uint16_t *cksum,check;
|
||||
cksum = (uint16_t*)&(((struct tcphdr*)(((char *)network_header + (network_header->ihl<<2))))->check);
|
||||
//check = csum_tcpudp_magic(((struct iphdr *)network_header)->saddr, ((struct iphdr *)network_header)->daddr, tcp_hdrlen(skb), IPPROTO_TCP, ~(*cksum));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user