nfqws: cosmetics

This commit is contained in:
bol-van 2022-02-05 13:39:09 +03:00
parent 6151afe727
commit b787ed0146

View File

@ -376,11 +376,11 @@ bool ip6_insert_simple_hdr(uint8_t type, uint8_t *data_pkt, size_t len_pkt, uint
if ((len_pkt+8)<=*buflen && len_pkt>=sizeof(struct ip6_hdr)) if ((len_pkt+8)<=*buflen && len_pkt>=sizeof(struct ip6_hdr))
{ {
struct ip6_hdr *ip6 = (struct ip6_hdr *)buf; struct ip6_hdr *ip6 = (struct ip6_hdr *)buf;
struct ip6_ext *hbh = (struct ip6_ext*)(ip6+1); struct ip6_ext *hdr = (struct ip6_ext*)(ip6+1);
*ip6 = *(struct ip6_hdr*)data_pkt; *ip6 = *(struct ip6_hdr*)data_pkt;
memset(hbh,0,8); memset(hdr,0,8);
memcpy((uint8_t*)hbh+8, data_pkt+sizeof(struct ip6_hdr), len_pkt-sizeof(struct ip6_hdr)); memcpy((uint8_t*)hdr+8, data_pkt+sizeof(struct ip6_hdr), len_pkt-sizeof(struct ip6_hdr));
hbh->ip6e_nxt = ip6->ip6_ctlun.ip6_un1.ip6_un1_nxt; hdr->ip6e_nxt = ip6->ip6_ctlun.ip6_un1.ip6_un1_nxt;
ip6->ip6_ctlun.ip6_un1.ip6_un1_nxt = type; ip6->ip6_ctlun.ip6_un1.ip6_un1_nxt = type;
ip6->ip6_ctlun.ip6_un1.ip6_un1_plen = net16_add(ip6->ip6_ctlun.ip6_un1.ip6_un1_plen, 8); ip6->ip6_ctlun.ip6_un1.ip6_un1_plen = net16_add(ip6->ip6_ctlun.ip6_un1.ip6_un1_plen, 8);
*buflen = len_pkt + 8; *buflen = len_pkt + 8;