Re: Freebsd 5.0 NICs issue

2005-03-17 Thread Daniel O'Connor
On Fri, 18 Mar 2005 06:47, Amandeep Pannu wrote:
> Now the em0 nic is up with 205.229.165.4 netmask 255.255.255.0
> ifconfig em1 inet 205.229.165.8 netmask 255.255.255.0 up

You can't have 2 NIC's on the same subnet (you can't have 2 IPs on any NIC in 
the same subnet).

Why do you want to do this? If you want an alias you only need 1 NIC and you 
do..

ifconfig em0 inet 205.229.165.4 netmask 255.255.255.0
ifconfig em0 alias inet 205.229.165.8 netmask 255.255.255.255

What is the second NIC going to be used for?

-- 
Daniel O'Connor software and network engineer
for Genesis Software - http://www.gsoft.com.au
"The nice thing about standards is that there
are so many of them to choose from."
  -- Andrew Tanenbaum
GPG Fingerprint - 5596 B766 97C0 0E94 4347 295E E593 DC20 7B3F CE8C


pgpUJcDz4Ipik.pgp
Description: PGP signature


Re: some bugs in the kernel

2005-03-17 Thread David Schultz
On Mon, Mar 14, 2005, Ted Unangst wrote:
> These bugs were found using the Coverity Prevent static analysis tool.
[...]

Thanks for reporting these!  It's great that your tools have been
finding all these obscure bugs before users do.  All of these
should be fixed now, except for the if_ti bug, which I've
forwarded to [EMAIL PROTECTED]


pjd 2005-03-16 20:48:13 UTC

  FreeBSD src repository

  Modified files:
sys/geom geom_bsd.c
  Log:
  Plug memory leak.

  Submitted by:   Ted Unangst
  Found by:   Coverity Prevent analysis tool
  Approved by:phk
  MFC after:  3 days

  Revision  ChangesPath
  1.73  +1 -2  src/sys/geom/geom_bsd.c


das 2005-03-18 05:43:34 UTC

  FreeBSD src repository

  Modified files:
sys/dev/hptmvgui_lib.c
  Log:
  Don't read past the end of pVDevice[].  (Previously, we would iterate 
  twice as many times as there were entries in the array.)

  Spotted by: Ted Unangst using the Coverity Prevent static analysis tool
  Reviewed by:scottl

  Revision  ChangesPath
  1.4   +1 -1  src/sys/dev/hptmv/gui_lib.c


das 2005-03-18 05:43:31 UTC

  FreeBSD src repository

  Modified files:
sys/dev/hptmventry.c
  Log:
  Don't write past the end of the VendorId field (and into the ProductId
  field).

  Spotted by: Ted Unangst using the Coverity Prevent static analysis tool
  Reviewed by:scottl

  Revision  ChangesPath
  1.7   +1 -1  src/sys/dev/hptmv/entry.c


imp 2005-03-15 22:53:31 UTC

  FreeBSD src repository

  Modified files:
sys/dev/pci  pci.c
  Log:
  If bus_generic_susped returns an error, devlist is not freed.  Free
it.

  Submitted by: Ted Unangst (using the Coverity Prevent analysis tool)

  Revision  ChangesPath
  1.281 +3 -1  src/sys/dev/pci/pci.c


das 2005-03-18 05:43:37 UTC

  FreeBSD src repository

  Modified files:
sys/dev/mlx  mlx_pci.c
  Log:
  If mlx_attach() returns an error, don't free sc again.  

  Spotted by: Ted Unangst using the Coverity Prevent static analysis tool
  Reviewed by:scottl

  Revision  ChangesPath
  1.21  +1 -3  src/sys/dev/mlx/mlx_pci.c
___
freebsd-hackers@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to "[EMAIL PROTECTED]"


Re: Freebsd 5.0 NICs issue

2005-03-17 Thread Joseph Koshy
> ifconfig em1 inet 205.229.165.8 netmask 255.255.255.0 up

   ifconfig em1 alias ALIAS-ADDRESSS netmask NETMASK

-- 
FreeBSD Volunteer, http://people.freebsd.org/~jkoshy
___
freebsd-hackers@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to "[EMAIL PROTECTED]"


Re: How to send a signal from inside the kernel?

2005-03-17 Thread Joseph Koshy
> Here are the headers needed in case someone reads this thread:
> 
> #include  /*needed only for NULL, can be removed*/
> #include 
> #include 
> #include 
> #include 
> #include 

According to the manual page for psignal(9) in -current, you 
only need  and .

You need to hold the PROC lock for the target process before 
invoking psignal().

-- 
FreeBSD Volunteer, http://people.freebsd.org/~jkoshy
___
freebsd-hackers@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to "[EMAIL PROTECTED]"


Re: style(9) example :-)

2005-03-17 Thread Greg 'groggy' Lehey
On Thursday, 17 March 2005 at 19:33:50 +0300, Roman Kurakin wrote:
> Hi,
>
> I was unable to refrain from posting this :-)
>
> int i;main(){for(;i["] o, world!\n",'/'/'/'));}read(j,i,p){write(j/p+p,i---j,i/i);}

There used to be a whole culture of this sort of thing.  My favourite
one is an anagram generator:

#include  

