did somebody notice a crash in ip_output if you're using multicast?

2001-07-19 Thread Matthew Jacob


fatal kernel trap:

trap entry = 0x2 (memory management fault)
cpuid  = 0
faulting va= 0x48
type   = access violation
cause  = load instructon
pc = 0xfc4ce89c
ra = 0xfc4ce874
sp = 0xfe002e1bbaf8
usp= 0x11ffb5a0
curproc= 0xfe0028293fc0
pid = 199, comm = ntpd

Stopped at  ip_output+0x9bc:ldq t0,0x48(s6) 0x48
t0=0x20
11d00,s6=0x0
db t
ip_output() at ip_output+0x9bc
igmp_sendpkt() at igmp_sendpkt+0x1a0
igmp_joingroup() at igmp_joingroup+0x7c
in_addmulti() at in_addmulti+0x108
ip_setmoptions() at ip_setmoptions+0x4c0
ip_ctloutput() at ip_ctloutput+0x2ac
sosetopt() at sosetopt+0x4c
setsockopt() at setsockopt+0xb4
syscall() at syscall+0x728
XentSys() at XentSys+0x64
--- syscall (105, FreeBSD ELF, setsockopt) ---
--- user mode ---
db reboot

halted CPU 0

halt code = 5
HALT instruction executed
PC = fc5cdf40

CPU 0 booting

(boot dkb200.2.0.5.1 -flags a)
pblock 0 of dkb200.2.0.5.1 is a valid boot block
reading 15 blocks from dkb200.2.0.5.1
bootstrap code read in
base = 20, image_start = 0, image_bytes = 1e00
initializing HWRPB at 2000

-matt



To Unsubscribe: send mail to [EMAIL PROTECTED]
with unsubscribe freebsd-current in the body of the message



Re: did somebody notice a crash in ip_output if you're using multicast?

2001-07-19 Thread Ruslan Ermilov

Could you please try the attached patch and see if it helps?

On Thu, Jul 19, 2001 at 12:40:11PM -0700, Matthew Jacob wrote:
 
 fatal kernel trap:
 
 trap entry = 0x2 (memory management fault)
 cpuid  = 0
 faulting va= 0x48
 type   = access violation
 cause  = load instructon
 pc = 0xfc4ce89c
 ra = 0xfc4ce874
 sp = 0xfe002e1bbaf8
 usp= 0x11ffb5a0
 curproc= 0xfe0028293fc0
 pid = 199, comm = ntpd
 
 Stopped at  ip_output+0x9bc:ldq t0,0x48(s6) 0x48
 t0=0x20
 11d00,s6=0x0
 db t
 ip_output() at ip_output+0x9bc
 igmp_sendpkt() at igmp_sendpkt+0x1a0
 igmp_joingroup() at igmp_joingroup+0x7c
 in_addmulti() at in_addmulti+0x108
 ip_setmoptions() at ip_setmoptions+0x4c0
 ip_ctloutput() at ip_ctloutput+0x2ac
 sosetopt() at sosetopt+0x4c
 setsockopt() at setsockopt+0xb4
 syscall() at syscall+0x728
 XentSys() at XentSys+0x64
 --- syscall (105, FreeBSD ELF, setsockopt) ---
 --- user mode ---
 db reboot
 
 halted CPU 0
 
 halt code = 5
 HALT instruction executed
 PC = fc5cdf40
 
 CPU 0 booting
 
 (boot dkb200.2.0.5.1 -flags a)
 pblock 0 of dkb200.2.0.5.1 is a valid boot block
 reading 15 blocks from dkb200.2.0.5.1
 bootstrap code read in
 base = 20, image_start = 0, image_bytes = 1e00
 initializing HWRPB at 2000
 
 -matt
 
 
 
 To Unsubscribe: send mail to [EMAIL PROTECTED]
 with unsubscribe freebsd-current in the body of the message

-- 
Ruslan Ermilov  Oracle Developer/DBA,
[EMAIL PROTECTED]   Sunbay Software AG,
[EMAIL PROTECTED]  FreeBSD committer,
+380.652.512.251Simferopol, Ukraine

http://www.FreeBSD.org  The Power To Serve
http://www.oracle.com   Enabling The Information Age


