I am uploading a NMU once again to fix this. The debdiff is attached.
diff -Nru packeth-2.1/debian/changelog packeth-2.1/debian/changelog
--- packeth-2.1/debian/changelog        2023-09-20 17:54:49.000000000 +0000
+++ packeth-2.1/debian/changelog        2023-10-01 12:56:11.000000000 +0000
@@ -1,3 +1,10 @@
+packeth (2.1-0.2) unstable; urgency=medium
+
+  * Non-maintainer upload
+  * Drop unused code with x86 assembly (Closes: #1053312)
+
+ -- Bastian Germann <b...@debian.org>  Sun, 01 Oct 2023 12:56:11 +0000
+
 packeth (2.1-0.1) unstable; urgency=medium
 
   * Non-maintainer upload
diff -Nru packeth-2.1/debian/patches/04-no-asm.patch 
packeth-2.1/debian/patches/04-no-asm.patch
--- packeth-2.1/debian/patches/04-no-asm.patch  1970-01-01 00:00:00.000000000 
+0000
+++ packeth-2.1/debian/patches/04-no-asm.patch  2023-10-01 12:56:11.000000000 
+0000
@@ -0,0 +1,182 @@
+Description: Drop unused code with x86 assembly
+Author: Bastian Germann <b...@debian.org>
+---
+--- packeth-2.1.orig/cli/cli_send.c
++++ packeth-2.1/cli/cli_send.c
+@@ -1729,36 +1728,6 @@ void onexit(int signum)
+ }
+ 
+ 
/*------------------------------------------------------------------------------*/
+-inline __sum16
+-ip_fast_csum(const void *iph, unsigned int ihl)
+-{
+-    unsigned int sum;
+-    
+-    asm("  movl (%1), %0\n"
+-        "  subl $4, %2\n"
+-        "  jbe 2f\n"
+-        "  addl 4(%1), %0\n"
+-        "  adcl 8(%1), %0\n"
+-        "  adcl 12(%1), %0\n"
+-        "1: adcl 16(%1), %0\n"
+-        "  lea 4(%1), %1\n"
+-        "  decl %2\n"
+-        "  jne      1b\n"
+-        "  adcl $0, %0\n"
+-        "  movl %0, %2\n"
+-        "  shrl $16, %0\n"
+-        "  addw %w2, %w0\n"
+-        "  adcl $0, %0\n"
+-        "  notl %0\n"
+-        "2:"
+-        /* Since the input registers which are loaded with iph and ih
+-           are modified, we must also specify them as outputs, or gcc
+-           will assume they contain their original values. */
+-        : "=r" (sum), "=r" (iph), "=r" (ihl)
+-        : "1" (iph), "2" (ihl)
+-        : "memory");
+-    return (__sum16)sum;
+-}
+ 
/*------------------------------------------------------------------------------*/
+ uint16_t
+ TCPChecksum(uint16_t* buf1, int buf1len, uint16_t* buf2, int buf2len)
+@@ -1808,139 +1777,6 @@ MyRandom(uint64_t *seed)
+     return (uint32_t)(*seed >> 32); 
+ }
+ 
/*------------------------------------------------------------------------------*/
+-char *
+-build_packet(char *buffer, int pktsize, int tot_rules, int *rule_idx, 
uint64_t *seed, int attack)
+-{
+-    struct ether_header *ethh;
+-    struct iphdr *iph;
+-    struct tcphdr *tcph;
+-    uint16_t tot_len;
+-    static struct
+-    {
+-        uint32_t src_addr;
+-        uint32_t dst_addr;
+-        uint8_t zero;
+-        uint8_t protocol;
+-        uint16_t len;
+-    } __attribute__ ((aligned (__WORDSIZE))) pseudo_header = {
+-        IP_SRC_ADDR, IP_DST_ADDR, 0, IPPROTO_TCP, 0,
+-    };
+-    static u_int8_t ether_dhost[ETH_ALEN] = MAC_DST_ADDR;
+-    static u_int8_t ether_shost[ETH_ALEN] = MAC_SRC_ADDR;
+-    static uint64_t attack_meter = 0;
+-    uint64_t attack_index;
+-    uint8_t attack_packet = 0;
+-    
+-    /* build ether header (14B) */
+-    ethh = (struct ether_header *)buffer;
+-    memcpy(ethh->ether_dhost, ether_dhost, ETH_ALEN);
+-    memcpy(ethh->ether_shost, ether_shost, ETH_ALEN);
+-    ethh->ether_type = htons(ETHERTYPE_IP);
+-
+-    tot_len = pktsize - sizeof(struct ether_header);
+-    
+-    /* build ip header (20B) */
+-    iph = (struct iphdr *)(ethh + 1);
+-    memset(iph, 0, sizeof (struct iphdr));      
+-    iph->ihl = (unsigned int)(sizeof(struct iphdr)>>2);
+-    iph->version = 4;
+-    iph->ttl = 32;
+-    iph->protocol = IPPROTO_TCP;
+-    /* in nbo */
+-    iph->saddr = IP_SRC_ADDR;
+-    iph->daddr = IP_DST_ADDR;
+-    iph->tot_len = htons(tot_len);
+-    iph->check = ip_fast_csum(iph, iph->ihl);
+-
+-    /* build tcp header (20B) */
+-    tcph = (struct tcphdr *)((char *)buffer + sizeof(struct ether_header) +
+-                 sizeof(struct iphdr));
+-    memset(tcph, 0, sizeof (struct tcphdr));    
+-    tcph->source = TCP_SRC_PORT;
+-    tcph->dest = TCP_DST_PORT;
+-    tcph->seq = MyRandom(seed);
+-    tcph->ack_seq = MyRandom(seed);
+-    tcph->doff = (sizeof(struct tcphdr)>>2);
+-    tcph->res1 = 0;
+-    tcph->res2 = 0;
+-    tcph->urg = 0;
+-    tcph->ack = 1;
+-    tcph->psh = 0;
+-    tcph->rst = 0;
+-    tcph->syn = 0;
+-    tcph->fin = 0;
+-    tcph->window = htons(5840);
+-
+-    attack_index = attack_meter & (4 - 1);
+-    switch (attack) {
+-    case 0:
+-        memcpy((char *)buffer + sizeof(struct ether_header) +
+-               sizeof(struct iphdr) + sizeof(struct tcphdr),
+-               null_payload, tot_len + sizeof(struct ether_header));
+-        break;
+-    case 1:
+-        if (attack_index == 0) {
+-            memcpy((char *)buffer + sizeof(struct ether_header) +
+-                   sizeof(struct iphdr) + sizeof(struct tcphdr),
+-                   g_content[*rule_idx], tot_len + sizeof(struct 
ether_header));
+-            attack_packet = 1;
+-        }
+-        else
+-            memcpy((char *)buffer + sizeof(struct ether_header) +
+-                   sizeof(struct iphdr) + sizeof(struct tcphdr),
+-                   null_payload, tot_len + sizeof(struct ether_header));
+-        break;
+-    case 2:
+-        if (attack_index == 0 || attack_index == 2) {
+-            memcpy((char *)buffer + sizeof(struct ether_header) +
+-                   sizeof(struct iphdr) + sizeof(struct tcphdr),
+-                   g_content[*rule_idx], tot_len + sizeof(struct 
ether_header));
+-            attack_packet = 1;          
+-        }
+-        else
+-            memcpy((char *)buffer + sizeof(struct ether_header) +
+-                   sizeof(struct iphdr) + sizeof(struct tcphdr),
+-                   null_payload, tot_len + sizeof(struct ether_header));
+-        break;
+-    case 3:
+-        if (attack_index != 0) {
+-            memcpy((char *)buffer + sizeof(struct ether_header) +
+-                   sizeof(struct iphdr) + sizeof(struct tcphdr),
+-                   g_content[*rule_idx], tot_len + sizeof(struct 
ether_header));
+-            attack_packet = 1;
+-        }
+-        else
+-            memcpy((char *)buffer + sizeof(struct ether_header) +
+-                   sizeof(struct iphdr) + sizeof(struct tcphdr),
+-                   null_payload, tot_len + sizeof(struct ether_header));
+-        break;
+-    case 4:
+-        /* build payload */
+-        memcpy((char *)buffer + sizeof(struct ether_header) +
+-               sizeof(struct iphdr) + sizeof(struct tcphdr),
+-               g_content[*rule_idx], tot_len + sizeof(struct ether_header));
+-        attack_packet = 1;
+-        break;
+-    default:
+-        fprintf(stderr, "Control can never come here!\n");
+-        exit(EXIT_FAILURE);
+-    }
+-
+-    /* update rule offset */
+-    if (attack_packet)
+-        *rule_idx = (*rule_idx + 1) % tot_rules;
+-
+-    /* update checksum */
+-    tot_len -= sizeof(struct iphdr);
+-    pseudo_header.len = htons(tot_len);
+-    tcph->check = TCPChecksum((uint16_t *) &pseudo_header,
+-                  sizeof(pseudo_header), (uint16_t *)tcph,
+-                  tot_len);
+-
+-    attack_meter++;
+-    
+-    return buffer;
+-}
+ 
/*------------------------------------------------------------------------------*/
+ /* IDS mode */
+ 
diff -Nru packeth-2.1/debian/patches/series packeth-2.1/debian/patches/series
--- packeth-2.1/debian/patches/series   2023-09-20 17:54:49.000000000 +0000
+++ packeth-2.1/debian/patches/series   2023-10-01 12:56:11.000000000 +0000
@@ -1,3 +1,4 @@
 01-fix_warnings.patch
 02-fix_typo.patch
 03-no-werror.patch
+04-no-asm.patch

Reply via email to