long a
[4],b[
4],c[4]
,d[0400],e=1;
typedef struct f{long g
,h,i[4],j;struct f*k;}f;f g,*
l[4096   ]; char h[256],*m,k=3;
 long n (o, p,q)long*o,*p,*q;{
 long r   =4,s,i=0;for(;r--;s=i^
 *o^*p, i=i&*p|(i|*p)&~*o++,*q
 ++=s,p ++);return i;}t(i,p)long*p
 ;{*c=d   [i],n(a,c,b),n(p,b,p);}u(j)f*j;{j->h
 =(j->g =j->i[0]|j->i[1]|j->i[2]|j->i[3])&4095;}v(
j,s)f*   j; {int i; for(j->k->k&&v(j->k, ' '),fseek(
stdin, j->j, 0);i=getchar(),putchar(i-'\n'?i:s),i-
'\n';);}w(o,r,j,x,p)f*o,*j;long p;{f q;int 
s,i=o->h;q.k=o;r>i?j=l[r=i]:r>1, s|=s
>>2,s|=s>>4,s
|=s>>8
,j=l[r
=((r&i
 |s)&~(s>>1))-1&i]):0;--x;for
 (;x&&!(p&i);p>>=1);for(;!x&&j;n(o->i,j->i,q.
i),u(&q),q.g||(q.j=j->j,v(&q,'\n')),j=j->k);for(;x;j=x
 ?j->k:0){for(;!j&&((r=(r&i)-1&i)-i&&(r&p)?2:(x=0));j=l[r]);!
  x||(j->g&~o->g)||n  (o->i,j->i,q.i)||(
u(&q), q.j=j  ->j,q.g?w(&q
   ,r,j->k,x  ,p):v(&q,
  '\n'));}}y(){f
 j;char*z,*p;
for(;m  ? j.j=
ftell(  stdin)
,7,(m=   gets(m ))||w(
&g,315   *13,l[ 4095]
 ,k,64*  64)&0:0;n(g
  .i,j.i,b)||(u (&j),j.
   k=l[j.h],l[j.h]= &j,y())){for(z= p=h;*z&&(
d[*z++]||(p=0)););for(z=p?n(j.i   ,j.i,j.i)+h:"";
  *z;t(*z++,j.i));}}main(o,p)char**  p; {for(;m = *++p;)for(;*m-
'-'?*m:(k= -atoi(m))&0;d[*m]||(d[*m  ]=e,e<<=1),t(*m++,g.i)); u(&
 g),m=h
 ,y();}


To run it, you need a dictionary such as /usr/share/dict/web2.  For
example:

gson free software foundation   < /usr/share/dict/web2
gson obfuscated c contest   < /usr/share/dict/web2
gson unix international < /usr/share/dict/web2
gson george bush< /usr/share/dict/web2
gson bill clinton   < /usr/share/dict/web2
gson ross perot < /usr/share/dict/web2
gson paul e tsongas < /usr/share/dict/web2

Greg
--
See complete headers for address and phone numbers.


pgpuVrWFfvjSy.pgp
Description: PGP signature


Re: How to send a signal from inside the kernel?

2005-03-17 Thread Max Laier
On Thursday 17 March 2005 20:55, Aziz KEZZOU wrote:
> Here are the headers needed in case someone reads this thread:
>
> #include  /*needed only for NULL, can be removed*/
> #include 
> #include 

As a community service: Style(9) instructs to include either  OR 
 but not both.  The latter includes  which defines 
what you are already guessing.

> #include 
> #include 
> #include 

-- 
/"\  Best regards,  | [EMAIL PROTECTED]
\ /  Max Laier  | ICQ #67774661
 X   http://pf4freebsd.love2party.net/  | [EMAIL PROTECTED]
/ \  ASCII Ribbon Campaign  | Against HTML Mail and News


pgphDLeIs8vq7.pgp
Description: PGP signature


Re: Freebsd 5.0 NICs issue

2005-03-17 Thread Amandeep Pannu
Hi Guys,

Anything on this.
Any help would be great.

Thanks
A
> Hi
>
> I have a machine running FreeBSD 5.0 , it is actually my Primary DNS
> server.
> it has two Nics.
> em0 and em1
> Now the em0 nic is up with 205.229.165.4 netmask 255.255.255.0
>
> When I try to do
> ifconfig em1 inet 205.229.165.8 netmask 255.255.255.0 up
> it say File exists.
> then i read that the netmask should be 255.255.255.255 then i did that the
> machine then is hooked wiht the ethernet cable in em1 and it starts puring
> some
> kernel:arp messages.
> I have tried doing it from scratch removinf all entriedsfrom /etc/rc.conf
> and then tried to manuall assign them IP. em0 goes well but again em1 say
> file exists or those arp messages copme up.
>
> Any ideas what is going on.
>
> Thanks in advance
> A
> ___
> freebsd-hackers@freebsd.org mailing list
> http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
> To unsubscribe, send any mail to "[EMAIL PROTECTED]"
>


-- 
Amandeep.S
[EMAIL PROTECTED]
http://aman.chamkila.org
___
freebsd-hackers@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to "[EMAIL PROTECTED]"


Re: style(9) example :-)