Index: ip_output.c
===
RCS file: /home/ncvs/src/sys/netinet/ip_output.c,v
retrieving revision 1.130
diff -u -p -r1.130 ip_output.c
--- ip_output.c 2001/07/19 07:10:30 1.130
+++ ip_output.c 2001/07/19 10:49:09
@@ -253,14 +253,13 @@ ip_output(m0, opt, ro, flags, imo)
ip-ip_ttl = 1;
isbroadcast = in_broadcast(dst-sin_addr, ifp);
} else if (IN_MULTICAST(ntohl(ip-ip_dst.s_addr)) 
-   (imo != NULL) 
-   (imo-imo_multicast_ifp != NULL)) {
+   imo != NULL  imo-imo_multicast_ifp != NULL) {
/*
-* bypass the normal routing lookup for
-* multicast packets if the interface is
-* specified
+* Bypass the normal routing lookup for multicast
+* packets if the interface is specified.
 */
-   /* No Operation */
+   ifp = imo-imo_multicast_ifp;
+   IFP_TO_IA(ifp, ia);
} else {
/*
 * If this is the case, we probably don't want to allocate
@@ -303,8 +302,6 @@ ip_output(m0, opt, ro, flags, imo)
 */
if (imo != NULL) {
ip-ip_ttl = imo-imo_multicast_ttl;
-   if (imo-imo_multicast_ifp != NULL)
-   ifp = imo-imo_multicast_ifp;
if (imo-imo_multicast_vif != -1)
ip-ip_src.s_addr =
ip_mcast_src(imo-imo_multicast_vif);
@@ -325,13 +322,9 @@ ip_output(m0, opt, ro, flags, imo)
 * of outgoing interface.
 */
if (ip-ip_src.s_addr == INADDR_ANY) {
-   register struct in_ifaddr *ia1;
-
-   TAILQ_FOREACH(ia1, in_ifaddrhead, ia_link)
-   if (ia1-ia_ifp == ifp) {
-   ip-ip_src = IA_SIN(ia1)-sin_addr;
-   break;
-   }
+   /* XXX: interface may have no addresses. */
+   if (ia != NULL)
+   ip-ip_src = IA_SIN(ia)-sin_addr;
}
 
IN_LOOKUP_MULTI(ip-ip_dst, ifp, inm);
@@ -824,7 +817,7 @@ pass:
}
 
/* Record statistics for this interface address. */
-   if (!(flags  IP_FORWARDING)) {
+   if (!(flags  IP_FORWARDING)  ia) {
ia-ia_ifa.if_opackets++;
ia-ia_ifa.if_obytes += m-m_pkthdr.len;
}
@@ -964,7 +957,7 @@ sendorfree:
/* clean ipsec history once it goes out of the node */
ipsec_delaux(m);
 #endif
-   if (error == 0) {
+   if (error == 0  ia) {
/* Record statistics for this interface address. */
ia-ia_ifa.if_opackets++;
ia-ia_ifa.if_obytes += m-m_pkthdr.len;



Re: did somebody notice a crash in ip_output if you're using multicast?

2001-07-19 Thread Matthew Jacob


I'll try it if I can get booted again :-)

Yea, I found the panic line-

/* Record statistics for this interface address. */
if (!(flags  IP_FORWARDING)) {
*   ia-ia_ifa.if_opackets++;
ia-ia_ifa.if_obytes += m-m_pkthdr.len;
}

and was doing something less invasive than your patch when your mail arrived.

-matt




To Unsubscribe: send mail to [EMAIL PROTECTED]
with unsubscribe freebsd-current in the body of the message



Re: did somebody notice a crash in ip_output if you're using multicast?

2001-07-19 Thread Matthew Jacob


Had to make a minor change to make sure isbroadcast was set, but yes, that
worked, thank you!

-matt






Index: ip_output.c
===
RCS file: /home/ncvs/src/sys/netinet/ip_output.c,v
retrieving revision 1.130
diff -u -r1.130 ip_output.c
--- ip_output.c 2001/07/19 07:10:30 1.130
+++ ip_output.c 2001/07/19 20:14:09
@@ -253,14 +253,14 @@
ip-ip_ttl = 1;
isbroadcast = in_broadcast(dst-sin_addr, ifp);
} else if (IN_MULTICAST(ntohl(ip-ip_dst.s_addr)) 
-   (imo != NULL) 
-   (imo-imo_multicast_ifp != NULL)) {
+   imo != NULL  imo-imo_multicast_ifp != NULL) {
/*
-* bypass the normal routing lookup for
-* multicast packets if the interface is
-* specified
+* Bypass the normal routing lookup for multicast
+* packets if the interface is specified.
 */
-   /* No Operation */
+   ifp = imo-imo_multicast_ifp;
+   IFP_TO_IA(ifp, ia);
+   isbroadcast = 0;
} else {
/*
 * If this is the case, we probably don't want to allocate
@@ -303,8 +303,6 @@
 */
if (imo != NULL) {
ip-ip_ttl = imo-imo_multicast_ttl;
-   if (imo-imo_multicast_ifp != NULL)
-   ifp = imo-imo_multicast_ifp;
if (imo-imo_multicast_vif != -1)
ip-ip_src.s_addr =
ip_mcast_src(imo-imo_multicast_vif);
@@ -325,13 +323,9 @@
 * of outgoing interface.
 */
if (ip-ip_src.s_addr == INADDR_ANY) {
-   register struct in_ifaddr *ia1;
-
-   TAILQ_FOREACH(ia1, in_ifaddrhead, ia_link)
-   if (ia1-ia_ifp == ifp) {
-   ip-ip_src = IA_SIN(ia1)-sin_addr;
-   break;
-   }
+   /* XXX: interface may have no addresses. */
+   if (ia != NULL)
+   ip-ip_src = IA_SIN(ia)-sin_addr;
}
 
IN_LOOKUP_MULTI(ip-ip_dst, ifp, inm);
@@ -824,7 +818,7 @@
}
 
/* Record statistics for this interface address. */
-   if (!(flags  IP_FORWARDING)) {
+   if (!(flags  IP_FORWARDING)  ia) {
ia-ia_ifa.if_opackets++;
ia-ia_ifa.if_obytes += m-m_pkthdr.len;
}
@@ -964,7 +958,7 @@
/* clean ipsec history once it goes out of the node */
ipsec_delaux(m);
 #endif
-   if (error == 0) {
+   if (error == 0  ia) {
/* Record statistics for this interface address. */
ia-ia_ifa.if_opackets++;
ia-ia_ifa.if_obytes += m-m_pkthdr.len;