Two patchoids for Linux-Alpha.

First patch:  some architectures define fewer signals.  See signal(7).

Index: diald.c
===================================================================
RCS file: /usr/local/cvsroot/linux/utils/diald/diald.c,v
retrieving revision 1.1.1.2
retrieving revision 1.2
diff -p -u -r1.1.1.2 -r1.2
--- diald.c     1999/10/02 16:50:18     1.1.1.2
+++ diald.c     1999/10/07 17:03:49     1.2
@@ -280,7 +280,9 @@ void signal_setup()
     SIGNAL(SIGUSR2, print_filter_queue); /* dump the packet queue to the log */
     SIGNAL(SIGPIPE, SIG_IGN);
     SIGNAL(SIGTERM, sig_term);          /* Terminate: user take link down */
+#ifdef     SIGSTKFLT
     SIGNAL(SIGSTKFLT, stray_signal);
+#endif
     SIGNAL(SIGCHLD, sig_chld);         /* reap dead kids */
     SIGNAL(SIGURG, stray_signal);
     SIGNAL(SIGXCPU, stray_signal);


Second patch:  I get obnoxious `unaligned trap' messages in my syslog.
The following fixes it.  I think the `temp' variable should be an __u32
instead of an int, but I don't want to start a code audit of word length
assumptions.  This fixes the unaligned access, nothing more.


Index: firewall.c
===================================================================
RCS file: /usr/local/cvsroot/linux/utils/diald/firewall.c,v
retrieving revision 1.1.1.2
retrieving revision 1.3
diff -p -u -r1.1.1.2 -r1.3
--- firewall.c  1999/10/02 16:50:18     1.1.1.2
+++ firewall.c  1999/10/10 22:09:23     1.3
@@ -694,10 +694,17 @@ int check_firewall(int unitnum, unsigned
            term = &fw->filt.terms[i];
            if (FW_TCP_STATE(term->offset))
                v = (lflags.tcp_flags >> term->shift) && term->mask;
-           else
-               v = (ntohl(*(int *)(&(FW_IN_DATA(term->offset)?data:pkt)
-                                 [FW_OFFSET(term->offset)]))
-                   >> term->shift) & term->mask;
+           else {
+               int temp; 
+               memcpy(
+                   &temp,
+                   &(FW_IN_DATA(term->offset)?data:pkt) [
+                       FW_OFFSET(term->offset)
+                   ],
+                   sizeof(temp)
+               );
+               v = (ntohl(temp) >> term->shift) & term->mask;
+           }
 #ifdef 0
            syslog(LOG_INFO,"testing ip %x:%x data %x:%x mask %x shift %x test %x v 
%x",
                ntohl(*(int *)(&pkt[FW_OFFSET(term->offset)])),


-
To unsubscribe from this list: send the line "unsubscribe linux-diald" in
the body of a message to [EMAIL PROTECTED]

Reply via email to