diff --git a/.github/workflows/github-actions-ci.yml b/.github/workflows/github-actions-ci.yml index 692bbf4e..8a9882d5 100644 --- a/.github/workflows/github-actions-ci.yml +++ b/.github/workflows/github-actions-ci.yml @@ -28,5 +28,5 @@ jobs: - name: List files in the repository run: ls ${{ github.workspace }} - name: tests - run: sudo make test || cat test/test.log + run: sudo make test || (cat test/test.log; false) - run: echo "This test's status is ${{ job.status }}." diff --git a/src/tcpedit/tcpedit.c b/src/tcpedit/tcpedit.c index 160ec75f..f846d8b6 100644 --- a/src/tcpedit/tcpedit.c +++ b/src/tcpedit/tcpedit.c @@ -185,8 +185,10 @@ tcpedit_packet(tcpedit_t *tcpedit, struct pcap_pkthdr **pkthdr, u_char **pktdata volatile uint16_t oldval = *((uint16_t *)ip_hdr); volatile uint16_t newval; - ip_hdr->ip_tos = tcpedit->tos; newval = *((uint16_t *)ip_hdr); + newval = htons((ntohs(newval) & 0xff00) | (tcpedit->tos & 0xff)); + *((uint16_t *)ip_hdr) = newval; + static uint32_t cnt; csum_replace2(&ip_hdr->ip_sum, oldval, newval); }