2005-03-17 Thread Giorgos Keramidas
On 2005-03-18 00:50, Roman Kurakin <[EMAIL PROTECTED]> wrote:
>Giorgos Keramidas:
>>On 2005-03-17 19:33, Roman Kurakin <[EMAIL PROTECTED]> wrote:
>>>I was unable to refrain from posting this :-)
>>>
>>>int i;main(){for(;i["]>>o, world!\n",'/'/'/'));}read(j,i,p){write(j/p+p,i---j,i/i);}
>>
>>I've written stuff that's probably a bit harder to read, but in Perl :P
>>
>>% cat filter.pl
>>#/usr/bin/perl
>>while(){chomp;print(join('',(map{my($b,$j,$t,$o)=(65,128,90,ord($_));((
>>$o-$b)>=0&&($o-$b)<=($t-$b))?eval{$o=(($o-$b)+13)%26+$b;$j=11;}:eval{$b=97;$t=
>>122;(($b>$o)||($t<$o))?eval{$j=10;}:eval{$o=(($o-$b)+13)%26+$b;$j=1431;};};$_=
>>chr(int(int(($j%2)==(chr($o)==$_))?$o:ord($_)));}(split//,$_)))."\n");}
>>%
>
> I saw smth like that, which run rm -rf /. I hope this one word greeting ;-)
> Probably one such code could be added to fortunes.

This one is a rot13 filter.  But no need to run it.  It's was fun
writing, but very very useless.  Other than as an example of how ugly
Perl can be, I guess...
___
freebsd-hackers@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to "[EMAIL PROTECTED]"


IP over FireWire and Mac OSX

2005-03-17 Thread Rex Roof
I have a FreeBSD 5.3 i386 machine I installed today, then ran cvsup
with tag=RELENG_5_3.
then I rebuilt my kernel with these options in:

# FireWire support
device  firewire
device  sbp
device  fwe
device  fwip
options DEVICE_POLLING


I plugged this machine into my Powermac G4 running OS X 10.3.8, and I
assigned IP addresses to the firewire devices on both, so they look
like this:

the mac:

fw0: flags=8863 mtu 4078
inet6 fe80::20a:95ff:fe69:b7d2 prefixlen 64 scopeid 0x5 
inet 10.0.1.10 netmask 0xff00 broadcast 10.0.1.255
lladdr 00:0a:95:ff:fe:69:b7:d2 
media: autoselect  status: active
supported media: autoselect 


the FreeBSD box:

fwip0: flags=108843 mtu 1500
inet 10.0.1.11 netmask 0xff00 broadcast 10.0.1.255
lladdr 0.30.3c.0.0.9.a0.33.a.2.ff.fe.0.0.0.0



Now, pinging one machine from the other seems to work fine.  but as
soon as I try traceroute or ssh (originating from either side) my mac
crashes with the nice screen telling me to hold down the power button.

the dmesg output I'll post below, with the messages it produces when
my mac crashes and comes back up again.  anyone had any luck getting
this working?  is there something I'm missing?  any suggestions would
be appreciated.



Copyright (c) 1992-2004 The FreeBSD Project.
Copyright (c) 1979, 1980, 1983, 1986, 1988, 1989, 1991, 1992, 1993, 1994
The Regents of the University of California. All rights reserved.
FreeBSD 5.3-RELEASE-p5 #0: Thu Mar 17 17:11:46 UTC 2005
[EMAIL PROTECTED]:/usr/src/sys/i386/compile/NEWSHAOLIN
Timecounter "i8254" frequency 1193182 Hz quality 0
CPU: Intel Pentium III (930.32-MHz 686-class CPU)
  Origin = "GenuineIntel"  Id = 0x68a  Stepping = 10
  
Features=0x383fbff
real memory  = 266301440 (253 MB)
avail memory = 255127552 (243 MB)
npx0: [FAST]
npx0:  on motherboard
npx0: INT 16 interface
acpi0:  on motherboard
acpi0: Power Button (fixed)
Timecounter "ACPI-fast" frequency 3579545 Hz quality 1000
acpi_timer0: <24-bit timer at 3.579545MHz> port 0x808-0x80b on acpi0
cpu0:  on acpi0
acpi_button0:  on acpi0
pcib0:  port 0xcf8-0xcff on acpi0
pci0:  on pcib0
agp0:  mem
0xff08-0xff0f,0xf800-0xfbff irq 9 at device 2.0 on
pci0
pcib1:  at device 30.0 on pci0
pci1:  on pcib1
fwohci0:  mem 0xfdfff000-0xfdff irq 9 at device
7.0 on pci1
fwohci0: OHCI version 1.0 (ROM=1)
fwohci0: No. of Isochronous channels is 8.
fwohci0: EUI64 00:30:3c:00:00:09:a0:33
fwohci0: Phy 1394a available S400, 3 ports.
fwohci0: Link S400, max_rec 2048 bytes.
firewire0:  on fwohci0
fwip0:  on firewire0
fwip0: Firewire address: 00:30:3c:00:00:09:a0:33 @ 0xfffe,
S400, maxrec 2048
fwohci0: Initiate bus reset
fwohci0: node_id=0xc800ffc3, gen=1, CYCLEMASTER mode
firewire0: 4 nodes, maxhop <= 2, cable IRM = 3 (me)
firewire0: bus manager 3 (me)
xl0: <3Com 3c905C-TX Fast Etherlink XL> port 0xec80-0xecff mem
0xfdffec00-0xfdffec7f irq 11 at device 12.0 on pci1
miibus0:  on xl0
ukphy0:  on miibus0
ukphy0:  10baseT, 10baseT-FDX, 100baseTX, 100baseTX-FDX, auto
xl0: Ethernet address: 00:b0:d0:f1:d8:9e
isab0:  at device 31.0 on pci0
isa0:  on isab0
atapci0:  port
0xffa0-0xffaf,0x376,0x170-0x177,0x3f6,0x1f0-0x1f7 at device 31.1 on
pci0
ata0: channel #0 on atapci0
ata1: channel #1 on atapci0
uhci0:  port
0xff80-0xff9f irq 11 at device 31.2 on pci0
uhci0: [GIANT-LOCKED]
usb0:  on uhci0
usb0: USB revision 1.0
uhub0: Intel UHCI root hub, class 9/0, rev 1.00/1.00, addr 1
uhub0: 2 ports with 2 removable, self powered
pci0:  at device 31.3 (no driver attached)
uhci1:  port
0xff60-0xff7f irq 11 at device 31.4 on pci0
uhci1: [GIANT-LOCKED]
usb1:  on uhci1
usb1: USB revision 1.0
uhub1: Intel UHCI root hub, class 9/0, rev 1.00/1.00, addr 1
uhub1: 2 ports with 2 removable, self powered
pci0:  at device 31.5 (no driver attached)
sio0: <16550A-compatible COM port> port 0x3f8-0x3ff irq 4 flags 0x10 on acpi0
sio0: type 16550A
sio1: <16550A-compatible COM port> port 0x2f8-0x2ff irq 3 on acpi0
sio1: type 16550A
ppc0:  port 0x778-0x77f,0x378-0x37f irq 7 on acpi0
ppc0: SMC-like chipset (ECP/EPP/PS2/NIBBLE) in COMPATIBLE mode
ppc0: FIFO with 16/16/8 bytes threshold
ppbus0:  on ppc0
plip0:  on ppbus0
lpt0:  on ppbus0
lpt0: Interrupt-driven port
ppi0:  on ppbus0
pmtimer0 on isa0
orm0:  at iomem 0xca000-0xcbfff,0xc-0xc9fff on isa0
sc0:  at flags 0x100 on isa0
sc0: VGA <16 virtual consoles, flags=0x300>
vga0:  at port 0x3c0-0x3df iomem 0xa-0xb on isa0
atkbdc0:  at port 0x64,0x60 on isa0
atkbd0:  irq 1 on atkbdc0
kbd0 at atkbd0
atkbd0: [GIANT-LOCKED]
Timecounter "TSC" frequency 930319180 Hz quality 800
Timecounters tick every 10.000 msec
ad0: 19073MB  [38752/16/63] at ata0-master UDMA100
acd0: CDROM  at ata1-master PIO4
Mounting root from ufs:/dev/ad0s1a
firewire0: New S400 device ID:000a95fffe69b7d2
firewire0: New S400 device ID:000a2700040217fe
firewire0: New S400 device ID:000a270002b9ca1e
arp: 10.0.1.10 moved from
00:0a:95:ff:fe:69:b7:d2:0c:83:0

Re: style(9) example :-)

2005-03-17 Thread Roman Kurakin
Giorgos Keramidas:
On 2005-03-17 19:33, Roman Kurakin <[EMAIL PROTECTED]> wrote:
 

Hi,
I was unable to refrain from posting this :-)
int i;main(){for(;i["]
o, world!\n",'/'/'/'));}read(j,i,p){write(j/p+p,i---j,i/i);}
   

I've written stuff that's probably a bit harder to read, but in Perl :P
% cat filter.pl
#/usr/bin/perl
while(){chomp;print(join('',(map{my($b,$j,$t,$o)=(65,128,90,ord($_));((
$o-$b)>=0&&($o-$b)<=($t-$b))?eval{$o=(($o-$b)+13)%26+$b;$j=11;}:eval{$b=97;$t=
122;(($b>$o)||($t<$o))?eval{$j=10;}:eval{$o=(($o-$b)+13)%26+$b;$j=1431;};};$_=
chr(int(int(($j%2)==(chr($o)==$_))?$o:ord($_)));}(split//,$_)))."\n");}
%
I saw smth like that, which run rm -rf /. I hope this one word greeting ;-)
Probably one such code could be added to fortunes.
rik
___
freebsd-hackers@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to "[EMAIL PROTECTED]"
 


___
freebsd-hackers@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to "[EMAIL PROTECTED]"


Re: NO_TCSH leaves crud in /usr/src

2005-03-17 Thread Colin Percival
Doug Barton wrote:
> This issue has been around a long time, but I keep forgetting to post
> it. When I enable NO_TCSH in /etc/make.conf, after a build/installworld
> I get this in /usr/src:
> 
> ? bin/csh/gethost
> ? bin/csh/sh.err.h
> ? bin/csh/tc.const.h
> 
> They don't seem to hurt anything, but it would be nice to get this fixed.

The problem is in src/rescue/Makefile.  I'll fix it.

Colin Percival
___
freebsd-hackers@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to "[EMAIL PROTECTED]"


Re: How to send a signal from inside the kernel?

2005-03-17 Thread John-Mark Gurney
Aziz KEZZOU wrote this message on Thu, Mar 17, 2005 at 14:55 -0500:
> > Aziz KEZZOU wrote this message on Thu, Mar 17, 2005 at 12:34 -0500:
> > > Hi all,
> > > I would like to send a signal (e.g SIGUSR1) to a user process from
> > > inside the kernel (kld module).
> > > Can any one tell me how to do it ?
> > > I tried the following code inspired from sys/kern/kern_sig.c :
> > > ==
> > > #include 
> > > #include 
> > >
> > > int process_pid;
> > > struct kill_args {
> > >   int pid;
> > >   int signum;
> > > };
> > >
> > > void send_SIGUSR1() {
> > >   struct kill_args uap;
> > >   uap.pid = process_pid;
> > >   uap.signum = SIGUSR1;
> > >   kill((struct thread *)0, &uap);
> > > }
> > > ===
> > >
> > > but that causes a page fault in kernel mode (ie. Kernel panic :-)
> > >
> > > Any help is appreciated, thanks.
> > 
> > Take a look at psignal(9)...  You'll need to look up the struct proc
> > for psignal with pfind(9)...   and then PROC_UNLOCK the struct proc
> > after you've used psignal...
> > 
> > so:
> > struct proc *p;
> > 
> > p = pfind(pid);
> > if (p != NULL) {
> > psignal(p, SIGUSR1);
> > PROC_UNLOCK(p);
> > }
> > 
> > I haven't tried the code above, but that should do what you want...
> 
> It works, thanks a lot !!
> Here are the headers needed in case someone reads this thread:
> 
> #include  /*needed only for NULL, can be removed*/

This header (unistd.h) shouldn't be included in kernel code...

> #include 
> #include 

style(9) says:
 Kernel include files (i.e. sys/*.h) come first; normally, include
  OR , but not both.

It also looks like sys/param.h is suppose to define NULL since it
includes _null.h (on -current) or defines it directly (on RELENG_4)...  

so you could should just include sys/param.h, and ditch sys/types.h
and unistd.h and it should work...

> #include 
> #include 
> #include  

-- 
  John-Mark Gurney  Voice: +1 415 225 5579

 "All that I will do, has been done, All that I have, has not."
___
freebsd-hackers@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to "[EMAIL PROTECTED]"


NO_TCSH leaves crud in /usr/src

2005-03-17 Thread Doug Barton
This issue has been around a long time, but I keep forgetting to post it. 
When I enable NO_TCSH in /etc/make.conf, after a build/installworld I get 
this in /usr/src:

? bin/csh/gethost
? bin/csh/sh.err.h
? bin/csh/tc.const.h
They don't seem to hurt anything, but it would be nice to get this fixed.
Doug
--
This .signature sanitized for your protection
___
freebsd-hackers@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to "[EMAIL PROTECTED]"


Re: style(9) example :-)

2005-03-17 Thread Giorgos Keramidas
On 2005-03-17 19:33, Roman Kurakin <[EMAIL PROTECTED]> wrote:
> Hi,
>
> I was unable to refrain from posting this :-)
>
> int i;main(){for(;i["] o, world!\n",'/'/'/'));}read(j,i,p){write(j/p+p,i---j,i/i);}

I've written stuff that's probably a bit harder to read, but in Perl :P

% cat filter.pl
#/usr/bin/perl
while(){chomp;print(join('',(map{my($b,$j,$t,$o)=(65,128,90,ord($_));((
$o-$b)>=0&&($o-$b)<=($t-$b))?eval{$o=(($o-$b)+13)%26+$b;$j=11;}:eval{$b=97;$t=
122;(($b>$o)||($t<$o))?eval{$j=10;}:eval{$o=(($o-$b)+13)%26+$b;$j=1431;};};$_=
chr(int(int(($j%2)==(chr($o)==$_))?$o:ord($_)));}(split//,$_)))."\n");}
%
___
freebsd-hackers@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to "[EMAIL PROTECTED]"


Re: Freebsd 5.0 NICs issue

2005-03-17 Thread Amandeep Pannu
Hi

I have a machine running FreeBSD 5.0 , it is actually my Primary DNS server.
it has two Nics.
em0 and em1
Now the em0 nic is up with 205.229.165.4 netmask 255.255.255.0

When I try to do
ifconfig em1 inet 205.229.165.8 netmask 255.255.255.0 up
it say File exists.
then i read that the netmask should be 255.255.255.255 then i did that the
machine then is hooked wiht the ethernet cable in em1 and it starts puring
some
kernel:arp messages.
I have tried doing it from scratch removinf all entriedsfrom /etc/rc.conf
and then tried to manuall assign them IP. em0 goes well but again em1 say
file exists or those arp messages copme up.

Any ideas what is going on.

Thanks in advance
A
___
freebsd-hackers@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to "[EMAIL PROTECTED]"


Re: How to send a signal from inside the kernel?

2005-03-17 Thread Aziz KEZZOU
> Aziz KEZZOU wrote this message on Thu, Mar 17, 2005 at 12:34 -0500:
> > Hi all,
> > I would like to send a signal (e.g SIGUSR1) to a user process from
> > inside the kernel (kld module).
> > Can any one tell me how to do it ?
> > I tried the following code inspired from sys/kern/kern_sig.c :
> > ==
> > #include 
> > #include 
> >
> > int process_pid;
> > struct kill_args {
> >   int pid;
> >   int signum;
> > };
> >
> > void send_SIGUSR1() {
> >   struct kill_args uap;
> >   uap.pid = process_pid;
> >   uap.signum = SIGUSR1;
> >   kill((struct thread *)0, &uap);
> > }
> > ===
> >
> > but that causes a page fault in kernel mode (ie. Kernel panic :-)
> >
> > Any help is appreciated, thanks.
> 
> Take a look at psignal(9)...  You'll need to look up the struct proc
> for psignal with pfind(9)...   and then PROC_UNLOCK the struct proc
> after you've used psignal...
> 
> so:
> struct proc *p;
> 
> p = pfind(pid);
> if (p != NULL) {
> psignal(p, SIGUSR1);
> PROC_UNLOCK(p);
> }
> 
> I haven't tried the code above, but that should do what you want...

It works, thanks a lot !!
Here are the headers needed in case someone reads this thread:

#include  /*needed only for NULL, can be removed*/
#include 
#include 
#include 
#include 
#include  

Have fun,
Aziz
___
freebsd-hackers@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to "[EMAIL PROTECTED]"


Re: How to send a signal from inside the kernel?

2005-03-17 Thread John-Mark Gurney
Aziz KEZZOU wrote this message on Thu, Mar 17, 2005 at 12:34 -0500:
> Hi all,
> I would like to send a signal (e.g SIGUSR1) to a user process from
> inside the kernel (kld module).
> Can any one tell me how to do it ?
> I tried the following code inspired from sys/kern/kern_sig.c :
> ==
> #include  
> #include 
> 
> int process_pid;
> struct kill_args {
>   int pid;
>   int signum;
> };
> 
> void send_SIGUSR1() {
>   struct kill_args uap;
>   uap.pid = process_pid;
>   uap.signum = SIGUSR1;  
>   kill((struct thread *)0, &uap);
> }
> ===
> 
> but that causes a page fault in kernel mode (ie. Kernel panic :-)
> 
> Any help is appreciated, thanks.

Take a look at psignal(9)...  You'll need to look up the struct proc
for psignal with pfind(9)...   and then PROC_UNLOCK the struct proc
after you've used psignal...

so:
struct proc *p;

p = pfind(pid);
if (p != NULL) {
psignal(p, SIGUSR1);
PROC_UNLOCK(p);
}

I haven't tried the code above, but that should do what you want...

-- 
  John-Mark Gurney  Voice: +1 415 225 5579

 "All that I will do, has been done, All that I have, has not."
___
freebsd-hackers@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to "[EMAIL PROTECTED]"


How to send a signal from inside the kernel?

2005-03-17 Thread Aziz KEZZOU
Hi all,
I would like to send a signal (e.g SIGUSR1) to a user process from
inside the kernel (kld module).
Can any one tell me how to do it ?
I tried the following code inspired from sys/kern/kern_sig.c :
==
#include  
#include 

int process_pid;
struct kill_args {
int pid;
int signum;
};

void send_SIGUSR1() {
  struct kill_args uap;
  uap.pid = process_pid;
  uap.signum = SIGUSR1;  
  kill((struct thread *)0, &uap);
}
===

but that causes a page fault in kernel mode (ie. Kernel panic :-)

Any help is appreciated, thanks.
Aziz
___
freebsd-hackers@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to "[EMAIL PROTECTED]"


style(9) example :-)

2005-03-17 Thread Roman Kurakin
Hi,
I was unable to refrain from posting this :-)
int i;main(){for(;i["]
Best regards,
rik
___
freebsd-hackers@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to "[EMAIL PROTECTED]"


Re: problem due to hostname change

2005-03-17 Thread Pietro Cerutti
On Thu, 17 Mar 2005 07:38:49 -0800, Ted Mittelstaedt
<[EMAIL PROTECTED]> wrote:
> 
> 
> > -Original Message-
> > From: [EMAIL PROTECTED]
> > [mailto:[EMAIL PROTECTED] Behalf Of Pietro Cerutti
> > Sent: Thursday, March 17, 2005 7:05 AM
> > To: Lowell Gilbert
> > Cc: FreeBSD
> > Subject: Re: problem due to hostname change
> >
> > No, this is not the problem. I searched in httpd.conf but I didn't
> > find anything concerning my .
> >
> 
> When apache starts up if it don't have your hostname set in it's
> config file then it issues a system call asking what
> the hostname for the IP address is that is on your host.
> 
> whatever it gets back it then uses to setup a default website.  If you
> change the name of your host in /etc.rc.conf then it better also
> have been changed in any DNS servers that your system is using.
> 
> >
> > I'm sure I didn't set my  anywhere else than in rc.conf
> >
> 
> Did you check /etc/hosts
> 
> 
> Ted
> 
> 


Thanks Ted, Neo-Vortex and Eric.

nothing found with grep on /etc/* , /usr/local/etc* , /var/named/*
but I found this:

# grep  /var/*
Binary file /var/db matches
Binary file /var/mysql matches
Binary file /var/restoresymtable matches
#

Well I double check once more on my system!

Thank you!

-- 
Pietro Cerutti
<[EMAIL PROTECTED]>


Beansidhe - SwiSS Death / Thrash Metal


Windows: "Where do you want to go today?"
Linux: "Where do you want to go tomorrow?"
FreeBSD: "Are you guys coming or what?"
___
freebsd-hackers@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to "[EMAIL PROTECTED]"


Re: Fwd: problem due to hostname change

2005-03-17 Thread Eric Anderson
Pietro Cerutti wrote:
Hi Hackers,
I posted this on freebsd-questions, but couldn't find a solution...
Maybe here
Thank you!
Please: don't Cc me, I'm on the list!
-- Forwarded message --
From: Pietro Cerutti <[EMAIL PROTECTED]>
Date: Thu, 17 Mar 2005 15:04:45 +
Subject: Re: problem due to hostname change
To: Lowell Gilbert <[EMAIL PROTECTED]>
Cc: FreeBSD 
On 17 Mar 2005 09:57:26 -0500, Lowell Gilbert
<[EMAIL PROTECTED]> wrote:
Pietro Cerutti <[EMAIL PROTECTED]> writes:

Hi list,
my computer is not part of a domain, and so I had set my hostname to
.
Now I changed it in rc.conf to :
~> cat /etc/rc.conf | grep hostname
hostname=""
~>
I rebooted, but my pc is still somewhere configured to be called .
First of all, when the pc boots, I see this in dmesg:
FreeBSD 5.4-PRERELEASE #10: Wed Mar  9 15:40:46 UTC 2005
   @:/usr/obj/usr/src/sys/GAHR
That's not a problem; all it means is that's who built the kernel.  It
doesn't get used for *anything* other than printing that message.

Then, when I try to start apache, I see this in my
/var/log/httpd-error.log, and apache won't start:
[Thu Mar 17 13:29:11 2005] [alert] mod_unique_id: unable to
gethostbyname("")
You must have put the old hostname into Apache's configuration
explicitly.  You will need to change it by hand.  The configuration
file is (by default, as installed from the port)
/usr/local/etc/apache/httpd.conf.

No, this is not the problem. I searched in httpd.conf but I didn't
find anything concerning my .
I even deinstalled & deleted the configuration files & reinstalled apache.
Don't forget this:
FreeBSD 5.4-PRERELEASE #10: Wed Mar  9 15:40:46 UTC 2005
@:/usr/obj/usr/src/sys/GAHR
Here I have my  too.

My question is: how can I change my hostname to  safely,
in a way that the  is not used anymore in any part of
the OS?
Changing rc.conf is enough for anything that was configured
automatically.

It should be so, but it actually isn't.
If you changed some other configuration by hand, you
will need to change it again by hand.  Note that if you had not added
your hostname to httpd.conf, Apache would have used the system
hostname by default (I believe; I haven't actually checked this
recently).

I'm sure I didn't set my  anywhere else than in rc.conf

What about /etc/hosts?  Maybe try:
grep oldhostname /etc/*
Eric

--

Eric AndersonSr. Systems AdministratorCentaur Technology
I have seen the future and it is just like the present, only longer.

___
freebsd-hackers@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to "[EMAIL PROTECTED]"


Fwd: problem due to hostname change

2005-03-17 Thread Pietro Cerutti
Hi Hackers,
I posted this on freebsd-questions, but couldn't find a solution...

Maybe here

Thank you!


Please: don't Cc me, I'm on the list!


-- Forwarded message --
From: Pietro Cerutti <[EMAIL PROTECTED]>
Date: Thu, 17 Mar 2005 15:04:45 +
Subject: Re: problem due to hostname change
To: Lowell Gilbert <[EMAIL PROTECTED]>
Cc: FreeBSD 


On 17 Mar 2005 09:57:26 -0500, Lowell Gilbert
<[EMAIL PROTECTED]> wrote:
> Pietro Cerutti <[EMAIL PROTECTED]> writes:
>
> > Hi list,
> > my computer is not part of a domain, and so I had set my hostname to
> > .
> > Now I changed it in rc.conf to :
> >
> > ~> cat /etc/rc.conf | grep hostname
> > hostname=""
> > ~>
> >
> > I rebooted, but my pc is still somewhere configured to be called 
> > .
> > First of all, when the pc boots, I see this in dmesg:
> >
> > FreeBSD 5.4-PRERELEASE #10: Wed Mar  9 15:40:46 UTC 2005
> > @:/usr/obj/usr/src/sys/GAHR
>
> That's not a problem; all it means is that's who built the kernel.  It
> doesn't get used for *anything* other than printing that message.
>
> > Then, when I try to start apache, I see this in my
> > /var/log/httpd-error.log, and apache won't start:
> >
> > [Thu Mar 17 13:29:11 2005] [alert] mod_unique_id: unable to
> > gethostbyname("")
>
> You must have put the old hostname into Apache's configuration
> explicitly.  You will need to change it by hand.  The configuration
> file is (by default, as installed from the port)
> /usr/local/etc/apache/httpd.conf.

No, this is not the problem. I searched in httpd.conf but I didn't
find anything concerning my .

I even deinstalled & deleted the configuration files & reinstalled apache.

Don't forget this:
FreeBSD 5.4-PRERELEASE #10: Wed Mar  9 15:40:46 UTC 2005
@:/usr/obj/usr/src/sys/GAHR

Here I have my  too.

>
> >
> > My question is: how can I change my hostname to  safely,
> > in a way that the  is not used anymore in any part of
> > the OS?
>
> Changing rc.conf is enough for anything that was configured
> automatically.

It should be so, but it actually isn't.

If you changed some other configuration by hand, you
> will need to change it again by hand.  Note that if you had not added
> your hostname to httpd.conf, Apache would have used the system
> hostname by default (I believe; I haven't actually checked this
> recently).

I'm sure I didn't set my  anywhere else than in rc.conf

>
> Be well.
>

However, thank you for your advice, but it didn't solve my problem...


--
Pietro Cerutti
<[EMAIL PROTECTED]>


Beansidhe - SwiSS Death / Thrash Metal


Windows: "Where do you want to go today?"
Linux: "Where do you want to go tomorrow?"
FreeBSD: "Are you guys coming or what?"


-- 
Pietro Cerutti
<[EMAIL PROTECTED]>


Beansidhe - SwiSS Death / Thrash Metal


Windows: "Where do you want to go today?"
Linux: "Where do you want to go tomorrow?"
FreeBSD: "Are you guys coming or what?"
___
freebsd-hackers@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to "[EMAIL PROTECTED]"


Re: FreeBSD 5.3: Sharedlibs using sharedlibs (and Tcl)

2005-03-17 Thread Peter Much
On Wed, Mar 16, 2005 at 03:35:16PM +0100, Palle Girgensohn wrote:
! 
! --On onsdag, mars 16, 2005 11.43.31 +0100 Peter Much 
! <[EMAIL PROTECTED]> wrote:
! 
! >! So, you're saying that pctclsh *can* access, but pgaccess *cannot*?
! >Odd...  ! I would expect they'd both use the same lib to connect, no?
! >I'll have to
! >
! >They use the same libraries, yes. But Tcl interpreter seem to need more
! >advice on where to find sub-functions in other libraries. It looks
! >like this:
! >
! >pgtclsh  -finds-> libpgtcl.so -finds-> libpq.so -finds-> libkrb5.so
! >pgaccess -loads-> libpgtcl.so -finds-> libpq.so -fails-> libkrb5.so
! 
! Uh, OK. I'm not qualified enough with linkers to answer this, I'm afraid. 
! Did you try the pgsql-interfaces mailing list?

Oh well, same with me. I sent a copy of one of my reports to that
list, yes. But only got feedback that it will be evaluated by
moderator, as I am not signed on that list.
I'm actually no professional psql user - the database is just a small
part of my installation, mainly logging the lowlevel error counts 
from my exabyte drives and providing reports about tape wearout.
And the kerberos is just there for fun, as a reference installation.

Nevertheless, I would think this is not a matter for the postgres
community. Because this would happen the same way with any other
application that provides Tcl support and kerberos support (or maybe
also with other components of the system, if they are used from Tcl).

So it seems either a Tcl problem or a linker/loader problem. Which,
I cannot say - maybe both.

! >And then I found that it is enough to place into libpq.so the explicit
! >references to libkrb5 and the other kerberos libs. That is what the
! >"readelf -a" output in my other mail shows.
! 
! sounds like a better solution, yes... Shouldn't they always be there? 
! Sounds like a bug to me?

Thats the question. 
I just did a little more investigation (like reading manpages)
and found out _WHY_ it does work for pgtclsh but not for pgaccess. 

There is a command "ldd" that shows nested library dependencies
for any program. 
For pgtclsh it shows all the kerberos libs:

bash-3.00# ldd /usr/local/bin/pgtclsh
/usr/local/bin/pgtclsh:
libpgtcl.so.2 => /usr/local/lib/libpgtcl.so.2 (0x28075000)
libpq.so.3 => /usr/local/lib/libpq.so.3 (0x2807d000)
libtcl84.so.1 => /usr/local/lib/libtcl84.so.1 (0x28097000)
libm.so.3 => /lib/libm.so.3 (0x28135000)
libkrb5.so.7 => /usr/lib/libkrb5.so.7 (0x2814f000)
libasn1.so.7 => /usr/lib/libasn1.so.7 (0x28186000)
libcrypto.so.3 => /lib/libcrypto.so.3 (0x281a6000)
libroken.so.7 => /usr/lib/libroken.so.7 (0x2829b000)
libcrypt.so.2 => /lib/libcrypt.so.2 (0x282a9000)
libcom_err.so.2 => /usr/lib/libcom_err.so.2 (0x282c1000)
libz.so.2 => /lib/libz.so.2 (0x282c3000)
libreadline.so.5 => /lib/libreadline.so.5 (0x282d3000)
libutil.so.4 => /lib/libutil.so.4 (0x282ff000)
libc.so.5 => /lib/libc.so.5 (0x2830b000)
libintl.so.6 => /usr/local/lib/libintl.so.6 (0x283e4000)
libssl.so.3 => /usr/lib/libssl.so.3 (0x283ed000)
libncurses.so.5 => /lib/libncurses.so.5 (0x2841b000)
libiconv.so.3 => /usr/local/lib/libiconv.so.3 (0x2845a000)

But for libpgtcl.so (this is the first elf binary that pgaccess gets
to see) it does not show these kerberos libraries (I use the old
libpq.so here, not the one that I have modified):

bash-3.00# ldd /usr/local/lib/libpgtcl.so
/usr/local/lib/libpgtcl.so:
libpq.so.3 => /usr/local/lib/libpq.so.3 (0x2815a000)
libtcl84.so.1 => /usr/local/lib/libtcl84.so.1 (0x28174000)
libm.so.3 => /lib/libm.so.3 (0x28212000)
libintl.so.6 => /usr/local/lib/libintl.so.6 (0x2822c000)
libssl.so.3 => /usr/lib/libssl.so.3 (0x28235000)
libcrypto.so.3 => /lib/libcrypto.so.3 (0x28263000)
libiconv.so.3 => /usr/local/lib/libiconv.so.3 (0x28358000)

Then the explanation became simple: these kerberos libraries get
just LITERALLY LISTED WITHIN THE pgtclsh BINARY! And this is an
impossible method for a Tcl script.

bash-3.00# readelf -d /usr/local/bin/pgtclsh | grep krb5
 0x0001 (NEEDED) Shared library: [libkrb5.so.7]

So now we have a full explanation for the behaviour, but not really
a solution.
Instead, this looks like a fundamental question about how to load
nested elf sharedlibs from interpreter languages.

>From my technical viewpoint, the only solution that makes sense
would be: every shared library must reference all other shared
libraries from which it uses functions. The shared library cannot
rely on the executable to do this job, because the executable
may be an interpreter script, which neither is able to do this
nor would it want to know them all.

>From this viewpoint, the linker command that creates libpq.so
is defective. So You were right and its a problem for the 
postgresql developers.

But as I am not competent with shared libraries and development
s