commit-hurd
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[gnumach] 01/56: Fix int/long discrepancy


From: Samuel Thibault
Subject: [gnumach] 01/56: Fix int/long discrepancy
Date: Sat, 28 Sep 2013 12:43:10 +0000

This is an automated email from the git hooks/post-receive script.

sthibault pushed a commit to branch master
in repository gnumach.

commit 1dc6074b62f8141e9848bbaee7275e5752507e8f
Author: Samuel Thibault <address@hidden>
Date:   Sat Jun 29 20:35:13 2013 +0200

    Fix int/long discrepancy
    
    * device/net_io.c (bpf_match): Make the `keys' parameter a pointer to
    unsigned int instead of unsigned long.
    (bpf_do_filter): Make `A', `B' and `mem' unsigned ints instead of unsigned
    longs. Also turn long casts into int casts.
---
 device/net_io.c |   14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/device/net_io.c b/device/net_io.c
index 4ebf996..fd71c02 100644
--- a/device/net_io.c
+++ b/device/net_io.c
@@ -394,7 +394,7 @@ int net_add_q_info (ipc_port_t rcv_port);
 int bpf_match (
    net_hash_header_t hash,
    int n_keys,
-   unsigned long *keys,
+   unsigned int *keys,
    net_hash_entry_t **hash_headpp,
       net_hash_entry_t *entpp);
 
@@ -1636,9 +1636,9 @@ bpf_do_filter(infp, p, wirelen, header, hlen, 
hash_headpp, entpp)
        register bpf_insn_t pc, pc_end;
        register unsigned int buflen;
 
-       register unsigned long A, X;
+       register unsigned int A, X;
        register int k;
-       unsigned long mem[BPF_MEMWORDS];
+       unsigned int mem[BPF_MEMWORDS];
 
        /* Generic pointer to either HEADER or P according to the specified 
offset. */
        char *data = NULL;
@@ -1689,9 +1689,9 @@ bpf_do_filter(infp, p, wirelen, header, hlen, 
hash_headpp, entpp)
                        k = pc->k;
 
                load_word:
-                       if ((u_int)k + sizeof(long) <= hlen)
+                       if ((u_int)k + sizeof(int) <= hlen)
                             data = header;
-                       else if ((u_int)k + sizeof(long) <= buflen) {
+                       else if ((u_int)k + sizeof(int) <= buflen) {
                             k -= hlen;
                             data = p;
                        } else
@@ -1702,7 +1702,7 @@ bpf_do_filter(infp, p, wirelen, header, hlen, 
hash_headpp, entpp)
                             A = EXTRACT_LONG(&data[k]);
                        else
 #endif
-                            A = ntohl(*(long *)(data + k));
+                            A = ntohl(*(int *)(data + k));
                        continue;
 
                case BPF_LD|BPF_H|BPF_ABS:
@@ -2032,7 +2032,7 @@ int
 bpf_match (hash, n_keys, keys, hash_headpp, entpp)
        net_hash_header_t hash;
        register int n_keys;
-       register unsigned long *keys;
+       register unsigned int *keys;
        net_hash_entry_t **hash_headpp, *entpp;
 {
        register net_hash_entry_t head, entp;

-- 
Alioth's /usr/local/bin/git-commit-notice on 
/srv/git.debian.org/git/pkg-hurd/gnumach.git



reply via email to

[Prev in Thread] Current Thread [Next in Thread]