On Wed, Sep 09, 1998 at 11:27:51AM -0500, Grant Edwards wrote:
> 
> I'm using diald 0.16.5 running under Red Hat 5.1 (2.0.35) SPARC.
> 
> Once a connection is established, diald generates constant signal 10 SIGBUS
> (which it apparently ignores).  Anybody have any ideas?

The SPARC processor has data-alignment requirements: ints and floats have to
be word aligned.  There is code in firewall.c that pulls an int out of a
buffer, and that data isn't word aligned, so it causes a bus fault.  Here's
the patch that fixes it (diff -c done relative to 0.16.5):

------------------------------cut here------------------------------
*** firewall.c.old      Tue Sep 15 13:50:17 1998
--- firewall.c  Tue Sep 15 13:35:36 1998
***************
*** 695,703 ****
            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;
  #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)])),
--- 695,708 ----
            if (FW_TCP_STATE(term->offset))
                v = (lflags.tcp_flags >> term->shift) && term->mask;
            else
!               {
!               int *p = (int 
*)(&(FW_IN_DATA(term->offset)?data:pkt)[FW_OFFSET(term->offset)]);
!               int i;
!               
!               memcpy(&i,&p, sizeof i);
!               
!               v = (ntohl(i) >> 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)])),
------------------------------cut here------------------------------



-- 
Grant Edwards
Rosemount Inc.

[EMAIL PROTECTED]

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

Reply via email to